示例#1
0
    def __init__(self, backend, attributes=None):

        self._backend = backend
        attributes = attributes or {}

        if isinstance(attributes, webexteamssdk.Person):
            self.teams_person = attributes
        else:
            self.teams_person = webexteamssdk.Person(attributes)
 async def create_person(
         self,
         p_emails: List[str],
         p_displayName: Optional[str] = None,
         p_firstName: Optional[str] = None,
         p_lastName: Optional[str] = None,
         p_avatar: Optional[str] = None,
         p_orgId: Optional[str] = None,
         p_roles: Optional[List[str]] = None,
         p_licenses: Optional[List[str]] = None) -> webexteamssdk.Person:
     url = self.people_endpoint
     data = {
         k[2:]: v
         for k, v in locals().items()
         if k.startswith('p_') and v is not None
     }
     r = await self.post(url=url, json=data)
     return webexteamssdk.Person(r)
 async def me(self):
     url = f'{self.people_endpoint}/me'
     r = await self.get(url)
     return webexteamssdk.Person(r)
 async def people_details(self, p_personId) -> webexteamssdk.Person:
     url = f'{self.people_endpoint}/{p_personId}'
     r = await self.get(url)
     return webexteamssdk.Person(r)