{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "https://fdc3.finos.org/schemas/next/api/privateChannelAddEventListenerRequest.schema.json",
	"type": "object",
	"title": "PrivateChannelAddEventListener Request",
	"description": "A request to add an event listener to a specific PrivateChannel.",
	"allOf": [
		{
			"$ref": "appRequest.schema.json"
		},
		{
			"type": "object",
			"properties": {
				"type": {
					"$ref": "#/$defs/PrivateChannelAddEventListenerRequestType"
				},
				"payload": {
					"$ref": "#/$defs/PrivateChannelAddEventListenerRequestPayload"
				},
				"meta": true
			},
			"additionalProperties": false
		}
	],
	"$defs": {
		"PrivateChannelAddEventListenerRequestType": {
			"title": "PrivateChannelAddEventListener Request Message Type",
			"const": "privateChannelAddEventListenerRequest"
		},
		"PrivateChannelAddEventListenerRequestPayload": {
			"title": "PrivateChannelAddEventListener Request Payload",
			"type": "object",
			"properties": {
				"privateChannelId": {
					"title": "Private Channel Id",
					"description": "The Id of the PrivateChannel that the listener should be added to.",
					"type": "string"
				},
				"listenerType": {
					"title": "Event listener type",
					"description": "The type of PrivateChannel event that the listener should be applied to, or null for all event types.",
					"oneOf" : [
						{ "$ref": "api.schema.json#/definitions/PrivateChannelEventType" },
						{
							"type": "null"
						}
					]
				}
			},
			"additionalProperties": false,
			"required": [
				"privateChannelId",
				"listenerType"
			]
		}
	}
}