diff --git a/intercom-java/src/main/java/io/intercom/api/Conversation.java b/intercom-java/src/main/java/io/intercom/api/Conversation.java index 5b3f8278..4afae27a 100644 --- a/intercom-java/src/main/java/io/intercom/api/Conversation.java +++ b/intercom-java/src/main/java/io/intercom/api/Conversation.java @@ -183,6 +183,9 @@ private static boolean isAdminQuery(Map params) { @JsonProperty("conversation_message") private ConversationMessage conversationMessage; + @JsonProperty("conversation_rating") + private ConversationRating conversationRating; + @JsonProperty("user") private User user; @@ -259,6 +262,10 @@ public ConversationMessage getConversationMessage() { return conversationMessage; } + public ConversationRating getConversationRating() { + return conversationRating; + } + public User getUser() { return user; } @@ -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) @@ -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)); @@ -379,6 +389,7 @@ public String toString() { ", state=" + state + ", read=" + read + ", links=" + links + + ", conversationRating=" + conversationRating + "} " + super.toString(); } } diff --git a/intercom-java/src/main/java/io/intercom/api/ConversationRating.java b/intercom-java/src/main/java/io/intercom/api/ConversationRating.java new file mode 100644 index 00000000..c1a893cb --- /dev/null +++ b/intercom-java/src/main/java/io/intercom/api/ConversationRating.java @@ -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(); + } +} diff --git a/intercom-java/src/main/java/io/intercom/api/Customer.java b/intercom-java/src/main/java/io/intercom/api/Customer.java new file mode 100644 index 00000000..8ac92b4e --- /dev/null +++ b/intercom-java/src/main/java/io/intercom/api/Customer.java @@ -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(); + } + +} diff --git a/intercom-java/src/main/java/io/intercom/api/Teammate.java b/intercom-java/src/main/java/io/intercom/api/Teammate.java new file mode 100644 index 00000000..158e88bd --- /dev/null +++ b/intercom-java/src/main/java/io/intercom/api/Teammate.java @@ -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(); + } + +}