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

32 lines
694 B
Python
Raw Normal View History

2024-04-13 22:43:03 +02:00
from datetime import datetime
from typing import Optional
from uuid import UUID
from pydantic import BaseModel
from app.schemas.connector import Connector
class ChargePointBase(BaseModel):
friendly_name: str
is_active: bool
class ChargePointUpdate(BaseModel):
friendly_name: Optional[str] = None
is_active: Optional[bool] = None
class ChargePointCreate(ChargePointBase):
pass
class ChargePoint(ChargePointBase):
id: UUID
last_seen: datetime | None
connectors: list[Connector] = []
class Config:
from_attributes = True
class ChargePointPassword(BaseModel):
password: str
class ChargePointConnectionInfo(BaseModel):
connected: bool