{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "description": "The queue pickup suspension configuration",
    "markdownDescription": "The [queue pickup suspension](https://docs.halon.io/manual/archive/master/queue.html#queue-pickup-suspension) configuration",
    "additionalProperties": false,
    "required": [
        "version"
    ],
    "properties": {
        "version": {
            "type": "string",
            "enum": [
                "6.11"
            ],
            "description": "The software version the configuration was created for"
        },
        "suspends": {
            "type": "array",
            "uniqueItems": false,
            "description": "The suspends",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "jobid": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/jobid"
                            },
                            {
                                "$ref": "#/definitions/regex"
                            }
                        ]
                    },
                    "tenantid": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/tenantid"
                            },
                            {
                                "$ref": "#/definitions/regex"
                            }
                        ]
                    },
                    "grouping": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/wildcard"
                            },
                            {
                                "$ref": "#/definitions/grouping"
                            },
                            {
                                "$ref": "#/definitions/regex"
                            }
                        ]
                    },
                    "localip": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/ipv4"
                            },
                            {
                                "$ref": "#/definitions/ipv4net"
                            },
                            {
                                "$ref": "#/definitions/ipv6"
                            },
                            {
                                "$ref": "#/definitions/ipv6net"
                            }
                        ]
                    },
                    "remoteip": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/ipv4"
                            },
                            {
                                "$ref": "#/definitions/ipv4net"
                            },
                            {
                                "$ref": "#/definitions/ipv6"
                            },
                            {
                                "$ref": "#/definitions/ipv6net"
                            }
                        ]
                    },
                    "transportid": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/objectid"
                            },
                            {
                                "$ref": "#/definitions/regex"
                            }
                        ]
                    },
                    "recipientdomain": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/domain"
                            },
                            {
                                "$ref": "#/definitions/wildcard"
                            },
                            {
                                "$ref": "#/definitions/regex"
                            }
                        ]
                    },
                    "remotemx": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/list"
                            },
                            {
                                "$ref": "#/definitions/domain"
                            },
                            {
                                "$ref": "#/definitions/wildcard"
                            },
                            {
                                "$ref": "#/definitions/regex"
                            }
                        ]
                    },
                    "tag": {
                        "$ref": "#/definitions/tag"
                    },
                    "properties": {
                        "$ref": "#/definitions/properties"
                    }
                }
            }
        }
    },
    "definitions": {
        "list": {
            "type": "string",
            "pattern": "^@[a-zA-Z0-9-_.]+$",
            "minLength": 2,
            "maxLength": 64
        },
        "jobid": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$).*$",
            "minLength": 1
        },
        "tenantid": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$).*$",
            "minLength": 1
        },
        "grouping": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$).*$",
            "minLength": 1
        },
        "objectid": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9-_.]+$",
            "minLength": 1,
            "maxLength": 64
        },
        "tag": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_.-]+$",
            "minLength": 1,
            "maxLength": 32
        },
        "properties": {
            "type": "object",
            "additionalProperties": {
                "oneOf": [
                    {
                        "type": "string",
                        "minLength": 1
                    },
                    {
                        "type": "number",
                        "minimum": 1
                    },
                    {
                        "type": "boolean"
                    }
                ]
            }
        },
        "domain": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)[a-zA-Z0-9_.-]+$",
            "minLength": 1
        },
        "ipv4": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(?:(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(\\.(?!$)|$)){4}$",
            "minLength": 7
        },
        "ipv4net": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(?:(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(\\.(?!$)|\/[0-9]+$)){4}$",
            "minLength": 9
        },
        "ipv6": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$",
            "minLength": 3
        },
        "ipv6net": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/[0-9]+$",
            "minLength": 3
        },
        "regex": {
            "type": "string",
            "pattern": "^/.*/$",
            "minLength": 2
        },
        "wildcard": {
            "type": "string",
            "pattern": "^[*][.][a-zA-Z0-9_.-]+$",
            "minLength": 3
        }
    }
}