{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/romm/json-schema/romm-install-request-schema-schema.json",
  "title": "InstallRequestSchema",
  "description": "An install request, as served and as stored in Redis while pending or taken.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/romm-devices-api-openapi.yml#/components/schemas/InstallRequestSchema",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "integer",
      "title": "User Id"
    },
    "device_id": {
      "type": "string",
      "title": "Device Id"
    },
    "rom_id": {
      "type": "integer",
      "title": "Rom Id"
    },
    "file_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "File Ids"
    },
    "status": {
      "$ref": "#/$defs/InstallStatus"
    },
    "reason": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Reason"
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "device_id",
    "rom_id",
    "file_ids",
    "status",
    "reason",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "InstallStatus": {
      "type": "string",
      "enum": [
        "pending",
        "taken",
        "done",
        "already_installed",
        "failed",
        "cancelled"
      ],
      "title": "InstallStatus"
    }
  }
}