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
22 changes: 22 additions & 0 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5759,6 +5759,19 @@ components:
items:
type: string
pattern: ^\+[1-9]\d{1,14}$
rcsAgent:
type: string
description: >-
Override the default RCS sender/agent ID used when checking RCS
capabilities.
When provided, this value is used as the `sender` in the RCS
capability-check request instead of the account default.
Must be 1–40 characters and contain only letters, digits,
underscores, or hyphens.
pattern: ^[A-Za-z0-9_-]{1,40}$
example: MyCustomRcsAgent
required:
- phoneNumbers
asyncLookupRequest:
Expand Down Expand Up @@ -8758,6 +8771,13 @@ components:
phoneNumbers:
- '+19196104423'
- '+19196104424'
rcsAgentRequestExample:
summary: Number Lookup Request with Custom RCS Agent
value:
phoneNumbers:
- '+19196104423'
- '+19196104424'
rcsAgent: MyCustomRcsAgent
lookupAcceptedExample:
summary: Numbers Lookup Accepted
value:
Expand Down Expand Up @@ -9518,6 +9538,8 @@ components:
$ref: '#/components/examples/singleNumberRequestExample'
multipleNumberRequestExample:
$ref: '#/components/examples/multipleNumberRequestExample'
rcsAgentRequestExample:
$ref: '#/components/examples/rcsAgentRequestExample'
createAsyncBulkLookupRequest:
description: Asynchronous bulk phone number lookup request.
required: true
Expand Down
18 changes: 15 additions & 3 deletions bandwidth/models/sync_lookup_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json

from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -29,8 +29,19 @@ class SyncLookupRequest(BaseModel):
SyncLookupRequest
""" # noqa: E501
phone_numbers: List[Annotated[str, Field(strict=True)]] = Field(description="Telephone numbers in E.164 format.", alias="phoneNumbers")
rcs_agent: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.", alias="rcsAgent")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["phoneNumbers"]
__properties: ClassVar[List[str]] = ["phoneNumbers", "rcsAgent"]

@field_validator('rcs_agent')
def rcs_agent_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value

if not re.match(r"^[A-Za-z0-9_-]{1,40}$", value):
raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_-]{1,40}$/")
return value

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -90,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
return cls.model_validate(obj)

_obj = cls.model_validate({
"phoneNumbers": obj.get("phoneNumbers")
"phoneNumbers": obj.get("phoneNumbers"),
"rcsAgent": obj.get("rcsAgent")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
1 change: 1 addition & 0 deletions docs/SyncLookupRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**phone_numbers** | **List[str]** | Telephone numbers in E.164 format. |
**rcs_agent** | **str** | Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions test/unit/api/test_phone_number_lookup_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_create_sync_lookup(self) -> None:
"""
request = SyncLookupRequest(
phone_numbers = [USER_NUMBER, BW_NUMBER],
rcs_agent = 'TestAgent'
)

response = self.api.create_sync_lookup_with_http_info(BW_ACCOUNT_ID, request)
Expand Down
4 changes: 3 additions & 1 deletion test/unit/models/test_sync_lookup_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def make_instance(self, include_optional) -> SyncLookupRequest:
return SyncLookupRequest(
phone_numbers = [
'+680728880015'
]
],
rcs_agent = 'TestAgent'
)
else:
return SyncLookupRequest(
Expand All @@ -50,6 +51,7 @@ def testSyncLookupRequest(self):
assert instance is not None
assert isinstance(instance, SyncLookupRequest)
assert instance.phone_numbers == ['+680728880015']
assert instance.rcs_agent == 'TestAgent'

if __name__ == '__main__':
unittest.main()
Loading