integrate/app/authentik/models.py

41 lines
905 B
Python
Raw Normal View History

2022-03-04 18:51:33 +01:00
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: str
email: str
avatar: str
attributes: Dict[str, Any]
uid: str
class GroupsObjItem(BaseModel):
pk: str
name: str
is_superuser: bool
2022-03-06 12:31:12 +01:00
parent: Optional[str]
parent_name: Optional[str]
2022-03-04 18:51:33 +01:00
users: List[int]
attributes: Dict[str, Any]
users_obj: List[UsersObjItem]
class User(BaseModel):
pk: Optional[str]
username: str
name: str
2022-03-06 15:29:00 +01:00
is_active: bool = True
2022-03-04 18:51:33 +01:00
last_login: Optional[str] = None
is_superuser: Optional[bool] = None
2022-03-06 15:29:00 +01:00
groups: List[str] = []
2022-03-04 18:51:33 +01:00
groups_obj: Optional[List[GroupsObjItem]] = None
email: str
avatar: Optional[str] = None
2022-03-06 15:29:00 +01:00
attributes: Dict[str, Any] = {}
2022-03-04 18:51:33 +01:00
uid: Optional[str] = None