selfprivacy-rest-api/selfprivacy_api/models/user.py

28 lines
625 B
Python
Raw Normal View History

from enum import Enum
from pydantic import BaseModel
2024-11-11 17:37:17 +00:00
from typing import Optional
class UserDataUserOrigin(Enum):
"""Origin of the user in the user data"""
NORMAL = "NORMAL"
PRIMARY = "PRIMARY"
ROOT = "ROOT"
class UserDataUser(BaseModel):
"""The user model from the userdata file"""
2024-11-11 17:47:31 +00:00
username: str
2024-11-15 00:19:24 +00:00
origin: UserDataUserOrigin
2024-11-14 23:30:24 +00:00
displayname: Optional[
str
] # in logic graphql will return "username" if "displayname" None
uuid: Optional[str]
email: Optional[str]
ssh_keys: Optional[list[str]]
directmemberof: Optional[list[str]]
memberof: Optional[list[str]]