Skip to content

Commit 806be95

Browse files
RuairiKmmartinic
authored andcommitted
Add attachment support
1 parent 34ddfcc commit 806be95

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

intercom-java/src/main/java/io/intercom/api/Reply.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class Reply<T extends Replier> extends TypedData {
99

1010
@JsonProperty("body")
1111
private String body;
12+
13+
@JsonProperty("attachment_urls")
14+
private String[] attachmentUrls;
1215

1316
@JsonProperty("from")
1417
T from;
@@ -29,6 +32,11 @@ public Reply<T> setBody(String body) {
2932
this.body = body;
3033
return this;
3134
}
35+
36+
public Reply<T> setAttachmentUrls(String[] attachmentUrls) {
37+
this.attachmentUrls = attachmentUrls;
38+
return this;
39+
}
3240

3341
T getFrom() {
3442
return from;

intercom-java/src/test/java/io/intercom/api/ConversationTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ public void testAdminReply() {
5858
} catch (InvalidException e) {
5959
fail();
6060
}
61+
62+
adminReply.setAttachmentUrls(new String[]{"http://www.example.com/attachment.jpg"});
63+
try {
64+
Conversation.validateAdminReplyRequest(adminReply);
65+
} catch (InvalidException e) {
66+
fail();
67+
}
6168
}
6269

6370
@Test

0 commit comments

Comments
 (0)