{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "anyOf": [
        {
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "additionalProperties": false,
                "description": "Describes RTP Sender transport parameters. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint. As a minimum all senders must support `source_ip`, `destination_ip`, `source_port`, `rtp_enabled` and `destination_port`. Senders supporting FEC and/or RTCP must support parameters prefixed with `fec` and `rtcp` respectively.",
                "patternProperties": {
                    "^ext_[a-zA-Z0-9_]+$": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Describes external Sender transport parameters defined in other AMWA specifications. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint.",
                        "title": "External Sender Transport Parameters",
                        "type": [
                            "string",
                            "boolean",
                            "null",
                            "number"
                        ]
                    }
                },
                "properties": {
                    "destination_ip": {
                        "anyOf": [
                            {
                                "format": "ipv4"
                            },
                            {
                                "format": "ipv6"
                            },
                            {
                                "pattern": "^auto$"
                            }
                        ],
                        "description": "IP address to which RTP packets will be sent. If auto is set the sender should select a multicast address to send to itself. For example it may implement MADCAP (RFC 2730), ZMAAP, or be allocated address by some other system responsible for co-ordination multicast address use.",
                        "type": "string"
                    },
                    "destination_port": {
                        "description": "destination port for RTP packets (auto = 5004 by default)",
                        "maximum": 65535,
                        "minimum": 1,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "fec1D_destination_port": {
                        "description": "destination port for RTP Column FEC packets (auto = RTP destination_port + 2 by default)",
                        "maximum": 65535,
                        "minimum": 1,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "fec1D_source_port": {
                        "description": "source port for RTP FEC packets (auto = RTP source_port + 2 by default)",
                        "maximum": 65535,
                        "minimum": 0,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "fec2D_destination_port": {
                        "description": "destination port for RTP Row FEC packets (auto = RTP destination_port + 4 by default)",
                        "maximum": 65535,
                        "minimum": 1,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "fec2D_source_port": {
                        "description": "source port for RTP FEC packets (auto = RTP source_port + 4 by default)",
                        "maximum": 65535,
                        "minimum": 0,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "fec_block_height": {
                        "description": "height of block over which FEC is calculated in packets",
                        "maximum": 200,
                        "minimum": 4,
                        "type": "integer"
                    },
                    "fec_block_width": {
                        "description": "width of block over which FEC is calculated in packets",
                        "maximum": 200,
                        "minimum": 4,
                        "type": "integer"
                    },
                    "fec_destination_ip": {
                        "anyOf": [
                            {
                                "format": "ipv4"
                            },
                            {
                                "format": "ipv6"
                            },
                            {
                                "pattern": "^auto$"
                            }
                        ],
                        "description": "May be used if NAT is being used at the destination (auto = destination_ip by default)",
                        "type": "string"
                    },
                    "fec_enabled": {
                        "description": "FEC on/off",
                        "type": "boolean"
                    },
                    "fec_mode": {
                        "description": "forward error correction mode to apply",
                        "enum": [
                            "1D",
                            "2D"
                        ],
                        "type": "string"
                    },
                    "fec_type": {
                        "description": "forward error correction mode to apply",
                        "enum": [
                            "XOR",
                            "Reed-Solomon"
                        ],
                        "type": "string"
                    },
                    "rtcp_destination_ip": {
                        "anyOf": [
                            {
                                "format": "ipv4"
                            },
                            {
                                "format": "ipv6"
                            },
                            {
                                "pattern": "^auto$"
                            }
                        ],
                        "description": "IP address to which RTCP packets will be sent (auto = same as RTP destination_ip by default)",
                        "type": "string"
                    },
                    "rtcp_destination_port": {
                        "description": "destination port for RTCP packets (auto = RTP destination_port + 1 by default)",
                        "maximum": 65535,
                        "minimum": 1,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "rtcp_enabled": {
                        "description": "rtcp on/off",
                        "type": "boolean"
                    },
                    "rtcp_source_port": {
                        "description": "source port for RTCP packets (auto = RTP source_port + 1 by default)",
                        "maximum": 65535,
                        "minimum": 0,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "rtp_enabled": {
                        "description": "RTP transmission active/inactive",
                        "type": "boolean"
                    },
                    "source_ip": {
                        "anyOf": [
                            {
                                "format": "ipv4"
                            },
                            {
                                "format": "ipv6"
                            },
                            {
                                "pattern": "^auto$"
                            }
                        ],
                        "description": "IP address from which RTP packets will be sent (IP address of interface bound to this output). The sender should provide an enum in the constraints endpoint, which should contain the available interface addresses. If the parameter is set to auto the sender should establish for itself which interface it should use, based on routing rules or its own internal configuration.",
                        "type": "string"
                    },
                    "source_port": {
                        "description": "source port for RTP packets (auto = 5004 by default)",
                        "maximum": 65535,
                        "minimum": 0,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    }
                },
                "title": "Sender Output",
                "type": "object"
            },
            "type": "array"
        },
        {
            "items": {
                "not": {}
            },
            "type": "array"
        },
        {
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "additionalProperties": false,
                "description": "Describes WebSocket Sender transport parameters. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint. WebSocket Senders must support all parameters in this schema.",
                "patternProperties": {
                    "^ext_[a-zA-Z0-9_]+$": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Describes external Sender transport parameters defined in other AMWA specifications. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint.",
                        "title": "External Sender Transport Parameters",
                        "type": [
                            "string",
                            "boolean",
                            "null",
                            "number"
                        ]
                    }
                },
                "properties": {
                    "connection_authorization": {
                        "description": "Indication of whether authorization is required to make a connection. If the parameter is set to auto the Sender should establish for itself whether authorization should be used, based on its own internal configuration.",
                        "enum": [
                            "auto",
                            true,
                            false
                        ],
                        "type": [
                            "string",
                            "boolean"
                        ]
                    },
                    "connection_uri": {
                        "anyOf": [
                            {
                                "pattern": "^auto$"
                            },
                            {
                                "format": "uri",
                                "pattern": "^wss?://.*"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "URI hosting the WebSocket server as defined in RFC 6455 Section 3. The sender should provide an enum in the constraints endpoint, which should contain the available interface addresses formatted as connection URIs. If the parameter is set to auto the sender should establish for itself which interface it should use, based on routing rules or its own internal configuration. A null value indicates that the sender has not yet been configured.",
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "title": "Sender Output",
                "type": "object"
            },
            "type": "array"
        },
        {
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "additionalProperties": false,
                "description": "Describes MQTT Sender transport parameters. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint. MQTT Senders must support all properties in this schema.",
                "patternProperties": {
                    "^ext_[a-zA-Z0-9_]+$": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Describes external Sender transport parameters defined in other AMWA specifications. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint.",
                        "title": "External Sender Transport Parameters",
                        "type": [
                            "string",
                            "boolean",
                            "null",
                            "number"
                        ]
                    }
                },
                "properties": {
                    "broker_authorization": {
                        "description": "Indication of whether authorization is used for communication with the broker. If the parameter is set to auto the Sender should establish for itself whether authorization should be used, based on a discovery mechanism or its own internal configuration.",
                        "enum": [
                            "auto",
                            true,
                            false
                        ],
                        "type": [
                            "string",
                            "boolean"
                        ]
                    },
                    "broker_protocol": {
                        "description": "Indication of whether TLS is used for communication with the broker. 'mqtt' indicates operation without TLS, and 'secure-mqtt' indicates use of TLS. If the parameter is set to auto the Sender should establish for itself which protocol it should use, based on a discovery mechanism or its own internal configuration.",
                        "enum": [
                            "auto",
                            "mqtt",
                            "secure-mqtt"
                        ],
                        "type": "string"
                    },
                    "broker_topic": {
                        "description": "The topic which MQTT messages will be sent to on the MQTT broker. A null value indicates that the Sender has not yet been configured.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "connection_status_broker_topic": {
                        "description": "The topic which MQTT status messages such as MQTT Last Will are sent to on the MQTT broker. A null value indicates that the Sender has not yet been configured, or is not using a connection status topic.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "destination_host": {
                        "anyOf": [
                            {
                                "pattern": "^auto$"
                            },
                            {
                                "format": "hostname"
                            },
                            {
                                "format": "ipv4"
                            },
                            {
                                "format": "ipv6"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Hostname or IP hosting the MQTT broker. If the parameter is set to auto the Sender should establish for itself which broker it should use, based on a discovery mechanism or its own internal configuration. A null value indicates that the Sender has not yet been configured.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "destination_port": {
                        "description": "Destination port for MQTT traffic. If the parameter is set to auto the Sender should establish for itself which broker it should use, based on a discovery mechanism or its own internal configuration.",
                        "maximum": 65535,
                        "minimum": 1,
                        "pattern": "^auto$",
                        "type": [
                            "integer",
                            "string"
                        ]
                    }
                },
                "title": "Sender Output",
                "type": "object"
            },
            "type": "array"
        }
    ],
    "description": "Transport-specific parameters. If this parameter is included in a client request it must include the same number of array elements (or 'legs') as specified in the constraints. If no changes are required to a specific leg it must be included as an empty object ({}).",
    "title": "Sender Transport Parameters"
}
