Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class ConversationMessage extends TypedData {
@JsonProperty
private String url;

@JsonProperty("delivered_as")
private String deliveredAs;

@JsonProperty("attachments")
private List<Attachment> attachments;

Expand Down Expand Up @@ -58,6 +61,10 @@ public String getUrl() {
return url;
}

public String getDeliveredAs() {
return deliveredAs;
}

public List<Attachment> getAttachments() {
return attachments;
}
Expand All @@ -67,6 +74,7 @@ public int hashCode() {
int result = subject != null ? subject.hashCode() : 0;
result = 31 * result + (body != null ? body.hashCode() : 0);
result = 31 * result + (author != null ? author.hashCode() : 0);
result = 31 * result + (deliveredAs != null ? deliveredAs.hashCode() : 0);
result = 31 * result + (id != null ? id.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (attachments != null ? attachments.hashCode() : 0);
Expand All @@ -87,6 +95,7 @@ public boolean equals(Object o) {
if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
if (deliveredAs != null ? !deliveredAs.equals(that.deliveredAs) : that.deliveredAs != null) return false;
if (attachments != null ? !attachments.equals(that.attachments) : that.attachments != null) return false;

return true;
Expand All @@ -101,6 +110,7 @@ public String toString() {
", body='" + body + '\'' +
", author=" + author +
", url=" + url +
", deliveredAs=" + deliveredAs +
", attachments=" + attachments +
"} " + super.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public void testGetConversationMessageDetailsFromConversation() throws IOExcepti
assertEquals("<p>test</p>", conversationMessage.getBody());
assertEquals("Email subject", conversationMessage.getSubject());
assertEquals("https://intercom.com/", conversationMessage.getUrl());
assertEquals("customer_initiated", conversationMessage.getDeliveredAs());

assertEquals("lead", conversationMessage.getAuthor().getType());
assertEquals("576c1a139d0baad1010011111", conversationMessage.getAuthor().getId());
Expand Down Expand Up @@ -161,6 +162,7 @@ public void testGetConversationMessageDetailsFromConversationNoAttachments() thr
assertEquals("<p>test</p>", conversationMessage.getBody());
assertEquals("Email subject", conversationMessage.getSubject());
assertEquals("https://intercom.com/", conversationMessage.getUrl());
assertEquals("customer_initiated", conversationMessage.getDeliveredAs());

assertEquals("lead", conversationMessage.getAuthor().getType());
assertEquals("576c1a139d0baad1010011111", conversationMessage.getAuthor().getId());
Expand Down
1 change: 1 addition & 0 deletions intercom-java/src/test/resources/conversation.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"id": "33954111",
"subject": "Email subject",
"body": "<p>test</p>",
"delivered_as": "customer_initiated",
"author": {
"type": "lead",
"id": "576c1a139d0baad1010011111"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"id": "33954111",
"subject": "Email subject",
"body": "<p>test</p>",
"delivered_as": "customer_initiated",
"author": {
"type": "lead",
"id": "576c1a139d0baad1010011111"
Expand Down
3 changes: 3 additions & 0 deletions intercom-java/src/test/resources/conversations.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"id": "41111111",
"subject": "",
"body": "<p>Hey2</p>",
"delivered_as": "customer_initiated",
"author": {
"type": "user",
"id": "57b45f16d1aad7e69e011111"
Expand Down Expand Up @@ -56,6 +57,7 @@
"id": "41141111",
"subject": "",
"body": "<p>Hey</p>",
"delivered_as": "customer_initiated",
"author": {
"type": "user",
"id": "57b45bfef436c8d786000111"
Expand Down Expand Up @@ -85,6 +87,7 @@
"id": "33954838",
"subject": "",
"body": "<p>test</p>",
"delivered_as": "customer_initiated",
"author": {
"type": "lead",
"id": "576c1a139d0baad101001111"
Expand Down