Skip to content

Commit

Permalink
Merge branch 'main' into auth-rest-client
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Jun 24, 2024
2 parents b5d7622 + de885af commit 6342d7f
Show file tree
Hide file tree
Showing 166 changed files with 10,887 additions and 3,442 deletions.
99 changes: 99 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,105 @@
twilio-java changelog
=====================

[2024-06-18] Version 10.3.0
---------------------------
**Library - Chore**
- [PR #799](https://github.com/twilio/twilio-java/pull/799): process form and body params for all methods except GET. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Events**
- Add `status` and `documentation_url` to Event Types

**Lookups**
- Removed unused `fraud` lookups in V1 only to facilitate rest proxy migration

**Numbers**
- Add date_created field to the Get Port In Request API
- Rename the `status_last_time_updated_timestamp` field to `last_updated` in the Get Port In Phone Number API **(breaking change)**
- Add Rejection reason and rejection reason code to the Get Port In Phone Number API
- Remove the carrier information from the Portability API

**Proxy**
- Change property `type` from enum to ienum

**Trusthub**
- Add skipMessagingUseCase field in compliance_tollfree_inquiry.


[2024-06-06] Version 10.2.1
---------------------------
**Api**
- Mark MaxPrice as obsolete

**Lookups**
- Update examples for `phone_number_quality_score`

**Messaging**
- List tollfree verifications on parent account and all sub-accounts


[2024-05-24] Version 10.2.0
---------------------------
**Library - Docs**
- [PR #792](https://github.com/twilio/twilio-java/pull/792): added json examples. Thanks to [@sbansla](https://github.com/sbansla)!

**Library - Chore**
- [PR #796](https://github.com/twilio/twilio-java/pull/796): adding variant class. Thanks to [@sbansla](https://github.com/sbansla)!
- [PR #794](https://github.com/twilio/twilio-java/pull/794): Update pom.xml. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Api**
- Add ie1 as supported region for UserDefinedMessage and UserDefinedMessageSubscription.

**Flex**
- Adding validated field to `plugin_versions`
- Corrected the data type for `runtime_domain`, `call_recording_webhook_url`, `crm_callback_url`, `crm_fallback_url`, `flex_url` in Flex Configuration
- Making `routing` optional in Create Interactions endpoint

**Intelligence**
- Expose operator authoring apis to public visibility
- Deleted `language_code` parameter from updating service in v2 **(breaking change)**
- Add read_only_attached_operator_sids to v2 services

**Numbers**
- Add API endpoint for GET Porting Webhook Configurations By Account SID
- Remove bulk portability api under version `/v1`. **(breaking change)**
- Removed porting_port_in_fetch.json files and move the content into porting_port_in.json files
- Add API endpoint to deleting Webhook Configurations
- Add Get Phone Number by Port in request SID and Phone Number SID api
- Add Create Porting webhook configuration API
- Added bundle_sid and losing_carrier_information fields to Create PortInRequest api to support Japan porting

**Taskrouter**
- Add back `routing_target` property to tasks
- Add back `ignore_capacity` property to tasks
- Removing `routing_target` property to tasks due to revert
- Removing `ignore_capacity` property to tasks due to revert
- Add `routing_target` property to tasks
- Add `ignore_capacity` property to tasks

**Trusthub**
- Add new field errors to bundle as part of public API response in customer_profile.json and trust_product.json **(breaking change)**
- Add themeSetId field in compliance_tollfree_inquiry.

**Verify**
- Update `friendly_name` description on service docs


[2024-04-18] Version 10.1.5
---------------------------
**Library - Chore**
- [PR #791](https://github.com/twilio/twilio-java/pull/791): add variant class to compliance tests. Thanks to [@sbansla](https://github.com/sbansla)!
- [PR #789](https://github.com/twilio/twilio-java/pull/789): bumping nexus staging maven plugin version. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Flex**
- Add header `ui_version` to `web_channels` API

**Messaging**
- Redeploy after failed pipeline

**Numbers**
- Add Delete Port In request phone number api and Add Delete Port In request api


[2024-04-04] Version 10.1.4
---------------------------
**Api**
Expand Down
25 changes: 25 additions & 0 deletions examples/Content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
public class ContentExamples {
public static void main {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
createTwilioText();
}

public static void createTwilioText() {
Content.ContentCreateRequest createRequest = new Content.ContentCreateRequest("es", types);

Content.TwilioText twilioText = new Content.TwilioText();
twilioText.setBody("text body");

Content.Types types = new Content.Types();
types.setTwilioText(twilioText);

Map<String, String> variables = new HashMap<>();
variables.put("var1", "val1");

createRequest.setVariables(variables);
createRequest.setFriendlyName("name");

Content newContent = Content.creator(createRequest).create();
}

}
28 changes: 28 additions & 0 deletions examples/PreviewMessaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class PreviewMessagingExamples {
public static void main {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
sendBulkMessages();
}

private static void sendBulkMessages() {
Message.CreateMessagesRequest createMessagesRequest = new Message.CreateMessagesRequest();
List<String> toNumbers; // recipients numbers
// Set from number
PhoneNumber fromNumber;
// Set list of number where you want to send bulk message.
List<Message.MessagingV1Message> phoneList = new ArrayList<>();
for (String to: toNumbers) {
Message.MessagingV1Message phone = new Message.MessagingV1Message();
phone.setTo(new PhoneNumber(to));
phoneList.add(phone);
}
createMessagesRequest.setFrom(fromNumber);
createMessagesRequest.setBody("Bulk message to send");
createMessagesRequest.setMessages(phoneList);
Message message = Message.creator(createMessagesRequest).create();
}

}
7 changes: 4 additions & 3 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>10.1.4</version>
<version>10.3.0</version>
<description>Twilio Java Helper Library</description>
<url>https://www.twilio.com</url>
<licenses>
Expand All @@ -19,7 +19,7 @@
<url>[email protected]:twilio/twilio-java.git</url>
<connection>scm:git:[email protected]:twilio/twilio-java.git</connection>
<developerConnection>scm:git:[email protected]:twilio/twilio-java.git</developerConnection>
<tag>10.1.4</tag>
<tag>10.3.0</tag>
</scm>
<developers>
<developer>
Expand Down Expand Up @@ -337,6 +337,7 @@
<source>8</source>
<target>8</target>
<showDeprecation>true</showDeprecation>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -479,4 +480,4 @@
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
</project>
</project>
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/Domains.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum Domains {
INTELLIGENCE("intelligence"),
IPMESSAGING("ip-messaging"),
LOOKUPS("lookups"),
PREVIEWMESSAGING("preview.messaging"),
MARKETPLACE("marketplace"),
MESSAGING("messaging"),
MICROVISOR("microvisor"),
MONITOR("monitor"),
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 @@ -21,7 +21,7 @@
*/
public class Twilio {

public static final String VERSION = "10.1.4";
public static final String VERSION = "10.3.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
4 changes: 1 addition & 3 deletions src/main/java/com/twilio/http/NetworkHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ public <T extends IRequest> Response makeRequest(final T request) {
}
}

if (method == HttpMethod.POST) {
// TODO: It will be removed after one RC Release.
if (request.getContentType() == null) request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
HttpEntity entity = new StringEntity(request.getBody(), ContentType.APPLICATION_JSON);
builder.setEntity(entity);
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/twilio/http/ValidationClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public ValidationClient(final String accountSid,

final PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
connectionManager.setDefaultSocketConfig(socketConfig);
/*
/*
* Example: Lets say client has one server.
* There are 4 servers on edge handling client request.
* Each request takes on an average 500ms (2 request per second)
Expand Down Expand Up @@ -176,9 +176,7 @@ public Response makeRequest(IRequest iRequest) {
}

HttpMethod method = request.getMethod();
if (method == HttpMethod.POST) {
// TODO: It will be removed after one RC Release.
if (request.getContentType() == null) request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
HttpEntity entity = new StringEntity(request.getBody(), ContentType.APPLICATION_JSON);
builder.setEntity(entity);
Expand Down
40 changes: 20 additions & 20 deletions src/main/java/com/twilio/rest/api/v2010/account/Call.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,6 @@ public static Call fromJson(
}
}

public enum UpdateStatus {
CANCELED("canceled"),
COMPLETED("completed");

private final String value;

private UpdateStatus(final String value) {
this.value = value;
}

public String toString() {
return value;
}

@JsonCreator
public static UpdateStatus forValue(final String value) {
return Promoter.enumFromString(value, UpdateStatus.values());
}
}

private final String sid;
private final ZonedDateTime dateCreated;
private final ZonedDateTime dateUpdated;
Expand Down Expand Up @@ -466,6 +446,26 @@ public int hashCode() {
);
}

public enum UpdateStatus {
CANCELED("canceled"),
COMPLETED("completed");

private final String value;

private UpdateStatus(final String value) {
this.value = value;
}

public String toString() {
return value;
}

@JsonCreator
public static UpdateStatus forValue(final String value) {
return Promoter.enumFromString(value, UpdateStatus.values());
}
}

public enum Status {
QUEUED("queued"),
RINGING("ringing"),
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/com/twilio/rest/api/v2010/account/Conference.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,6 @@ public static Conference fromJson(
}
}

public enum UpdateStatus {
COMPLETED("completed");

private final String value;

private UpdateStatus(final String value) {
this.value = value;
}

public String toString() {
return value;
}

@JsonCreator
public static UpdateStatus forValue(final String value) {
return Promoter.enumFromString(value, UpdateStatus.values());
}
}

private final String accountSid;
private final ZonedDateTime dateCreated;
private final ZonedDateTime dateUpdated;
Expand Down Expand Up @@ -331,4 +312,23 @@ public static Status forValue(final String value) {
return Promoter.enumFromString(value, Status.values());
}
}

public enum UpdateStatus {
COMPLETED("completed");

private final String value;

private UpdateStatus(final String value) {
this.value = value;
}

public String toString() {
return value;
}

@JsonCreator
public static UpdateStatus forValue(final String value) {
return Promoter.enumFromString(value, UpdateStatus.values());
}
}
}
Loading

0 comments on commit 6342d7f

Please sign in to comment.