32 lines
694 B
Python
32 lines
694 B
Python
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
|