{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "agent-command",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "command_id": {
      "type": "string",
      "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
    },
    "kind": {
      "enum": [
        "stage_profile",
        "activate_route",
        "drain_route",
        "stop_profile",
        "remove_runtime",
        "test_exit",
        "rotate_key"
      ]
    },
    "resource_id": {
      "type": "string",
      "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
    },
    "desired_version_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_current_version_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "route_configuration": {
      "anyOf": [
        {
          "$ref": "route-configuration.schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "vpn_configuration": {
      "anyOf": [
        {
          "$ref": "vpn-profile.schema.json"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "command_id",
    "kind",
    "resource_id",
    "desired_version_id",
    "expected_current_version_id",
    "expires_at",
    "route_configuration",
    "vpn_configuration"
  ]
}
