{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "globalSettings": {
            "type": "object",
            "properties": {
                "namespaceAliases": {
                    "type": "array",
                    "items": {
                        "properties": {
                            "alias": {
                                "type": "string"
                            },
                            "namespace": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "alias",
                            "namespace"
                        ]
                    }
                },
                "defaultParameters": {
                    "type": "array",
                    "items": {
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "parameters": {
                                "type": "object"
                            }
                        },
                        "required": [
                            "type",
                            "parameters"
                        ]
                    }
                }
            }
        },
        "deviceGroups": {
            "type": "array",
            "items": {
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "devices": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "deviceId": {
                                    "type": "string"
                                },
                                "deviceSecret": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "deviceId",
                                "deviceSecret"
                            ]
                        }
                    },
                    "jobs": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "interval": {
                                    "type": "string"
                                },
                                "sourceFilter": {
                                    "$ref": "#/definitions/filter"
                                },
                                "intermediaFilters": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/filter"
                                    }
                                },
                                "sinkFilter": {
                                    "$ref": "#/definitions/filter"
                                }
                            }
                        }
                    }
                },
                "required": [
                    "name",
                    "devices",
                    "jobs"
                ]
            }
        }
    },
    "required": [
        "deviceGroups"
    ],
    "definitions": {
        "filter": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "parameters": {
                    "type": "object"
                }
            },
            "required": [
                "name",
                "type"
            ]
        }
    }
}