dm_mac.models.api_schemas module

Request and response models for API endpoint validation.

class dm_mac.models.api_schemas.ApiIndexResponse(*, message: str)

Bases: BaseModel

Response body for GET /api/.

_abc_impl = <_abc._abc_data object>
message: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dm_mac.models.api_schemas.ErrorResponse(*, error: str)

Bases: BaseModel

Generic error response.

_abc_impl = <_abc._abc_data object>
error: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dm_mac.models.api_schemas.MachineUpdateRequest(*, machine_name: str, oops: bool, rfid_value: str, uptime: float, wifi_signal_db: float, wifi_signal_percent: float, internal_temperature_c: float, amps: float = 0.0)

Bases: BaseModel

Request body for POST /api/machine/update.

_abc_impl = <_abc._abc_data object>
amps: float
internal_temperature_c: float
machine_name: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

oops: bool
rfid_value: str
uptime: float
wifi_signal_db: float
wifi_signal_percent: float
class dm_mac.models.api_schemas.MachineUpdateResponse(*, relay: bool, display: str, oops_led: bool, status_led_rgb: List[float], status_led_brightness: float)

Bases: BaseModel

Response body for POST /api/machine/update (200).

_abc_impl = <_abc._abc_data object>
display: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

oops_led: bool
relay: bool
status_led_brightness: float
status_led_rgb: List[float]
class dm_mac.models.api_schemas.ReloadUsersResponse(*, removed: int, updated: int, added: int)

Bases: BaseModel

Response body for POST /api/reload-users (200).

_abc_impl = <_abc._abc_data object>
added: int
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

removed: int
updated: int
class dm_mac.models.api_schemas.SuccessResponse(*, success: bool)

Bases: BaseModel

Generic success response.

_abc_impl = <_abc._abc_data object>
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

success: bool