35 lines
739 B
Python
35 lines
739 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
from pydantic import BaseModel
|
|
|
|
from app.schemas.user import User
|
|
|
|
class IdTokenBase(BaseModel):
|
|
friendly_name: str
|
|
is_active: bool
|
|
owner_id: UUID
|
|
token: str
|
|
|
|
class IdTokenCreate(IdTokenBase):
|
|
pass
|
|
|
|
class IdTokenUpdate(BaseModel):
|
|
friendly_name: Optional[str] = None
|
|
is_active: Optional[bool] = None
|
|
owner_id: Optional[UUID] = None
|
|
|
|
class IdToken(IdTokenBase):
|
|
id: UUID
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class IdTokenLearnBase(BaseModel):
|
|
user_id: UUID
|
|
|
|
class IdTokenLearnRequest(IdTokenLearnBase):
|
|
until: Optional[datetime] = None
|
|
|
|
class IdTokenLearnResponse(IdTokenLearnBase):
|
|
until: datetime |