Skip to content

Commit 751f7b9

Browse files
authored
Merge pull request #194 from DckcDan/master
Added the trackId and ttl fields to conversations request objects.
2 parents 94db8ba + f12279d commit 751f7b9

File tree

6 files changed

+164
-85
lines changed

6 files changed

+164
-85
lines changed

api/src/main/java/com/messagebird/MessageBirdClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class MessageBirdClient {
7272
* can, however, override this behaviour by providing absolute URLs
7373
* ourselves.
7474
*/
75-
private static final String CONVERSATIONS_BASE_URL = "https://conversations.messagebird.com/v1";
75+
static final String CONVERSATIONS_BASE_URL = "https://conversations.messagebird.com/v1";
7676
static final String VOICE_CALLS_BASE_URL = "https://voice.messagebird.com";
7777
static final String NUMBERS_CALLS_BASE_URL = "https://numbers.messagebird.com/v1";
7878
static final String MESSAGING_BASE_URL = "https://messaging.messagebird.com/v1";
@@ -91,10 +91,10 @@ public class MessageBirdClient {
9191
private static final String VERIFYPATH = "/verify";
9292
private static final String VERIFYEMAILPATH = "/verify/messages/email";
9393
private static final String VOICEMESSAGESPATH = "/voicemessages";
94-
private static final String CONVERSATION_PATH = "/conversations";
95-
private static final String CONVERSATION_SEND_PATH = "/send";
96-
private static final String CONVERSATION_MESSAGE_PATH = "/messages";
97-
private static final String CONVERSATION_WEBHOOK_PATH = "/webhooks";
94+
static final String CONVERSATION_PATH = "/conversations";
95+
static final String CONVERSATION_SEND_PATH = "/send";
96+
static final String CONVERSATION_MESSAGE_PATH = "/messages";
97+
static final String CONVERSATION_WEBHOOK_PATH = "/webhooks";
9898
static final String INTEGRATIONS_WHATSAPP_PATH = "/platforms/whatsapp";
9999
static final String VOICECALLSPATH = "/calls";
100100
static final String LEGSPATH = "/legs";

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class ConversationMessage {
1313
private String id;
1414
private String conversationId;
1515
private String channelId;
16+
private String trackId;
1617
private ConversationMessageDirection direction;
1718
private ConversationMessageStatus status;
1819
private ConversationContentType type;
@@ -122,6 +123,14 @@ public void setPlatform(String platform) {
122123
this.platform = platform;
123124
}
124125

126+
public String getTrackId() {
127+
return trackId;
128+
}
129+
130+
public void setTrackId(String trackId) {
131+
this.trackId = trackId;
132+
}
133+
125134
@Override
126135
public String toString() {
127136
return "ConversationMessage{" +
@@ -131,6 +140,7 @@ public String toString() {
131140
", direction=" + direction +
132141
", status=" + status +
133142
", type=" + type +
143+
", trackID=" + trackId +
134144
", content=" + content +
135145
", createdDatetime=" + createdDatetime +
136146
", updatedDatetime=" + updatedDatetime +
@@ -139,4 +149,4 @@ public String toString() {
139149
", platform='" + platform + '\'' +
140150
'}';
141151
}
142-
}
152+
}

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class ConversationMessageRequest {
1111
private ConversationContent content;
1212
private String channelId;
1313
private String reportUrl;
14+
private String trackId;
15+
private String ttl;
1416
private Map<String, Object> source;
1517

1618
public ConversationContentType getType() {
@@ -53,6 +55,21 @@ public void setSource(Map<String, Object> source) {
5355
this.source = source;
5456
}
5557

58+
public String getTrackId() {
59+
return trackId;
60+
}
61+
62+
public void setTrackId(String trackId) {
63+
this.trackId = trackId;
64+
}
65+
public String getTtl() {
66+
return ttl;
67+
}
68+
69+
public void setTtl(String ttl) {
70+
this.ttl = ttl;
71+
}
72+
5673
@Override
5774
public String toString() {
5875
return "ConversationMessageRequest{" +
@@ -61,6 +78,8 @@ public String toString() {
6178
", channelId='" + channelId + '\'' +
6279
", reportUrl='" + reportUrl + '\'' +
6380
", source=" + source +
81+
", trackID=" + trackId +
82+
", ttl=" + ttl +
6483
'}';
6584
}
66-
}
85+
}

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class ConversationSendRequest {
88
private ConversationContent content;
99
private String from;
1010
private String reportUrl;
11+
private String trackId;
12+
private String ttl;
1113
private ConversationFallbackOption fallback;
1214
private Map<String, Object> source;
1315
private ConversationMessageTag tag;
@@ -90,6 +92,21 @@ public void setTag(ConversationMessageTag tag) {
9092
this.tag = tag;
9193
}
9294

95+
public void setTrackId(String trackId) {
96+
this.trackId = trackId;
97+
}
98+
99+
public String getTrackId() {
100+
return trackId;
101+
}
102+
103+
public String getTtl() {
104+
return ttl;
105+
}
106+
107+
public void setTtl(String ttl) {
108+
this.ttl = ttl;
109+
}
93110
@Override
94111
public String toString() {
95112
return "ConversationSendRequest{" +
@@ -98,11 +115,11 @@ public String toString() {
98115
", content=" + content +
99116
", from='" + from + '\'' +
100117
", reportUrl='" + reportUrl + '\'' +
118+
", trackId='" + trackId + '\'' +
119+
", ttl='" + ttl + '\'' +
101120
", fallback=" + fallback + '\'' +
102121
", tags=" + tag +
103122
", source='" + source + '\'' +
104123
'}';
105124
}
106-
}
107-
108-
125+
}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class ConversationStartRequest {
1414
private ConversationMessageTag tag;
1515
private String channelId;
1616
private String reportUrl;
17+
private String trackId;
18+
private String ttl;
1719

1820
public ConversationStartRequest(
1921
final String to,
@@ -91,6 +93,14 @@ public void setTag(ConversationMessageTag tag) {
9193
this.tag = tag;
9294
}
9395

96+
public String getTrackId() {
97+
return trackId;
98+
}
99+
100+
public void setTrackId(String trackId) {
101+
this.trackId = trackId;
102+
}
103+
94104
@Override
95105
public String toString() {
96106
return "ConversationStartRequest{" +
@@ -101,6 +111,8 @@ public String toString() {
101111
", tag=" + tag +
102112
", channelId='" + channelId + '\'' +
103113
", reportUrl='" + reportUrl + '\'' +
114+
", trackId='" + trackId + '\'' +
115+
", ttl='" + ttl + '\'' +
104116
'}';
105117
}
106-
}
118+
}

0 commit comments

Comments
 (0)