Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 122 additions & 23 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5552,6 +5552,10 @@ components:
example: GET
lookupErrorSchema:
type: object
required:
- code
- type
- description
properties:
code:
type: string
Expand Down Expand Up @@ -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: <code>`: The RCS service returned an unrecognized
status code, where `<code>` 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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions bandwidth/models/lookup_error_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
10 changes: 6 additions & 4 deletions bandwidth/models/lookup_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions docs/LookupErrorSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/LookupResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 &#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]
**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]
**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]
**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

Expand Down
8 changes: 0 additions & 8 deletions test/unit/api/test_phone_number_lookup_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion test/unit/models/test_lookup_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
)
Expand All @@ -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()
Loading