{
    "$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": "MQTT Sender Transport Parameters",
    "type": "object"
}
