Skip to content

Commit c3c0082

Browse files
authored
Merge pull request #128 from mehmetminanc/conversations-updates
Updates conversations API with recent features.
2 parents 02ffc87 + 0d2137d commit c3c0082

20 files changed

+597
-11
lines changed

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<connection>scm:git:[email protected]:messagebird/java-rest-api.git</connection>
4343
<developerConnection>scm:git:[email protected]:messagebird/java-rest-api.git</developerConnection>
4444
<url>[email protected]:messagebird/java-rest-api.git</url>
45-
<tag>HEAD</tag>
45+
<tag>HEAD</tag>
4646
</scm>
4747

4848
<profiles>

api/src/main/java/com/messagebird/objects/ListBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class ListBase<T> {
1313
private Integer limit;
1414
private Integer totalCount;
1515
private Links links;
16+
private List<T> items;
1617

1718
public ListBase() {
1819
}
@@ -28,7 +29,6 @@ public String toString() {
2829
'}';
2930
}
3031

31-
private List<T> items;
3232

3333
public Integer getOffset() {
3434
return offset;

api/src/main/java/com/messagebird/objects/MessageReference.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class MessageReference {
44

55
private String href;
66
private int totalCount;
7+
private String lastMessageId;
78

89
public String getHREF() {
910
return href;
@@ -21,11 +22,16 @@ public void setTotalCount(int totalCount) {
2122
this.totalCount = totalCount;
2223
}
2324

25+
public String getLastMessageId() {
26+
return lastMessageId;
27+
}
28+
2429
@Override
2530
public String toString() {
2631
return "MessageReference{" +
2732
"href='" + href + '\'' +
2833
", totalCount=" + totalCount +
34+
", lastMessageId='" + lastMessageId + '\'' +
2935
'}';
3036
}
3137
}

api/src/main/java/com/messagebird/objects/conversations/ConversationChannel.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class ConversationChannel {
1111

1212
private String id;
1313
private String name;
14+
// See: ConversationPlatformConstants
15+
private String platformId;
1416
private ConversationChannelStatus status;
1517
private Date createdDatetime;
1618
private Date updatedDatetime;
@@ -55,11 +57,20 @@ public void setUpdatedDatetime(final Date updatedDatetime) {
5557
this.updatedDatetime = updatedDatetime;
5658
}
5759

60+
public String getPlatformId() {
61+
return platformId;
62+
}
63+
64+
public void setPlatformId(String platformId) {
65+
this.platformId = platformId;
66+
}
67+
5868
@Override
5969
public String toString() {
6070
return "ConversationChannel{" +
6171
"id='" + id + '\'' +
6272
", name='" + name + '\'' +
73+
", platformId=" + platformId +
6374
", status=" + status +
6475
", createdDatetime=" + createdDatetime +
6576
", updatedDatetime=" + updatedDatetime +

api/src/main/java/com/messagebird/objects/conversations/ConversationContent.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class ConversationContent {
1111
private ConversationContentHsm hsm;
1212
private ConversationContentMedia image;
1313
private ConversationContentLocation location;
14+
private ConversationContentEmail email;
1415
private String text;
1516
private ConversationContentMedia video;
1617

@@ -70,6 +71,14 @@ public void setVideo(ConversationContentMedia video) {
7071
this.video = video;
7172
}
7273

74+
public ConversationContentEmail getEmail() {
75+
return email;
76+
}
77+
78+
public void setEmail(ConversationContentEmail email) {
79+
this.email = email;
80+
}
81+
7382
@Override
7483
public String toString() {
7584
return "ConversationContent{" +
@@ -78,6 +87,7 @@ public String toString() {
7887
", hsm=" + hsm +
7988
", image=" + image +
8089
", location=" + location +
90+
", email=" + email +
8191
", text='" + text + '\'' +
8292
", video=" + video +
8393
'}';
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
package com.messagebird.objects.conversations;
2+
3+
import java.util.List;
4+
import java.util.Map;
5+
6+
public class ConversationContentEmail {
7+
private String id;
8+
private ConversationEmailRecipient from;
9+
private List<ConversationEmailRecipient> to;
10+
private String subject;
11+
private ConversationEmailContent content;
12+
private String replyTo;
13+
private String returnPath;
14+
private Map<String, String> headers;
15+
private ConversationEmailTracking tracking;
16+
private boolean performSubstitutions;
17+
private List<ConversationEmailAttachment> attachments;
18+
private List<ConversationEmailInlineImage> inlineImages;
19+
20+
public String getId() {
21+
return id;
22+
}
23+
24+
public void setId(String id) {
25+
this.id = id;
26+
}
27+
28+
public ConversationEmailRecipient getFrom() {
29+
return from;
30+
}
31+
32+
public void setFrom(ConversationEmailRecipient from) {
33+
this.from = from;
34+
}
35+
36+
public List<ConversationEmailRecipient> getTo() {
37+
return to;
38+
}
39+
40+
public void setTo(List<ConversationEmailRecipient> to) {
41+
this.to = to;
42+
}
43+
44+
public String getSubject() {
45+
return subject;
46+
}
47+
48+
public void setSubject(String subject) {
49+
this.subject = subject;
50+
}
51+
52+
public ConversationEmailContent getContent() {
53+
return content;
54+
}
55+
56+
public void setContent(ConversationEmailContent content) {
57+
this.content = content;
58+
}
59+
60+
public String getReplyTo() {
61+
return replyTo;
62+
}
63+
64+
public void setReplyTo(String replyTo) {
65+
this.replyTo = replyTo;
66+
}
67+
68+
public String getReturnPath() {
69+
return returnPath;
70+
}
71+
72+
public void setReturnPath(String returnPath) {
73+
this.returnPath = returnPath;
74+
}
75+
76+
public Map<String, String> getHeaders() {
77+
return headers;
78+
}
79+
80+
public void setHeaders(Map<String, String> headers) {
81+
this.headers = headers;
82+
}
83+
84+
public ConversationEmailTracking getTracking() {
85+
return tracking;
86+
}
87+
88+
public void setTracking(ConversationEmailTracking tracking) {
89+
this.tracking = tracking;
90+
}
91+
92+
public boolean isPerformSubstitutions() {
93+
return performSubstitutions;
94+
}
95+
96+
public void setPerformSubstitutions(boolean performSubstitutions) {
97+
this.performSubstitutions = performSubstitutions;
98+
}
99+
100+
public List<ConversationEmailAttachment> getAttachments() {
101+
return attachments;
102+
}
103+
104+
public void setAttachments(List<ConversationEmailAttachment> attachments) {
105+
this.attachments = attachments;
106+
}
107+
108+
public List<ConversationEmailInlineImage> getInlineImages() {
109+
return inlineImages;
110+
}
111+
112+
public void setInlineImages(List<ConversationEmailInlineImage> inlineImages) {
113+
this.inlineImages = inlineImages;
114+
}
115+
116+
@Override
117+
public String toString() {
118+
return "ConversationContentEmail{" +
119+
"id='" + id + '\'' +
120+
", from=" + from +
121+
", to=" + to +
122+
", subject='" + subject + '\'' +
123+
", content=" + content +
124+
", replyTo='" + replyTo + '\'' +
125+
", returnPath='" + returnPath + '\'' +
126+
", headers=" + headers +
127+
", tracking=" + tracking +
128+
", performSubstitutions=" + performSubstitutions +
129+
", attachments=" + attachments +
130+
", inlineImages=" + inlineImages +
131+
'}';
132+
}
133+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.messagebird.objects.conversations;
2+
3+
public class ConversationEmailAttachment {
4+
private String id;
5+
private String name;
6+
private String type;
7+
private String URL;
8+
private String length;
9+
10+
public String getId() {
11+
return id;
12+
}
13+
14+
public void setId(String id) {
15+
this.id = id;
16+
}
17+
18+
public String getName() {
19+
return name;
20+
}
21+
22+
public void setName(String name) {
23+
this.name = name;
24+
}
25+
26+
public String getType() {
27+
return type;
28+
}
29+
30+
public void setType(String type) {
31+
this.type = type;
32+
}
33+
34+
public String getURL() {
35+
return URL;
36+
}
37+
38+
public void setURL(String URL) {
39+
this.URL = URL;
40+
}
41+
42+
public String getLength() {
43+
return length;
44+
}
45+
46+
public void setLength(String length) {
47+
this.length = length;
48+
}
49+
50+
@Override
51+
public String toString() {
52+
return "ConversationEmailAttachment{" +
53+
"id='" + id + '\'' +
54+
", name='" + name + '\'' +
55+
", type='" + type + '\'' +
56+
", URL='" + URL + '\'' +
57+
", length='" + length + '\'' +
58+
'}';
59+
}
60+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.messagebird.objects.conversations;
2+
3+
public class ConversationEmailContent {
4+
private String html;
5+
private String text;
6+
7+
public String getHtml() {
8+
return html;
9+
}
10+
11+
public void setHtml(String html) {
12+
this.html = html;
13+
}
14+
15+
public String getText() {
16+
return text;
17+
}
18+
19+
public void setText(String text) {
20+
this.text = text;
21+
}
22+
23+
@Override
24+
public String toString() {
25+
return "ConversationEmailContent{" +
26+
"html='" + html + '\'' +
27+
", text='" + text + '\'' +
28+
'}';
29+
}
30+
}

0 commit comments

Comments
 (0)