azure.communication.administration.aio package

class azure.communication.administration.aio.CommunicationIdentityClient(endpoint: str, credential: str, **kwargs: Any)[source]

Azure Communication Services Identity client.

Parameters
  • endpoint (str) – The endpoint url for Azure Communication Service resource.

  • credential – The credentials with which to authenticate. The value is an account shared access key

Example:

async close()None[source]

Close the :class: ~azure.communication.administration.aio.CommunicationIdentityClient session.

async create_user(**kwargs) → azure.communication.administration._shared.models.CommunicationUser[source]

create a single Communication user

return: CommunicationUser rtype: ~azure.communication.administration.CommunicationUser

async delete_user(communication_user: CommunicationUser, **kwargs: Any)None[source]

Triggers revocation event for user and deletes all its data.

Parameters

communication_user (CommunicationUser) – Azure Communication User to delete

Returns

None

Return type

None

classmethod from_connection_string(conn_str: str, **kwargs: Any) → CommunicationIdentityClient[source]

Create CommunicationIdentityClient from a Connection String.

Parameters

conn_str (str) – A connection string to an Azure Communication Service resource.

Returns

Instance of CommunicationIdentityClient.

Return type

CommunicationIdentityClient

Example:

async issue_token(user: CommunicationUser, scopes: List[str], **kwargs: Any) → CommunicationIdentityToken[source]

Generates a new token for an identity.

Parameters
Returns

CommunicationIdentityToken

Return type

CommunicationIdentityToken

async revoke_tokens(user: CommunicationUser, issued_before: Optional[datetime.datetime] = None, **kwargs: Any)None[source]

Schedule revocation of all tokens of an identity.

Parameters
  • user (CommunicationUser) – Azure Communication User.

  • issued_before (datetime) – All tokens that are issued prior to this time should get revoked.

Returns

None

Return type

None

class azure.communication.administration.aio.PhoneNumberAdministrationClient(endpoint: str, credential: str, **kwargs: Any)[source]

Azure Communication Services Phone Number Management client.

Parameters
  • endpoint (str) – The endpoint url for Azure Communication Service resource.

  • credential – The credentials with which to authenticate. The value is an account shared access key

async begin_purchase_reservation(**kwargs: Any) → AsyncLROPoller[PhoneNumberReservation][source]

Begins purchase the reserved phone numbers of a phone number search. Caller must provide either reservation_id, or continuation_token keywords to use the method. If both reservation_id and continuation_token are specified, only continuation_token will be used to restart a poller from a saved state, and keyword reservation_id will be ignored. :keyword str reservation_id: The reservation id to be purchased. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.administration.PhoneNumberReservation]

async begin_release_phone_numbers(**kwargs: Any) → AsyncLROPoller[PhoneNumberRelease][source]

Begins creating a release for the given phone numbers. Caller must provide either phone_numbers, or continuation_token keywords to use the method. If both phone_numbers and continuation_token are specified, only continuation_token will be used to restart a poller from a saved state, and keyword phone_numbers will be ignored.

Keyword Arguments
  • phone_numbers (list[str]) – The list of phone numbers in the release request.

  • continuation_token (str) – A continuation token to restart a poller from a saved state.

Return type

AsyncLROPoller[PhoneNumberRelease]

async begin_reserve_phone_numbers(**kwargs: Any) → AsyncLROPoller[PhoneNumberReservation][source]

Begins creating a phone number search to reserve phone numbers. Caller must provide either options, or continuation_token keywords to use the method. If both options and continuation_token are specified, only continuation_token will be used to restart a poller from a saved state, and keyword options will be ignored. :keyword azure.communication.administration.CreateSearchOptions options: reservation options. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.administration.PhoneNumberReservation]

async cancel_reservation(reservation_id: str, **kwargs: Any)None[source]

Cancels the reservation. This means existing numbers in the reservation will be made available.

Parameters

reservation_id (str) – The reservation id to be canceled.

Return type

None

async close()None[source]

Close the :class: ~azure.communication.administration.aio.PhoneNumberAdministrationClient session.

async configure_number(pstn_configuration: PstnConfiguration, phone_number: str, **kwargs: Any)None[source]

Endpoint for configuring a pstn number.

Parameters
  • pstn_configuration (PstnConfiguration) – Definition for pstn number configuration.

  • phone_number (str) – The phone number to configure.

Return type

None

classmethod from_connection_string(conn_str: str, **kwargs: Any) → PhoneNumberAdministrationClient[source]

Create PhoneNumberAdministrationClient from a Connection String.

Parameters

conn_str (str) – A connection string to an Azure Communication Service resource.

Returns

Instance of PhoneNumberAdministrationClient.

Return type

PhoneNumberAdministrationClient

async get_all_area_codes(location_type: str, country_code: str, phone_plan_id: str, **kwargs: Any) → AreaCodes[source]

Gets a list of the supported area codes.

Parameters
  • location_type (str) – The type of location information required by the plan.

  • country_code (str) – The ISO 3166-2 country code.

  • phone_plan_id (str) – The plan id from which to search area codes.

Keyword Arguments

location_options (List["LocationOptionsQuery"]) –

Represents the underlying list of countries. :rtype: ~azure.communication.administration.AreaCodes

async get_capabilities_update(capabilities_update_id: str, **kwargs: Any) → UpdatePhoneNumberCapabilitiesResponse[source]

Get capabilities by capabilities update id.

Parameters

capabilities_update_id (str) –

Return type

UpdatePhoneNumberCapabilitiesResponse

async get_number_configuration(phone_number: str, **kwargs: Any) → NumberConfigurationResponse[source]

Endpoint for getting number configurations.

