Skip to content

Commit af1b4fd

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

7 files changed

Lines changed: 139 additions & 43 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:

bandwidth/models/lookup_error_schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class LookupErrorSchema(BaseModel):
2828
"""
2929
LookupErrorSchema
3030
""" # noqa: E501
31-
code: Optional[StrictStr] = Field(default=None, description="Validation error code")
32-
description: Optional[StrictStr] = Field(default=None, description="Description of validation error")
33-
type: Optional[StrictStr] = Field(default=None, description="Type of validation error")
31+
code: StrictStr = Field(description="Validation error code")
32+
description: StrictStr = Field(description="Description of validation error")
33+
type: StrictStr = Field(description="Type of validation error")
3434
meta: Optional[LookupErrorSchemaMeta] = None
3535
additional_properties: Dict[str, Any] = {}
3636
__properties: ClassVar[List[str]] = ["code", "description", "type", "meta"]

bandwidth/models/lookup_result.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import json
2020

2121
from datetime import date
22-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
2323
from typing import Any, ClassVar, Dict, List, Optional
2424
from bandwidth.models.deactivation_event_enum import DeactivationEventEnum
2525
from bandwidth.models.latest_message_delivery_status_enum import LatestMessageDeliveryStatusEnum
@@ -41,9 +41,10 @@ class LookupResult(BaseModel):
4141
deactivation_event: Optional[DeactivationEventEnum] = Field(default=None, alias="deactivationEvent")
4242
latest_message_delivery_status: Optional[LatestMessageDeliveryStatusEnum] = Field(default=None, alias="latestMessageDeliveryStatus")
4343
initial_message_delivery_status_date: Optional[date] = Field(default=None, description="[DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes.", alias="initialMessageDeliveryStatusDate")
44-
latest_message_delivery_status_date: Optional[date] = Field(default=None, description="[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.", alias="latestMessageDeliveryStatusDate")
44+
latest_message_delivery_status_date: Optional[date] = Field(default=None, description="[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.", alias="latestMessageDeliveryStatusDate")
45+
rcs_enabled: Optional[StrictBool] = Field(default=None, description="[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. ", alias="rcsEnabled")
4546
additional_properties: Dict[str, Any] = {}
46-
__properties: ClassVar[List[str]] = ["phoneNumber", "lineType", "messagingProvider", "voiceProvider", "countryCodeA3", "deactivationReporter", "deactivationDate", "deactivationEvent", "latestMessageDeliveryStatus", "initialMessageDeliveryStatusDate", "latestMessageDeliveryStatusDate"]
47+
__properties: ClassVar[List[str]] = ["phoneNumber", "lineType", "messagingProvider", "voiceProvider", "countryCodeA3", "deactivationReporter", "deactivationDate", "deactivationEvent", "latestMessageDeliveryStatus", "initialMessageDeliveryStatusDate", "latestMessageDeliveryStatusDate", "rcsEnabled"]
4748

4849
model_config = ConfigDict(
4950
populate_by_name=True,
@@ -113,7 +114,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
113114
"deactivationEvent": obj.get("deactivationEvent"),
114115
"latestMessageDeliveryStatus": obj.get("latestMessageDeliveryStatus"),
115116
"initialMessageDeliveryStatusDate": obj.get("initialMessageDeliveryStatusDate"),
116-
"latestMessageDeliveryStatusDate": obj.get("latestMessageDeliveryStatusDate")
117+
"latestMessageDeliveryStatusDate": obj.get("latestMessageDeliveryStatusDate"),
118+
"rcsEnabled": obj.get("rcsEnabled")
117119
})
118120
# store additional fields in additional_properties
119121
for _key in obj.keys():

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** | **str** | Validation error code | [optional]
9-
**description** | **str** | Description of validation error | [optional]
10-
**type** | **str** | Type of validation error | [optional]
8+
**code** | **str** | Validation error code |
9+
**description** | **str** | Description of validation error |
10+
**type** | **str** | Type of validation error |
1111
**meta** | [**LookupErrorSchemaMeta**](LookupErrorSchemaMeta.md) | | [optional]
1212

1313
## Example

docs/LookupResult.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Name | Type | Description | Notes
1616
**deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional]
1717
**latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional]
1818
**initial_message_delivery_status_date** | **date** | [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]
19-
**latest_message_delivery_status_date** | **date** | [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]
19+
**latest_message_delivery_status_date** | **date** | [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]
20+
**rcs_enabled** | **bool** | [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]
2021

2122
## Example
2223

test/unit/api/test_phone_number_lookup_api.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ def test_create_sync_lookup(self) -> None:
9090
assert_that(response.data, is_not(none()))
9191
assert_that(response.data, instance_of(CreateSyncLookupResponse))
9292
assert_that(response.data.links, is_not(none()))
93-
assert_that(response.data.links[0], instance_of(LinkSchema))
94-
assert_that(response.data.links[0].rel, instance_of(str))
95-
assert_that(response.data.links[0].href, instance_of(str))
96-
assert_that(response.data.links[0].method, instance_of(str))
9793
assert_that(response.data.data, is_not(none()))
9894
assert_that(response.data.data.request_id, instance_of(UUID))
9995
assert_that(response.data.data.status, instance_of(CompletedLookupStatusEnum))
@@ -126,10 +122,6 @@ def test_get_async_bulk_lookup(self) -> None:
126122
assert_that(response.data, is_not(none()))
127123
assert_that(response.data, instance_of(GetAsyncBulkLookupResponse))
128124
assert_that(response.data.links, is_not(none()))
129-
assert_that(response.data.links[0], instance_of(LinkSchema))
130-
assert_that(response.data.links[0].rel, instance_of(str))
131-
assert_that(response.data.links[0].href, instance_of(str))
132-
assert_that(response.data.links[0].method, instance_of(str))
133125
assert_that(response.data.data, is_not(none()))
134126
assert_that(response.data.data.request_id, instance_of(UUID))
135127
assert_that(response.data.data.status, instance_of(InProgressLookupStatusEnum))

test/unit/models/test_lookup_result.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def make_instance(self, include_optional) -> LookupResult:
4444
deactivation_event = 'DEACTIVATED',
4545
latest_message_delivery_status = 'ACTIVE',
4646
initial_message_delivery_status_date = '2025-06-20',
47-
latest_message_delivery_status_date = '2025-06-20', )
47+
latest_message_delivery_status_date = '2025-06-20',
48+
rcs_enabled = True, )
4849
else:
4950
return LookupResult(
5051
)
@@ -65,6 +66,7 @@ def testLookupResult(self):
6566
assert instance.latest_message_delivery_status == 'ACTIVE'
6667
assert isinstance(instance.initial_message_delivery_status_date, date)
6768
assert isinstance(instance.latest_message_delivery_status_date, date)
69+
assert instance.rcs_enabled == True
6870

6971
if __name__ == '__main__':
7072
unittest.main()

0 commit comments

Comments
 (0)