{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "route-configuration",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "executor_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        "address_family": {
          "enum": [
            "ipv4",
            "ipv6"
          ]
        },
        "expected_public_ip": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "type": "string",
                  "format": "ipv4"
                },
                {
                  "type": "string",
                  "format": "ipv6"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "max_concurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128
        },
        "driver": {
          "const": "php_https"
        },
        "endpoint_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "node_secret_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        }
      },
      "required": [
        "executor_id",
        "address_family",
        "expected_public_ip",
        "weight",
        "max_concurrency",
        "driver",
        "endpoint_url",
        "node_secret_id"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "executor_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        "address_family": {
          "enum": [
            "ipv4",
            "ipv6"
          ]
        },
        "expected_public_ip": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "type": "string",
                  "format": "ipv4"
                },
                {
                  "type": "string",
                  "format": "ipv6"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "max_concurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128
        },
        "driver": {
          "const": "bound_ip"
        },
        "source_address": {
          "oneOf": [
            {
              "type": "string",
              "format": "ipv4"
            },
            {
              "type": "string",
              "format": "ipv6"
            }
          ]
        },
        "interface_reference": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.-]{1,32}$"
        }
      },
      "required": [
        "executor_id",
        "address_family",
        "expected_public_ip",
        "weight",
        "max_concurrency",
        "driver",
        "source_address",
        "interface_reference"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "executor_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        "address_family": {
          "enum": [
            "ipv4",
            "ipv6"
          ]
        },
        "expected_public_ip": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "type": "string",
                  "format": "ipv4"
                },
                {
                  "type": "string",
                  "format": "ipv6"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "max_concurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128
        },
        "driver": {
          "const": "openvpn"
        },
        "profile_version_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        }
      },
      "required": [
        "executor_id",
        "address_family",
        "expected_public_ip",
        "weight",
        "max_concurrency",
        "driver",
        "profile_version_id"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "executor_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        "address_family": {
          "enum": [
            "ipv4",
            "ipv6"
          ]
        },
        "expected_public_ip": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "type": "string",
                  "format": "ipv4"
                },
                {
                  "type": "string",
                  "format": "ipv6"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "max_concurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128
        },
        "driver": {
          "const": "wireguard"
        },
        "profile_version_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        }
      },
      "required": [
        "executor_id",
        "address_family",
        "expected_public_ip",
        "weight",
        "max_concurrency",
        "driver",
        "profile_version_id"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "executor_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        "address_family": {
          "enum": [
            "ipv4",
            "ipv6"
          ]
        },
        "expected_public_ip": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "type": "string",
                  "format": "ipv4"
                },
                {
                  "type": "string",
                  "format": "ipv6"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "max_concurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128
        },
        "driver": {
          "const": "http_connect"
        },
        "proxy_host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "proxy_port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "authentication_secret_id": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "dns_mode": {
          "enum": [
            "local_validated",
            "proxy_resolved"
          ]
        },
        "proxy_transport": {
          "enum": [
            "tls",
            "private_plain"
          ]
        },
        "private_proxy_enrolled": {
          "type": "boolean"
        }
      },
      "required": [
        "executor_id",
        "address_family",
        "expected_public_ip",
        "weight",
        "max_concurrency",
        "driver",
        "proxy_host",
        "proxy_port",
        "authentication_secret_id",
        "dns_mode"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "executor_id": {
          "type": "string",
          "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
        },
        "address_family": {
          "enum": [
            "ipv4",
            "ipv6"
          ]
        },
        "expected_public_ip": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "type": "string",
                  "format": "ipv4"
                },
                {
                  "type": "string",
                  "format": "ipv6"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "max_concurrency": {
          "type": "integer",
          "minimum": 1,
          "maximum": 128
        },
        "driver": {
          "const": "socks5"
        },
        "proxy_host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "proxy_port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "authentication_secret_id": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "dns_mode": {
          "enum": [
            "local_validated",
            "proxy_resolved"
          ]
        },
        "proxy_transport": {
          "enum": [
            "tls",
            "private_plain"
          ]
        },
        "private_proxy_enrolled": {
          "type": "boolean"
        }
      },
      "required": [
        "executor_id",
        "address_family",
        "expected_public_ip",
        "weight",
        "max_concurrency",
        "driver",
        "proxy_host",
        "proxy_port",
        "authentication_secret_id",
        "dns_mode"
      ]
    }
  ]
}
