Skip to content

Commit e6b7a61

Browse files
committed
Merge branch 'master' of https://github.com/twilio/twilio-java into alpha
2 parents c2010ce + dcb594c commit e6b7a61

File tree

84 files changed

+6616
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+6616
-314
lines changed

VERSIONS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ functionality will only be added to the current version. The current version -
3535
1 will continue to be supported with bugfixes and security updates, but no new
3636
features.
3737

38-
## Edge Features (Edge Branch)
38+
## Edge Features (alpha Branch)
3939

4040
Twilio frequently rolls out new features in public and private beta periods.
4141
Twilio strives to ship early and often and bake customer feedback back into our
@@ -61,4 +61,4 @@ in the stable artifact, with a `MAJOR` or `MINOR` version bump.
6161
To use an `Edge` artifact in your JAVA project you will have to make sure that
6262
you pin the artifact with `alpha` stability in your `pom.xml`.
6363

64-
[semver]: http://semver.org/
64+
[semver]: http://semver.org/

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
<use>true</use>
177177
<windowtitle>Twilio Java</windowtitle>
178178
<doctitle><![CDATA[<h1>Twilio Java</h1>]]></doctitle>
179-
<bottom><![CDATA[<i>Copyright &#169; 2011 Twilio, Inc. All Rights Reserved.</i>]]></bottom>
179+
<bottom><![CDATA[<i>Copyright &#169; 2016 Twilio, Inc. All Rights Reserved.</i>]]></bottom>
180180
</configuration>
181181
</plugin>
182182

src/main/java/com/twilio/rest/api/v2010/account/Call.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,38 @@ public static Status forValue(final String value) {
112112
}
113113
}
114114

115+
public enum UpdateStatus {
116+
CANCELED("canceled"),
117+
COMPLETED("completed");
118+
119+
private final String value;
120+
121+
private UpdateStatus(final String value) {
122+
this.value = value;
123+
}
124+
125+
public String toString() {
126+
return value;
127+
}
128+
129+
/**
130+
* Generate a UpdateStatus from a string.
131+
* @param value string value
132+
* @return generated UpdateStatus
133+
*/
134+
@JsonCreator
135+
public static UpdateStatus forValue(final String value) {
136+
String normalized = value.replace("-", "_").toUpperCase();
137+
try {
138+
return UpdateStatus.valueOf(normalized);
139+
} catch (RuntimeException e) {
140+
141+
// Don't blow up of value does not exist
142+
return null;
143+
}
144+
}
145+
}
146+
115147
/**
116148
* Create a CallCreator to execute create.
117149
*

src/main/java/com/twilio/rest/api/v2010/account/CallUpdater.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class CallUpdater extends Updater<Call> {
2525
private final String sid;
2626
private URI url;
2727
private HttpMethod method;
28-
private Call.Status status;
28+
private Call.UpdateStatus status;
2929
private URI fallbackUrl;
3030
private HttpMethod fallbackMethod;
3131
private URI statusCallback;
@@ -96,7 +96,7 @@ public CallUpdater setMethod(final HttpMethod method) {
9696
* @param status Status to update the Call with
9797
* @return this
9898
*/
99-
public CallUpdater setStatus(final Call.Status status) {
99+
public CallUpdater setStatus(final Call.UpdateStatus status) {
100100
this.status = status;
101101
return this;
102102
}

src/main/java/com/twilio/rest/api/v2010/account/Conference.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
@JsonIgnoreProperties(ignoreUnknown = true)
3535
public class Conference extends Resource {
36-
private static final long serialVersionUID = 42097688383145L;
36+
private static final long serialVersionUID = 26859400656542L;
3737

3838
public enum Status {
3939
INIT("init"),
@@ -155,6 +155,7 @@ public static Conference fromJson(final InputStream json, final ObjectMapper obj
155155
private final String sid;
156156
private final Conference.Status status;
157157
private final String uri;
158+
private final Map<String, String> subresourceUris;
158159

159160
@JsonCreator
160161
private Conference(@JsonProperty("account_sid")
@@ -172,7 +173,9 @@ private Conference(@JsonProperty("account_sid")
172173
@JsonProperty("status")
173174
final Conference.Status status,
174175
@JsonProperty("uri")
175-
final String uri) {
176+
final String uri,
177+
@JsonProperty("subresource_uris")
178+
final Map<String, String> subresourceUris) {
176179
this.accountSid = accountSid;
177180
this.dateCreated = DateConverter.rfc2822DateTimeFromString(dateCreated);
178181
this.dateUpdated = DateConverter.rfc2822DateTimeFromString(dateUpdated);
@@ -181,6 +184,7 @@ private Conference(@JsonProperty("account_sid")
181184
this.sid = sid;
182185
this.status = status;
183186
this.uri = uri;
187+
this.subresourceUris = subresourceUris;
184188
}
185189

186190
/**
@@ -255,6 +259,15 @@ public final String getUri() {
255259
return this.uri;
256260
}
257261

262+
/**
263+
* Returns The The subresource_uris.
264+
*
265+
* @return The subresource_uris
266+
*/
267+
public final Map<String, String> getSubresourceUris() {
268+
return this.subresourceUris;
269+
}
270+
258271
@Override
259272
public boolean equals(final Object o) {
260273
if (this == o) {
@@ -274,7 +287,8 @@ public boolean equals(final Object o) {
274287
Objects.equals(friendlyName, other.friendlyName) &&
275288
Objects.equals(sid, other.sid) &&
276289
Objects.equals(status, other.status) &&
277-
Objects.equals(uri, other.uri);
290+
Objects.equals(uri, other.uri) &&
291+
Objects.equals(subresourceUris, other.subresourceUris);
278292
}
279293

280294
@Override
@@ -286,7 +300,8 @@ public int hashCode() {
286300
friendlyName,
287301
sid,
288302
status,
289-
uri);
303+
uri,
304+
subresourceUris);
290305
}
291306

292307
@Override
@@ -300,6 +315,7 @@ public String toString() {
300315
.add("sid", sid)
301316
.add("status", status)
302317
.add("uri", uri)
318+
.add("subresourceUris", subresourceUris)
303319
.toString();
304320
}
305321
}

src/main/java/com/twilio/rest/api/v2010/account/Message.java

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
@JsonIgnoreProperties(ignoreUnknown = true)
4040
public class Message extends Resource {
41-
private static final long serialVersionUID = 8764009288306L;
41+
private static final long serialVersionUID = 201754449447651L;
4242

4343
public enum Status {
4444
QUEUED("queued"),
@@ -300,21 +300,25 @@ public static MessageReader reader() {
300300
*
301301
* @param accountSid The account_sid
302302
* @param sid The message to redact
303+
* @param body The body
303304
* @return MessageUpdater capable of executing the update
304305
*/
305306
public static MessageUpdater updater(final String accountSid,
306-
final String sid) {
307-
return new MessageUpdater(accountSid, sid);
307+
final String sid,
308+
final String body) {
309+
return new MessageUpdater(accountSid, sid, body);
308310
}
309311

310312
/**
311313
* Create a MessageUpdater to execute update.
312314
*
313315
* @param sid The message to redact
316+
* @param body The body
314317
* @return MessageUpdater capable of executing the update
315318
*/
316-
public static MessageUpdater updater(final String sid) {
317-
return new MessageUpdater(sid);
319+
public static MessageUpdater updater(final String sid,
320+
final String body) {
321+
return new MessageUpdater(sid, body);
318322
}
319323

320324
/**
@@ -364,6 +368,7 @@ public static Message fromJson(final InputStream json, final ObjectMapper object
364368
private final Integer errorCode;
365369
private final String errorMessage;
366370
private final com.twilio.type.PhoneNumber from;
371+
private final String messagingServiceSid;
367372
private final String numMedia;
368373
private final String numSegments;
369374
private final BigDecimal price;
@@ -395,6 +400,8 @@ private Message(@JsonProperty("account_sid")
395400
final String errorMessage,
396401
@JsonProperty("from")
397402
final com.twilio.type.PhoneNumber from,
403+
@JsonProperty("messaging_service_sid")
404+
final String messagingServiceSid,
398405
@JsonProperty("num_media")
399406
final String numMedia,
400407
@JsonProperty("num_segments")
@@ -424,6 +431,7 @@ private Message(@JsonProperty("account_sid")
424431
this.errorCode = errorCode;
425432
this.errorMessage = errorMessage;
426433
this.from = from;
434+
this.messagingServiceSid = messagingServiceSid;
427435
this.numMedia = numMedia;
428436
this.numSegments = numSegments;
429437
this.price = price;
@@ -525,6 +533,15 @@ public final com.twilio.type.PhoneNumber getFrom() {
525533
return this.from;
526534
}
527535

536+
/**
537+
* Returns The The messaging_service_sid.
538+
*
539+
* @return The messaging_service_sid
540+
*/
541+
public final String getMessagingServiceSid() {
542+
return this.messagingServiceSid;
543+
}
544+
528545
/**
529546
* Returns The Number of media files associated with the message.
530547
*
@@ -628,6 +645,7 @@ public boolean equals(final Object o) {
628645
Objects.equals(errorCode, other.errorCode) &&
629646
Objects.equals(errorMessage, other.errorMessage) &&
630647
Objects.equals(from, other.from) &&
648+
Objects.equals(messagingServiceSid, other.messagingServiceSid) &&
631649
Objects.equals(numMedia, other.numMedia) &&
632650
Objects.equals(numSegments, other.numSegments) &&
633651
Objects.equals(price, other.price) &&
@@ -651,6 +669,7 @@ public int hashCode() {
651669
errorCode,
652670
errorMessage,
653671
from,
672+
messagingServiceSid,
654673
numMedia,
655674
numSegments,
656675
price,
@@ -675,6 +694,7 @@ public String toString() {
675694
.add("errorCode", errorCode)
676695
.add("errorMessage", errorMessage)
677696
.add("from", from)
697+
.add("messagingServiceSid", messagingServiceSid)
678698
.add("numMedia", numMedia)
679699
.add("numSegments", numSegments)
680700
.add("price", price)

src/main/java/com/twilio/rest/api/v2010/account/MessageUpdater.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,33 @@
2020
public class MessageUpdater extends Updater<Message> {
2121
private String accountSid;
2222
private final String sid;
23-
private String body;
23+
private final String body;
2424

2525
/**
2626
* Construct a new MessageUpdater.
2727
*
2828
* @param sid The message to redact
29+
* @param body The body
2930
*/
30-
public MessageUpdater(final String sid) {
31+
public MessageUpdater(final String sid,
32+
final String body) {
3133
this.sid = sid;
34+
this.body = body;
3235
}
3336

3437
/**
3538
* Construct a new MessageUpdater.
3639
*
3740
* @param accountSid The account_sid
3841
* @param sid The message to redact
42+
* @param body The body
3943
*/
4044
public MessageUpdater(final String accountSid,
41-
final String sid) {
45+
final String sid,
46+
final String body) {
4247
this.accountSid = accountSid;
4348
this.sid = sid;
44-
}
45-
46-
/**
47-
* The body.
48-
*
49-
* @param body The body
50-
* @return this
51-
*/
52-
public MessageUpdater setBody(final String body) {
5349
this.body = body;
54-
return this;
5550
}
5651

5752
/**

src/main/java/com/twilio/rest/api/v2010/account/Queue.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,22 @@ public static QueueReader reader() {
124124
* Create a QueueCreator to execute create.
125125
*
126126
* @param accountSid The account_sid
127+
* @param friendlyName A user-provided string that identifies this queue.
127128
* @return QueueCreator capable of executing the create
128129
*/
129-
public static QueueCreator creator(final String accountSid) {
130-
return new QueueCreator(accountSid);
130+
public static QueueCreator creator(final String accountSid,
131+
final String friendlyName) {
132+
return new QueueCreator(accountSid, friendlyName);
131133
}
132134

133135
/**
134136
* Create a QueueCreator to execute create.
135137
*
138+
* @param friendlyName A user-provided string that identifies this queue.
136139
* @return QueueCreator capable of executing the create
137140
*/
138-
public static QueueCreator creator() {
139-
return new QueueCreator();
141+
public static QueueCreator creator(final String friendlyName) {
142+
return new QueueCreator(friendlyName);
140143
}
141144

142145
/**

src/main/java/com/twilio/rest/api/v2010/account/QueueCreator.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,28 @@
1919

2020
public class QueueCreator extends Creator<Queue> {
2121
private String accountSid;
22-
private String friendlyName;
22+
private final String friendlyName;
2323
private Integer maxSize;
2424

2525
/**
2626
* Construct a new QueueCreator.
27+
*
28+
* @param friendlyName A user-provided string that identifies this queue.
2729
*/
28-
public QueueCreator() {
30+
public QueueCreator(final String friendlyName) {
31+
this.friendlyName = friendlyName;
2932
}
3033

3134
/**
3235
* Construct a new QueueCreator.
3336
*
3437
* @param accountSid The account_sid
35-
*/
36-
public QueueCreator(final String accountSid) {
37-
this.accountSid = accountSid;
38-
}
39-
40-
/**
41-
* A user-provided string that identifies this queue..
42-
*
4338
* @param friendlyName A user-provided string that identifies this queue.
44-
* @return this
4539
*/
46-
public QueueCreator setFriendlyName(final String friendlyName) {
40+
public QueueCreator(final String accountSid,
41+
final String friendlyName) {
42+
this.accountSid = accountSid;
4743
this.friendlyName = friendlyName;
48-
return this;
4944
}
5045

5146
/**

0 commit comments

Comments
 (0)