Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
274 changes: 274 additions & 0 deletions CHANGES.md

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@

_`MAJOR` version bumps will have upgrade notes posted here._

[2026-08-26] 12.x.x to 13.x.x
-----------------------------
### Overview
##### Twilio Java Helper Library's major version 13.0.0 includes:
1. A fix to ensure nested response models gracefully handle unknown fields (forward compatibility).
2. A fix to class name generation for nested models and enums whose schema names contain numbers (e.g., API version identifiers like `v2`).

##### Breaking Changes

###### 1. Nested model and enum class names corrected
Type names derived from schema names containing numbers (e.g., `conversations.v2.action_status`) previously had those numbers silently dropped. They are now correctly included.

**Who is impacted:**
Users who reference generated nested enum or model types by name in their code for the following resources:
- `com.twilio.rest.conversations.v2.Action`
- `com.twilio.rest.conversations.v2.Communication`
- `com.twilio.rest.conversations.v2.Configuration`
- `com.twilio.rest.conversations.v2.Conversation`
- `com.twilio.rest.conversations.v2.Operation`
- `com.twilio.rest.conversations.v2.Participant`
- `com.twilio.rest.messaging.v2.ChannelsSender`

**Example of renamed type (generator fix):**

| 12.x.x | 13.x.x |
|---------|---------|
| `Conversation.ConversationsVConversationGroupingType` | `Conversation.ConversationsV2ConversationGroupingType` |

##### Migration

Find and replace the old type names with the corrected names. If you use any nested enum or model class from the affected resources above, update the class reference.

```java
// 12.x.x
Conversation.ConversationsVConversationGroupingType type = Conversation.ConversationsVConversationGroupingType.OPEN;

// 13.x.x
Conversation.ConversationsV2ConversationGroupingType type = Conversation.ConversationsV2ConversationGroupingType.OPEN;
```

##### Non-Breaking Fix

###### Forward compatibility for nested response models
All nested response model Builder classes now include `@JsonIgnoreProperties(ignoreUnknown = true)`. This prevents `UnrecognizedPropertyException` when the API returns new fields that are not yet defined in the SDK. No code changes required — this fix is transparent to existing users.


