Skip to content

Commit 1d1dded

Browse files
authored
Merge branch 'main' into brtc-python-sdk
2 parents 479561f + f7060ab commit 1d1dded

8 files changed

Lines changed: 139 additions & 51 deletions

File tree

bandwidth.yml

Lines changed: 121 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5727,6 +5727,10 @@ components:
57275727
example: GET
57285728
lookupErrorSchema:
57295729
type: object
5730+
required:
5731+
- code
5732+
- type
5733+
- description
57305734
properties:
57315735
code:
57325736
type: string
@@ -5874,6 +5878,39 @@ components:
58745878
type: array
58755879
items:
58765880
$ref: '#/components/schemas/lookupErrorSchema'
5881+
rcsErrorEnum:
5882+
type: string
5883+
description: >-
5884+
[RCS-Only](#section/RCS-Only). Error encountered during RCS capability
5885+
lookup. Appears as the `code` field in the top-level `errors` array.
5886+
5887+
5888+
**RCS service pass-through codes:**
5889+
5890+
- `REQUEST_FAILED`: The RCS service returned this error code.
5891+
5892+
- `UNKNOWN_CODE`: The RCS service returned this error code.
5893+
5894+
- `INVALID_DESTINATION_ADDRESS`: The RCS service returned this error
5895+
code.
5896+
5897+
- `UNKNOWN_STATUS: <code>`: The RCS service returned an unrecognized
5898+
status code, where `<code>` is the raw value.
5899+
5900+
5901+
**Service-level errors:**
5902+
5903+
- `MISSING_FROM_RESPONSE`: The phone number was absent from the RCS
5904+
service response.
5905+
5906+
- `RCS_SERVICE_UNAVAILABLE`: An exception was thrown during the async
5907+
RCS service call.
5908+
5909+
- `RCS_SERVICE_DISABLED`: RCS lookup is disabled in configuration.
5910+
5911+
- `EMPTY_RESPONSE`: The RCS service returned a null or empty response
5912+
body.
5913+
example: RCS_SERVICE_UNAVAILABLE
58775914
lookupResult:
58785915
type: object
58795916
description: Carrier information results for the specified telephone number.
@@ -5939,6 +5976,14 @@ components:
59395976
59405977
Value resets every time the `latestMessageDeliveryStatus` changes.
59415978
example: '2025-06-21'
5979+
rcsEnabled:
5980+
type: boolean
5981+
description: >
5982+
[RCS-Only](#section/RCS-Only). Indicates whether the phone number is
5983+
capable of receiving RCS messages. Value will be null if account has
5984+
RCS, but no value was returned. Absent when account does not have
5985+
RCS.
5986+
example: true
59425987
accountId1:
59435988
type: string
59445989
description: User's account ID.
@@ -7621,6 +7666,10 @@ components:
76217666
$ref: '#/components/examples/lookupCompleteWithDniExample'
76227667
lookupCompleteExample:
76237668
$ref: '#/components/examples/lookupCompleteExample'
7669+
lookupCompleteWithRcsExample:
7670+
$ref: '#/components/examples/lookupCompleteWithRcsExample'
7671+
lookupCompleteWithRcsErrorExample:
7672+
$ref: '#/components/examples/lookupCompleteWithRcsErrorExample'
76247673
lookupPartialExample:
76257674
$ref: '#/components/examples/lookupPartialExample'
76267675
lookupFailedExample:
@@ -7632,8 +7681,8 @@ components:
76327681
schema:
76337682
$ref: '#/components/schemas/createAsyncBulkLookupResponse'
76347683
examples:
7635-
lookupInProgressExample:
7636-
$ref: '#/components/examples/lookupInProgressExample'
7684+
lookupAcceptedExample:
7685+
$ref: '#/components/examples/lookupAcceptedExample'
76377686
getAsyncBulkLookupResponse:
76387687
description: OK
76397688
content:
@@ -8659,25 +8708,32 @@ components:
86598708
phoneNumbers:
86608709
- '+19196104423'
86618710
- '+19196104424'
8662-
lookupInProgressExample:
8663-
summary: Numbers Lookup In Progress
8711+
lookupAcceptedExample:
8712+
summary: Numbers Lookup Accepted
86648713
value:
86658714
links:
8666-
- href: href
8667-
rel: rel
8715+
- href: >-
8716+
/accounts/9912345/phoneNumberLookup/bulk/004223a0-8b17-41b1-bf81-20732adf5590
8717+
rel: createdRequest
86688718
method: GET
86698719
data:
86708720
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
86718721
status: IN_PROGRESS
86728722
results: []
86738723
errors: []
8724+
lookupInProgressExample:
8725+
summary: Numbers Lookup In Progress
8726+
value:
8727+
links: []
8728+
data:
8729+
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
8730+
status: IN_PROGRESS
8731+
results: []
8732+
errors: []
86748733
lookupFailedExample:
86758734
summary: Numbers Lookup Failed
86768735
value:
8677-
links:
8678-
- href: href
8679-
rel: rel
8680-
method: GET
8736+
links: []
86818737
data:
86828738
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
86838739
status: FAILED
@@ -8694,10 +8750,7 @@ components:
86948750
lookupPartialExample:
86958751
summary: Numbers Lookup Partial Complete
86968752
value:
8697-
links:
8698-
- href: href
8699-
rel: rel
8700-
method: GET
8753+
links: []
87018754
data:
87028755
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
87038756
status: PARTIAL_COMPLETE
@@ -8724,10 +8777,7 @@ components:
87248777
lookupCompleteExample:
87258778
summary: Numbers Lookup Complete (without DNI)
87268779
value:
8727-
links:
8728-
- href: href
8729-
rel: rel
8730-
method: GET
8780+
links: []
87318781
data:
87328782
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
87338783
status: COMPLETE
@@ -8746,10 +8796,7 @@ components:
87468796
lookupCompleteWithDniExample:
87478797
summary: Numbers Lookup Complete (with DNI)
87488798
value:
8749-
links:
8750-
- href: href
8751-
rel: rel
8752-
method: GET
8799+
links: []
87538800
data:
87548801
requestId: 20732adf-bf81-8b17-41b1-004223a05590
87558802
status: COMPLETE
@@ -8787,6 +8834,58 @@ components:
87878834
deactivationEvent: DEACTIVATED
87888835
latestMessageDeliveryStatus: NOT_ENABLED
87898836
errors: []
8837+
lookupCompleteWithRcsExample:
8838+
summary: Numbers Lookup Complete (with RCS)
8839+
value:
8840+
links: []
8841+
data:
8842+
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
8843+
status: COMPLETE
8844+
results:
8845+
- phoneNumber: '+10072904497'
8846+
lineType: MOBILE
8847+
messagingProvider: Verizon Wireless
8848+
voiceProvider: Verizon Wireless
8849+
countryCodeA3: USA
8850+
rcsEnabled: true
8851+
- phoneNumber: '+10072904498'
8852+
lineType: MOBILE
8853+
messagingProvider: T-Mobile USA
8854+
voiceProvider: T-Mobile USA
8855+
countryCodeA3: USA
8856+
rcsEnabled: false
8857+
errors: []
8858+
lookupCompleteWithRcsErrorExample:
8859+
summary: Numbers Lookup Complete (with RCS error)
8860+
value:
8861+
links: []
8862+
data:
8863+
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
8864+
status: COMPLETE
8865+
results:
8866+
- phoneNumber: '+10072904497'
8867+
lineType: MOBILE
8868+
messagingProvider: Verizon Wireless
8869+
voiceProvider: Verizon Wireless
8870+
countryCodeA3: USA
8871+
- phoneNumber: '+10072904498'
8872+
lineType: MOBILE
8873+
messagingProvider: T-Mobile USA
8874+
voiceProvider: T-Mobile USA
8875+
countryCodeA3: USA
8876+
errors:
8877+
- code: RCS_SERVICE_UNAVAILABLE
8878+
type: rcs-error
8879+
description: An exception was thrown during the async RCS service call.
8880+
meta:
8881+
phoneNumbers:
8882+
- '+10072904497'
8883+
- code: MISSING_FROM_RESPONSE
8884+
type: rcs-error
8885+
description: The phone number was absent from the RCS service response.
8886+
meta:
8887+
phoneNumbers:
8888+
- '+10072904498'
87908889
badRequestExample:
87918890
summary: Example Bad Request Error
87928891
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
@@ -40,10 +40,11 @@ class LookupResult(BaseModel):
4040
deactivation_date: Optional[StrictStr] = Field(default=None, description="[DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event.", alias="deactivationDate")
4141
deactivation_event: Optional[DeactivationEventEnum] = Field(default=None, alias="deactivationEvent")
4242
latest_message_delivery_status: Optional[LatestMessageDeliveryStatusEnum] = Field(default=None, alias="latestMessageDeliveryStatus")
43-
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")
43+
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")
4444
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
@@ -15,8 +15,9 @@ Name | Type | Description | Notes
1515
**deactivation_date** | **str** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional]
1616
**deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional]
1717
**latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional]
18-
**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]
18+
**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]
1919
**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/smoke/test_phone_number_lookup_api.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,14 @@ def test_create_get_async_bulk_lookup(self) -> None:
7474
assert_that(response.data.errors, instance_of(list))
7575

