{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "rule-items": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "file.type",
                            "file.name",
                            "file.measurements",
                            "container.has-type",
                            "container.has-measurement"
                        ]
                    },
                    "value": {
                        "type": "string"
                    },
                    "regex": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "type",
                    "value"
                ],
                "additionalProperties": false
            }
        },
        "rule-input": {
            "type": "object",
            "properties": {
                "_id": {
                    "type": "string"
                },
                "project_id": {
                    "type": "string"
                },
                "alg": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "any": {
                    "$ref": "#/definitions/rule-items"
                },
                "all": {
                    "$ref": "#/definitions/rule-items"
                },
                "disabled": {
                    "type": "boolean"
                }
            },
            "additionalProperties": false,
            "x-sdk-model": "rule"
        },
        "rule-output": {
            "type": "object",
            "properties": {
                "_id": {
                    "type": "string"
                },
                "alg": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "any": {
                    "$ref": "#/definitions/rule-items"
                },
                "all": {
                    "$ref": "#/definitions/rule-items"
                },
                "disabled": {
                    "type": "boolean"
                }
            },
            "x-sdk-model": "rule"
        }
    },
    "properties": {
        "rule-items": {
            "$ref": "#/definitions/rule-items"
        },
        "rule-input": {
            "$ref": "#/definitions/rule-input"
        },
        "rule-output": {
            "$ref": "#/definitions/rule-output"
        }
    },
    "required": [
        "rule-items",
        "rule-input",
        "rule-output"
    ]
}