simple-ocpp-cs/app/schemas/id_token.py

35 lines
739 B
Python
Raw Permalink Normal View History

2024-04-19 00:08:29 +02:00
from datetime import datetime
2024-04-14 17:34:46 +02:00
from typing import Optional
2024-04-13 22:43:03 +02:00
from uuid import UUID
2024-03-28 21:23:25 +01:00
from pydantic import BaseModel
2024-04-13 22:43:03 +02:00
from app.schemas.user import User
2024-03-28 21:23:25 +01:00
class IdTokenBase(BaseModel):
2024-04-14 17:34:46 +02:00
friendly_name: str
2024-03-28 21:23:25 +01:00
is_active: bool
2024-04-14 17:34:46 +02:00
owner_id: UUID
token: str
2024-03-28 21:23:25 +01:00
class IdTokenCreate(IdTokenBase):
pass
2024-04-14 17:34:46 +02:00
class IdTokenUpdate(BaseModel):
friendly_name: Optional[str] = None
is_active: Optional[bool] = None
owner_id: Optional[UUID] = None
2024-03-28 21:23:25 +01:00
class IdToken(IdTokenBase):
2024-04-13 22:43:03 +02:00
id: UUID
2024-03-28 21:23:25 +01:00
class Config:
2024-04-19 00:08:29 +02:00
from_attributes = True
class IdTokenLearnBase(BaseModel):
user_id: UUID
class IdTokenLearnRequest(IdTokenLearnBase):
until: Optional[datetime] = None
class IdTokenLearnResponse(IdTokenLearnBase):
until: datetime