Skip to content

Commit cc2499b

Browse files
committed
* Adds Conversations email content.
* Some minor fixes over the last commit.
1 parent da9ba66 commit cc2499b

10 files changed

+300
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.messagebird.objects;
22

3+
import com.sun.istack.internal.Nullable;
4+
35
public class MessageReference {
46

57
private String href;

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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.messagebird.objects.conversations;
2+
3+
import com.messagebird.objects.MessageResponse;
4+
5+
import java.util.List;
6+
import java.util.Map;
7+
8+
public class ConversationContentEmail {
9+
private String id;
10+
private ConversationEmailRecipient from;
11+
private List<ConversationEmailRecipient> to;
12+
private String subject;
13+
private ConversationEmailContent content;
14+
private String replyTo;
15+
private String returnPath;
16+
private Map<String, String> headers;
17+
private ConversationEmailTracking tracking;
18+
private boolean performSubstitutions;
19+
private List<ConversationEmailAttachment> attachments;
20+
private List<ConversationEmailInlineImage> inlineImages;
21+
}
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+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.messagebird.objects.conversations;
2+
3+
public class ConversationEmailInlineImage {
4+
private String id;
5+
private String name;
6+
private String type;
7+
private String URL;
8+
private int length;
9+
private String contentId;
10+
11+
public String getId() {
12+
return id;
13+
}
14+
15+
public void setId(String id) {
16+
this.id = id;
17+
}
18+
19+
public String getName() {
20+
return name;
21+
}
22+
23+
public void setName(String name) {
24+
this.name = name;
25+
}
26+
27+
public String getType() {
28+
return type;
29+
}
30+
31+
public void setType(String type) {
32+
this.type = type;
33+
}
34+
35+
public String getURL() {
36+
return URL;
37+
}
38+
39+
public void setURL(String URL) {
40+
this.URL = URL;
41+
}
42+
43+
public int getLength() {
44+
return length;
45+
}
46+
47+
public void setLength(int length) {
48+
this.length = length;
49+
}
50+
51+
public String getContentId() {
52+
return contentId;
53+
}
54+
55+
public void setContentId(String contentId) {
56+
this.contentId = contentId;
57+
}
58+
59+
@Override
60+
public String toString() {
61+
return "ConversationEmailInlineImage{" +
62+
"id='" + id + '\'' +
63+
", name='" + name + '\'' +
64+
", type='" + type + '\'' +
65+
", URL='" + URL + '\'' +
66+
", length=" + length +
67+
", contentId='" + contentId + '\'' +
68+
'}';
69+
}
70+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.messagebird.objects.conversations;
2+
3+
import java.util.Map;
4+
5+
public class ConversationEmailRecipient {
6+
private String email;
7+
private String name;
8+
private Map<String, String> variables;
9+
10+
public String getEmail() {
11+
return email;
12+
}
13+
14+
public void setEmail(String email) {
15+
this.email = email;
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 Map<String, String> getVariables() {
27+
return variables;
28+
}
29+
30+
public void setVariables(Map<String, String> variables) {
31+
this.variables = variables;
32+
}
33+
34+
@Override
35+
public String toString() {
36+
return "ConversationEmailRecipient{" +
37+
"email='" + email + '\'' +
38+
", name='" + name + '\'' +
39+
", variables=" + variables +
40+
'}';
41+
}
42+
}
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 ConversationEmailTracking {
4+
private boolean open;
5+
private boolean click;
6+
7+
public boolean isOpen() {
8+
return open;
9+
}
10+
11+
public void setOpen(boolean open) {
12+
this.open = open;
13+
}
14+
15+
public boolean isClick() {
16+
return click;
17+
}
18+
19+
public void setClick(boolean click) {
20+
this.click = click;
21+
}
22+
23+
@Override
24+
public String toString() {
25+
return "ConversationEmailTracking{" +
26+
"open=" + open +
27+
", click=" + click +
28+
'}';
29+
}
30+
}

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public class ConversationMessage {
2020
private Date createdDatetime;
2121
private Date updatedDatetime;
2222
private Map<String, Object> source;
23+
private ConversationMessageTag tag;
24+
/**
25+
* See: {@link ConversationPlatformConstants}
26+
*/
27+
private String platform;
2328

2429
public String getId() {
2530
return id;
@@ -101,6 +106,22 @@ public void setSource(Map<String, Object> source) {
101106
this.source = source;
102107
}
103108

109+
public ConversationMessageTag getTag() {
110+
return tag;
111+
}
112+
113+
public void setTag(ConversationMessageTag tag) {
114+
this.tag = tag;
115+
}
116+
117+
public String getPlatform() {
118+
return platform;
119+
}
120+
121+
public void setPlatform(String platform) {
122+
this.platform = platform;
123+
}
124+
104125
@Override
105126
public String toString() {
106127
return "ConversationMessage{" +
@@ -114,6 +135,8 @@ public String toString() {
114135
", createdDatetime=" + createdDatetime +
115136
", updatedDatetime=" + updatedDatetime +
116137
", source=" + source +
138+
", tag=" + tag +
139+
", platform='" + platform + '\'' +
117140
'}';
118141
}
119142
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.messagebird.objects.conversations;
22

3+
import java.util.Map;
4+
35
/**
46
* Request object that is used to send new messages over a channel.
57
*/
@@ -9,6 +11,7 @@ public class ConversationMessageRequest {
911
private ConversationContent content;
1012
private String channelId;
1113
private String reportUrl;
14+
private Map<String, Object> source;
1215

1316
public ConversationContentType getType() {
1417
return type;
@@ -42,13 +45,22 @@ public void setReportUrl(String reportUrl) {
4245
this.reportUrl = reportUrl;
4346
}
4447

48+
public Map<String, Object> getSource() {
49+
return source;
50+
}
51+
52+
public void setSource(Map<String, Object> source) {
53+
this.source = source;
54+
}
55+
4556
@Override
4657
public String toString() {
4758
return "ConversationMessageRequest{" +
4859
"type=" + type +
4960
", content=" + content +
5061
", channelId='" + channelId + '\'' +
5162
", reportUrl='" + reportUrl + '\'' +
63+
", source=" + source +
5264
'}';
5365
}
5466
}

0 commit comments

Comments
 (0)