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 a7ea3016..ba9b5d91 100644 --- a/intercom-java/src/main/java/io/intercom/api/Conversation.java +++ b/intercom-java/src/main/java/io/intercom/api/Conversation.java @@ -211,6 +211,9 @@ private static boolean isAdminQuery(Map params) { @JsonProperty("links") private Map links; + @JsonProperty("customers") + private List customers; + public Conversation() { } @@ -295,6 +298,14 @@ public boolean getRead() { return read; } + public List getCustomers() { + if (customers == null) { + customers= find(this.getId()).getCustomers(); + } + + return customers; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -316,6 +327,8 @@ public boolean equals(Object o) { return false; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (links != null ? !links.equals(that.links) : that.links != null) return false; + if (customers != null ? !customers.equals(that.customers) : that.customers != null) + return false; if (!type.equals(that.type)) return false; //noinspection RedundantIfStatement if (user != null ? !user.equals(that.user) : that.user != null) return false; @@ -338,6 +351,7 @@ public int hashCode() { result = 31 * result + (open ? 1 : 0); result = 31 * result + (read ? 1 : 0); result = 31 * result + (links != null ? links.hashCode() : 0); + result = 31 * result + (customers != null ? customers.hashCode() : 0); return result; } @@ -357,6 +371,7 @@ public String toString() { ", open=" + open + ", read=" + read + ", links=" + links + + ", customers=" + customers + "} " + super.toString(); } } diff --git a/intercom-java/src/main/java/io/intercom/api/ConversationPartCollection.java b/intercom-java/src/main/java/io/intercom/api/ConversationPartCollection.java index 0a67e617..f4ae9b12 100644 --- a/intercom-java/src/main/java/io/intercom/api/ConversationPartCollection.java +++ b/intercom-java/src/main/java/io/intercom/api/ConversationPartCollection.java @@ -23,4 +23,8 @@ public List getPage() { public ConversationPartCollection nextPage() { return new ConversationPartCollection(); } + + @JsonProperty("total_count") + public int total_count; + } 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..a0aa46f0 --- /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(); + } + +} \ No newline at end of file