diff --git a/bandwidth.yml b/bandwidth.yml index 5b874eeb..84e00b33 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -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: @@ -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: @@ -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 diff --git a/bandwidth/models/sync_lookup_request.py b/bandwidth/models/sync_lookup_request.py index 1532a912..dcb30f42 100644 --- a/bandwidth/models/sync_lookup_request.py +++ b/bandwidth/models/sync_lookup_request.py @@ -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 @@ -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, @@ -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(): diff --git a/docs/SyncLookupRequest.md b/docs/SyncLookupRequest.md index 7b753251..71c32667 100644 --- a/docs/SyncLookupRequest.md +++ b/docs/SyncLookupRequest.md @@ -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 diff --git a/test/unit/api/test_phone_number_lookup_api.py b/test/unit/api/test_phone_number_lookup_api.py index caec4524..799358eb 100644 --- a/test/unit/api/test_phone_number_lookup_api.py +++ b/test/unit/api/test_phone_number_lookup_api.py @@ -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) diff --git a/test/unit/models/test_sync_lookup_request.py b/test/unit/models/test_sync_lookup_request.py index d73fcb54..b946135e 100644 --- a/test/unit/models/test_sync_lookup_request.py +++ b/test/unit/models/test_sync_lookup_request.py @@ -35,7 +35,8 @@ def make_instance(self, include_optional) -> SyncLookupRequest: return SyncLookupRequest( phone_numbers = [ '+680728880015' - ] + ], + rcs_agent = 'TestAgent' ) else: return SyncLookupRequest( @@ -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()