wxc_sdk.locations package
Locations
Locations are used to organize Webex Calling (BroadCloud) features within physical locations. Webex Control Hub may be used to define new locations.
Searching and viewing locations in your organization requires an administrator auth token with the spark-admin:people_read and spark-admin:people_write or spark-admin:device_read AND spark-admin:device_writescope combinations.
- class wxc_sdk.locations.LocationAddress(*, address1: str, address2: str | None = None, city: str, state: str, postalCode: str, country: str | None = None)[source]
Bases:
ApiModel
Address of a
Location
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- address1: str
address line 1
- address2: str | None
address line 2
- city: str
city
- state: str
state
- postal_code: str
ZIP/Postal code
- country: str | None
country
- class wxc_sdk.locations.Location(*, id: str | None = None, name: str | None = None, orgId: str | None = None, address: LocationAddress | None = None, timeZone: str | None = None, preferredLanguage: str | None = None)[source]
Bases:
ApiModel
Webex location
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- location_id: str | None
A unique identifier for the location.
- name: str | None
The name of the location.
- org_id: str | None
The ID of the organization to which this location belongs.
- address: LocationAddress | None
The address of the location,
LocationAddress
- time_zone: str | None
- preferred_language: str | None
- property location_id_uuid: str
location id as UUID
- property org_id_uuid: str
org id as UUID
- class wxc_sdk.locations.LocationsApi(*, session: RestSession, base: str | None = None)[source]
Bases:
ApiChild
Location API
Locations are used to organize Webex Calling (BroadCloud) features within physical locations. Webex Control Hub may be used to define new locations.
Searching and viewing locations in your organization requires an administrator auth token with the spark-admin:people_read and spark-admin:people_write or spark-admin:device_read AND spark-admin:device_write scope combinations.
- list(name: str | None = None, location_id: str | None = None, org_id: str | None = None, **params) Generator[Location, None, None] [source]
List locations for an organization.
- Parameters:
name (str) – List locations whose name contains this string (case-insensitive).
location_id (str) – List locations by ID.
org_id (str) – List locations in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
generator of
Location
instances
- by_name(name: str, org_id: str | None = None) Location | None [source]
Get a location by name
- Parameters:
name (str) – name of the location to search
org_id (str) – search in list of locations in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
locations
- Return type:
- details(location_id) Location [source]
Shows details for a location, by ID.
This API only works for Customer administrators and for Partner administrators to query their own organization. Partner administrators looking to query customer organizations should use the List Locations endpoint to retrieve information about locations.
- Parameters:
location_id (str) – A unique identifier for the location.
- Returns:
location details
- Return type:
- create(name: str, time_zone: str, preferred_language: str, announcement_language: str, address1: str, city: str, state: str, postal_code: str, country: str, address2: str | None = None, org_id: str | None = None) str [source]
Create a new Location for a given organization. Only an admin in a Webex Calling licensed organization can create a new Location.
The following body parameters are required to create a new location: name, timeZone, preferredLanguage, address, announcementLanguage.
Creating a location in your organization requires an administrator auth token with the spark-admin:locations_write.
- Parameters:
name (str) – The name of the location.
time_zone (str) – Time zone associated with this location
preferred_language (str) – Default email language.
announcement_language (str) – Location’s phone announcement language.
address1 (str) – Address 1
address2 (str) – Address 2
city (str) – City
state (str) – State Code
postal_code (str) – Postal Code
country (str) – ISO-3166 2-Letter Country Code.
org_id (str) – Create a location common attribute for this organization.
- Returns:
ID of new location
- Return type:
- update(location_id: str, settings: Location, org_id: str | None = None)[source]
Update details for a location, by ID.
Specify the location ID in the locationId parameter in the URI. Only an admin can update a location details.
Updating a location in your organization requires an administrator auth token with the spark-admin:locations_write.
- Parameters:
location_id (str) – Update location common attributes for this location.
settings (
Location
) – new settings for the org:org_id (str) – Update location common attributes for this organization
- base = 'locations'
- session: RestSession
REST session