sinch.domains.numbers.api.v1 package

class sinch.domains.numbers.api.v1.ActiveNumbers(sinch)[source]

Bases: BaseNumbers

list(
region_code: str | None = None,
number_type: Literal['MOBILE', 'LOCAL', 'TOLL_FREE'] | Annotated[str, Strict(strict=True)] | None = None,
number_pattern: str | None = None,
number_search_pattern: Literal['START', 'CONTAINS', 'END'] | Annotated[str, Strict(strict=True)] | None = None,
capabilities: List[Literal['SMS', 'VOICE'] | Annotated[str, Strict(strict=True)]] | None = None,
page_size: int | None = None,
page_token: str | None = None,
order_by: Literal['PHONE_NUMBER', 'DISPLAY_NAME'] | Annotated[str, Strict(strict=True)] | None = None,
**kwargs,
) Paginator[ActiveNumber][source]
Parameters:
  • region_code (str | None)

  • number_type (Literal['MOBILE', 'LOCAL', 'TOLL_FREE'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)

  • number_pattern (str | None)

  • number_search_pattern (Literal['START', 'CONTAINS', 'END'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)

  • capabilities (List[Literal['SMS', 'VOICE'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)]] | None)

  • page_size (int | None)

  • page_token (str | None)

  • order_by (Literal['PHONE_NUMBER', 'DISPLAY_NAME'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)

Return type:

Paginator[ActiveNumber]

update(
phone_number: str,
display_name: str | None = None,
sms_configuration: SmsConfigurationDict | None = None,
voice_configuration: Annotated[VoiceConfigurationFAXDict | VoiceConfigurationRTCDict | VoiceConfigurationESTDict | VoiceConfigurationCustomDict, FieldInfo(annotation=NoneType, required=True, discriminator='type')] | None = None,
event_destination_target: str | None = None,
**kwargs,
) ActiveNumber[source]
Parameters:
Return type:

ActiveNumber

get(
phone_number: str,
**kwargs,
) ActiveNumber[source]
Parameters:

phone_number (str)

Return type:

ActiveNumber

release(
phone_number: str,
**kwargs,
) ActiveNumber[source]
Parameters:

phone_number (str)

Return type:

ActiveNumber

class sinch.domains.numbers.api.v1.AvailableNumbers(sinch)[source]

Bases: BaseNumbers

check_availability(
phone_number: str,
**kwargs,
) AvailableNumber[source]
Parameters:

phone_number (str)

Return type:

AvailableNumber

search_for_available_numbers(
region_code: str,
number_type: Literal['MOBILE', 'LOCAL', 'TOLL_FREE'] | Annotated[str, Strict(strict=True)],
number_pattern: str | None = None,
number_search_pattern: Literal['START', 'CONTAINS', 'END'] | Annotated[str, Strict(strict=True)] | None = None,
capabilities: List[Literal['SMS', 'VOICE'] | Annotated[str, Strict(strict=True)]] | None = None,
page_size: int | None = None,
**kwargs,
) Paginator[AvailableNumber][source]
Parameters:
  • region_code (str)

  • number_type (Literal['MOBILE', 'LOCAL', 'TOLL_FREE'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)])

  • number_pattern (str | None)

  • number_search_pattern (Literal['START', 'CONTAINS', 'END'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)

  • capabilities (List[Literal['SMS', 'VOICE'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)]] | None)

  • page_size (int | None)

Return type:

Paginator[AvailableNumber]

rent(
phone_number: str,
sms_configuration: SmsConfigurationDict | None = None,
voice_configuration: Annotated[VoiceConfigurationFAXDict | VoiceConfigurationRTCDict | VoiceConfigurationESTDict | VoiceConfigurationCustomDict, FieldInfo(annotation=NoneType, required=True, discriminator='type')] | None = None,
event_destination_target: str | None = None,
**kwargs,
) ActiveNumber[source]
Parameters:
Return type:

ActiveNumber

rent_any(
region_code: str,
number_type: Literal['MOBILE', 'LOCAL', 'TOLL_FREE'] | Annotated[str, Strict(strict=True)],
number_pattern: NumberPatternDict | None = None,
capabilities: List[Literal['SMS', 'VOICE'] | Annotated[str, Strict(strict=True)]] | None = None,
sms_configuration: SmsConfigurationDict | None = None,
voice_configuration: Annotated[VoiceConfigurationFAXDict | VoiceConfigurationRTCDict | VoiceConfigurationESTDict | VoiceConfigurationCustomDict, FieldInfo(annotation=NoneType, required=True, discriminator='type')] | None = None,
event_destination_target: str | None = None,
**kwargs,
) ActiveNumber[source]
Parameters:
Return type:

ActiveNumber

class sinch.domains.numbers.api.v1.AvailableRegions(sinch)[source]

Bases: object

list(
types: List[Literal['MOBILE', 'LOCAL', 'TOLL_FREE'] | Annotated[str, Strict(strict=True)]] | None = None,
**kwargs,
) Paginator[AvailableRegion][source]

Lists all regions for numbers provided using the project ID. Some numbers can be configured for multiple regions. See which regions apply to your virtual number.

Parameters:
  • types (Optional[List[NumberType]]) – List of number types to filter the regions.

  • kwargs (Optional[dict]) – Additional parameters for the request.

Returns:

A paginator object containing the list of available regions.

Return type:

Paginator[Region]

For additional documentation, see https://www.sinch.com and visit our developer portal.

class sinch.domains.numbers.api.v1.EventDestinations(sinch)[source]

Bases: BaseNumbers

get(
**kwargs,
) EventDestinationResponse[source]

Returns the event destination configuration for the specified project

Parameters:

kwargs (dict) – Additional parameters for the request.

Returns:

The event destination configuration for the project.

Return type:

EventDestinationResponse

For detailed documentation, visit: https://developers.sinch.com

update(
hmac_secret: str,
**kwargs,
) EventDestinationResponse[source]

Updates the event destination configuration for the specified project

Parameters:
  • hmac_secret (str) – The HMAC secret used to sign the event destination requests.

  • kwargs (dict) – Additional parameters for the request.

Returns:

The updated event destination configuration for the project.

Return type:

EventDestinationResponse

For detailed documentation, visit https://developers.sinch.com