{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/comp-ai/main/json-schema/comp-ai-device-response-dto-schema.json",
  "title": "DeviceResponseDto",
  "x-generated": "2026-10-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/comp-ai-openapi.json#/components/schemas/DeviceResponseDto",
  "type": "object",
  "properties": {
    "created_at": {
      "type": "string",
      "description": "Device created at"
    },
    "updated_at": {
      "type": "string",
      "description": "Device updated at"
    },
    "software": {
      "type": "array",
      "description": "Software list",
      "items": {
        "type": "object"
      }
    },
    "software_updated_at": {
      "type": "string",
      "description": "Software updated at"
    },
    "id": {
      "description": "Device ID (numeric for Fleet devices, string UUID for device-agent devices)",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "detail_updated_at": {
      "type": "string",
      "description": "Detail updated at"
    },
    "label_updated_at": {
      "type": "string",
      "description": "Label updated at"
    },
    "policy_updated_at": {
      "type": "string",
      "description": "Policy updated at"
    },
    "last_enrolled_at": {
      "type": "string",
      "description": "Last enrolled at"
    },
    "seen_time": {
      "type": "string",
      "description": "Last seen time"
    },
    "refetch_requested": {
      "type": "boolean",
      "description": "Refetch requested"
    },
    "hostname": {
      "type": "string",
      "description": "Hostname"
    },
    "uuid": {
      "type": "string",
      "description": "Device UUID"
    },
    "platform": {
      "type": "string",
      "description": "Platform"
    },
    "osquery_version": {
      "type": "string",
      "description": "Osquery version"
    },
    "orbit_version": {
      "type": "string",
      "description": "Orbit version"
    },
    "fleet_desktop_version": {
      "type": "string",
      "description": "Fleet desktop version"
    },
    "scripts_enabled": {
      "type": "boolean",
      "description": "Scripts enabled"
    },
    "os_version": {
      "type": "string",
      "description": "OS version"
    },
    "build": {
      "type": "string",
      "description": "Build"
    },
    "platform_like": {
      "type": "string",
      "description": "Platform like"
    },
    "code_name": {
      "type": "string",
      "description": "Code name"
    },
    "uptime": {
      "type": "number",
      "description": "Uptime in seconds"
    },
    "memory": {
      "type": "number",
      "description": "Memory in bytes"
    },
    "cpu_type": {
      "type": "string",
      "description": "CPU type"
    },
    "cpu_subtype": {
      "type": "string",
      "description": "CPU subtype"
    },
    "cpu_brand": {
      "type": "string",
      "description": "CPU brand"
    },
    "cpu_physical_cores": {
      "type": "number",
      "description": "CPU physical cores"
    },
    "cpu_logical_cores": {
      "type": "number",
      "description": "CPU logical cores"
    },
    "hardware_vendor": {
      "type": "string",
      "description": "Hardware vendor"
    },
    "hardware_model": {
      "type": "string",
      "description": "Hardware model"
    },
    "hardware_version": {
      "type": "string",
      "description": "Hardware version"
    },
    "hardware_serial": {
      "type": "string",
      "description": "Hardware serial"
    },
    "computer_name": {
      "type": "string",
      "description": "Computer name"
    },
    "public_ip": {
      "type": "string",
      "description": "Public IP"
    },
    "primary_ip": {
      "type": "string",
      "description": "Primary IP"
    },
    "primary_mac": {
      "type": "string",
      "description": "Primary MAC"
    },
    "distributed_interval": {
      "type": "number",
      "description": "Distributed interval"
    },
    "config_tls_refresh": {
      "type": "number",
      "description": "Config TLS refresh"
    },
    "logger_tls_period": {
      "type": "number",
      "description": "Logger TLS period"
    },
    "team_id": {
      "type": [
        "object",
        "null"
      ],
      "description": "Team ID"
    },
    "pack_stats": {
      "type": "array",
      "description": "Pack stats",
      "items": {
        "type": "object"
      }
    },
    "team_name": {
      "type": [
        "object",
        "null"
      ],
      "description": "Team name"
    },
    "users": {
      "type": "array",
      "description": "Users",
      "items": {
        "type": "object"
      }
    },
    "gigs_disk_space_available": {
      "type": "number",
      "description": "Disk space available in GB"
    },
    "percent_disk_space_available": {
      "type": "number",
      "description": "Percent disk space available"
    },
    "gigs_total_disk_space": {
      "type": "number",
      "description": "Total disk space in GB"
    },
    "disk_encryption_enabled": {
      "type": "boolean",
      "description": "Disk encryption enabled"
    },
    "issues": {
      "type": "object",
      "description": "Issues",
      "additionalProperties": true
    },
    "mdm": {
      "type": "object",
      "description": "MDM info",
      "additionalProperties": true
    },
    "refetch_critical_queries_until": {
      "type": [
        "object",
        "null"
      ],
      "description": "Refetch critical queries until"
    },
    "last_restarted_at": {
      "type": "string",
      "description": "Last restarted at"
    },
    "policies": {
      "description": "Policies",
      "type": "array",
      "items": {
        "$ref": "#/$defs/FleetPolicyDto"
      }
    },
    "labels": {
      "type": "array",
      "description": "Labels",
      "items": {
        "type": "object"
      }
    },
    "packs": {
      "type": "array",
      "description": "Packs",
      "items": {
        "type": "object"
      }
    },
    "batteries": {
      "type": "array",
      "description": "Batteries",
      "items": {
        "type": "object"
      }
    },
    "end_users": {
      "type": "array",
      "description": "End users",
      "items": {
        "type": "object"
      }
    },
    "last_mdm_enrolled_at": {
      "type": "string",
      "description": "Last MDM enrolled at"
    },
    "last_mdm_checked_in_at": {
      "type": "string",
      "description": "Last MDM checked in at"
    },
    "status": {
      "type": "string",
      "description": "Device status"
    },
    "display_text": {
      "type": "string",
      "description": "Display text"
    },
    "display_name": {
      "type": "string",
      "description": "Display name"
    }
  },
  "required": [
    "created_at",
    "updated_at",
    "software",
    "software_updated_at",
    "id",
    "detail_updated_at",
    "label_updated_at",
    "policy_updated_at",
    "last_enrolled_at",
    "seen_time",
    "refetch_requested",
    "hostname",
    "uuid",
    "platform",
    "osquery_version",
    "orbit_version",
    "fleet_desktop_version",
    "scripts_enabled",
    "os_version",
    "build",
    "platform_like",
    "code_name",
    "uptime",
    "memory",
    "cpu_type",
    "cpu_subtype",
    "cpu_brand",
    "cpu_physical_cores",
    "cpu_logical_cores",
    "hardware_vendor",
    "hardware_model",
    "hardware_version",
    "hardware_serial",
    "computer_name",
    "public_ip",
    "primary_ip",
    "primary_mac",
    "distributed_interval",
    "config_tls_refresh",
    "logger_tls_period",
    "team_id",
    "pack_stats",
    "team_name",
    "users",
    "gigs_disk_space_available",
    "percent_disk_space_available",
    "gigs_total_disk_space",
    "disk_encryption_enabled",
    "issues",
    "mdm",
    "refetch_critical_queries_until",
    "last_restarted_at",
    "policies",
    "labels",
    "packs",
    "batteries",
    "end_users",
    "last_mdm_enrolled_at",
    "last_mdm_checked_in_at",
    "status",
    "display_text",
    "display_name"
  ],
  "$defs": {
    "FleetPolicyDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Policy ID"
        },
        "name": {
          "type": "string",
          "description": "Policy name"
        },
        "query": {
          "type": "string",
          "description": "Policy query"
        },
        "critical": {
          "type": "boolean",
          "description": "Whether policy is critical"
        },
        "description": {
          "type": "string",
          "description": "Policy description"
        },
        "author_id": {
          "type": "number",
          "description": "Author ID"
        },
        "author_name": {
          "type": "string",
          "description": "Author name"
        },
        "author_email": {
          "type": "string",
          "description": "Author email"
        },
        "team_id": {
          "type": [
            "object",
            "null"
          ],
          "description": "Team ID"
        },
        "resolution": {
          "type": "string",
          "description": "Policy resolution"
        },
        "platform": {
          "type": "string",
          "description": "Platform"
        },
        "calendar_events_enabled": {
          "type": "boolean",
          "description": "Calendar events enabled"
        },
        "created_at": {
          "type": "string",
          "description": "Created at"
        },
        "updated_at": {
          "type": "string",
          "description": "Updated at"
        },
        "response": {
          "type": "string",
          "description": "Policy response"
        }
      },
      "required": [
        "id",
        "name",
        "query",
        "critical",
        "description",
        "author_id",
        "author_name",
        "author_email",
        "team_id",
        "resolution",
        "platform",
        "calendar_events_enabled",
        "created_at",
        "updated_at",
        "response"
      ]
    }
  }
}