{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "title": "Device Event",
  "description": "The desktop or mobile device produced event specific structure.",
  "$comment": "This is used typically by the system and diagnostics events from the device.",
  "extends": {
    "$comment": "Extends common event structure",
    "$ref": "event.json"
  },
  "properties": {
    "installationDirective": {
      "title": "Installation directive",
      "description": "The app installation directive. The event containing installationDirective reacts on particular installation directive the client got from IDS. Used when eventType is for example CLIENT_APP_DOWNLOAD, CLIENT_APP_INSTALLATION...",
      "$ref": "#/$defs/event-installation-directive"
    },
    "biometricMethods": {
      "title": "Biometric Methods",
      "description": "List of biometric methods involved in this event. Used when eventType is related to biometric manipulation, for example CLIENT_BIOMETRIC_ADDED.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "FACE",
          "FINGERPRINT"
        ]
      }
    }
  },
  "$defs": {
    "event-installation-directive": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "title": "Installation directive",
      "description": "Defines what should be installed on asset",
      "type": "object",
      "properties": {
        "id": {
          "title": "Id",
          "description": "The identifier of the installation directive. Used as correlation to track the status.",
          "$comment": "Used as correlation to track the status.",
          "type": "string"
        },
        "artifacts": {
          "title": "Artifacts",
          "description": "The artifacts which should be installed on the asset.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/software-artifact"
          }
        }
      }
    },
    "software-artifact": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "title": "Software artifact",
      "description": "Software artifact which can be installed on the asset.",
      "type": "object",
      "properties": {
        "name": {
          "title": "Name",
          "description": "The display name of the artifact",
          "type": "string"
        },
        "artifactId": {
          "title": "Artifact id",
          "description": "The identifier of the artifact",
          "type": "string"
        },
        "version": {
          "title": "Artifact version",
          "description": "The version of the artifact",
          "type": "string"
        }
      }
    }
  }
}
