{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/romm/json-schema/romm-device-schema-schema.json",
  "title": "DeviceSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/romm-devices-api-openapi.yml#/components/schemas/DeviceSchema",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "integer",
      "title": "User Id"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "platform": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Platform"
    },
    "client": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client"
    },
    "client_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Version"
    },
    "ip_address": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ip Address"
    },
    "mac_address": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mac Address"
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hostname"
    },
    "client_device_identifier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Device Identifier"
    },
    "sync_mode": {
      "$ref": "#/$defs/SyncMode"
    },
    "sync_enabled": {
      "type": "boolean",
      "title": "Sync Enabled"
    },
    "sync_config": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sync Config"
    },
    "capabilities": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "boolean"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Capabilities"
    },
    "last_seen": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Seen"
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "name",
    "platform",
    "client",
    "client_version",
    "ip_address",
    "mac_address",
    "hostname",
    "client_device_identifier",
    "sync_mode",
    "sync_enabled",
    "sync_config",
    "capabilities",
    "last_seen",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "SyncMode": {
      "type": "string",
      "enum": [
        "api",
        "file_transfer",
        "push_pull"
      ],
      "title": "SyncMode"
    }
  }
}