7676
request_id = response.data.data.request_id
77-
sleep(30)
77+
sleep(60)
7878

7979
response = self.api.get_async_bulk_lookup_with_http_info(BW_ACCOUNT_ID, request_id)
8080
assert_that(response, is_not(none()))
8181
assert_that(response.status_code, equal_to(200))
8282
assert_that(response.data, is_not(none()))
8383
assert_that(response.data, instance_of(GetAsyncBulkLookupResponse))
8484
assert_that(response.data.links, is_not(none()))
85-
assert_that(response.data.links[0], instance_of(LinkSchema))
86-
assert_that(response.data.links[0].rel, instance_of(str))
87-
assert_that(response.data.links[0].href, instance_of(str))
88-
assert_that(response.data.links[0].method, instance_of(str))
8985
assert_that(response.data.data, is_not(none()))
9086
assert_that(response.data.data.request_id, equal_to(request_id))
9187
assert_that(response.data.data.status, instance_of(InProgressLookupStatusEnum))
@@ -110,10 +106,6 @@ def test_create_sync_lookup(self) -> None:
110106
assert_that(response.data, is_not(none()))
111107
assert_that(response.data, instance_of(CreateSyncLookupResponse))
112108
assert_that(response.data.links, is_not(none()))
113-
assert_that(response.data.links[0], instance_of(LinkSchema))
114-
assert_that(response.data.links[0].rel, instance_of(str))
115-
assert_that(response.data.links[0].href, instance_of(str))
116-
assert_that(response.data.links[0].method, instance_of(str))
117109
assert_that(response.data.data, is_not(none()))
118110
assert_that(response.data.data.request_id, instance_of(UUID))
119111
assert_that(response.data.data.status, instance_of(CompletedLookupStatusEnum))

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)