Skip to content

Add conversation ratings support #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions intercom-java/src/main/java/io/intercom/api/Conversation.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ private static boolean isAdminQuery(Map<String, String> params) {
@JsonProperty("conversation_message")
private ConversationMessage conversationMessage;

@JsonProperty("conversation_rating")
private ConversationRating conversationRating;

@JsonProperty("user")
private User user;

Expand Down Expand Up @@ -259,6 +262,10 @@ public ConversationMessage getConversationMessage() {
return conversationMessage;
}

public ConversationRating getConversationRating() {
return conversationRating;
}

public User getUser() {
return user;
}
Expand Down Expand Up @@ -327,6 +334,8 @@ public boolean equals(Object o) {
if (assignee != null ? !assignee.equals(that.assignee) : that.assignee != null) return false;
if (conversationMessage != null ? !conversationMessage.equals(that.conversationMessage) : that.conversationMessage != null)
return false;
if (conversationRating != null ? !conversationRating.equals(that.conversationRating) : that.conversationRating != null)
return false;
if (conversationPartCollection != null ? !conversationPartCollection.equals(that.conversationPartCollection) : that.conversationPartCollection != null)
return false;
if (tagCollection != null ? !tagCollection.equals(that.tagCollection) : that.tagCollection != null)
Expand All @@ -347,6 +356,7 @@ public int hashCode() {
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (conversationMessage != null ? conversationMessage.hashCode() : 0);
result = 31 * result + (conversationRating != null ? conversationRating.hashCode() : 0);
result = 31 * result + (user != null ? user.hashCode() : 0);
result = 31 * result + (assignee != null ? assignee.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
Expand Down Expand Up @@ -379,6 +389,7 @@ public String toString() {
", state=" + state +
", read=" + read +
", links=" + links +
", conversationRating=" + conversationRating +
"} " + super.toString();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package io.intercom.api;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConversationRating extends TypedData {

@JsonProperty
private int rating;

@JsonProperty
private String remark;

@JsonProperty("created_at")
private long createdAt;

@JsonProperty
private Customer customer;

@JsonProperty
private Teammate teammate;

public ConversationRating() {
}

public int getRating() {
return rating;
}

public String getRemark() {
return remark;
}

public long getCreatedAt() {
return createdAt;
}

public Customer getCustomer() {
return customer;
}

public Teammate getTeammate() {
return teammate;
}

@Override
public int hashCode() {
int result = remark != null ? remark.hashCode() : 0;
result = 31 * result + (customer != null ? customer.hashCode() : 0);
result = 31 * result + (teammate != null ? teammate.hashCode() : 0);
result = 31 * result + (int) (createdAt ^ (createdAt >>> 32));
result = 31 * result + rating;

return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

ConversationRating that = (ConversationRating) o;

if (customer != null ? !customer.equals(that.customer) : that.customer != null) return false;
if (teammate != null ? !teammate.equals(that.teammate) : that.teammate != null) return false;
if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
if (createdAt != that.createdAt) return false;
if (rating != that.rating) return false;

return true;
}

@Override
public String toString() {
return "ConversationRating{" +
"rating='" + rating + '\'' +
", remark='" + remark + '\'' +
", created_at='" + createdAt + '\'' +
", customer=" + customer +
", teammate=" + teammate +
"} " + super.toString();
}
}
69 changes: 69 additions & 0 deletions intercom-java/src/main/java/io/intercom/api/Customer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package io.intercom.api;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Customer extends TypedData {

@JsonProperty("type")
private String type;

@JsonProperty("id")
private String id;

public Customer() {
}

public String getType() {
return type;
}

public Customer setType(String type) {
this.type = type;
return this;
}

public String getId() {
return id;
}

public Customer setId(String id) {
this.id = id;
return this;
}

@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (type != null ? type.hashCode() : 0);
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Customer customer = (Customer) o;

if (id != null ? !id.equals(customer.id) : customer.id != null) return false;
if (type != null ? !type.equals(customer.type) : customer.type != null) return false;

return true;
}

@Override
public String toString() {
return "Customer{" +
"type='" + type + '\'' +
", id='" + id+ '\'' +
"} " + super.toString();
}

}
68 changes: 68 additions & 0 deletions intercom-java/src/main/java/io/intercom/api/Teammate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package io.intercom.api;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Teammate extends TypedData {

@JsonProperty("type")
private String type;

@JsonProperty("id")
private String id;

public Teammate() {
}

public String getType() {
return type;
}

public Teammate setType(String type) {
this.type = type;
return this;
}

public String getId() {
return id;
}

public Teammate setId(String id) {
this.id = id;
return this;
}

@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (type != null ? type.hashCode() : 0);
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Teammate teammate = (Teammate) o;

if (id != null ? !id.equals(teammate.id) : teammate.id != null) return false;
if (type != null ? !type.equals(teammate.type) : teammate.type != null) return false;

return true;
}

@Override
public String toString() {
return "Teammate{" +
"type='" + type + '\'' +
", id='" + id+ '\'' +
"} " + super.toString();
}

}