Parameters

phone_number (str) – The phone number in the E.164 format.

Return type

NumberConfigurationResponse

async get_phone_plan_location_options(country_code: str, phone_plan_group_id: str, phone_plan_id: str, **kwargs: Any) → LocationOptionsResponse[source]

Gets a list of location options for a phone plan.

Parameters
  • country_code (str) – The ISO 3166-2 country code.

  • phone_plan_group_id (str) –

  • phone_plan_id (str) –

Keyword Arguments

locale (str) – A language-locale pairing which will be used to localise the names of countries.

The default is “en-US”. :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :rtype: ~azure.communication.administration.LocationOptionsResponse

async get_release_by_id(release_id: str, **kwargs: Any) → PhoneNumberRelease[source]

Gets a release by a release id.

Parameters

release_id (str) – Represents the release id.

Return type

PhoneNumberRelease

async get_reservation_by_id(reservation_id: str, **kwargs: Any) → PhoneNumberReservation[source]

Get reservation by reservation id.

Parameters

reservation_id (str) – The reservation id to get reservation.

Return type

PhoneNumberReservation

list_all_phone_numbers(**kwargs: Any) → AsyncItemPaged[AcquiredPhoneNumbers][source]

Gets the list of the acquired phone numbers.

Keyword Arguments

locale (str) – A language-locale pairing which will be used to localise the names of countries.

The default is “en-US”. :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.AcquiredPhoneNumbers]

list_all_releases(**kwargs: Any) → AsyncItemPaged[PhoneNumberEntities][source]

Gets a list of all releases.

Keyword Arguments

skip (int) – An optional parameter for how many entries to skip, for pagination purposes.

The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhoneNumberEntities]

list_all_searches(**kwargs: Any) → AsyncItemPaged[PhoneNumberEntities][source]

Gets a list of all searches.

Keyword Arguments

skip (int) – An optional parameter for how many entries to skip, for pagination purposes.

The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhoneNumberEntities]

list_all_supported_countries(**kwargs: Any) → AsyncItemPaged[PhoneNumberCountries][source]

Gets a list of supported countries.

Gets a list of supported countries.

Keyword Arguments

locale (str) – A language-locale pairing which will be used to localise the names of countries.

The default is “en-US”. :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :return: An iterator like instance of either PhoneNumberCountries or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhoneNumberCountries]

list_phone_plan_groups(country_code: str, **kwargs: Any) → AsyncItemPaged[PhonePlanGroups][source]

Gets a list of phone plan groups for the given country.

Parameters

country_code (str) – The ISO 3166-2 country code.

Keyword Arguments

locale (str) – A language-locale pairing which will be used to localise the names of countries.

The default is “en-US”. :keyword include_rate_information bool: An optional boolean parameter for including rate information in result. The default is False”. :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhonePlanGroups]

list_phone_plans(country_code: str, phone_plan_group_id: str, **kwargs: Any) → AsyncItemPaged[PhonePlansResponse][source]

Gets a list of phone plans for a phone plan group.

Parameters
  • country_code (str) – The ISO 3166-2 country code.

  • phone_plan_group_id (str) –

Keyword Arguments

locale (str) – A language-locale pairing which will be used to localise the names of countries.

The default is “en-US”. :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. The default is 0. :keyword int take: An optional parameter for how many entries to return, for pagination purposes. The default is 100. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhonePlansResponse]

async unconfigure_number(phone_number: str, **kwargs: Any)None[source]

Endpoint for unconfiguring a pstn number by removing the configuration.

Parameters

phone_number (str) – The phone number in the E.164 format.

Return type

None

async update_capabilities(phone_number_capabilities_update: Dict[str, NumberUpdateCapabilities], **kwargs: Any) → UpdateNumberCapabilitiesResponse[source]

Adds or removes phone number capabilities.

Parameters

phone_number_capabilities_update (dict[str, NumberUpdateCapabilities]) – The map of phone numbers to the capabilities update applied to the phone number.

Return type

UpdateNumberCapabilitiesResponse

class azure.communication.administration.aio.ReservePhoneNumberPollingAsync(is_terminated: bool, polling_interval: int = 5)[source]
finished()bool
classmethod from_continuation_token(continuation_token, client, **kwargs)
get_continuation_token()
initialize(client: Any, initial_response: Any, deserialization_callback: Callable)None[source]
resource() → Union[azure.communication.administration._phonenumber._generated.models._models_py3.PhoneNumberReservation, azure.communication.administration._phonenumber._generated.models._models_py3.PhoneNumberRelease]
async run()None
status()str
class azure.communication.administration.aio.PurchaseReservationPollingAsync(is_terminated: bool, polling_interval: int = 5)[source]
finished()bool
classmethod from_continuation_token(continuation_token, client, **kwargs)
get_continuation_token()
initialize(client: Any, initial_response: Any, deserialization_callback: Callable)None[source]
resource() → Union[azure.communication.administration._phonenumber._generated.models._models_py3.PhoneNumberReservation, azure.communication.administration._phonenumber._generated.models._models_py3.PhoneNumberRelease]
async run()None
status()str
class azure.communication.administration.aio.ReleasePhoneNumberPollingAsync(is_terminated: bool, polling_interval: int = 5)[source]
finished()bool
classmethod from_continuation_token(continuation_token, client, **kwargs)
get_continuation_token()
initialize(client: Any, initial_response: Any, deserialization_callback: Callable)None[source]
resource() → Union[azure.communication.administration._phonenumber._generated.models._models_py3.PhoneNumberReservation, azure.communication.administration._phonenumber._generated.models._models_py3.PhoneNumberRelease]
async run()None
status()str