"""
exec assistant settings API
"""
from pydantic import Field
from ..base import ApiModel
from ..base import SafeEnum as Enum
from .common import PersonSettingsApiChild
__all__ = ['ExecAssistantApi', 'ExecAssistantType', '_Helper']
[docs]
class ExecAssistantType(str, Enum):
"""
Indicates the Executive Assistant type.
"""
#: Indicates the feature is not enabled.
unassigned = 'UNASSIGNED'
#: Indicates the feature is enabled and the person is an Executive
executive = 'EXECUTIVE'
#: Indicates the feature is enabled and the person is an Executive Assistant.
executive_assistant = 'EXECUTIVE_ASSISTANT'
class _Helper(ApiModel):
exec_type: ExecAssistantType = Field(alias='type')
[docs]
class ExecAssistantApi(PersonSettingsApiChild):
"""
API for person's exec assistant settings
"""
feature = 'executiveAssistant'
[docs]
def read(self, person_id: str, org_id: str = None) -> ExecAssistantType:
"""
Retrieve Executive Assistant Settings for a Person
Retrieve the executive assistant settings for the specified personId.
People with the executive service enabled, can select from a pool of assistants who have been assigned the
executive assistant service and who can answer or place calls on their behalf. Executive assistants can set
the call forward destination and join or leave an executive's pool.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
:param person_id: Unique identifier for the person.
:type person_id: str
:param org_id: Person is in this organization. Only admin users of another organization (such as partners)
may use this parameter as the default is the same organization as the token used to access API.
:type org_id: str
:return: exec assistant setting
:rtype: :class:`ExecAssistantType`
"""
ep = self.f_ep(person_id=person_id)
params = org_id and {'orgId': org_id} or None
data = self.get(ep, params=params)
h: _Helper = _Helper.model_validate(data)
return h.exec_type