Skip to content

Commit 4181ef3

Browse files
band-swi-release-engineering[bot]DX-Bandwidthckoegel
authored
SWI-10976 Update SDK Based on Recent Spec Changes (#241)
* Generate SDK with OpenAPI Generator Version * unit tests --------- Co-authored-by: DX-Bandwidth <dx@bandwidth.com> Co-authored-by: ckoegel <ckoegel1006@gmail.com>
1 parent 2464987 commit 4181ef3

6 files changed

Lines changed: 84 additions & 5 deletions

File tree

api/openapi.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6860,6 +6860,13 @@ components:
68606860
phoneNumbers:
68616861
- "+19196104423"
68626862
- "+19196104424"
6863+
rcsAgentRequestExample:
6864+
summary: Number Lookup Request with Custom RCS Agent
6865+
value:
6866+
phoneNumbers:
6867+
- "+19196104423"
6868+
- "+19196104424"
6869+
rcsAgent: MyCustomRcsAgent
68636870
lookupAcceptedExample:
68646871
summary: Numbers Lookup Accepted
68656872
value:
@@ -8236,6 +8243,8 @@ components:
82368243
$ref: "#/components/examples/singleNumberRequestExample"
82378244
multipleNumberRequestExample:
82388245
$ref: "#/components/examples/multipleNumberRequestExample"
8246+
rcsAgentRequestExample:
8247+
$ref: "#/components/examples/rcsAgentRequestExample"
82398248
schema:
82408249
$ref: "#/components/schemas/syncLookupRequest"
82418250
description: Synchronous phone number lookup request.
@@ -14452,6 +14461,14 @@ components:
1445214461
maximum: 100
1445314462
minimum: 1
1445414463
type: array
14464+
rcsAgent:
14465+
description: |-
14466+
Override the default RCS sender/agent ID used when checking RCS capabilities.
14467+
When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default.
14468+
Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.
14469+
example: MyCustomRcsAgent
14470+
pattern: "^[A-Za-z0-9_-]{1,40}$"
14471+
type: string
1445514472
required:
1445614473
- phoneNumbers
1445714474
type: object

bandwidth.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5759,6 +5759,19 @@ components:
57595759
items:
57605760
type: string
57615761
pattern: ^\+[1-9]\d{1,14}$
5762+
rcsAgent:
5763+
type: string
5764+
description: >-
5765+
Override the default RCS sender/agent ID used when checking RCS
5766+
capabilities.
5767+
5768+
When provided, this value is used as the `sender` in the RCS
5769+
capability-check request instead of the account default.
5770+
5771+
Must be 1–40 characters and contain only letters, digits,
5772+
underscores, or hyphens.
5773+
pattern: ^[A-Za-z0-9_-]{1,40}$
5774+
example: MyCustomRcsAgent
57625775
required:
57635776
- phoneNumbers
57645777
asyncLookupRequest:
@@ -8758,6 +8771,13 @@ components:
87588771
phoneNumbers:
87598772
- '+19196104423'
87608773
- '+19196104424'
8774+
rcsAgentRequestExample:
8775+
summary: Number Lookup Request with Custom RCS Agent
8776+
value:
8777+
phoneNumbers:
8778+
- '+19196104423'
8779+
- '+19196104424'
8780+
rcsAgent: MyCustomRcsAgent
87618781
lookupAcceptedExample:
87628782
summary: Numbers Lookup Accepted
87638783
value:
@@ -9518,6 +9538,8 @@ components:
95189538
$ref: '#/components/examples/singleNumberRequestExample'
95199539
multipleNumberRequestExample:
95209540
$ref: '#/components/examples/multipleNumberRequestExample'
9541+
rcsAgentRequestExample:
9542+
$ref: '#/components/examples/rcsAgentRequestExample'
95219543
createAsyncBulkLookupRequest:
95229544
description: Asynchronous bulk phone number lookup request.
95239545
required: true

docs/SyncLookupRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| Name | Type | Description | Notes |
99
|------------ | ------------- | ------------- | -------------|
1010
|**phoneNumbers** | **List&lt;String&gt;** | Telephone numbers in E.164 format. | |
11+
|**rcsAgent** | **String** | Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the &#x60;sender&#x60; 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] |
1112

1213

1314

src/main/java/com/bandwidth/sdk/model/SyncLookupRequest.java

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public class SyncLookupRequest {
5959
@javax.annotation.Nonnull
6060
private List<String> phoneNumbers = new ArrayList<>();
6161

62+
public static final String SERIALIZED_NAME_RCS_AGENT = "rcsAgent";
63+
@SerializedName(SERIALIZED_NAME_RCS_AGENT)
64+
@javax.annotation.Nullable
65+
private String rcsAgent;
66+
6267
public SyncLookupRequest() {
6368
}
6469

@@ -88,6 +93,25 @@ public void setPhoneNumbers(@javax.annotation.Nonnull List<String> phoneNumbers)
8893
this.phoneNumbers = phoneNumbers;
8994
}
9095

96+
97+
public SyncLookupRequest rcsAgent(@javax.annotation.Nullable String rcsAgent) {
98+
this.rcsAgent = rcsAgent;
99+
return this;
100+
}
101+
102+
/**
103+
* Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the &#x60;sender&#x60; in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.
104+
* @return rcsAgent
105+
*/
106+
@javax.annotation.Nullable
107+
public String getRcsAgent() {
108+
return rcsAgent;
109+
}
110+
111+
public void setRcsAgent(@javax.annotation.Nullable String rcsAgent) {
112+
this.rcsAgent = rcsAgent;
113+
}
114+
91115
/**
92116
* A container for additional, undeclared properties.
93117
* This is a holder for any undeclared properties as specified with
@@ -143,20 +167,22 @@ public boolean equals(Object o) {
143167
return false;
144168
}
145169
SyncLookupRequest syncLookupRequest = (SyncLookupRequest) o;
146-
return Objects.equals(this.phoneNumbers, syncLookupRequest.phoneNumbers)&&
170+
return Objects.equals(this.phoneNumbers, syncLookupRequest.phoneNumbers) &&
171+
Objects.equals(this.rcsAgent, syncLookupRequest.rcsAgent)&&
147172
Objects.equals(this.additionalProperties, syncLookupRequest.additionalProperties);
148173
}
149174

150175
@Override
151176
public int hashCode() {
152-
return Objects.hash(phoneNumbers, additionalProperties);
177+
return Objects.hash(phoneNumbers, rcsAgent, additionalProperties);
153178
}
154179

155180
@Override
156181
public String toString() {
157182
StringBuilder sb = new StringBuilder();
158183
sb.append("class SyncLookupRequest {\n");
159184
sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n");
185+
sb.append(" rcsAgent: ").append(toIndentedString(rcsAgent)).append("\n");
160186
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
161187
sb.append("}");
162188
return sb.toString();
@@ -179,7 +205,7 @@ private String toIndentedString(Object o) {
179205

180206
static {
181207
// a set of all properties/fields (JSON key names)
182-
openapiFields = new HashSet<String>(Arrays.asList("phoneNumbers"));
208+
openapiFields = new HashSet<String>(Arrays.asList("phoneNumbers", "rcsAgent"));
183209

184210
// a set of required properties/fields (JSON key names)
185211
openapiRequiredFields = new HashSet<String>(Arrays.asList("phoneNumbers"));
@@ -211,6 +237,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
211237
} else if (!jsonObj.get("phoneNumbers").isJsonArray()) {
212238
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()));
213239
}
240+
if ((jsonObj.get("rcsAgent") != null && !jsonObj.get("rcsAgent").isJsonNull()) && !jsonObj.get("rcsAgent").isJsonPrimitive()) {
241+
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()));
242+
}
214243
}
215244

216245
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

src/test/java/com/bandwidth/sdk/unit/api/PhoneNumberLookupApiTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public void createAsyncBulkLookupTest() throws ApiException {
101101
@Test
102102
public void createSyncLookupTest() throws ApiException {
103103
SyncLookupRequest syncLookupRequest = new SyncLookupRequest()
104-
.phoneNumbers(Arrays.asList("+1234567890", "+1987654321"));
104+
.phoneNumbers(Arrays.asList("+1234567890", "+1987654321"))
105+
.rcsAgent("TestAgent");
105106
ApiResponse<CreateSyncLookupResponse> response = api.createSyncLookupWithHttpInfo(BW_ACCOUNT_ID, syncLookupRequest);
106107
assertThat(response.getStatusCode(), is(200));
107108
assertThat(response.getData(), instanceOf(CreateSyncLookupResponse.class));

src/test/java/com/bandwidth/sdk/unit/models/SyncLookupRequestTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
*/
3030
public class SyncLookupRequestTest {
3131
private final SyncLookupRequest model = new SyncLookupRequest()
32-
.phoneNumbers(new ArrayList<String>(Arrays.asList("+1234567890", "+1987654321")));
32+
.phoneNumbers(new ArrayList<String>(Arrays.asList("+1234567890", "+1987654321")))
33+
.rcsAgent("TestAgent");
3334

3435
/**
3536
* Model tests for SyncLookupRequest
@@ -47,4 +48,12 @@ public void phoneNumbersTest() {
4748
assertThat(model.getPhoneNumbers(), instanceOf(List.class));
4849
}
4950

51+
/**
52+
* Test the property 'rcsAgent'
53+
*/
54+
@Test
55+
public void rcsAgentTest() {
56+
assertThat(model.getRcsAgent(), instanceOf(String.class));
57+
}
58+
5059
}

0 commit comments

Comments
 (0)