forked from messagebird/java-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMessageParam.java
111 lines (89 loc) · 2.88 KB
/
MessageParam.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package com.messagebird.objects.conversations;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;
public class MessageParam {
private TemplateMediaType type;
private String text;
private String payload;
private HSMCurrency currency;
private String dateTime;
private Media document;
private Media image;
private Media video;
@JsonProperty("expiration_time")
private String expirationTime;
public TemplateMediaType getType() {
return type;
}
public void setType(TemplateMediaType type) {
this.type = type;
}
public String getText() {
return text;
}
public void setText(String text) {
if (StringUtils.isBlank(text)) {
throw new IllegalArgumentException("Text cannot be null or empty");
}
this.text = text;
}
public String getPayload() {
return payload;
}
public void setPayload(String payload) {
this.payload = payload;
}
public HSMCurrency getCurrency() {
return currency;
}
public void setCurrency(HSMCurrency currency) {
this.currency = currency;
}
public String getDateTime() {
return dateTime;
}
public void setDateTime(String dateTime) {
if (StringUtils.isBlank(dateTime)) {
throw new IllegalArgumentException("dateTime cannot be null or empty");
}
this.dateTime = dateTime;
}
public Media getDocument() {
return document;
}
public void setDocument(Media document) {
this.document = document;
}
public Media getImage() {
return image;
}
public void setImage(Media image) {
this.image = image;
}
public Media getVideo() { return video; }
public void setVideo(Media video) { this.video = video; }
public String getExpirationTime() {
return expirationTime;
}
public void setExpirationTime(String expirationTime) {
if (StringUtils.isBlank(expirationTime)) {
throw new IllegalArgumentException("expirationTime cannot be null or empty");
}
this.expirationTime = expirationTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("MessageParam{");
sb.append("type=").append(type)
.append(", text='").append(text).append('\'')
.append(", payload='").append(payload).append('\'')
.append(", currency=").append(currency)
.append(", dateTime='").append(dateTime).append('\'')
.append(", document=").append(document)
.append(", image=").append(image)
.append(", video=").append(video)
.append(", expirationTime='").append(expirationTime).append('\'')
.append('}');
return sb.toString();
}
}