From f902aec3eec744290e0baf45e8030ca6a57ea2cf Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 31 Mar 2026 14:34:49 +0000 Subject: [PATCH 1/2] Generate SDK with OpenAPI Generator Version --- bandwidth.yml | 145 ++++++++++++++++++++---- bandwidth/models/lookup_error_schema.py | 6 +- bandwidth/models/lookup_result.py | 10 +- docs/LookupErrorSchema.md | 6 +- docs/LookupResult.md | 3 +- 5 files changed, 136 insertions(+), 34 deletions(-) diff --git a/bandwidth.yml b/bandwidth.yml index bfa971f6..d3f8539c 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -5552,6 +5552,10 @@ components: example: GET lookupErrorSchema: type: object + required: + - code + - type + - description properties: code: type: string @@ -5699,6 +5703,39 @@ components: type: array items: $ref: '#/components/schemas/lookupErrorSchema' + rcsErrorEnum: + type: string + description: >- + [RCS-Only](#section/RCS-Only). Error encountered during RCS capability + lookup. Appears as the `code` field in the top-level `errors` array. + + + **RCS service pass-through codes:** + + - `REQUEST_FAILED`: The RCS service returned this error code. + + - `UNKNOWN_CODE`: The RCS service returned this error code. + + - `INVALID_DESTINATION_ADDRESS`: The RCS service returned this error + code. + + - `UNKNOWN_STATUS: `: The RCS service returned an unrecognized + status code, where `` is the raw value. + + + **Service-level errors:** + + - `MISSING_FROM_RESPONSE`: The phone number was absent from the RCS + service response. + + - `RCS_SERVICE_UNAVAILABLE`: An exception was thrown during the async + RCS service call. + + - `RCS_SERVICE_DISABLED`: RCS lookup is disabled in configuration. + + - `EMPTY_RESPONSE`: The RCS service returned a null or empty response + body. + example: RCS_SERVICE_UNAVAILABLE lookupResult: type: object description: Carrier information results for the specified telephone number. @@ -5757,13 +5794,21 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date bandwidth last received - delivery status information for this phone number. + 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. example: '2025-06-21' + rcsEnabled: + type: boolean + 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. + example: true accountId1: type: string description: User's account ID. @@ -7149,6 +7194,10 @@ components: $ref: '#/components/examples/lookupCompleteWithDniExample' lookupCompleteExample: $ref: '#/components/examples/lookupCompleteExample' + lookupCompleteWithRcsExample: + $ref: '#/components/examples/lookupCompleteWithRcsExample' + lookupCompleteWithRcsErrorExample: + $ref: '#/components/examples/lookupCompleteWithRcsErrorExample' lookupPartialExample: $ref: '#/components/examples/lookupPartialExample' lookupFailedExample: @@ -7160,8 +7209,8 @@ components: schema: $ref: '#/components/schemas/createAsyncBulkLookupResponse' examples: - lookupInProgressExample: - $ref: '#/components/examples/lookupInProgressExample' + lookupAcceptedExample: + $ref: '#/components/examples/lookupAcceptedExample' getAsyncBulkLookupResponse: description: OK content: @@ -8049,25 +8098,32 @@ components: phoneNumbers: - '+19196104423' - '+19196104424' - lookupInProgressExample: - summary: Numbers Lookup In Progress + lookupAcceptedExample: + summary: Numbers Lookup Accepted value: links: - - href: href - rel: rel + - href: >- + /accounts/9912345/phoneNumberLookup/bulk/004223a0-8b17-41b1-bf81-20732adf5590 + rel: createdRequest method: GET data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: IN_PROGRESS results: [] errors: [] + lookupInProgressExample: + summary: Numbers Lookup In Progress + value: + links: [] + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: IN_PROGRESS + results: [] + errors: [] lookupFailedExample: summary: Numbers Lookup Failed value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: FAILED @@ -8084,10 +8140,7 @@ components: lookupPartialExample: summary: Numbers Lookup Partial Complete value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: PARTIAL_COMPLETE @@ -8114,10 +8167,7 @@ components: lookupCompleteExample: summary: Numbers Lookup Complete (without DNI) value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: COMPLETE @@ -8136,10 +8186,7 @@ components: lookupCompleteWithDniExample: summary: Numbers Lookup Complete (with DNI) value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 20732adf-bf81-8b17-41b1-004223a05590 status: COMPLETE @@ -8177,6 +8224,58 @@ components: deactivationEvent: DEACTIVATED latestMessageDeliveryStatus: NOT_ENABLED errors: [] + lookupCompleteWithRcsExample: + summary: Numbers Lookup Complete (with RCS) + value: + links: [] + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + rcsEnabled: true + - phoneNumber: '+10072904498' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + rcsEnabled: false + errors: [] + lookupCompleteWithRcsErrorExample: + summary: Numbers Lookup Complete (with RCS error) + value: + links: [] + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + - phoneNumber: '+10072904498' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + errors: + - code: RCS_SERVICE_UNAVAILABLE + type: rcs-error + description: An exception was thrown during the async RCS service call. + meta: + phoneNumbers: + - '+10072904497' + - code: MISSING_FROM_RESPONSE + type: rcs-error + description: The phone number was absent from the RCS service response. + meta: + phoneNumbers: + - '+10072904498' badRequestExample: summary: Example Bad Request Error value: diff --git a/bandwidth/models/lookup_error_schema.py b/bandwidth/models/lookup_error_schema.py index cb7c1fa5..feb96349 100644 --- a/bandwidth/models/lookup_error_schema.py +++ b/bandwidth/models/lookup_error_schema.py @@ -28,9 +28,9 @@ class LookupErrorSchema(BaseModel): """ LookupErrorSchema """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="Validation error code") - description: Optional[StrictStr] = Field(default=None, description="Description of validation error") - type: Optional[StrictStr] = Field(default=None, description="Type of validation error") + code: StrictStr = Field(description="Validation error code") + description: StrictStr = Field(description="Description of validation error") + type: StrictStr = Field(description="Type of validation error") meta: Optional[LookupErrorSchemaMeta] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "description", "type", "meta"] diff --git a/bandwidth/models/lookup_result.py b/bandwidth/models/lookup_result.py index 4bd1f0c5..34f348e5 100644 --- a/bandwidth/models/lookup_result.py +++ b/bandwidth/models/lookup_result.py @@ -19,7 +19,7 @@ import json from datetime import date -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from bandwidth.models.deactivation_event_enum import DeactivationEventEnum from bandwidth.models.latest_message_delivery_status_enum import LatestMessageDeliveryStatusEnum @@ -41,9 +41,10 @@ class LookupResult(BaseModel): deactivation_event: Optional[DeactivationEventEnum] = Field(default=None, alias="deactivationEvent") latest_message_delivery_status: Optional[LatestMessageDeliveryStatusEnum] = Field(default=None, alias="latestMessageDeliveryStatus") 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") - 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") + 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") + 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") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["phoneNumber", "lineType", "messagingProvider", "voiceProvider", "countryCodeA3", "deactivationReporter", "deactivationDate", "deactivationEvent", "latestMessageDeliveryStatus", "initialMessageDeliveryStatusDate", "latestMessageDeliveryStatusDate"] + __properties: ClassVar[List[str]] = ["phoneNumber", "lineType", "messagingProvider", "voiceProvider", "countryCodeA3", "deactivationReporter", "deactivationDate", "deactivationEvent", "latestMessageDeliveryStatus", "initialMessageDeliveryStatusDate", "latestMessageDeliveryStatusDate", "rcsEnabled"] model_config = ConfigDict( populate_by_name=True, @@ -113,7 +114,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "deactivationEvent": obj.get("deactivationEvent"), "latestMessageDeliveryStatus": obj.get("latestMessageDeliveryStatus"), "initialMessageDeliveryStatusDate": obj.get("initialMessageDeliveryStatusDate"), - "latestMessageDeliveryStatusDate": obj.get("latestMessageDeliveryStatusDate") + "latestMessageDeliveryStatusDate": obj.get("latestMessageDeliveryStatusDate"), + "rcsEnabled": obj.get("rcsEnabled") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/docs/LookupErrorSchema.md b/docs/LookupErrorSchema.md index cb7daf4c..a6d80914 100644 --- a/docs/LookupErrorSchema.md +++ b/docs/LookupErrorSchema.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | Validation error code | [optional] -**description** | **str** | Description of validation error | [optional] -**type** | **str** | Type of validation error | [optional] +**code** | **str** | Validation error code | +**description** | **str** | Description of validation error | +**type** | **str** | Type of validation error | **meta** | [**LookupErrorSchemaMeta**](LookupErrorSchemaMeta.md) | | [optional] ## Example diff --git a/docs/LookupResult.md b/docs/LookupResult.md index b7758648..649e6896 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] **latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] **initial_message_delivery_status_date** | **date** | [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. | [optional] -**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 `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] +**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 `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] +**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] ## Example From 3867064a02c8581793b1138578c0ed9e8d540bcd Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 31 Mar 2026 14:48:31 -0400 Subject: [PATCH 2/2] update tests --- test/unit/api/test_phone_number_lookup_api.py | 8 -------- test/unit/models/test_lookup_result.py | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/test/unit/api/test_phone_number_lookup_api.py b/test/unit/api/test_phone_number_lookup_api.py index c231d169..caec4524 100644 --- a/test/unit/api/test_phone_number_lookup_api.py +++ b/test/unit/api/test_phone_number_lookup_api.py @@ -90,10 +90,6 @@ def test_create_sync_lookup(self) -> None: assert_that(response.data, is_not(none())) assert_that(response.data, instance_of(CreateSyncLookupResponse)) assert_that(response.data.links, is_not(none())) - assert_that(response.data.links[0], instance_of(LinkSchema)) - assert_that(response.data.links[0].rel, instance_of(str)) - assert_that(response.data.links[0].href, instance_of(str)) - assert_that(response.data.links[0].method, instance_of(str)) assert_that(response.data.data, is_not(none())) assert_that(response.data.data.request_id, instance_of(UUID)) assert_that(response.data.data.status, instance_of(CompletedLookupStatusEnum)) @@ -126,10 +122,6 @@ def test_get_async_bulk_lookup(self) -> None: assert_that(response.data, is_not(none())) assert_that(response.data, instance_of(GetAsyncBulkLookupResponse)) assert_that(response.data.links, is_not(none())) - assert_that(response.data.links[0], instance_of(LinkSchema)) - assert_that(response.data.links[0].rel, instance_of(str)) - assert_that(response.data.links[0].href, instance_of(str)) - assert_that(response.data.links[0].method, instance_of(str)) assert_that(response.data.data, is_not(none())) assert_that(response.data.data.request_id, instance_of(UUID)) assert_that(response.data.data.status, instance_of(InProgressLookupStatusEnum)) diff --git a/test/unit/models/test_lookup_result.py b/test/unit/models/test_lookup_result.py index d0e6d67a..6902dc35 100644 --- a/test/unit/models/test_lookup_result.py +++ b/test/unit/models/test_lookup_result.py @@ -44,7 +44,8 @@ def make_instance(self, include_optional) -> LookupResult: deactivation_event = 'DEACTIVATED', latest_message_delivery_status = 'ACTIVE', initial_message_delivery_status_date = '2025-06-20', - latest_message_delivery_status_date = '2025-06-20', ) + latest_message_delivery_status_date = '2025-06-20', + rcs_enabled = True, ) else: return LookupResult( ) @@ -65,6 +66,7 @@ def testLookupResult(self): assert instance.latest_message_delivery_status == 'ACTIVE' assert isinstance(instance.initial_message_delivery_status_date, date) assert isinstance(instance.latest_message_delivery_status_date, date) + assert instance.rcs_enabled == True if __name__ == '__main__': unittest.main()