{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.2/bridging/privateChannelOnAddContextListenerAgentRequest.schema.json",
  "title": "PrivateChannelOnAddContextListener Agent Request",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/PrivateChannelOnAddContextListenerRequestBase"
    },
    {
      "$ref": "agentRequest.schema.json"
    }
  ],
  "$defs": {
    "PrivateChannelOnAddContextListenerRequestBase": {
      "title": "PrivateChannelOnAddContextListener Request",
      "type": "object",
      "description": "A request to forward on an AddContextListener event, relating to a PrivateChannel",
      "properties": {
        "type": {
          "title": "Private Channel OnAddContextListener Message type",
          "const": "PrivateChannel.onAddContextListener"
        },
        "payload": {
          "title": "PrivateChannelOnAddContextListener Request Payload",
          "type": "object",
          "properties": {
            "channelId": {
              "type": "string",
              "title": "Channel Id",
              "description": "The id of the PrivateChannel that the context listener was added to."
            },
            "contextType": {
              "oneOf": [
                { "type": "string" },
                { "type": "null" }
              ],
              "title": "Context Type",
              "description": "The type of the context listener added. Should be null for an untyped listener."
            }
          },
          "additionalProperties": false,
          "required": ["channelId", "contextType"]
        },
        "meta": {
          "title": "PrivateChannelOnAddContextListener 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
    }
  }
}
