integrate/app/authentik/models.py
2022-04-22 18:34:48 +02:00

41 lines
No EOL
915 B
Python

from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class UsersObjItem(BaseModel):
pk: int
username: str
name: str
is_active: bool
last_login: Optional[str]
email: str
avatar: str
attributes: Dict[str, Any]
uid: str
class GroupsObjItem(BaseModel):
pk: str
name: str
is_superuser: bool
parent: Optional[str]
parent_name: Optional[str]
users: List[int]
attributes: Dict[str, Any]
users_obj: List[UsersObjItem]
class User(BaseModel):
pk: Optional[str]
username: str
name: str
is_active: bool = True
last_login: Optional[str] = None
is_superuser: Optional[bool] = None
groups: List[str] = []
groups_obj: Optional[List[GroupsObjItem]] = None
email: str
avatar: Optional[str] = None
attributes: Dict[str, Any] = {}
uid: Optional[str] = None