from tdw_catalog import Catalog
from tdw_catalog.entity import Entity, Property, EntityBase
[docs]@Entity([
Property("user_id", str, serialize=True),
Property("email", str),
Property("name", str),
])
class User(EntityBase):
"""
A :class:`.User` is a registered user of the ThinkData :class:`.Catalog`. Currently :class:`.User`\\ s can only be created
through the :class:`.Catalog` user interface, and cannot be created through the API.
:class:`.User`\\ s can be added as members of :class:`.Organization`\\ s and :class:`.Team`\\ s, and have :class:`.Dataset`\\ s shared with them.
Attributes
----------
user_id: str
The unique ID of a :class:`.User` on the :class:`.Catalog` server
email: str
The :class:`.User`'s registered email address
name: str
The :class:`.User`'s full name
"""
_client: 'Catalog'
user_id: str
email: str
name: str
def __str__(self) -> str:
return f"<User id={self.user_id} email={self.email}>"
@classmethod
def get(cls, client: 'Catalog', id: str):
return client._get_user(id)
# We are going to set an alias of ID here even though user_id is correct
@property
def id(self) -> str:
return self._user_id