azure.communication.administration package

class azure.communication.administration.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:

: utf-8

-------------------------------------------------------------------
ght (c) Microsoft Corporation. All rights reserved.
ed under the MIT License. See License.txt in the project root for
e information.
--------------------------------------------------------------------


entity_sample.py
ION:
e samples demonstrate identity client samples.

uthenticating a client via a connection string

on identity_samples.py

s

mmunicationIdentityClientSamples(object):

__init__(self):
self.connection_string = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING')

issue_token(self):
from azure.communication.administration import CommunicationIdentityClient

identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)
user = identity_client.create_user()
tokenresponse = identity_client.issue_token(user, scopes=["chat"])
print(tokenresponse)

revoke_tokens(self):
from azure.communication.administration import CommunicationIdentityClient

identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)
user = identity_client.create_user()
tokenresponse = identity_client.issue_token(user, scopes=["chat"])
identity_client.revoke_tokens(user)
print(tokenresponse)

create_user(self):
from azure.communication.administration import CommunicationIdentityClient
identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)
user = identity_client.create_user()

print(user.identifier)

delete_user(self):
from azure.communication.administration import CommunicationIdentityClient
identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)
user = identity_client.create_user()
identity_client.delete_user(user)

e__ == '__main__':
le = CommunicationIdentityClientSamples()
le.create_user()
le.delete_user()
le.issue_token()
le.revoke_tokens()
create_user(**kwargs) → azure.communication.administration._shared.models.CommunicationUser[source]

create a single Communication user

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

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:

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

Generates a new token for an identity.

Parameters
Returns

CommunicationIdentityToken

Return type

CommunicationIdentityToken

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

Schedule revocation of all tokens of an identity.

Parameters
  • user () – Azure Communication User.

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

Returns

None

Return type

None

class azure.communication.administration.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

