{
    "title": "jobsFilter",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.job.JobsFilter",
    "type": "object",
    "properties": {
        "controllerId": {
            "type": "string",
            "pattern": "^[^/\\<>?:\"|*]*$",
            "maxLength": 100
        },
        "jobs": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobPath",
                "type": "object",
                "required": [
                    "workflowPath"
                ],
                "properties": {
                    "workflowPath": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "job": {
                        "description": "if job undefined or empty then all jobs of specified workflow are requested",
                        "type": "string"
                    }
                }
            }
        },
        "excludeJobs": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobPath",
                "type": "object",
                "required": [
                    "workflowPath"
                ],
                "properties": {
                    "workflowPath": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "job": {
                        "description": "if job undefined or empty then all jobs of specified workflow are requested",
                        "type": "string"
                    }
                }
            }
        },
        "jobName": {
            "type": "string",
            "pattern": "^[^<>]*$",
            "maxLength": 255
        },
        "workflowPath": {
            "description": "pattern with wildcards '*' and '?' where '*' match zero or more characters and '?' match any single character",
            "type": "string",
            "pattern": "^[^<>]*$",
            "maxLength": 255
        },
        "workflowName": {
            "description": "pattern with wildcards '*' and '?' where '*' match zero or more characters and '?' match any single character",
            "type": "string",
            "pattern": "^[^<>]*$",
            "maxLength": 255
        },
        "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})?)?$"
        },
        "timeZone": {
            "description": "see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones",
            "type": "string"
        },
        "folders": {
            "type": "array",
            "items": {
                "type": "object",
                "javaType": "com.sos.joc.model.common.Folder",
                "required": [
                    "folder"
                ],
                "properties": {
                    "folder": {
                        "description": "absolute path of an object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "recursive": {
                        "type": "boolean",
                        "default": true
                    }
                },
                "additionalProperties": false
            }
        },
        "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"
                ]
            }
        },
        "criticalities": {
            "type": "array",
            "items": {
                "javaType": "com.sos.inventory.model.job.JobCriticality",
                "type": "string",
                "enum": [
                    "NORMAL",
                    "CRITICAL"
                ]
            }
        },
        "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",
                    "position"
                ],
                "properties": {
                    "historyId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "position": {
                        "type": "string"
                    }
                }
            }
        }
    }
}