{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "http://json-schema.int.adscore.com/zone/update.schema.json",
	"title": "Zone Update",
	"description": "Update Zone",
	"type": "object",
	"required": [
		"route_params"
	],
	"properties": {
		"route": {
			"type": "object",
			"properties": {
				"path": {
					"const": "/account/{account_id}/zone/{id}"
				},
				"methods": {
					"const": ["PUT"]
				}
			}
		},
		"route_params": {
			"type": "object",
			"description": "Route attributes",
			"required": [
				"account_id",
				"id"
			],
			"properties": {
				"account_id": {
					"type": "integer"
				},
				"id": {
					"type": "integer"
				}
			}
		},
		"body": {
			"type": "object",
			"description": "Zone data",
			"properties": {
				"id": {
					"type": "integer"
				},
				"name": {
					"type": "string",
					"description": "Name of the Zone",
					"minLength": 1
				},
				"request_auth": {
					"oneOf": [
						{
							"type": "string",
							"enum": ["hash_sha256", "sign_sha256"]
						},
						{
							"const": null
						}
					]
				},
				"response_auth": {
					"type": "string",
					"enum": [
                        "hash_sha256", "sign_sha256", 
                        "v5_0200H", "v5_0200S", "v5_0200I", "v5_0200M", "v5_0200J", 
                        "v5_0201H", "v5_0201S", "v5_0201I", "v5_0201M", "v5_0201J",
                        "v5_0101H", "v5_0101S", "v5_0101I", "v5_0101M", "v5_0101J"
                    ]
				},
				"request_referrer": {
					"oneOf": [
						{
							"type": "string",
							"maxLength": 255,
							"format": "url_with_wildcard"
						},
						{
							"type": "array",
							"items": {
								"type": "string",
								"maxLength": 255,
								"format": "url_with_wildcard"
							}
						},
						{
							"const": null
						}
					]
				},
				"external_sub_id_url": {
					"oneOf": [
						{
							"type": "string",
							"maxLength": 255,
							"format": "url_with_parameters"
						},
						{
							"const": null
						}
					],
					"description": "Traffic provider's SubID information page URL"
				},
				"traffic_options": {
					"type": "object",
					"properties": {
						"enable_subid_anomaly_detection": {
							"type": "boolean",
							"default": true
						},
						"allow_good_bots": {
							"type": "boolean",
							"default": false
						},
						"allow_google_scanners": {
							"type": "boolean",
							"default": false
						},
						"enable_anti_piracy_compliance": {
							"type": "boolean",
							"default": false
						},
						"allow_lite_processing": {
							"type": "boolean",
							"default": false
						},
						"iframe_handling": {
							"type": "string",
							"enum": ["auto", "deny"],
							"default": "auto"
						},
						"subid_source": {
							"type": "string",
							"enum": ["parameter", "location_domain", "referrer_domain", "location_param_utm_source", "location_param_utm_campaign", "location_param_utm_medium"],
							"default": "parameter"
						},
						"enable_compliance_intelligence": {
							"type": "boolean",
							"default": true
						},
						"enable_referrer_blacklisting": {
							"type": "boolean",
							"default": true
						},
						"mobile_request_as_desktop_traffic": {
							"type": "boolean",
							"default": true
						}
					}
				},
				"custom_fields":  {
					"description": "List of keys of custom fields that are present in SignatureV5. Full current list of available keys can be obtained from /list/zone_custom_fields",
					"oneOf": [
						{
							"type": "array",
							"format": "zone_custom_fields"
						},
						{
							"const": null
						}
					]
				}
			},
			"additionalProperties": false
		},
		"query": {
			"type": "object",
			"description": "Optional conditions",
			"properties": {
				"token": {
					"type": "string",
					"description": "2FA token, currently disabled (does no effect)",
					"minLength": 1
				}
			},
			"additionalProperties": false
		}
	}
}
		