Files
romm/backend/endpoints/responses/device/install.py
Georges-Antoine Assi 673c1b1052 refactor(device): nest device endpoints, responses and install handler in packages
- endpoints/device.py, device_install.py -> endpoints/device/__init__.py, install.py
- endpoints/responses/device.py, device_install.py -> endpoints/responses/device/__init__.py, install.py
- handler/device_install_handler.py, device_install_policy.py -> handler/device_install/__init__.py, policy.py

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 15:55:42 -04:00

33 lines
693 B
Python

import enum
from typing import Annotated
from pydantic import Field
from ..base import BaseModel, UTCDatetime
class InstallStatus(enum.StrEnum):
PENDING = "pending"
TAKEN = "taken"
DONE = "done"
ALREADY_INSTALLED = "already_installed"
FAILED = "failed"
CANCELLED = "cancelled"
InstallReason = Annotated[str, Field(max_length=500)]
class InstallRequestSchema(BaseModel):
"""An install request, as served and as stored in Redis while pending or taken."""
id: str
user_id: int
device_id: str
rom_id: int
file_ids: list[int]
status: InstallStatus
reason: InstallReason | None
created_at: UTCDatetime
updated_at: UTCDatetime