{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
        },
        "integrationType": {
            "type": "string",
            "enum": [
                "googlePubSub",
                "meridian",
                "mqtt",
                "particle"
            ]
        },
        "enabled": {
            "type": "boolean"
        },
        "topics": {
            "type": "array",
            "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
            }
        },
        "googlePubSubConfig": {
            "type": "object",
            "properties": {
                "projectId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "keyJson": {
                    "type": "string",
                    "maxLength": 32767,
                    "minLength": 4
                }
            },
            "additionalProperties": false,
            "required": [
                "projectId",
                "keyJson"
            ]
        },
        "mqttConfig": {
            "type": "object",
            "properties": {
                "clientId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "username": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "clean": {
                    "type": "boolean"
                },
                "port": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 65535
                },
                "protocol": {
                    "type": "string",
                    "enum": [
                        "mqtt",
                        "mqtts",
                        "ws",
                        "wss"
                    ]
                },
                "host": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "privateKey": {
                    "type": "string",
                    "maxLength": 32767,
                    "minLength": 4
                },
                "certificate": {
                    "type": "string",
                    "maxLength": 32767,
                    "minLength": 4
                },
                "caCertificate": {
                    "type": "string",
                    "maxLength": 32767,
                    "minLength": 4
                }
            },
            "additionalProperties": false,
            "required": [
                "port",
                "protocol",
                "host"
            ]
        },
        "particleConfig": {
            "type": "object",
            "properties": {
                "accessToken": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "productSlugOrId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "orgSlugOrId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "deviceNameOrId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                }
            },
            "additionalProperties": false,
            "required": [
                "accessToken"
            ]
        },
        "meridianConfig": {
            "type": "object",
            "properties": {
                "authenticationToken": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "locationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                },
                "assetUpdates": {
                    "type": "boolean"
                },
                "zoneUpdates": {
                    "type": "boolean"
                }
            },
            "additionalProperties": false,
            "required": [
                "authenticationToken",
                "locationId"
            ]
        }
    },
    "additionalProperties": false
}