From 0d58f6e3d1134152a55d8cbc2e9dc74e8c31400e Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 12 May 2026 15:00:57 +0000 Subject: [PATCH 1/2] Generate SDK with OpenAPI Generator Version --- api/openapi.yaml | 17 +++++++++ bandwidth.yml | 22 ++++++++++++ docs/SyncLookupRequest.md | 1 + .../sdk/model/SyncLookupRequest.java | 35 +++++++++++++++++-- 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 936caea2..f553c016 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -6860,6 +6860,13 @@ components: phoneNumbers: - "+19196104423" - "+19196104424" + rcsAgentRequestExample: + summary: Number Lookup Request with Custom RCS Agent + value: + phoneNumbers: + - "+19196104423" + - "+19196104424" + rcsAgent: MyCustomRcsAgent lookupAcceptedExample: summary: Numbers Lookup Accepted value: @@ -8236,6 +8243,8 @@ components: $ref: "#/components/examples/singleNumberRequestExample" multipleNumberRequestExample: $ref: "#/components/examples/multipleNumberRequestExample" + rcsAgentRequestExample: + $ref: "#/components/examples/rcsAgentRequestExample" schema: $ref: "#/components/schemas/syncLookupRequest" description: Synchronous phone number lookup request. @@ -14452,6 +14461,14 @@ components: maximum: 100 minimum: 1 type: array + rcsAgent: + description: |- + Override the default RCS sender/agent ID used when checking RCS capabilities. + When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. + Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. + example: MyCustomRcsAgent + pattern: "^[A-Za-z0-9_-]{1,40}$" + type: string required: - phoneNumbers type: object diff --git a/bandwidth.yml b/bandwidth.yml index 5b874eeb..84e00b33 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -5759,6 +5759,19 @@ components: items: type: string pattern: ^\+[1-9]\d{1,14}$ + rcsAgent: + type: string + description: >- + Override the default RCS sender/agent ID used when checking RCS + capabilities. + + When provided, this value is used as the `sender` in the RCS + capability-check request instead of the account default. + + Must be 1–40 characters and contain only letters, digits, + underscores, or hyphens. + pattern: ^[A-Za-z0-9_-]{1,40}$ + example: MyCustomRcsAgent required: - phoneNumbers asyncLookupRequest: @@ -8758,6 +8771,13 @@ components: phoneNumbers: - '+19196104423' - '+19196104424' + rcsAgentRequestExample: + summary: Number Lookup Request with Custom RCS Agent + value: + phoneNumbers: + - '+19196104423' + - '+19196104424' + rcsAgent: MyCustomRcsAgent lookupAcceptedExample: summary: Numbers Lookup Accepted value: @@ -9518,6 +9538,8 @@ components: $ref: '#/components/examples/singleNumberRequestExample' multipleNumberRequestExample: $ref: '#/components/examples/multipleNumberRequestExample' + rcsAgentRequestExample: + $ref: '#/components/examples/rcsAgentRequestExample' createAsyncBulkLookupRequest: description: Asynchronous bulk phone number lookup request. required: true diff --git a/docs/SyncLookupRequest.md b/docs/SyncLookupRequest.md index 80c63ca3..cac5b0c1 100644 --- a/docs/SyncLookupRequest.md +++ b/docs/SyncLookupRequest.md @@ -8,6 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**phoneNumbers** | **List<String>** | Telephone numbers in E.164 format. | | +|**rcsAgent** | **String** | Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. | [optional] | diff --git a/src/main/java/com/bandwidth/sdk/model/SyncLookupRequest.java b/src/main/java/com/bandwidth/sdk/model/SyncLookupRequest.java index 4131409d..635add8f 100644 --- a/src/main/java/com/bandwidth/sdk/model/SyncLookupRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/SyncLookupRequest.java @@ -59,6 +59,11 @@ public class SyncLookupRequest { @javax.annotation.Nonnull private List phoneNumbers = new ArrayList<>(); + public static final String SERIALIZED_NAME_RCS_AGENT = "rcsAgent"; + @SerializedName(SERIALIZED_NAME_RCS_AGENT) + @javax.annotation.Nullable + private String rcsAgent; + public SyncLookupRequest() { } @@ -88,6 +93,25 @@ public void setPhoneNumbers(@javax.annotation.Nonnull List phoneNumbers) this.phoneNumbers = phoneNumbers; } + + public SyncLookupRequest rcsAgent(@javax.annotation.Nullable String rcsAgent) { + this.rcsAgent = rcsAgent; + return this; + } + + /** + * Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. + * @return rcsAgent + */ + @javax.annotation.Nullable + public String getRcsAgent() { + return rcsAgent; + } + + public void setRcsAgent(@javax.annotation.Nullable String rcsAgent) { + this.rcsAgent = rcsAgent; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -143,13 +167,14 @@ public boolean equals(Object o) { return false; } SyncLookupRequest syncLookupRequest = (SyncLookupRequest) o; - return Objects.equals(this.phoneNumbers, syncLookupRequest.phoneNumbers)&& + return Objects.equals(this.phoneNumbers, syncLookupRequest.phoneNumbers) && + Objects.equals(this.rcsAgent, syncLookupRequest.rcsAgent)&& Objects.equals(this.additionalProperties, syncLookupRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(phoneNumbers, additionalProperties); + return Objects.hash(phoneNumbers, rcsAgent, additionalProperties); } @Override @@ -157,6 +182,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SyncLookupRequest {\n"); sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" rcsAgent: ").append(toIndentedString(rcsAgent)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -179,7 +205,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("phoneNumbers")); + openapiFields = new HashSet(Arrays.asList("phoneNumbers", "rcsAgent")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("phoneNumbers")); @@ -211,6 +237,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else if (!jsonObj.get("phoneNumbers").isJsonArray()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `phoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("phoneNumbers").toString())); } + if ((jsonObj.get("rcsAgent") != null && !jsonObj.get("rcsAgent").isJsonNull()) && !jsonObj.get("rcsAgent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `rcsAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rcsAgent").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 997ea7edeca57c285f5aa64bd26d1f918ec4e8ae Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 12 May 2026 14:16:16 -0400 Subject: [PATCH 2/2] unit tests --- .../sdk/unit/api/PhoneNumberLookupApiTest.java | 3 ++- .../sdk/unit/models/SyncLookupRequestTest.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/bandwidth/sdk/unit/api/PhoneNumberLookupApiTest.java b/src/test/java/com/bandwidth/sdk/unit/api/PhoneNumberLookupApiTest.java index 2c483609..11d6d676 100644 --- a/src/test/java/com/bandwidth/sdk/unit/api/PhoneNumberLookupApiTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/api/PhoneNumberLookupApiTest.java @@ -101,7 +101,8 @@ public void createAsyncBulkLookupTest() throws ApiException { @Test public void createSyncLookupTest() throws ApiException { SyncLookupRequest syncLookupRequest = new SyncLookupRequest() - .phoneNumbers(Arrays.asList("+1234567890", "+1987654321")); + .phoneNumbers(Arrays.asList("+1234567890", "+1987654321")) + .rcsAgent("TestAgent"); ApiResponse response = api.createSyncLookupWithHttpInfo(BW_ACCOUNT_ID, syncLookupRequest); assertThat(response.getStatusCode(), is(200)); assertThat(response.getData(), instanceOf(CreateSyncLookupResponse.class)); diff --git a/src/test/java/com/bandwidth/sdk/unit/models/SyncLookupRequestTest.java b/src/test/java/com/bandwidth/sdk/unit/models/SyncLookupRequestTest.java index d7e9f369..6d00cc8b 100644 --- a/src/test/java/com/bandwidth/sdk/unit/models/SyncLookupRequestTest.java +++ b/src/test/java/com/bandwidth/sdk/unit/models/SyncLookupRequestTest.java @@ -29,7 +29,8 @@ */ public class SyncLookupRequestTest { private final SyncLookupRequest model = new SyncLookupRequest() - .phoneNumbers(new ArrayList(Arrays.asList("+1234567890", "+1987654321"))); + .phoneNumbers(new ArrayList(Arrays.asList("+1234567890", "+1987654321"))) + .rcsAgent("TestAgent"); /** * Model tests for SyncLookupRequest @@ -47,4 +48,12 @@ public void phoneNumbersTest() { assertThat(model.getPhoneNumbers(), instanceOf(List.class)); } + /** + * Test the property 'rcsAgent' + */ + @Test + public void rcsAgentTest() { + assertThat(model.getRcsAgent(), instanceOf(String.class)); + } + }