{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.2/bridging/privateChannelOnDisconnectAgentRequest.schema.json",
  "title": "PrivateChannelOnDisconnect Agent Request",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/PrivateChannelOnDisconnectRequestBase"
    },
    {
      "$ref": "agentRequest.schema.json"
    }
  ],
  "$defs": {
    "PrivateChannelOnDisconnectRequestBase": {
      "title": "PrivateChannelOnDisconnect Request",
      "type": "object",
      "description": "A request to forward on a Disconnect event, relating to a PrivateChannel",
      "properties": {
        "type": {
          "title": "Private Channel OnDisconnect Message type",
          "const": "PrivateChannel.onDisconnect"
        },
        "payload": {
          "title": "PrivateChannelOnDisconnect Request Payload",
          "type": "object",
          "properties": {
            "channelId": {
              "type": "string",
              "title": "Channel Id",
              "description": "The id of the PrivateChannel that the agent discconnected from."
            }
          },
          "additionalProperties": false,
          "required": ["channelId"]
        },
        "meta": {
          "title": "PrivateChannelOnDisconnect 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
        }
      },
      "additionalProperties": false
    }
  }
}
