mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-29 09:20:01 +02:00
welcome to onyx
This commit is contained in:
46
backend/onyx/server/models.py
Normal file
46
backend/onyx/server/models.py
Normal file
@ -0,0 +1,46 @@
|
||||
from typing import Generic
|
||||
from typing import Optional
|
||||
from typing import TypeVar
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from onyx.auth.schemas import UserRole
|
||||
from onyx.auth.schemas import UserStatus
|
||||
|
||||
|
||||
DataT = TypeVar("DataT")
|
||||
|
||||
|
||||
class StatusResponse(BaseModel, Generic[DataT]):
|
||||
success: bool
|
||||
message: Optional[str] = None
|
||||
data: Optional[DataT] = None
|
||||
|
||||
|
||||
class ApiKey(BaseModel):
|
||||
api_key: str
|
||||
|
||||
|
||||
class IdReturn(BaseModel):
|
||||
id: int
|
||||
|
||||
|
||||
class MinimalUserSnapshot(BaseModel):
|
||||
id: UUID
|
||||
email: str
|
||||
|
||||
|
||||
class FullUserSnapshot(BaseModel):
|
||||
id: UUID
|
||||
email: str
|
||||
role: UserRole
|
||||
status: UserStatus
|
||||
|
||||
|
||||
class InvitedUserSnapshot(BaseModel):
|
||||
email: str
|
||||
|
||||
|
||||
class DisplayPriorityRequest(BaseModel):
|
||||
display_priority_map: dict[int, int]
|
Reference in New Issue
Block a user