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

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

Parameters

search_id (str) – The search 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

Creates a phone number search.

Keyword Arguments

body (azure.communication.administration.CreateSearchOptions) –

An optional parameter for defining the search options. The default is None. :rtype: ~azure.communication.administration.CreateSearchResponse

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_search_by_id(search_id: str, **kwargs: Any) → PhoneNumberSearch[source]

Get search by search id.

Parameters

search_id (str) – The search id to be searched for.

Return type

PhoneNumberSearch

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]

Purchases the phone number search.

Parameters

search_id (str) – The search id to be purchased.

Return type

None

async release_phone_numbers(phone_numbers: List[str], **kwargs: Any) → ReleaseResponse[source]

Creates a release for the given phone numbers.

Parameters

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

Return type

ReleaseResponse

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