Skip to content

Commit 77d89d0

Browse files
committed
Merge branch 'alpha' of https://github.com/twilio/twilio-java into asym-auth
2 parents ccbc880 + ec48da6 commit 77d89d0

File tree

177 files changed

+21093
-335
lines changed

Some content is hidden

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

177 files changed

+21093
-335
lines changed

CHANGES.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
twilio-java changelog
22
=====================
33

4-
[2016-10-05] Version 7.1.0
4+
[2016-11-16] Version 7.2.0-alpha-1
5+
--------------------------
6+
- Add PublicKey Credentials.
7+
- Add create/update to RatePlans.
8+
- Use separate enum for Updating Call `status`. This enum only exposes the statuses that a Call can be updated to.
9+
- Move the `body` parameter to be required in updating Messages.
10+
- Move the `friendlyName` parameter to be r equired in creating Queues.
11+
- Update to latest Notify.
12+
- Add Particpant creation to Conferences.
13+
- Add filtering by `CallSid` to Recordings.
14+
- Add missing fields to Call Recordings.
15+
- Add missing fields to Conferences.
16+
- Add missing fields to IncomingPhoneNumbers.
17+
- Add missing fields to Messages.
18+
19+
- * Twilio Chat *
20+
- Add Invites
21+
- Add `reachabilityEnabled`, `preWebhookUrl`, `postWebhookUrl`, `webhookMethod`, `webhookFilters`, `notifications` to Services.
22+
- Add `attributes`, `friendlyName`, `isOnline`, `isNotifiable` to Users.
23+
- Add `lastConsumedMessageIndex`, `lastConsumptionTimestamp` to Members.
24+
- Add `attributes`, `index` to Messages.
25+
- Add ability to update Members.
26+
- Add filtering by `identity` on Members.
27+
- Add webhook related parameters to Service updates.
28+
- Remove updating of `type` on Channels.
29+
30+
[2016-10-05] Version 7.1.0-alpha-1
531
--------------------------
632
- Update Usage Records to use `LocalDate` instead of `DateTime`
733
- Update TwiML Generator to reflect latest docs:

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<artifactId>twilio</artifactId>
88
<packaging>jar</packaging>
99
<name>twilio</name>
10-
<version>7.1.1-SNAPSHOT</version>
10+
<version>7.1.0-alpha-2-SNAPSHOT</version>
1111
<description>Twilio Java Helper Library</description>
1212
<url>https://www.twilio.com</url>
1313
<licenses>
@@ -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/Twilio.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
public class Twilio {
1414

15-
public static final String VERSION = "7.1.0";
15+
public static final String VERSION = "7.1.0-alpha-1";
1616
public static final String JAVA_VERSION = System.getProperty("java.version");
1717

1818
private static String username;

src/main/java/com/twilio/example/Example.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;
88
import com.twilio.rest.api.v2010.account.Message;
99
import com.twilio.rest.api.v2010.account.availablephonenumbercountry.Local;
10+
import com.twilio.rest.api.v2010.account.usage.Record;
1011
import com.twilio.rest.trunking.v1.Trunk;
1112
import com.twilio.rest.trunking.v1.TrunkCreator;
1213
import com.twilio.twiml.Play;
@@ -36,6 +37,11 @@ public static void main(String[] args) throws TwiMLException {
3637

3738
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
3839

40+
Iterable<Record> usage = Record.reader().read();
41+
for (Record record : usage) {
42+
System.out.println(record);
43+
}
44+
3945
// Get a number
4046
IncomingPhoneNumber number = buyNumber();
4147
System.out.println(number.getPhoneNumber());

src/main/java/com/twilio/rest/Domains.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public enum Domains {
1414
IPMESSAGING("ip-messaging"),
1515
LOOKUPS("lookups"),
1616
MONITOR("monitor"),
17+
NOTIFY("notify"),
18+
PREVIEW("preview"),
1719
PRICING("pricing"),
1820
TASKROUTER("taskrouter"),
1921
TRUNKING("trunking");

src/main/java/com/twilio/rest/accounts/v1/credential/PublicKeyCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public PublicKey create(final TwilioRestClient client) {
9999
*/
100100
private void addPostParams(final Request request) {
101101
if (publicKey != null) {
102-
request.addPostParam("PublicKey", publicKey);
102+
request.addPostParam("PublicKey", publicKey.toString());
103103
}
104104

105105
if (friendlyName != null) {

src/main/java/com/twilio/rest/accounts/v1/credential/PublicKeyUpdater.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
public class PublicKeyUpdater extends Updater<PublicKey> {
2121
private final String sid;
2222
private String friendlyName;
23-
private String publicKey;
2423

2524
/**
2625
* Construct a new PublicKeyUpdater.
@@ -42,17 +41,6 @@ public PublicKeyUpdater setFriendlyName(final String friendlyName) {
4241
return this;
4342
}
4443

45-
/**
46-
* The public_key.
47-
*
48-
* @param publicKey The public_key
49-
* @return this
50-
*/
51-
public PublicKeyUpdater setPublicKey(final String publicKey) {
52-
this.publicKey = publicKey;
53-
return this;
54-
}
55-
5644
/**
5745
* Make the request to the Twilio API to perform the update.
5846
*
@@ -101,9 +89,5 @@ private void addPostParams(final Request request) {
10189
if (friendlyName != null) {
10290
request.addPostParam("FriendlyName", friendlyName);
10391
}
104-
105-
if (publicKey != null) {
106-
request.addPostParam("PublicKey", publicKey);
107-
}
10892
}
10993
}

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
}

0 commit comments

Comments
 (0)