{
  "$ref": "#/definitions/pair-linked",
  "definitions": {
    "pair-linked": {
      "type": "object",
      "properties": {
        "v": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+$"
        },
        "id": {
          "type": "string",
          "minLength": 10,
          "maxLength": 64
        },
        "type": {
          "type": "string",
          "const": "pair.linked"
        },
        "ts": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "sid": {
          "type": "string",
          "minLength": 16,
          "maxLength": 128
        },
        "replyTo": {
          "type": "string",
          "minLength": 10,
          "maxLength": 64
        },
        "payload": {
          "type": "object",
          "properties": {
            "device": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "platform": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "platform"
              ],
              "additionalProperties": false
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "tier": {
              "type": "string",
              "enum": [
                "t0",
                "t1",
                "t2"
              ]
            }
          },
          "required": [
            "device",
            "scopes",
            "tier"
          ],
          "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/pair-linked.json"
}
