Skip to content

Commit

Permalink
Merge branch 'main' into snyk-fix-96f4480da26ebd31d3ea49bd3c37c147
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 authored Jan 16, 2025
2 parents 24b6a15 + faf0db4 commit 20d6286
Show file tree
Hide file tree
Showing 188 changed files with 12,970 additions and 3,805 deletions.
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Bug report
description: Report a bug with the twilio-java helper library.
title: "[BUG] Describe the issue briefly"
labels: "type: bug"
body:
- type: markdown
attributes:
value: |
Thank you for reporting a bug in the twilio-java helper library. Please provide the details below to help us investigate and resolve the issue.
- type: textarea
attributes:
label: Describe the bug
description: Provide a clear and concise description of the issue.
placeholder: A clear and concise description of the bug.
validations:
required: true

- type: textarea
attributes:
label: Code snippet
description: Provide the code snippet that reproduces the issue.
placeholder: "```\n// Code snippet here\n```"
validations:
required: true

- type: textarea
attributes:
label: Actual behavior
description: Describe what actually happened.
placeholder: A description of the actual behavior.
validations:
required: true

- type: textarea
attributes:
label: Expected behavior
description: Describe what you expected to happen.
placeholder: A description of the expected outcome.
validations:
required: true

- type: input
attributes:
label: twilio-java version
description: Specify the version of the twilio-java helper library you are using.
placeholder: e.g., 10.5.1
validations:
required: true

- type: input
attributes:
label: Java version
description: Specify the version of Java you are using.
placeholder: e.g., OpenJDK 11.0.16
validations:
required: true

- type: textarea
attributes:
label: Logs or error messages
description: Provide relevant logs or error messages (if any).
placeholder: "Error: Something went wrong..."

- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
placeholder: Any additional
3 changes: 3 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
TWILIO_ORGS_CLIENT_ID: ${{ secrets.TWILIO_ORGS_CLIENT_ID }}
TWILIO_ORGS_CLIENT_SECRET: ${{ secrets.TWILIO_ORGS_CLIENT_SECRET }}
TWILIO_ORG_SID: ${{ secrets.TWILIO_ORG_SID }}
TWILIO_CLIENT_ID: ${{ secrets.TWILIO_CLIENT_ID }}
TWILIO_CLIENT_SECRET: ${{ secrets.TWILIO_CLIENT_SECRET }}
TWILIO_MESSAGE_SID: ${{ secrets.TWILIO_MESSAGE_SID }}
run: mvn test -DTest="ClusterTest" -B

- uses: actions/setup-java@v4
Expand Down
161 changes: 161 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,167 @@
twilio-java changelog
=====================

[2025-01-13] Version 10.6.7
---------------------------
**Messaging**
- Adds validity period Default value in service resource documentation


[2025-01-09] Version 10.6.6
---------------------------
**Numbers**
- Change beta feature flag to use v2/BulkHostedNumberOrders


