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

20 lines
382 B
Python
Raw Permalink Normal View History

2024-04-14 01:42:51 +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
class UserBase(BaseModel):
friendly_name: str
is_active: bool
2024-04-14 01:42:51 +02:00
class UserUpdate(BaseModel):
friendly_name: Optional[str] = None
is_active: Optional[bool] = None
2024-03-28 21:23:25 +01:00
class UserCreate(UserBase):
pass
class User(UserBase):
2024-04-13 22:43:03 +02:00
id: UUID
2024-03-28 21:23:25 +01:00
class Config:
from_attributes = True