from datetime import datetime
from typing import Optional
from wxc_sdk.api_child import ApiChild
from wxc_sdk.base import ApiModel
__all__ = ['MSTeamsSettings', 'SettingsObject', 'MSTeamsSettingApi']
[docs]
class SettingsObject(ApiModel):
#: Name of the setting retrieved.
setting_name: Optional[str] = None
#: Level at which the `settingName` has been set.
level: Optional[str] = None
#: Either `true` or `false` for the respective `settingName` to be retrieved.
value: Optional[bool] = None
#: The date and time when the respective `settingName` was last updated.
last_modified: Optional[datetime] = None
[docs]
class MSTeamsSettings(ApiModel):
#: Unique identifier for the person.
person_id: Optional[str] = None
#: Unique identifier for the organization in which the person resides.
org_id: Optional[str] = None
#: Array of `SettingsObject`.
settings: Optional[list[SettingsObject]] = None
[docs]
class MSTeamsSettingApi(ApiChild, base='telephony/config/people'):
[docs]
def read(self, person_id: str,
org_id: str = None) -> MSTeamsSettings:
"""
Retrieve a Person's MS Teams Settings
At a person level, MS Teams settings allow access to retrieving the `HIDE WEBEX APP` and `PRESENCE SYNC`
settings.
To retrieve a person's MS Teams settings requires a full or read-only administrator auth token with a scope
of `spark-admin:telephony_config_read`.
:param person_id: Unique identifier for the person.
:type person_id: str
:param org_id: ID of the organization in which the person resides. Only admin users of another organization
(such as partners) may use this parameter since the default is the same organization as the token used to
access the API.
:type org_id: str
:rtype: :class:`MSTeamsSettings`
"""
params = {}
if org_id is not None:
params['orgId'] = org_id
url = self.ep(f'{person_id}/settings/msTeams')
data = super().get(url, params=params)
r = MSTeamsSettings.model_validate(data)
return r