{
    "title": "jobsFilter",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.job.JobsFilter",
    "type": "object",
    "required": [
        "jobschedulerId"
    ],
    "properties": {
        "jobschedulerId": {
            "type": "string",
            "pattern": "^[^/\\<>?:\"|*]*$",
            "maxLength": 100
        },
        "jobs": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobPath",
                "type": "object",
                "required": [
                    "job"
                ],
                "properties": {
                    "job": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    }
                }
            }
        },
        "excludeJobs": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobPath",
                "type": "object",
                "required": [
                    "job"
                ],
                "properties": {
                    "job": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    }
                }
            }
        },
        "orders": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.OrderPath",
                "type": "object",
                "required": [
                    "jobChain"
                ],
                "properties": {
                    "jobChain": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "orderId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "state": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    }
                }
            }
        },
        "compact": {
            "description": "controls if the object view is compact or detailed",
            "type": "boolean",
            "default": false
        },
        "compactView": {
            "type": "boolean",
            "default": false
        },
        "regex": {
            "description": "regular expression to filter JobScheduler objects by matching the path",
            "type": "string",
            "pattern": "^((?!<script( |>)|<svg/on).)*$"
        },
        "isOrderJob": {
            "type": "boolean"
        },
        "dateFrom": {
            "description": "0 or [number][smhdwMy] (where smhdwMy unit for second, minute, etc) or ISO 8601 timestamp",
            "type": "string",
            "pattern": "^([+-]?0|([+-]?[0-9]+[smhdwMy])+|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}([,.]\\d{1,3})?)(Z|[+-]\\d{2}(:?\\d{2})?)?$"
        },
        "dateTo": {
            "description": "0 or [number][smhdwMy] (where smhdwMy unit for second, minute, etc) or ISO 8601 timestamp",
            "type": "string",
            "pattern": "^([+-]?0|([+-]?[0-9]+[smhdwMy])+|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}([,.]\\d{1,3})?)(Z|[+-]\\d{2}(:?\\d{2})?)?$"
        },
        "criticality": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobCriticalityFilter",
                "type": "string",
                "description": "Criticality of a job",
                "enum": [
                    "NORMAL",
                    "MINOR",
                    "MAJOR"
                ]
            }
        },
        "timeZone": {
            "type": "string",
            "pattern": "^[^<>]*$",
            "maxLength": 255
        },
        "folders": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.common.Folder",
                "type": "object",
                "required": [
                    "folder"
                ],
                "properties": {
                    "folder": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "recursive": {
                        "type": "boolean",
                        "default": true
                    }
                }
            }
        },
        "states": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobStateFilter",
                "type": "string",
                "description": "QUEUED is alias of WAITINGFORRESOURCE",
                "enum": [
                    "PENDING",
                    "RUNNING",
                    "WAITINGFORRESOURCE",
                    "QUEUED",
                    "STOPPED"
                ]
            }
        },
        "limit": {
            "description": "only for db history urls to restrict the number of responsed records; -1=unlimited",
            "type": "integer",
            "default": 10000
        },
        "historyStates": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.common.HistoryStateText",
                "type": "string",
                "enum": [
                    "SUCCESSFUL",
                    "INCOMPLETE",
                    "FAILED"
                ]
            }
        },
        "taskIds": {
            "type": "array",
            "items": {
                "type": "number",
                "format": "utc-millisec",
                "minimum": 0
            }
        },
        "historyIds": {
            "type": "array",
            "items": {
                "description": "Only relevant for order jobs; cause=order resp.",
                "javaType": "com.sos.joc.model.job.TaskIdOfOrder",
                "type": "object",
                "required": [
                    "historyId",
                    "state"
                ],
                "properties": {
                    "historyId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "state": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    }
                }
            }
        },
        "runTimeIsTemporary": {
            "type": "boolean"
        }
    }
}