[2024-12-12] Version 10.6.5
---------------------------
**Library - Fix**
- [PR #822](https://github.com/twilio/twilio-java/pull/822): Update org.json:json library to resolve high severity vulnerability. Thanks to [@allantodd](https://github.com/allantodd)!


[2024-12-05] Version 10.6.4
---------------------------
**Api**
- Add optional parameter `intelligence_service` to `transcription`
- Updated `phone_number_sid` to be populated for sip trunking terminating calls.

**Numbers**
- Add Update Hosted Number Order V2 API endpoint
- Update Port in docs

**Twiml**
- Add optional parameter `intelligence_service` to `<Transcription>`
- Add support for new `<ConversationRelay>` and `<Assistant>` noun
- Add `events` attribute to `<Dial>` verb


[2024-11-15] Version 10.6.3
---------------------------
**Api**
- Added `ivr-virtual-agent-custom-voices` and `ivr-virtual-agent-genai` to `usage_record` API.
- Add open-api file tag to realtime_transcriptions

**Taskrouter**
- Add `api-tag` property to workers reservation
- Add `api-tag` property to task reservation


[2024-10-24] Version 10.6.2
---------------------------
**Library - Fix**
- [PR #741](https://github.com/twilio/twilio-java/pull/741): Security upgrade org.json:json from 20220320 to 20230227. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)!
- [PR #819](https://github.com/twilio/twilio-java/pull/819): Security upgrade commons-io:commons-io from 2.7 to 2.14.0. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)!

**Conversations**
- Expose ConversationWithParticipants resource that allows creating a conversation with participants


[2024-10-17] Version 10.6.1
---------------------------
**Api**
- Add response key `country` to fetch AvailablePhoneNumber resource by specific country.

**Messaging**
- Make library and doc public for requestManagedCert Endpoint


[2024-10-03] Version 10.6.0
---------------------------
**Library - Chore**
- [PR #818](https://github.com/twilio/twilio-java/pull/818): updated readme with Orgs example. Thanks to [@sbansla](https://github.com/sbansla)!

**Library - Feature**
- [PR #813](https://github.com/twilio/twilio-java/pull/813): Added OAuth Support for Public APIs with TokenManager Integration. Thanks to [@sbansla](https://github.com/sbansla)!

**Messaging**
- Add A2P external campaign CnpMigration flag

**Numbers**
- Add address sid to portability API

**Verify**
- Add `SnaClientToken` optional parameter on Verification check.
- Add `EnableSnaClientToken` optional parameter for Verification creation.


[2024-09-25] Version 10.5.2
---------------------------
**Library - Chore**
- [PR #815](https://github.com/twilio/twilio-java/pull/815): updated readme for Beta flag. Thanks to [@sbansla](https://github.com/sbansla)!

**Accounts**
- Update docs and mounts.
- Change library visibility to public
- Enable consent and contact bulk upsert APIs in prod.

**Serverless**
- Add is_plugin parameter in deployments api to check if it is plugins deployment


[2024-09-18] Version 10.5.1
---------------------------
**Intelligence**
- Remove public from operator_type
- Update operator_type to include general-availablity and deprecated

**Numbers**
- Remove beta flag for bundle clone API


[2024-09-05] Version 10.5.0
---------------------------
**Iam**
- updated library_visibility public for new public apikeys

**Numbers**
- Add new field in Error Codes for Regulatory Compliance.
- Change typing of Port In Request date_created field to date_time instead of date **(breaking change)**


[2024-08-26] Version 10.4.2
---------------------------
**Library - Fix**
- [PR #811](https://github.com/twilio/twilio-java/pull/811): making previewiam versionless. Thanks to [@sbansla](https://github.com/sbansla)!
- [PR #808](https://github.com/twilio/twilio-java/pull/808): added new httpclient for noauth and bearertoken requests. Thanks to [@sbansla](https://github.com/sbansla)!

**Library - Chore**
- [PR #806](https://github.com/twilio/twilio-java/pull/806): added multipart test in call api. Thanks to [@sbansla](https://github.com/sbansla)!

**Api**
- Update documentation of `error_code` and `error_message` on the Message resource.
- Remove generic parameters from `transcription` resource
- Added public documentation for Payload Data retrieval API

**Flex**
- Adding update Flex User api

**Insights**
- Added 'branded', 'business_profile' and 'voice_integrity' fields in List Call Summary

**Intelligence**
- Add `words` array information to the Sentences v2 entity.
- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` headers for Operator Results.
- Change the path parameter when fetching an `/OperatorType/{}` from `sid<EY>` to `string` to support searching by SID or by name
- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` headers for Transcript and Service endpoints.

**Messaging**
- Adds two new channel senders api to add/remove channel senders to/from a messaging service
- Extend ERC api to accept an optional attribute in request body to indicate CNP migration for an ERC

**Numbers**
- Modify visibility to public in bundle clone API
- Add `port_date` field to Port In Request and Port In Phone Numbers Fetch APIs
- Change properties docs for port in phone numbers api
- Add is_test body param to the Bundle Create API
- Change properties docs for port in api

**Trusthub**
- Add new field in themeSetId in compliance_inquiry.

**Verify**
- Update `custom_code_enabled` description on verification docs


[2024-07-02] Version 10.4.1
---------------------------
**Library - Fix**
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ This library supports the following Java implementations:

For Java 7 support, use `twilio-java` major version `7.X.X`.

### Beta Annotation

To indicate that a class or method is in beta and subject to change, we use the `@Beta` annotation. For example:

```java

@Beta
public class ClassName {
// Class implementation
}


public class ClassName {
@Beta
public void init() {
// Implementation
}
}
```

## Installation

`twilio-java` uses Maven. At present the jars _are_ available from a public [maven](https://mvnrepository.com/artifact/com.twilio.sdk/twilio) repository.
Expand Down Expand Up @@ -194,6 +214,15 @@ public class Example {
}
```



### OAuth Feature for Twilio APIs
We are introducing Client Credentials Flow-based OAuth 2.0 authentication.
This feature is currently in `beta` and its implementation is subject to change.

- API examples [here](https://github.com/twilio/twilio-java/blob/main/examples/FetchMessageUsingOAuth.md)
- Organisation API examples [here](https://github.com/twilio/twilio-java/blob/main/examples/BearerTokenAuthentication.md)

### Iterate through records

The library automatically handles paging for you. With the `read` method, you can specify the number of records you want to receive (`limit`) and the maximum size you want each page fetch to be (`pageSize`). The library will then handle the task for you, fetching new pages under the hood as you iterate over the records.
Expand Down
21 changes: 21 additions & 0 deletions examples/FetchMessageUsingOAuth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```
import com.twilio.Twilio;
import com.twilio.credential.ClientCredentialProvider;
import com.twilio.rest.api.v2010.account.Message;
public class FetchMessageUsingOAuth {
public static void main(String[] args) {
String clientId = "YOUR_CLIENT_ID";
String clientSecret = "YOUR_CLIENT_SECRET";
String accountSid = "YOUR_ACCOUNT_SID";
Twilio.init(new ClientCredentialProvider(clientId, clientSecret), accountSid);
/*
Or use the following if accountSid is not required as a path parameter for an API or when setting accountSid in the API.
Twilio.init(new ClientCredentialProvider(clientId, clientSecret));
*/
String messageSid = "YOUR_MESSAGE_SID";
Message message = Message.fetcher(messageSid).fetch();
}
}
```

11 changes: 8 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.4.1</version>
<version>10.6.7</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.4.1</tag>
<tag>10.6.7</tag>
</scm>
<developers>
<developer>
Expand Down Expand Up @@ -193,7 +193,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
Expand Down Expand Up @@ -321,6 +321,11 @@
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20240303</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/twilio/Domains.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
public enum Domains {
ACCOUNTS("accounts"),
API("api"),
ASSISTANTS("assistants"),
BULKEXPORTS("bulkexports"),
CHAT("chat"),
CONTENT("content"),
Expand All @@ -21,6 +22,7 @@ public enum Domains {
FLEXAPI("flex-api"),
FRONTLINEAPI("frontline-api"),
PREVIEWIAM("preview-iam"),
IAM("iam"),
INSIGHTS("insights"),
INTELLIGENCE("intelligence"),
IPMESSAGING("ip-messaging"),
Expand Down
Loading

0 comments on commit 20d6286

Please sign in to comment.