Skip to content

Commit 4b8f258

Browse files
authored
Merge pull request #274 from messagebird/feat/add-helper-method
adding helper method to get copyCode
2 parents e6dc614 + 24b8bdb commit 4b8f258

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Diff for: api/src/main/java/com/messagebird/objects/conversations/MessageParam.java

+5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ public void setExpirationTime(String expirationTime) {
9595
this.expirationTime = expirationTime;
9696
}
9797

98+
public String getCouponCode() {
99+
return couponCode;
100+
}
101+
98102
public void setCouponCode(String couponCode) {
99103
if (StringUtils.isBlank(couponCode)) {
100104
throw new IllegalArgumentException("couponCode cannot be null or empty");
@@ -114,6 +118,7 @@ public String toString() {
114118
.append(", image=").append(image)
115119
.append(", video=").append(video)
116120
.append(", expirationTime='").append(expirationTime).append('\'')
121+
.append(", couponCode='").append(couponCode).append('\'')
117122
.append('}');
118123
return sb.toString();
119124
}

Diff for: api/src/test/java/com/messagebird/objects/conversations/MessageParamTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public void testMessageParamToString() {
1111
param.setText("Sample text");
1212
param.setPayload("Sample payload");
1313

14-
String expected = "MessageParam{type=image, text='Sample text', payload='Sample payload', currency=null, dateTime='null', document=null, image=null, video=null, expirationTime='null'}";
14+
String expected = "MessageParam{type=image, text='Sample text', payload='Sample payload', currency=null, dateTime='null', document=null, image=null, video=null, expirationTime='null', couponCode='null'}";
1515
assertEquals(expected, param.toString());
1616
}
1717

Diff for: examples/src/main/java/ExampleConversationSendHSMCopyCodeTemplate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ExampleConversationSendHSMCopyCodeTemplate {
1313
public static void main(String[] args) {
1414
if (args.length < 6) {
1515
System.out.println("Please at least specify your access key, the channel id and destination address.\n" +
16-
"Usage : java -jar <this jar file> test_accesskey(Required) channel_id(Required) from(Required) destination(Required) templateName(Required) namespace(Required) expirationTimeInput(Required)");
16+
"Usage : java -jar <this jar file> test_accesskey(Required) channel_id(Required) from(Required) destination(Required) templateName(Required) namespace(Required) couponCodeInput(Required)");
1717
return;
1818
}
1919

0 commit comments

Comments
 (0)