Skip to content

Commit 13c9969

Browse files
band-swi-release-engineering[bot]DX-Bandwidthckoegel
authored
SWI-10305 Update SDK Based on Recent Spec Changes (#110)
* Generate SDK with OpenAPI Generator Version * update test --------- Co-authored-by: DX-Bandwidth <dx@bandwidth.com> Co-authored-by: ckoegel <ckoegel1006@gmail.com>
1 parent 1af6b5d commit 13c9969

6 files changed

Lines changed: 136 additions & 39 deletions

File tree

bandwidth.yml

Lines changed: 122 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5552,6 +5552,10 @@ components:
55525552
example: GET
55535553
lookupErrorSchema:
55545554
type: object
5555+
required:
5556+
- code
5557+
- type
5558+
- description
55555559
properties:
55565560
code:
55575561
type: string
@@ -5699,6 +5703,39 @@ components:
56995703
type: array
57005704
items:
57015705
$ref: '#/components/schemas/lookupErrorSchema'
5706+
rcsErrorEnum:
5707+
type: string
5708+
description: >-
5709+
[RCS-Only](#section/RCS-Only). Error encountered during RCS capability
5710+
lookup. Appears as the `code` field in the top-level `errors` array.
5711+
5712+
5713+
**RCS service pass-through codes:**
5714+
5715+
- `REQUEST_FAILED`: The RCS service returned this error code.
5716+
5717+
- `UNKNOWN_CODE`: The RCS service returned this error code.
5718+
5719+
- `INVALID_DESTINATION_ADDRESS`: The RCS service returned this error
5720+
code.
5721+
5722+
- `UNKNOWN_STATUS: <code>`: The RCS service returned an unrecognized
5723+
status code, where `<code>` is the raw value.
5724+
5725+
5726+
**Service-level errors:**
5727+
5728+
- `MISSING_FROM_RESPONSE`: The phone number was absent from the RCS
5729+
service response.
5730+
5731+
- `RCS_SERVICE_UNAVAILABLE`: An exception was thrown during the async
5732+
RCS service call.
5733+
5734+
- `RCS_SERVICE_DISABLED`: RCS lookup is disabled in configuration.
5735+
5736+
- `EMPTY_RESPONSE`: The RCS service returned a null or empty response
5737+
body.
5738+
example: RCS_SERVICE_UNAVAILABLE
57025739
lookupResult:
57035740
type: object
57045741
description: Carrier information results for the specified telephone number.
@@ -5757,13 +5794,21 @@ components:
57575794
format: date
57585795
description: >-
57595796
[DNI-Only](#section/DNI-Only). The date bandwidth last received
5760-
delivery status information for this phone number.
5797+
delivery status information for this phone number.
57615798
57625799
Use this field to understand how up-to-date the
57635800
`latestMessageDeliveryStatus` is.
57645801
57655802
Value resets every time the `latestMessageDeliveryStatus` changes.
57665803
example: '2025-06-21'
5804+
rcsEnabled:
5805+
type: boolean
5806+
description: >
5807+
[RCS-Only](#section/RCS-Only). Indicates whether the phone number is
5808+
capable of receiving RCS messages. Value will be null if account has
5809+
RCS, but no value was returned. Absent when account does not have
5810+
RCS.
5811+
example: true
57675812
accountId1:
57685813
type: string
57695814
description: User's account ID.
@@ -7149,6 +7194,10 @@ components:
71497194
$ref: '#/components/examples/lookupCompleteWithDniExample'
71507195
lookupCompleteExample:
71517196
$ref: '#/components/examples/lookupCompleteExample'
7197+
lookupCompleteWithRcsExample:
7198+
$ref: '#/components/examples/lookupCompleteWithRcsExample'
7199+
lookupCompleteWithRcsErrorExample:
7200+
$ref: '#/components/examples/lookupCompleteWithRcsErrorExample'
71527201
lookupPartialExample:
71537202
$ref: '#/components/examples/lookupPartialExample'
71547203
lookupFailedExample:
@@ -7160,8 +7209,8 @@ components:
71607209
schema:
71617210
$ref: '#/components/schemas/createAsyncBulkLookupResponse'
71627211
examples:
7163-
lookupInProgressExample:
7164-
$ref: '#/components/examples/lookupInProgressExample'
7212+
lookupAcceptedExample:
7213+
$ref: '#/components/examples/lookupAcceptedExample'
71657214
getAsyncBulkLookupResponse:
71667215
description: OK
71677216
content:
@@ -8049,25 +8098,32 @@ components:
80498098
phoneNumbers:
80508099
- '+19196104423'
80518100
- '+19196104424'
8052-
lookupInProgressExample:
8053-
summary: Numbers Lookup In Progress
8101+
lookupAcceptedExample:
8102+
summary: Numbers Lookup Accepted
80548103
value:
80558104
links:
8056-
- href: href
8057-
rel: rel
8105+
- href: >-
8106+
/accounts/9912345/phoneNumberLookup/bulk/004223a0-8b17-41b1-bf81-20732adf5590
8107+
rel: createdRequest
80588108
method: GET
80598109
data:
80608110
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
80618111
status: IN_PROGRESS
80628112
results: []
80638113
errors: []
8114+
lookupInProgressExample:
8115+
summary: Numbers Lookup In Progress
8116+
value:
8117+
links: []
8118+
data:
8119+
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
8120+
status: IN_PROGRESS
8121+
results: []
8122+
errors: []
80648123
lookupFailedExample:
80658124
summary: Numbers Lookup Failed
80668125
value:
8067-
links:
8068-
- href: href
8069-
rel: rel
8070-
method: GET
8126+
links: []
80718127
data:
80728128
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
80738129
status: FAILED
@@ -8084,10 +8140,7 @@ components:
80848140
lookupPartialExample:
80858141
summary: Numbers Lookup Partial Complete
80868142
value:
8087-
links:
8088-
- href: href
8089-
rel: rel
8090-
method: GET
8143+
links: []
80918144
data:
80928145
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
80938146
status: PARTIAL_COMPLETE
@@ -8114,10 +8167,7 @@ components:
81148167
lookupCompleteExample:
81158168
summary: Numbers Lookup Complete (without DNI)
81168169
value:
8117-
links:
8118-
- href: href
8119-
rel: rel
8120-
method: GET
8170+
links: []
81218171
data:
81228172
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
81238173
status: COMPLETE
@@ -8136,10 +8186,7 @@ components:
81368186
lookupCompleteWithDniExample:
81378187
summary: Numbers Lookup Complete (with DNI)
81388188
value:
8139-
links:
8140-
- href: href
8141-
rel: rel
8142-
method: GET
8189+
links: []
81438190
data:
81448191
requestId: 20732adf-bf81-8b17-41b1-004223a05590
81458192
status: COMPLETE
@@ -8177,6 +8224,58 @@ components:
81778224
deactivationEvent: DEACTIVATED
81788225
latestMessageDeliveryStatus: NOT_ENABLED
81798226
errors: []
8227+
lookupCompleteWithRcsExample:
8228+
summary: Numbers Lookup Complete (with RCS)
8229+
value:
8230+
links: []
8231+
data:
8232+
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
8233+
status: COMPLETE
8234+
results:
8235+
- phoneNumber: '+10072904497'
8236+
lineType: MOBILE
8237+
messagingProvider: Verizon Wireless
8238+
voiceProvider: Verizon Wireless
8239+
countryCodeA3: USA
8240+
rcsEnabled: true
8241+
- phoneNumber: '+10072904498'
8242+
lineType: MOBILE
8243+
messagingProvider: T-Mobile USA
8244+
voiceProvider: T-Mobile USA
8245+
countryCodeA3: USA
8246+
rcsEnabled: false
8247+
errors: []
8248+
lookupCompleteWithRcsErrorExample:
8249+
summary: Numbers Lookup Complete (with RCS error)
8250+
value:
8251+
links: []
8252+
data:
8253+
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
8254+
status: COMPLETE
8255+
results:
8256+
- phoneNumber: '+10072904497'
8257+
lineType: MOBILE
8258+
messagingProvider: Verizon Wireless
8259+
voiceProvider: Verizon Wireless
8260+
countryCodeA3: USA
8261+
- phoneNumber: '+10072904498'
8262+
lineType: MOBILE
8263+
messagingProvider: T-Mobile USA
8264+
voiceProvider: T-Mobile USA
8265+
countryCodeA3: USA
8266+
errors:
8267+
- code: RCS_SERVICE_UNAVAILABLE
8268+
type: rcs-error
8269+
description: An exception was thrown during the async RCS service call.
8270+
meta:
8271+
phoneNumbers:
8272+
- '+10072904497'
8273+
- code: MISSING_FROM_RESPONSE
8274+
type: rcs-error
8275+
description: The phone number was absent from the RCS service response.
8276+
meta:
8277+
phoneNumbers:
8278+
- '+10072904498'
81808279
badRequestExample:
81818280
summary: Example Bad Request Error
81828281
value:

docs/LookupErrorSchema.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**code** | **string** | Validation error code | [optional] [default to undefined]
9-
**description** | **string** | Description of validation error | [optional] [default to undefined]
10-
**type** | **string** | Type of validation error | [optional] [default to undefined]
8+
**code** | **string** | Validation error code | [default to undefined]
9+
**description** | **string** | Description of validation error | [default to undefined]
10+
**type** | **string** | Type of validation error | [default to undefined]
1111
**meta** | [**LookupErrorSchemaMeta**](LookupErrorSchemaMeta.md) | | [optional] [default to undefined]
1212

1313
## Example

docs/LookupResult.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Name | Type | Description | Notes
1616
**deactivationEvent** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] [default to undefined]
1717
**latestMessageDeliveryStatus** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] [default to undefined]
1818
**initialMessageDeliveryStatusDate** | **string** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in &#x60;latestMessageDeliveryStatus&#x60;. Think of this as the \&quot;start time\&quot; for that status. Value resets every time the &#x60;latestMessageDeliveryStatus&#x60; changes. | [optional] [default to undefined]
19-
**latestMessageDeliveryStatusDate** | **string** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the &#x60;latestMessageDeliveryStatus&#x60; is. Value resets every time the &#x60;latestMessageDeliveryStatus&#x60; changes. | [optional] [default to undefined]
19+
**latestMessageDeliveryStatusDate** | **string** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the &#x60;latestMessageDeliveryStatus&#x60; is. Value resets every time the &#x60;latestMessageDeliveryStatus&#x60; changes. | [optional] [default to undefined]
20+
**rcsEnabled** | **boolean** | [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. | [optional] [default to undefined]
2021

2122
## Example
2223

@@ -35,6 +36,7 @@ const instance: LookupResult = {
3536
latestMessageDeliveryStatus,
3637
initialMessageDeliveryStatusDate,
3738
latestMessageDeliveryStatusDate,
39+
rcsEnabled,
3840
};
3941
```
4042

models/lookup-error-schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export interface LookupErrorSchema {
2121
/**
2222
* Validation error code
2323
*/
24-
'code'?: string;
24+
'code': string;
2525
/**
2626
* Description of validation error
2727
*/
28-
'description'?: string;
28+
'description': string;
2929
/**
3030
* Type of validation error
3131
*/
32-
'type'?: string;
32+
'type': string;
3333
'meta'?: LookupErrorSchemaMeta;
3434
}
3535

models/lookup-result.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ export interface LookupResult {
5959
*/
6060
'initialMessageDeliveryStatusDate'?: string;
6161
/**
62-
* [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes.
62+
* [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes.
6363
*/
6464
'latestMessageDeliveryStatusDate'?: string;
65+
/**
66+
* [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS.
67+
*/
68+
'rcsEnabled'?: boolean;
6569
}
6670

6771

tests/unit/api/phone-number-lookup-api.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ describe('PhoneNumberLookupApi', () => {
4545
const { status, data } = await phoneNumberLookupApi.createSyncLookup(BW_ACCOUNT_ID, request);
4646

4747
expect(status).toEqual(200);
48-
expect(data.links[0]).toBeDefined();
49-
expect(data.links[0].rel).toBeString();
50-
expect(data.links[0].href).toBeString();
51-
expect(data.links[0].method).toBeString();
5248
expect(data.data.requestId).toBeString();
5349
expect(data.data.status).toBeOneOf(Object.values(CompletedLookupStatusEnum));
5450
expect(data.data.results).toBeInstanceOf(Array);
@@ -70,10 +66,6 @@ describe('PhoneNumberLookupApi', () => {
7066
const { status, data } = await phoneNumberLookupApi.getAsyncBulkLookup(BW_ACCOUNT_ID, requestId);
7167

7268
expect(status).toEqual(200);
73-
expect(data.links[0]).toBeDefined();
74-
expect(data.links[0].rel).toBeString();
75-
expect(data.links[0].href).toBeString();
76-
expect(data.links[0].method).toBeString();
7769
expect(data.data.requestId).toBeString();
7870
expect(data.data.status).toBeOneOf(Object.values(InProgressLookupStatusEnum));
7971
expect(data.data.results).toBeInstanceOf(Array);

0 commit comments

Comments
 (0)