wxc_sdk.telephony.emergency_address package

class wxc_sdk.telephony.emergency_address.EmergencyAddressApi(*, session: RestSession, base: str = None)[source]

Bases: ApiChild

API to handle emergency address settings for a location

add_to_location(location_id: str, address: EmergencyAddress | SuggestedEmergencyAddress, org_id: str = None) str[source]

Add an Emergency Address to a Location

Adds a new emergency address to the specified location. On success, returns the unique identifier of the newly created emergency address.

Emergency address settings allow the admin to configure or update the physical address associated with a phone number or a location.

Adding emergency address to a location requires a full administrator auth token with scope of spark-admin:telephony_pstn_write.

Parameters:
  • location_id (str) – Location to which the emergency address will be added.

  • address (Union[EmergencyAddress, SuggestedEmergencyAddress]) – Emergency address to add.

  • org_id (str) – Adding emergency address for a location in this organization.

Return type:

str

lookup_for_location(location_id: str, address: EmergencyAddress | SuggestedEmergencyAddress, org_id: str = None) list[SuggestedEmergencyAddress][source]

Emergency Address Lookup to Verify if Address is Valid

Returns a suggested address. If the input address is valid and unchanged, no errors are returned. If the input address requires corrections, the response includes a suggested address along with error details.

Emergency address settings allow the admin to configure or update the physical address associated with a phone number or a location.

Emergency address lookup to verify if address is valid requires a full administrator auth token with scope of spark-admin:telephony_pstn_read.

Parameters:
  • location_id (str) – Emergency address lookup for this location.

  • address (Union[EmergencyAddress, SuggestedEmergencyAddress]) – Emergency address to lookup.

  • org_id (str) – Emergency address lookup for this organization.

Return type:

list[SuggestedEmergencyAddress]

update_for_location(location_id: str, address_id: str, address: EmergencyAddress | SuggestedEmergencyAddress, org_id: str = None)[source]

Update the Emergency Address of a Location

Updates the emergency address of the specified location.

Emergency address settings allow the admin to configure or update the physical address associated with a phone number or a location.

Updating the emergency address of a location requires a full administrator auth token with scope of spark-admin:telephony_pstn_write.

Parameters:
  • location_id (str) – Location for which the emergency address will be updated.

  • address_id (str) – Unique identifier for the emergency address that will be updated.

  • address (Union[EmergencyAddress, SuggestedEmergencyAddress]) – Emergency address to update.

  • org_id (str) – Updating the emergency address of a location in this organization.

Return type:

None

update_for_phone_number(phone_number: str, emergency_address: EmergencyAddress | SuggestedEmergencyAddress = None, org_id: str = None)[source]

Update the emergency address for a phone number.

Emergency address settings allow the admin to configure or update the physical address associated with a phone number or a location.

Updating the emergency address for a phone number requires a full administrator auth token with scope of spark-admin:telephony_pstn_write.

Parameters:
  • phone_number (str) – Update the emergency address for this phone number.

  • emergency_address (Union[EmergencyAddress, SuggestedEmergencyAddress]) – Emergency address to update. Using an empty JSON object deletes the custom emergency address for the number and replaces it with the location’s default emergency address.

  • org_id (str) – Update the emergency address of phone number in this organization.

Return type:

None

base = 'telephony/pstn'
class wxc_sdk.telephony.emergency_address.EmergencyAddress(*, address1: str | None = None, address2: str | None = None, city: str | None = None, state: str | None = None, postalCode: str | None = None, country: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

address1: str | None

Primary street information for the emergency address.

address2: str | None

Apartment number or any other secondary information for the emergency address.

city: str | None

City for the emergency address.

state: str | None

State or Province or Region for the emergency address.

postal_code: str | None

Postal code for the emergency address.

country: str | None

Country for the emergency address.

class wxc_sdk.telephony.emergency_address.AddressLookupError(*, code: str | None = None, title: str | None = None, detail: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

code: str | None

Error code.

title: str | None

Error title.

detail: str | None

Detailed error message.

class wxc_sdk.telephony.emergency_address.SuggestedEmergencyAddress(*, address1: str | None = None, address2: str | None = None, city: str | None = None, state: str | None = None, postalCode: str | None = None, country: str | None = None, meta: dict | None = None, errors: list[AddressLookupError] | None = None, **extra_data: Any)[source]

Bases: EmergencyAddress

meta: dict | None

Additional metadata for the emergency address.

errors: list[AddressLookupError] | None

List of errors encountered during address validation. Returned only when the input address was corrected and a suggested address was provided. Each error describes a specific issue with the original input.