[2026-04-21] 11.x.x to 12.x.x
-----------------------------
### Overview
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>twilio</artifactId>
<packaging>jar</packaging>
<name>twilio</name>
<version>12.1.1</version>
<version>13.0.0</version>
<description>Twilio Java Helper Library</description>
<url>https://www.twilio.com</url>
<licenses>
Expand All @@ -19,7 +19,7 @@
<url>git@github.com:twilio/twilio-java.git</url>
<connection>scm:git:git@github.com:twilio/twilio-java.git</connection>
<developerConnection>scm:git:git@github.com:twilio/twilio-java.git</developerConnection>
<tag>12.1.1</tag>
<tag>13.0.0</tag>
</scm>
<developers>
<developer>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/twilio/Domains.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
public enum Domains {
ACCOUNTS("accounts"),
API("api"),
ASSISTANTS("assistants"),
BULKEXPORTS("bulkexports"),
CHAT("chat"),
CONTENT("content"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/Twilio.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
public class Twilio {

public static final String VERSION = "12.1.1";
public static final String VERSION = "13.0.0";
public static final String JAVA_VERSION = System.getProperty("java.version");
public static final String OS_NAME = System.getProperty("os.name");
public static final String OS_ARCH = System.getProperty("os.arch");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

import com.twilio.base.TwilioResponse;
import com.twilio.base.Updater;
import com.twilio.constant.EnumConstants;
import com.twilio.constant.EnumConstants.ParameterType;
import com.twilio.converter.Serializer;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
Expand All @@ -29,8 +32,17 @@

public class AuthTokenPromotionUpdater extends Updater<AuthTokenPromotion> {

private Boolean suppressEmailNotification;

public AuthTokenPromotionUpdater() {}

public AuthTokenPromotionUpdater setSuppressEmailNotification(
final Boolean suppressEmailNotification
) {
this.suppressEmailNotification = suppressEmailNotification;
return this;
}

private Response makeRequest(final TwilioRestClient client) {
String path = "/v1/AuthTokens/Promote";

Expand All @@ -39,6 +51,8 @@ private Response makeRequest(final TwilioRestClient client) {
Domains.ACCOUNTS.toString(),
path
);
request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
addPostParams(request);

Response response = client.request(request);

Expand Down Expand Up @@ -87,4 +101,15 @@ public TwilioResponse<AuthTokenPromotion> updateWithResponse(
response.getHeaders()
);
}

private void addPostParams(final Request request) {
if (suppressEmailNotification != null) {
Serializer.toString(
request,
"SuppressEmailNotification",
suppressEmailNotification,
ParameterType.URLENCODED
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public boolean equals(final Object o) {
}

BulkConsents other = (BulkConsents) o;
return (Objects.equals(items, other.items));
return Objects.equals(items, other.items);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public boolean equals(final Object o) {
}

BulkContacts other = (BulkContacts) o;
return (Objects.equals(items, other.items));
return Objects.equals(items, other.items);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public boolean equals(final Object o) {
}

MessagingGeopermissions other = (MessagingGeopermissions) o;
return (Objects.equals(permissions, other.permissions));
return Objects.equals(permissions, other.permissions);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
import java.io.InputStream;

public class MessagingGeopermissionsFetcher
extends Fetcher<MessagingGeopermissions> {
extends Fetcher<MessagingGeopermissions>
{

private String countryCode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
import java.util.List;

public class MessagingGeopermissionsUpdater
extends Updater<MessagingGeopermissions> {
extends Updater<MessagingGeopermissions>
{

private List<Object> permissions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

import com.twilio.base.Creator;
import com.twilio.base.TwilioResponse;
import com.twilio.constant.EnumConstants;
import com.twilio.constant.EnumConstants.ParameterType;
import com.twilio.converter.Serializer;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
Expand All @@ -29,8 +32,17 @@

public class SecondaryAuthTokenCreator extends Creator<SecondaryAuthToken> {

private Boolean suppressEmailNotification;

public SecondaryAuthTokenCreator() {}

public SecondaryAuthTokenCreator setSuppressEmailNotification(
final Boolean suppressEmailNotification
) {
this.suppressEmailNotification = suppressEmailNotification;
return this;
}

private Response makeRequest(final TwilioRestClient client) {
String path = "/v1/AuthTokens/Secondary";

Expand All @@ -39,6 +51,8 @@ private Response makeRequest(final TwilioRestClient client) {
Domains.ACCOUNTS.toString(),
path
);
request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
addPostParams(request);

Response response = client.request(request);

Expand Down Expand Up @@ -87,4 +101,15 @@ public TwilioResponse<SecondaryAuthToken> createWithResponse(
response.getHeaders()
);
}

private void addPostParams(final Request request) {
if (suppressEmailNotification != null) {
Serializer.toString(
request,
"SuppressEmailNotification",
suppressEmailNotification,
ParameterType.URLENCODED
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import com.twilio.base.Deleter;
import com.twilio.base.TwilioResponse;
import com.twilio.constant.EnumConstants.ParameterType;
import com.twilio.converter.Serializer;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
Expand All @@ -30,8 +32,17 @@

public class SecondaryAuthTokenDeleter extends Deleter<SecondaryAuthToken> {

private Boolean suppressEmailNotification;

public SecondaryAuthTokenDeleter() {}

public SecondaryAuthTokenDeleter setSuppressEmailNotification(
final Boolean suppressEmailNotification
) {
this.suppressEmailNotification = suppressEmailNotification;
return this;
}

private Response makeRequest(final TwilioRestClient client) {
String path = "/v1/AuthTokens/Secondary";

Expand All @@ -42,6 +53,7 @@ private Response makeRequest(final TwilioRestClient client) {
Domains.ACCOUNTS.toString(),
path
);
addQueryParams(request);

Response response = client.request(request);

Expand Down Expand Up @@ -88,4 +100,15 @@ public TwilioResponse<Boolean> deleteWithResponse(
response.getHeaders()
);
}

private void addQueryParams(final Request request) {
if (suppressEmailNotification != null) {
Serializer.toString(
request,
"SuppressEmailNotification",
suppressEmailNotification,
ParameterType.QUERY
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ private Response makeRequest(final TwilioRestClient client) {
this.pathAccountSid == null
? client.getAccountSid()
: this.pathAccountSid;
path =
path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);

Request request = new Request(
HttpMethod.POST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ private Response makeRequest(final TwilioRestClient client) {
this.pathAccountSid == null
? client.getAccountSid()
: this.pathAccountSid;
path =
path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace("{" + "Sid" + "}", this.pathSid.toString());

Predicate<Integer> deleteStatuses = i ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ private Response makeRequest(final TwilioRestClient client) {
this.pathAccountSid == null
? client.getAccountSid()
: this.pathAccountSid;
path =
path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace("{" + "Sid" + "}", this.pathSid.toString());

Request request = new Request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ private Request buildFirstPageRequest(final TwilioRestClient client) {
this.pathAccountSid == null
? client.getAccountSid()
: this.pathAccountSid;
path =
path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);

Request request = new Request(
HttpMethod.GET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ private Response makeRequest(final TwilioRestClient client) {
this.pathAccountSid == null
? client.getAccountSid()
: this.pathAccountSid;
path =
path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace("{" + "Sid" + "}", this.pathSid.toString());

Request request = new Request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ private Response makeRequest(final TwilioRestClient client) {
this.pathAccountSid == null
? client.getAccountSid()
: this.pathAccountSid;
path =
path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);
path = path.replace(
"{" + "AccountSid" + "}",
this.pathAccountSid.toString()
);

Request request = new Request(
HttpMethod.POST,
Expand Down
Loading
Loading