{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.1/bridging/privateChannelOnUnsubscribeAgentRequest.schema.json",
  "title": "PrivateChannelOnUnsubscribe Agent Request",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/PrivateChannelOnUnsubscribeRequestBase"
    },
    {
      "$ref": "agentRequest.schema.json"
    }
  ],
  "$defs": {
    "PrivateChannelOnUnsubscribeRequestBase": {
      "title": "PrivateChannelOnUnsubscribe Request",
      "type": "object",
      "description": "A request to forward on an Unsubscribe event, relating to a PrivateChannel",
      "properties": {
        "type": {
          "title": "Private Channel OnUnsubscribe Message type",
          "const": "PrivateChannel.onUnsubscribe"
        },
        "payload": {
          "title": "PrivateChannelOnUnsubscribe Request Payload",
          "type": "object",
          "properties": {
            "channelId": {
              "type": "string"
            },
            "contextType": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": ["channelId", "contextType"]
        },
        "meta": {
          "title": "PrivateChannelOnUnsubscribe Request Metadata",
          "type": "object",
          "properties": {
            "requestUuid": true,
            "timestamp": true,
            "source": {
              "$ref": "common.schema.json#/$defs/AppRequestSource"
            },
            "destination": {
              "$ref": "common.schema.json#/$defs/AppDestination"
            }
          },
          "unevaluatedProperties": false
        }
      }
    }
  }
}
