mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 18:42:34 +01:00
- 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>
33 lines
693 B
Python
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
|