{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$ref": "#/definitions/IDeploymentDescriptor",
    "definitions": {
        "IEmpty": {
            "type": "object"
        },
        "IDeploymentDescriptor": {
            "type": "object",
            "properties": {
                "$schema": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "asmApiUrl": {
                    "type": "string"
                },
                "asmUIUrl": {
                    "type": "string"
                },
                "authTicket": {
                    "type": "string"
                },
                "messageTemplate": {
                    "type": "string"
                },
                "messageHours": {
                    "type": "number"
                },
                "zebraScenarios": {
                    "$ref": "#/definitions/IZebraScenarios"
                },
                "browserScenarios": {
                    "type": "array",
                    "items": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "browserName": {
                                        "type": "string"
                                    },
                                    "version": {
                                        "type": "string"
                                    },
                                    "locationMatch": {
                                        "type": "string"
                                    },
                                    "url": {
                                        "type": "string"
                                    },
                                    "run": {
                                        "type": "boolean"
                                    }
                                },
                                "required": ["name"]
                            }
                        ]
                    }
                },
                "checks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IChecksGroup"
                    }
                }
            },
            "required": [
                "name",
                "description",
                "asmApiUrl",
                "asmUIUrl",
                "authTicket",
                "checks"
            ],
            "additionalProperties": false
        },
        "IZebraScenarios": {
            "type": "object",
            "properties": {
                "compileOptions": {
                    "$ref": "#/definitions/IZebraCompileOptions"
                },
                "groups": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IZebraScenarioGroup"
                    }
                }
            },
            "required": ["compileOptions", "groups"],
            "additionalProperties": false
        },
        "IZebraCompileOptions": {
            "type": "object",
            "properties": {
                "ContentTest": {
                    "$ref": "#/definitions/ContentTestType"
                },
                "NeedContentFilter": {
                    "type": "boolean"
                },
                "NeedErrorFilter": {
                    "type": "boolean"
                },
                "PageThinkTime": {
                    "type": "number"
                },
                "PageThinkTimeVariance": {
                    "$ref": "#/definitions/TimeVarianceType"
                },
                "ExternalXmlAndSoapRequestSize": {
                    "$ref": "#/definitions/ExternalXmlSizeType"
                },
                "PrxVersion": {
                    "type": "string"
                },
                "NtlmEnable": {
                    "type": "boolean"
                },
                "NtlmProtocol": {
                    "$ref": "#/definitions/NtlmProtocolType"
                },
                "NtlmDomain": {
                    "type": "string"
                },
                "NtlmUsername": {
                    "type": "string"
                },
                "NtlmPassword": {
                    "type": "string"
                },
                "NtlmCyberArkCommand": {
                    "type": "string"
                },
                "DisableHTTPProxyCache": {
                    "type": "boolean"
                },
                "HttpHost": {
                    "type": "string"
                },
                "HttpsHost": {
                    "type": "string"
                },
                "HttpPort": {
                    "type": "number"
                },
                "HttpsPort": {
                    "type": "number"
                },
                "AuthUsername": {
                    "type": "string"
                },
                "AuthPassword": {
                    "type": "string"
                },
                "ExcludeNextProxyFor": {
                    "type": "string"
                },
                "StripAcceptHeader": {
                    "type": "boolean"
                },
                "StripReferrerHeader": {
                    "type": "boolean"
                }
            },
            "required": [],
            "additionalProperties": false
        },
        "ContentTestType": {
            "type": "string",
            "enum": ["heuristic", "size", "none"]
        },
        "TimeVarianceType": {
            "type": "number",
            "enum": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
        },
        "ExternalXmlSizeType": {
            "type": "number",
            "enum": [0, 1024, 2048, 4096, 8192]
        },
        "NtlmProtocolType": {
            "type": "string",
            "enum": ["lm", "v1", "v2"]
        },
        "IZebraScenarioGroup": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "compileOptions": {
                    "$ref": "#/definitions/IZebraCompileOptions"
                },
                "scenarios": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IZebraScenario"
                    }
                },
                "disabled": {
                    "type": "boolean"
                },
                "directory": {
                    "type": "string",
                    "description": "The top directory in the source"
                }
            },
            "required": ["name", "compileOptions", "scenarios"],
            "additionalProperties": false
        },
        "IZebraScenario": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/ZebraScenarioType"
                },
                "plugins": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "files": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "subDirectory": {
                    "type": "string"
                }
            },
            "required": ["name", "type"],
            "additionalProperties": false
        },
        "ZebraScenarioType": {
            "type": "string",
            "enum": ["zip", "prxdat"]
        },
        "IChecksGroup": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "disabled": {
                    "type": "boolean"
                },
                "run": {
                    "$ref": "#/definitions/RunCheckType"
                },
                "monitorGroups": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "alerts": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IAlert"
                    }
                },
                "locationMatch": {
                    "type": "string"
                },
                "tags": {
                    "$ref": "#/definitions/ITag"
                },
                "zebraChecks": {
                    "$ref": "#/definitions/IZebraCheckGroup"
                },
                "urlChecks": {
                    "$ref": "#/definitions/IUrlCheckGroup"
                },
                "browserChecks": {
                    "$ref": "#/definitions/IBrowserCheckGroup"
                },
                "commandChecks": {
                    "$ref": "#/definitions/ICommandCheckGroup"
                }
            },
            "required": ["name", "run", "monitorGroups", "locationMatch"],
            "additionalProperties": false
        },
        "RunCheckType": {
            "type": "string",
            "enum": ["none", "all", "scheduled"]
        },
        "IAlert": {
            "type": "object",
            "properties": {
                "type": {
                    "$ref": "#/definitions/AlertType"
                },
                "name": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                }
            },
            "required": ["type", "name", "severity"],
            "additionalProperties": false
        },
        "AlertType": {
            "type": "string",
            "enum": ["email", "sms", "webhook"]
        },
        "ITag": {
            "type": "object",
            "allOf": [
                {
                    "type": "object",
                    "patternProperties": {
                        "^.*$": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            ]
        },
        "IHeader": {
            "type": "object",
            "allOf": [
                {
                    "type": "object",
                    "patternProperties": {
                        "^.*$": {
                            "type": "string"
                        }
                    }
                }
            ]
        },
        "IZebraCheckGroup": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckBase"
                }
            ],
            "properties": {
                "config": {
                    "$ref": "#/definitions/ICheckConfig"
                },
                "checks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IZebraCheck"
                    }
                }
            },
            "required": ["config", "checks"],
            "additionalProperties": true
        },
        "ICheck": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckBase"
                }
            ],
            "properties": {
                "id": {
                    "type": "number"
                }
            },
            "additionalProperties": true
        },
        "ICheckBase": {
            "type": "object",
            "properties": {
                "locationMatch": {
                    "type": "string"
                },
                "tags": {
                    "$ref": "#/definitions/ITag"
                }
            },
            "additionalProperties": true
        },
        "ICheckConfig": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "interval_seconds": {
                    "type": "number"
                },
                "max_attempts": {
                    "type": "number"
                },
                "attempt_pause": {
                    "type": "number",
                    "enum": [
                        0, 50, 100, 200, 500, 1000, 2000, 3000, 5000, 10000,
                        20000, 30000, 60000
                    ]
                },
                "location_code": {
                    "type": "string"
                },
                "fail_over": {
                    "type": "boolean",
                    "default": true
                },
                "check_fail_severity": {
                    "type": "string",
                    "default": "F"
                },
                "threshold_w": {
                    "type": "number"
                },
                "threshold_w_set_0": {
                    "type": "boolean"
                },
                "threshold_w_dynamic": {
                    "$ref": "#/definitions/IThresholdDynamic"
                },
                "threshold_e": {
                    "type": "number"
                },
                "threshold_e_set_0": {
                    "type": "boolean"
                },
                "threshold_e_dynamic": {
                    "$ref": "#/definitions/IThresholdDynamic"
                },
                "threshold_lo_w": {
                    "type": "number"
                },
                "threshold_lo_w_set_0": {
                    "type": "boolean"
                },
                "threshold_lo_w_dynamic": {
                    "$ref": "#/definitions/IThresholdDynamic"
                },
                "threshold_lo_e": {
                    "type": "number"
                },
                "threshold_lo_e_set_0": {
                    "type": "boolean"
                },
                "threshold_lo_e_dynamic": {
                    "$ref": "#/definitions/IThresholdDynamic"
                },
                "scheduled_inclusion": {
                    "type": "string"
                },
                "scheduled_exclusion": {
                    "type": "string"
                },
                "target_sla": {
                    "type": "number"
                },
                "target_sla_2": {
                    "type": "number"
                },
                "verify_ping": {
                    "type": "string"
                }
            },
            "required": [],
            "additionalProperties": true
        },
        "IThresholdDynamic": {
            "type": "object",
            "properties": {
                "baselineMeasure": {
                    "type": "string"
                },
                "baselinePeriodH": {
                    "type": "number"
                },
                "factor": {
                    "type": "number"
                },
                "offset": {
                    "type": "number"
                }
            },
            "required": [
                "baselineMeasure",
                "baselinePeriodH",
                "factor",
                "offset"
            ],
            "additionalProperties": false
        },
        "IZebraCheck": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheck"
                }
            ],
            "properties": {
                "config": {
                    "$ref": "#/definitions/IZebraCheckConfig"
                }
            },
            "required": ["config"],
            "additionalProperties": true
        },
        "IZebraCheckConfig": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckConfig"
                }
            ],
            "properties": {
                "scenario_filename": {
                    "type": "string"
                },
                "scenario_file_type": {
                    "type": "string",
                    "default": "original"
                },
                "concurrent_users": {
                    "type": "number",
                    "enum": [1, 2, 3, 5, 10, 15, 20]
                },
                "test_duration": {
                    "type": "number",
                    "enum": [15, 30, 45, 60, 120, 180, 300, 360]
                },
                "request_timeout": {
                    "type": "number",
                    "enum": [10, 20, 30, 40, 50, 60, 120]
                },
                "start_delay": {
                    "type": "number",
                    "enum": [1, 2, 3, 5, 10, 20, 30, 50, 100, 200]
                },
                "max_loops": {
                    "type": "number",
                    "enum": [0, 1, 2, 3, 5, 10, 20, 40]
                },
                "statistics_sampling_interval": {
                    "type": "number"
                },
                "max_error_snapshot": {
                    "type": "number",
                    "enum": [1, 2, 3]
                },
                "percurlopt": {
                    "type": "number",
                    "enum": [0, 1, 2, 5, 7],
                    "description": "0 = No extra URL data. 1 = Extra performance data per individual request. 2 = Store Request Headers. 5 = Store Response Headers. 7 = Store both Request & Response headers."
                },
                "additional_options": {
                    "type": "string"
                },
                "unit": {
                    "type": "string",
                    "default": "ms"
                }
            },
            "required": ["scenario_filename"],
            "additionalProperties": true
        },
        "IUrlCheckGroup": {
            "type": "object",
            "anyOf": [
                {
                    "$ref": "#/definitions/ICheckBase"
                },
                {
                    "$ref": "#/definitions/IEmpty"
                }
            ],
            "properties": {
                "config": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/IUrlCheckConfig"
                        },
                        {
                            "$ref": "#/definitions/IEmpty"
                        }
                    ]
                },
                "checks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IUrlCheck"
                    }
                }
            },
            "required": ["config", "checks"],
            "additionalProperties": true
        },
        "IUrlCheckConfig": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckConfig"
                }
            ],
            "properties": {
                "url": {
                    "type": "string"
                },
                "request_method": {
                    "$ref": "#/definitions/RequestMethodType"
                },
                "authentication": {
                    "$ref": "#/definitions/IUrlAuthentication"
                },
                "content_pattern_type": {
                    "$ref": "#/definitions/ContentPatternType"
                },
                "content_pattern": {
                    "type": "string"
                },
                "content_pattern_case_sensitive": {
                    "type": "boolean"
                },
                "post_data": {
                    "type": "string"
                },
                "custom_hdrs": {
                    "$ref": "#/definitions/IHeader"
                },
                "max_redirects": {
                    "type": "number"
                },
                "disable_certificate_verification": {
                    "type": "boolean"
                }
            },
            "required": [],
            "additionalProperties": true
        },
        "RequestMethodType": {
            "type": "string",
            "enum": [
                "CONNECT",
                "DELETE",
                "HEAD",
                "GET",
                "OPTIONS",
                "PATCH",
                "POST",
                "PUT",
                "TRACE"
            ]
        },
        "IUrlAuthentication": {
            "type": "object",
            "properties": {
                "type": {
                    "$ref": "#/definitions/AuthType"
                },
                "username": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                }
            },
            "required": ["type"],
            "additionalProperties": false
        },
        "AuthType": {
            "type": "string",
            "enum": ["basic", "none"]
        },
        "ContentPatternType": {
            "type": "string",
            "enum": ["literal", "regex"]
        },
        "IUrlCheck": {
            "type": "object",
            "properties": {
                "config": {
                    "$ref": "#/definitions/IUrlCheckConfig"
                }
            },
            "allOf": [
                {
                    "$ref": "#/definitions/ICheck"
                }
            ],
            "required": ["config"],
            "additionalProperties": true
        },
        "IBrowserCheckGroup": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckBase"
                }
            ],
            "properties": {
                "browserName": {
                    "type": "string"
                },
                "minVersion": {
                    "type": "number",
                    "description": "Minimal version number"
                },
                "version": {
                    "type": "string",
                    "description": "Exact version string"
                },
                "config": {
                    "$ref": "#/definitions/IBrowserCheckConfig"
                },
                "checks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IBrowserCheck"
                    }
                }
            },
            "required": ["browserName", "minVersion", "config", "checks"],
            "additionalProperties": true
        },
        "IIgnoreType": {
            "type": "object",
            "properties": {
                "status_codes": {
                    "type": "string"
                },
                "types": {
                    "type": "string"
                }
            },
            "required": ["status_codes", "types"]
        },
        "IBrowserCheckConfig": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckConfig"
                }
            ],
            "properties": {
                "url": {
                    "type": "string"
                },
                "result_mode": {
                    "type": "integer",
                    "enum": [10, 20, 30, 40, 50, 60, 70, 80]
                },
                "custom_hdrs": {
                    "$ref": "#/definitions/IHeader"
                },
                "screen_resolution": {
                    "type": "string"
                },
                "screenshot_mode": {
                    "type": "string",
                    "enum": ["OnTransition", "OnError", "Always"]
                },
                "blurring_mode": {
                    "type": "integer"
                },
                "ignore_file_types": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IIgnoreType"
                    }
                },
                "ignore_mime_types": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IIgnoreType"
                    }
                },
                "block_domains": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "allow_domains": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "stop_urls": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "url_severity_mapping": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "url_format": {
                                "type": "string",
                                "enum": ["wildcard", "regex"]
                            },

                            "url": {
                                "type": "string"
                            },
                            "status_codes": {
                                "type": "string"
                            },
                            "severity": {
                                "type": "string",
                                "enum": ["I", "W", "E", "F"]
                            }
                        }
                    }
                },
                "url_severity_mapping_preserve_time": {
                    "type": "boolean"
                },
                "url_severity_mapping_error_wildcard": {
                    "type": "integer",
                    "enum": [0, 1, 2]
                }
            },
            "additionalProperties": true
        },
        "IBrowserCheck": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheck"
                }
            ],
            "properties": {
                "config": {
                    "$ref": "#/definitions/IBrowserCheckConfig"
                },
                "scenario": {
                    "type": "string"
                },
                "browserName": {
                    "type": "string"
                },
                "minVersion": {
                    "type": "number"
                },
                "version": {
                    "type": "string",
                    "description": "Exact version string"
                }
            },
            "required": ["config"],
            "additionalProperties": true
        },
        "ICommandCheckGroup": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckBase"
                }
            ],
            "properties": {
                "config": {
                    "$ref": "#/definitions/ICommandCheckConfig"
                },
                "checks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/ICommandCheck"
                    }
                }
            },
            "required": ["config", "checks"],
            "additionalProperties": true
        },
        "ICommandCheckConfig": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheckConfig"
                }
            ],
            "properties": {
                "unit": {
                    "type": "string"
                }
            },
            "additionalProperties": true,
            "required": []
        },
        "ICommandCheck": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/ICheck"
                }
            ],
            "properties": {
                "config": {
                    "$ref": "#/definitions/ICommandCheckConfig"
                },
                "category": {
                    "$ref": "#/definitions/CommandCategoryType"
                },
                "name": {
                    "type": "string"
                },
                "arguments": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/IArgument"
                    }
                }
            },
            "required": ["config", "category", "name", "arguments"],
            "additionalProperties": true
        },
        "CommandCategoryType": {
            "type": "string",
            "enum": [
                "Diagnostic",
                "DNS",
                "DNS v2",
                "Integrations",
                "FTP",
                "Security"
            ]
        },
        "IArgument": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": ["name", "value"],
            "additionalProperties": false
        }
    }
}
