wxc_sdk.telephony.call_routing.translation_pattern package
- class wxc_sdk.telephony.call_routing.translation_pattern.TranslationPatternsApi(*, session: RestSession, base: str | None = None)[source]
Bases:
ApiChildTranslation Patterns
A translation pattern lets you manipulate dialed digits before routing a call and applies to outbound calls only.
Call routing supports translation patterns at the organization level.
Viewing these translation patterns for an organization requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
Modifying these translation patterns for an organization requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- create(pattern: TranslationPattern, location_id: str | None = None, org_id: str | None = None) str[source]
Create a Translation Pattern
A translation pattern lets you manipulate dialed digits before routing a call and applies to outbound calls only.
Create a translation pattern for a given organization.
Requires a full administrator auth token with the spark-admin:telephony_config_write scope.
- Parameters:
pattern (TranslationPattern) – Translation pattern to create
location_id (str) – Unique identifier for the location. Only used when creating location level translation
org_id (str) – ID of the organization containing the translation pattern
- Return type:
str
- list(limit_to_location_id: str | None = None, limit_to_org_level_enabled: bool | None = None, name: str | None = None, matching_pattern: str | None = None, org_id: str | None = None, **params) Generator[TranslationPattern, None, None][source]
Retrieve a list of Translation Patterns
A translation pattern lets you manipulate dialed digits before routing a call and applies to outbound calls only.
Retrieve a list of translation patterns for a given organization.
Requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
limit_to_location_id (str) – When a location ID is passed, then return only the corresponding location level translation patterns.
limit_to_org_level_enabled (bool) – When set to be true, then return only the organization-level translation patterns.
name (str) – Only return translation patterns with the matching name.
matching_pattern (str) – Only return translation patterns with the matching matchingPattern.
org_id (str) – ID of the organization containing the translation patterns.
- Returns:
Generator yielding
TranslationPatternGetinstances
- details(translation_id: str, location_id: str | None = None, org_id: str | None = None) TranslationPattern[source]
Retrieve the details of a Translation Pattern
A translation pattern lets you manipulate dialed digits before routing a call and applies to outbound calls only.
Retrieve the details of a translation pattern for a given organization.
Requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
translation_id (str) – Retrieve the translation pattern with the matching ID.
location_id (str) – Unique identifier for the location. Only used when getting details for location level translation patterns
org_id (str) – ID of the organization containing the translation pattern.
- Return type:
- update(pattern: TranslationPattern, location_id: str | None = None, org_id: str | None = None)[source]
Modify a Translation Pattern
A translation pattern lets you manipulate dialed digits before routing a call and applies to outbound calls only.
Modify a translation pattern for a given organization. To update a location level translation pattern the location.id attribute of the pattern has to be set
Requires a full administrator auth token with the spark-admin:telephony_config_write scope.
- Parameters:
pattern (TranslationPattern) – Translation pattern to be updated
location_id (str) – Unique identifier for the location. Only used when updating location level translation pattern
org_id (str) – ID of the organization containing the translation pattern.
- Return type:
None
- delete(translation_id: str, location_id: str | None = None, org_id: str | None = None)[source]
Delete a Translation Pattern
A translation pattern lets you manipulate dialed digits before routing a call and applies to outbound calls only.
Delete a translation pattern for a given organization.
Requires a full administrator auth token with the spark-admin:telephony_config_write scope.
- Parameters:
translation_id (str) – Delete a translation pattern with the matching ID.
location_id – Unique identifier for the location. Only used when deleting location level translation patterns
org_id (str) – ID of the organization containing the translation pattern.
- Return type:
None
- base = 'telephony/config/callRouting/translationPatterns'
- class wxc_sdk.telephony.call_routing.translation_pattern.TranslationPattern(*, id: str | None = None, name: str | None = None, matchingPattern: str | None = None, replacementPattern: str | None = None, level: TranslationPatternLevel | None = None, location: IdAndName | None = None, **extra_data: Any)[source]
Bases:
ApiModel- id: str | None
Unique identifier for a translation pattern.
- name: str | None
Name given to a translation pattern for an organization.
- matching_pattern: str | None
Matching pattern given to a translation pattern for an organization.
- replacement_pattern: str | None
Replacement pattern given to a translation pattern for an organization.
- level: TranslationPatternLevel | None