{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/devices.schema.json",
  "title": "tables/devices.json",
  "description": "The rows of the table devices that belong to the workspace, one object per row, keyed by the database's column names.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "organization_id": {
        "type": "string",
        "format": "uuid"
      },
      "source": {
        "type": "string"
      },
      "external_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "platform": {
        "type": [
          "string",
          "null"
        ]
      },
      "os_version": {
        "type": [
          "string",
          "null"
        ]
      },
      "serial_number": {
        "type": [
          "string",
          "null"
        ]
      },
      "owner_email": {
        "type": [
          "string",
          "null"
        ]
      },
      "owner_name": {
        "type": [
          "string",
          "null"
        ]
      },
      "personnel_id": {
        "type": [
          "string",
          "null"
        ],
        "format": "uuid"
      },
      "managed": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "compliant": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "encrypted": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "protection": {
        "type": "string",
        "enum": [
          "protected",
          "unprotected",
          "unknown"
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "active",
          "gone"
        ]
      },
      "last_seen_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "first_seen_on": {
        "type": "string",
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "last_read_on": {
        "type": "string",
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      }
    },
    "required": [
      "id",
      "organization_id",
      "source",
      "external_id",
      "name",
      "platform",
      "os_version",
      "serial_number",
      "owner_email",
      "owner_name",
      "personnel_id",
      "managed",
      "compliant",
      "encrypted",
      "protection",
      "status",
      "last_seen_at",
      "first_seen_on",
      "last_read_on",
      "created_at",
      "updated_at"
    ],
    "additionalProperties": false
  }
}
