{
  "$ref": "#/definitions/session-linked",
  "definitions": {
    "session-linked": {
      "type": "object",
      "properties": {
        "v": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+$"
        },
        "id": {
          "type": "string",
          "minLength": 10,
          "maxLength": 64
        },
        "type": {
          "type": "string",
          "const": "session.linked"
        },
        "ts": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "sid": {
          "type": "string",
          "minLength": 16,
          "maxLength": 128
        },
        "replyTo": {
          "type": "string",
          "minLength": 10,
          "maxLength": 64
        },
        "payload": {
          "type": "object",
          "properties": {
            "sid": {
              "type": "string"
            },
            "capabilities": {
              "type": "object",
              "properties": {
                "profiles": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "enum": [
                          "core",
                          "embed",
                          "companion",
                          "provider"
                        ]
                      },
                      "version": {
                        "type": "string",
                        "pattern": "^\\d+\\.\\d+$"
                      }
                    },
                    "required": [
                      "name",
                      "version"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1
                },
                "stt": {
                  "type": "string",
                  "enum": [
                    "device",
                    "hub",
                    "none"
                  ],
                  "default": "none"
                },
                "tts": {
                  "type": "string",
                  "enum": [
                    "device",
                    "hub",
                    "none"
                  ],
                  "default": "none"
                },
                "locales": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 35
                  },
                  "default": []
                },
                "audio": {
                  "type": "boolean",
                  "default": false
                },
                "tools": {
                  "type": "boolean",
                  "default": false
                }
              },
              "required": [
                "profiles"
              ],
              "additionalProperties": false
            },
            "tier": {
              "type": "string",
              "enum": [
                "t0",
                "t1",
                "t2"
              ]
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "resumeKey": {
              "type": "string"
            }
          },
          "required": [
            "sid",
            "capabilities",
            "tier",
            "scopes"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "v",
        "id",
        "type",
        "ts",
        "payload"
      ],
      "additionalProperties": true
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schwaizer.ch/ocp/schemas/1.0/session-linked.json"
}
