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

24 lines
488 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
uuid: Optional[str]
2024-11-11 17:37:17 +00:00
displayname: Optional[str]
email: Optional[str]
2024-11-11 17:47:31 +00:00
username: str
ssh_keys: list[str] # TODO WHY NOT OPTIONAL?
origin: UserDataUserOrigin