begin_purchase_reservation(**kwargs: Any) → LROPoller[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.LROPoller[~azure.communication.administration.PhoneNumberReservation]

begin_release_phone_numbers(**kwargs: Any) → LROPoller[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

LROPoller[PhoneNumberRelease]

begin_reserve_phone_numbers(**kwargs: Any) → LROPoller[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.LROPoller[~azure.communication.administration.PhoneNumberReservation]

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

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. :param str conn_str:

A connection string to an Azure Communication Service resource.

Returns

Instance of PhoneNumberAdministrationClient.

Return type

PhoneNumberAdministrationClient

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

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

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

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

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

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) → ItemPaged[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.paging.ItemPaged[~azure.communication.administration.AcquiredPhoneNumbers]

list_all_releases(**kwargs: Any) → ItemPaged[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.paging.ItemPaged[~azure.communication.administration.PhoneNumberEntities]

list_all_searches(**kwargs: Any) → ItemPaged[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.paging.ItemPaged[~azure.communication.administration.PhoneNumberEntities]

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

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. :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.PhoneNumberCountries]

list_phone_plan_groups(country_code: str, **kwargs: Any) → ItemPaged[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.paging.ItemPaged[~azure.communication.administration.PhonePlanGroups]

list_phone_plans(country_code: str, phone_plan_group_id: str, **kwargs: Any) → ItemPaged[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.paging.ItemPaged[~azure.communication.administration.PhonePlansResponse]

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

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.ReservePhoneNumberPolling(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]
run()None
status()str
class azure.communication.administration.PurchaseReservationPolling(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]
run()None
status()str
class azure.communication.administration.ReleasePhoneNumberPolling(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]
run()None
status()str
class azure.communication.administration.CommunicationTokenRequest(*, scopes: List[str], **kwargs)[source]

CommunicationTokenRequest.

All required parameters must be populated in order to send to Azure.

Parameters

scopes (list[str]) – Required. List of scopes attached to the token.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.CommunicationIdentityToken(*, id: str, token: str, expires_on: datetime.datetime, **kwargs)[source]

CommunicationIdentityToken.

All required parameters must be populated in order to send to Azure.

Parameters
  • id (str) – Required. Identifier of the identity owning the token.

  • token (str) – Required. The token issued for the identity.

  • expires_on (datetime) – Required. The expiry time of the token.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.AcquiredPhoneNumber(*, phone_number: str, acquired_capabilities: List[Union[str, Capability]], available_capabilities: List[Union[str, Capability]], assignment_status: Union[str, AssignmentStatus, None] = None, place_name: Optional[str] = None, activation_state: Union[str, ActivationState, None] = None, **kwargs)[source]

Represents an acquired phone number.

All required parameters must be populated in order to send to Azure.

Parameters
  • phone_number (str) – Required. String of the E.164 format of the phone number.

  • acquired_capabilities (list[str or Capability]) – Required. The set of all acquired capabilities of the phone number.

  • available_capabilities (list[str or Capability]) – Required. The set of all available capabilities that can be acquired for this phone number.

  • assignment_status (str or AssignmentStatus) – The assignment status of the phone number. Conveys what type of entity the number is assigned to. Possible values include: “Unassigned”, “Unknown”, “UserAssigned”, “ConferenceAssigned”, “FirstPartyAppAssigned”, “ThirdPartyAppAssigned”.

  • place_name (str) – The name of the place of the phone number.

  • activation_state (str or ActivationState) – The activation state of the phone number. Can be “Activated”, “AssignmentPending”, “AssignmentFailed”, “UpdatePending”, “UpdateFailed”. Possible values include: “Activated”, “AssignmentPending”, “AssignmentFailed”, “UpdatePending”, “UpdateFailed”.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.AcquiredPhoneNumbers(*, phone_numbers: Optional[List[AcquiredPhoneNumber]] = None, next_link: Optional[str] = None, **kwargs)[source]

A wrapper of list of phone numbers.

Parameters
  • phone_numbers (list[AcquiredPhoneNumber]) – Represents a list of phone numbers.

  • next_link (str) – Represents the URL link to the next page.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.AreaCodes(*, primary_area_codes: Optional[List[str]] = None, secondary_area_codes: Optional[List[str]] = None, next_link: Optional[str] = None, **kwargs)[source]

Represents a list of area codes.

Parameters
  • primary_area_codes (list[str]) – Represents the list of primary area codes.

  • secondary_area_codes (list[str]) – Represents the list of secondary area codes.

  • next_link (str) – Represents the URL link to the next page.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.CreateSearchOptions(*, display_name: str, description: str, phone_plan_ids: List[str], area_code: str, quantity: Optional[int] = None, location_options: Optional[List[LocationOptionsDetails]] = None, **kwargs)[source]

Represents a search creation option.

All required parameters must be populated in order to send to Azure.

Parameters
  • display_name (str) – Required. Display name of the search.

  • description (str) – Required. Description of the search.

  • phone_plan_ids (list[str]) – Required. The plan subtype ids from which to create the search.

  • area_code (str) – Required. The area code from which to create the search.

  • quantity (int) – The quantity of phone numbers to request.

  • location_options (list[LocationOptionsDetails]) – The location options of the search.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.CreateSearchResponse(*, search_id: str, **kwargs)[source]

Represents a search creation response.

All required parameters must be populated in order to send to Azure.

Parameters

search_id (str) – Required. The search id of the search that was created.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.LocationOptionsQuery(*, label_id: Optional[str] = None, options_value: Optional[str] = None, **kwargs)[source]

Represents a location options parameter, used for fetching area codes.

Parameters
  • label_id (str) – Represents the location option label id, returned from the GetLocationOptions API.

  • options_value (str) – Represents the location options value, returned from the GetLocationOptions API.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.LocationOptionsResponse(*, location_options: Optional[LocationOptions] = None, **kwargs)[source]

Represents a wrapper around a list of location options.

Parameters

location_options (LocationOptions) – Represents a location options.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.NumberConfigurationResponse(*, pstn_configuration: azure.communication.administration._phonenumber._generated.models._models_py3.PstnConfiguration, **kwargs)[source]

Definition for number configuration.

All required parameters must be populated in order to send to Azure.

Parameters

pstn_configuration (PstnConfiguration) – Required. Definition for pstn number configuration.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.NumberUpdateCapabilities(*, add: Optional[List[Union[str, Capability]]] = None, remove: Optional[List[Union[str, Capability]]] = None, **kwargs)[source]

Represents an individual number capabilities update request.

Parameters
  • add (list[str or Capability]) – Capabilities to be added to a phone number.

  • remove (list[str or Capability]) – Capabilities to be removed from a phone number.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PhoneNumberCountries(*, countries: Optional[List[PhoneNumberCountry]] = None, next_link: Optional[str] = None, **kwargs)[source]

Represents a wrapper around a list of countries.

Parameters
  • countries (list[PhoneNumberCountry]) – Represents the underlying list of countries.

  • next_link (str) – Represents the URL link to the next page.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PhoneNumberEntities(*, entities: Optional[List[PhoneNumberEntity]] = None, next_link: Optional[str] = None, **kwargs)[source]

Represents a list of searches or releases, as part of the response when fetching all searches or releases.

Parameters
  • entities (list[PhoneNumberEntity]) – The underlying list of entities.

  • next_link (str) – Represents the URL link to the next page.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PhoneNumberRelease(*, release_id: Optional[str] = None, created_at: Optional[datetime.datetime] = None, status: Union[str, ReleaseStatus, None] = None, error_message: Optional[str] = None, phone_number_release_status_details: Optional[Dict[str, PhoneNumberReleaseDetails]] = None, **kwargs)[source]

Represents a release.

Parameters
  • release_id (str) – The id of the release.

  • created_at (datetime) – The creation time of the release.

  • status (str or ReleaseStatus) – The release status. Possible values include: “Pending”, “InProgress”, “Complete”, “Failed”, “Expired”.

  • error_message (str) – The underlying error message of a release.

  • phone_number_release_status_details (dict[str, PhoneNumberReleaseDetails]) – The list of phone numbers in the release, mapped to its individual statuses.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PhoneNumberReservation(*, reservation_id: Optional[str] = None, display_name: Optional[str] = None, created_at: Optional[datetime.datetime] = None, description: Optional[str] = None, phone_plan_ids: Optional[List[str]] = None, area_code: Optional[str] = None, quantity: Optional[int] = None, location_options: Optional[List[LocationOptionsDetails]] = None, status: Union[str, SearchStatus, None] = None, phone_numbers: Optional[List[str]] = None, reservation_expiry_date: Optional[datetime.datetime] = None, error_code: Optional[int] = None, **kwargs)[source]

Represents a phone number search.

Parameters
  • reservation_id (str) – The id of the search.

  • display_name (str) – The name of the search.

  • created_at (datetime) – The creation time of the search.

  • description (str) – The description of the search.

  • phone_plan_ids (list[str]) – The phone plan ids of the search.

  • area_code (str) – The area code of the search.

  • quantity (int) – The quantity of phone numbers in the search.

  • location_options (list[LocationOptionsDetails]) – The location options of the search.

  • status (str or SearchStatus) – The status of the search. Possible values include: “Pending”, “InProgress”, “Reserved”, “Expired”, “Expiring”, “Completing”, “Refreshing”, “Success”, “Manual”, “Cancelled”, “Cancelling”, “Error”, “PurchasePending”.

  • phone_numbers (list[str]) – The list of phone numbers in the search, in the case the status is reserved or success.

  • reservation_expiry_date (datetime) – The date that search expires and the numbers become available.

  • error_code (int) – The error code of the search.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PhonePlanGroups(*, phone_plan_groups: Optional[List[PhonePlanGroup]] = None, next_link: Optional[str] = None, **kwargs)[source]

Represents a wrapper of list of plan groups.

Parameters
  • phone_plan_groups (list[PhonePlanGroup]) – The underlying list of phone plan groups.

  • next_link (str) – Represents the URL link to the next page.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PhonePlansResponse(*, phone_plans: Optional[List[PhonePlan]] = None, next_link: Optional[str] = None, **kwargs)[source]

Represents a wrapper around a list of countries.

Parameters
  • phone_plans (list[PhonePlan]) – Represents the underlying list of phone plans.

  • next_link (str) – Represents the URL link to the next page.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.PstnConfiguration(*, callback_url: str, application_id: Optional[str] = None, **kwargs)[source]

Definition for pstn number configuration.

All required parameters must be populated in order to send to Azure.

Parameters
  • callback_url (str) – Required. The webhook URL on the phone number configuration.

  • application_id (str) – The application id of the application to which to configure.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.ReleaseResponse(*, release_id: str, **kwargs)[source]

Represents a release response.

All required parameters must be populated in order to send to Azure.

Parameters

release_id (str) – Required. The release id of a created release.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.UpdateNumberCapabilitiesResponse(*, capabilities_update_id: str, **kwargs)[source]

Represents a number capability update response.

All required parameters must be populated in order to send to Azure.

Parameters

capabilities_update_id (str) – Required. The capabilities id.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.UpdatePhoneNumberCapabilitiesResponse(*, capabilities_update_id: Optional[str] = None, created_at: Optional[datetime.datetime] = None, capabilities_update_status: Union[str, CapabilitiesUpdateStatus, None] = None, phone_number_capabilities_updates: Optional[Dict[str, NumberUpdateCapabilities]] = None, **kwargs)[source]

Response for getting a phone number update capabilities.

Parameters
  • capabilities_update_id (str) – The id of the phone number capabilities update.

  • created_at (datetime) – The time the capabilities update was created.

  • capabilities_update_status (str or CapabilitiesUpdateStatus) – Status of the capabilities update. Possible values include: “Pending”, “InProgress”, “Complete”, “Error”.

  • phone_number_capabilities_updates (dict[str, NumberUpdateCapabilities]) – The capabilities update for each of a set of phone numbers.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Return a dict that can be JSONify using json.dump.

Advanced usage might optionaly use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

key_transformer (function) – A key transformer function.

Returns

A dict JSON compatible object

Return type

dict

classmethod deserialize(data, content_type=None)

Parse a str using the RestAPI syntax and return a model.

Parameters
  • data (str) – A str using RestAPI structure. JSON by default.

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod enable_additional_properties_sending()
classmethod from_dict(data, key_extractors=None, content_type=None)

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

Parameters
  • data (dict) – A dict using RestAPI structure

  • content_type (str) – JSON by default, set application/xml if XML.

Returns

An instance of this model

Raises

DeserializationError if something went wrong

classmethod is_xml_model()
serialize(keep_readonly=False, **kwargs)

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

Parameters

keep_readonly (bool) – If you want to serialize the readonly attributes

Returns

A dict JSON compatible object

Return type

dict

validate()

Validate this model recursively and return a list of ValidationError.

Returns

A list of validation error

Return type

list

class azure.communication.administration.CommunicationUser(identifier)[source]

Represents a user in Azure Communication Service. :ivar identifier: Communication user identifier. :vartype identifier: str :param identifier: Identifier to initialize CommunicationUser. :type identifier: str

class azure.communication.administration.PhoneNumber(value)[source]

Represents a phone number. :ivar value: Value for a phone number. :vartype value: str :param value: Value to initialize PhoneNumber. :type value: str

class azure.communication.administration.UnknownIdentifier(identifier)[source]

Represents an identifier of an unknown type. It will be encountered in communications with endpoints that are not identifiable by this version of the SDK. :ivar identifier: Unknown communication identifier. :vartype identifier: str :param identifier: Value to initialize UnknownIdentifier. :type identifier: str