{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "filter-definition": {
            "type": "object",
            "properties": {
                "+": {
                    "$ref": "#/definitions/filter-items"
                },
                "plus": {
                    "$ref": "#/definitions/filter-items"
                },
                "-": {
                    "$ref": "#/definitions/filter-items"
                },
                "minus": {
                    "$ref": "#/definitions/filter-items"
                }
            },
            "x-sdk-ignore-properties": [
                "+",
                "-"
            ],
            "additionalProperties": false
        },
        "filter-items": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "string"
            }
        },
        "download-node": {
            "type": "object",
            "properties": {
                "level": {
                    "type": "string",
                    "enum": [
                        "project",
                        "session",
                        "acquisition",
                        "analysis"
                    ]
                },
                "_id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{24}$"
                }
            },
            "required": [
                "level",
                "_id"
            ],
            "additionalProperties": false
        },
        "download-filter": {
            "type": "object",
            "properties": {
                "tags": {
                    "$ref": "#/definitions/filter-definition"
                },
                "types": {
                    "$ref": "#/definitions/filter-definition"
                }
            }
        },
        "download-input": {
            "title": "Download",
            "type": "object",
            "properties": {
                "optional": {
                    "type": "boolean"
                },
                "nodes": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/download-node"
                    }
                },
                "filters": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/download-filter"
                    }
                }
            },
            "required": [
                "optional",
                "nodes"
            ],
            "additionalProperties": false
        },
        "download-ticket": {
            "type": "object",
            "properties": {
                "ticket": {
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "ticket"
            ]
        }
    },
    "properties": {
        "filter-definition": {
            "$ref": "#/definitions/filter-definition"
        },
        "filter-items": {
            "$ref": "#/definitions/filter-items"
        },
        "download-node": {
            "$ref": "#/definitions/download-node"
        },
        "download-filter": {
            "$ref": "#/definitions/download-filter"
        },
        "download-input": {
            "$ref": "#/definitions/download-input"
        },
        "download-ticket": {
            "$ref": "#/definitions/download-ticket"
        }
    },
    "required": [
        "filter-definition",
        "filter-items",
        "download-node",
        "download-filter",
        "download-input",
        "download-ticket"
    ]
}