{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-dns/json-schema/google-cloud-dns-response-policy-rules-patch-response-schema.json",
  "title": "ResponsePolicyRulesPatchResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-dns-response-policy-rules-api-openapi.yml#/components/schemas/ResponsePolicyRulesPatchResponse",
  "properties": {
    "responsePolicyRule": {
      "$ref": "#/$defs/ResponsePolicyRule"
    }
  },
  "type": "object",
  "$defs": {
    "RRSetRoutingPolicy": {
      "description": "A RRSetRoutingPolicy represents ResourceRecordSet data that is returned dynamically with the response varying based on configured properties such as geolocation or by weighted random selection.",
      "type": "object",
      "properties": {
        "wrr": {
          "$ref": "#/$defs/RRSetRoutingPolicyWrrPolicy"
        },
        "primaryBackup": {
          "$ref": "#/$defs/RRSetRoutingPolicyPrimaryBackupPolicy"
        },
        "geo": {
          "$ref": "#/$defs/RRSetRoutingPolicyGeoPolicy"
        },
        "kind": {
          "type": "string",
          "readOnly": true,
          "default": "dns#rRSetRoutingPolicy"
        },
        "healthCheck": {
          "description": "The fully qualified URL of the HealthCheck to use for this RRSetRoutingPolicy. Format this URL like `https://www.googleapis.com/compute/v1/projects/{project}/global/healthChecks/{healthCheck}`. https://cloud.google.com/compute/docs/reference/rest/v1/healthChecks",
          "type": "string"
        }
      }
    },
    "RRSetRoutingPolicyGeoPolicy": {
      "description": "Configures a `RRSetRoutingPolicy` that routes based on the geo location of the querying user.",
      "type": "object",
      "properties": {
        "kind": {
          "readOnly": true,
          "default": "dns#rRSetRoutingPolicyGeoPolicy",
          "type": "string"
        },
        "items": {
          "description": "The primary geo routing configuration. If there are multiple items with the same location, an error is returned instead.",
          "items": {
            "$ref": "#/$defs/RRSetRoutingPolicyGeoPolicyGeoPolicyItem"
          },
          "type": "array"
        },
        "enableFencing": {
          "description": "Without fencing, if health check fails for all configured items in the current geo bucket, we failover to the next nearest geo bucket. With fencing, if health checking is enabled, as long as some targets in the current geo bucket are healthy, we return only the healthy targets. However, if all targets are unhealthy, we don't failover to the next nearest bucket; instead, we return all the items in the current bucket even when all targets are unhealthy.",
          "type": "boolean"
        }
      }
    },
    "RRSetRoutingPolicyGeoPolicyGeoPolicyItem": {
      "description": "ResourceRecordSet data for one geo location.",
      "type": "object",
      "properties": {
        "kind": {
          "default": "dns#rRSetRoutingPolicyGeoPolicyGeoPolicyItem",
          "readOnly": true,
          "type": "string"
        },
        "healthCheckedTargets": {
          "$ref": "#/$defs/RRSetRoutingPolicyHealthCheckTargets",
          "description": "For A and AAAA types only. Endpoints to return in the query result only if they are healthy. These can be specified along with `rrdata` within this item."
        },
        "location": {
          "description": "The geo-location granularity is a GCP region. This location string should correspond to a GCP region. e.g. \"us-east1\", \"southamerica-east1\", \"asia-east1\", etc.",
          "type": "string"
        },
        "signatureRrdatas": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "DNSSEC generated signatures for all the `rrdata` within this item. When using health-checked targets for DNSSEC-enabled zones, you can only use at most one health-checked IP address per item."
        },
        "rrdatas": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      }
    },
    "RRSetRoutingPolicyHealthCheckTargets": {
      "type": "object",
      "properties": {
        "internalLoadBalancers": {
          "type": "array",
          "description": "Configuration for internal load balancers to be health checked.",
          "items": {
            "$ref": "#/$defs/RRSetRoutingPolicyLoadBalancerTarget"
          }
        },
        "externalEndpoints": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "The Internet IP addresses to be health checked. The format matches the format of ResourceRecordSet.rrdata as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1)"
        }
      },
      "description": "HealthCheckTargets describes endpoints to health-check when responding to Routing Policy queries. Only the healthy endpoints will be included in the response. Set either `internal_load_balancer` or `external_endpoints`. Do not set both."
    },
    "RRSetRoutingPolicyLoadBalancerTarget": {
      "description": "The configuration for an individual load balancer to health check.",
      "properties": {
        "ipAddress": {
          "description": "The frontend IP address of the load balancer to health check.",
          "type": "string"
        },
        "port": {
          "description": "The configured port of the load balancer.",
          "type": "string"
        },
        "ipProtocol": {
          "description": "The protocol of the load balancer to health check.",
          "type": "string",
          "enum": [
            "undefined",
            "tcp",
            "udp"
          ]
        },
        "project": {
          "description": "The project ID in which the load balancer is located.",
          "type": "string"
        },
        "kind": {
          "default": "dns#rRSetRoutingPolicyLoadBalancerTarget",
          "readOnly": true,
          "type": "string"
        },
        "loadBalancerType": {
          "description": "The type of load balancer specified by this target. This value must match the configuration of the load balancer located at the LoadBalancerTarget's IP address, port, and region. Use the following: - *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. - *regionalL7ilb*: for a regional internal Application Load Balancer. - *globalL7ilb*: for a global internal Application Load Balancer. ",
          "type": "string",
          "enum": [
            "none",
            "globalL7ilb",
            "regionalL4ilb",
            "regionalL7ilb"
          ]
        },
        "region": {
          "type": "string",
          "description": "The region in which the load balancer is located."
        },
        "networkUrl": {
          "description": "The fully qualified URL of the network that the load balancer is attached to. This should be formatted like `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "RRSetRoutingPolicyPrimaryBackupPolicy": {
      "description": "Configures a RRSetRoutingPolicy such that all queries are responded with the primary_targets if they are healthy. And if all of them are unhealthy, then we fallback to a geo localized policy.",
      "properties": {
        "kind": {
          "type": "string",
          "default": "dns#rRSetRoutingPolicyPrimaryBackupPolicy",
          "readOnly": true
        },
        "backupGeoTargets": {
          "$ref": "#/$defs/RRSetRoutingPolicyGeoPolicy",
          "description": "Backup targets provide a regional failover policy for the otherwise global primary targets. If serving state is set to `BACKUP`, this policy essentially becomes a geo routing policy."
        },
        "trickleTraffic": {
          "type": "number",
          "description": "When serving state is `PRIMARY`, this field provides the option of sending a small percentage of the traffic to the backup targets.",
          "format": "double"
        },
        "primaryTargets": {
          "$ref": "#/$defs/RRSetRoutingPolicyHealthCheckTargets",
          "description": "Endpoints that are health checked before making the routing decision. Unhealthy endpoints are omitted from the results. If all endpoints are unhealthy, we serve a response based on the `backup_geo_targets`."
        }
      },
      "type": "object"
    },
    "RRSetRoutingPolicyWrrPolicy": {
      "type": "object",
      "description": "Configures a RRSetRoutingPolicy that routes in a weighted round robin fashion.",
      "properties": {
        "kind": {
          "type": "string",
          "readOnly": true,
          "default": "dns#rRSetRoutingPolicyWrrPolicy"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/RRSetRoutingPolicyWrrPolicyWrrPolicyItem"
          },
          "type": "array"
        }
      }
    },
    "RRSetRoutingPolicyWrrPolicyWrrPolicyItem": {
      "properties": {
        "signatureRrdatas": {
          "items": {
            "type": "string"
          },
          "description": "DNSSEC generated signatures for all the `rrdata` within this item. When using health-checked targets for DNSSEC-enabled zones, you can only use at most one health-checked IP address per item.",
          "type": "array"
        },
        "weight": {
          "description": "The weight corresponding to this `WrrPolicyItem` object. When multiple `WrrPolicyItem` objects are configured, the probability of returning an `WrrPolicyItem` object's data is proportional to its weight relative to the sum of weights configured for all items. This weight must be non-negative.",
          "format": "double",
          "type": "number"
        },
        "rrdatas": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "kind": {
          "readOnly": true,
          "type": "string",
          "default": "dns#rRSetRoutingPolicyWrrPolicyWrrPolicyItem"
        },
        "healthCheckedTargets": {
          "$ref": "#/$defs/RRSetRoutingPolicyHealthCheckTargets",
          "description": "Endpoints that are health checked before making the routing decision. The unhealthy endpoints are omitted from the result. If all endpoints within a bucket are unhealthy, we choose a different bucket (sampled with respect to its weight) for responding. If DNSSEC is enabled for this zone, only one of `rrdata` or `health_checked_targets` can be set."
        }
      },
      "type": "object",
      "description": "A routing block which contains the routing information for one WRR item."
    },
    "ResourceRecordSet": {
      "description": "A unit of data that is returned by the DNS servers.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "For example, www.example.com."
        },
        "rrdatas": {
          "description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "type": {
          "type": "string",
          "description": "The identifier of a supported record type. See the list of Supported DNS record types."
        },
        "ttl": {
          "description": "Number of seconds that this `ResourceRecordSet` can be cached by resolvers.",
          "format": "int32",
          "type": "integer"
        },
        "routingPolicy": {
          "$ref": "#/$defs/RRSetRoutingPolicy",
          "description": "Configures dynamic query responses based on either the geo location of the querying user or a weighted round robin based routing policy. A valid `ResourceRecordSet` contains only `rrdata` (for static resolution) or a `routing_policy` (for dynamic resolution)."
        },
        "signatureRrdatas": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "kind": {
          "readOnly": true,
          "default": "dns#resourceRecordSet",
          "type": "string"
        }
      }
    },
    "ResponsePolicyRule": {
      "type": "object",
      "description": "A Response Policy Rule is a selector that applies its behavior to queries that match the selector. Selectors are DNS names, which may be wildcards or exact matches. Each DNS query subject to a Response Policy matches at most one ResponsePolicyRule, as identified by the dns_name field with the longest matching suffix.",
      "properties": {
        "localData": {
          "$ref": "#/$defs/ResponsePolicyRuleLocalData",
          "description": "Answer this query directly with DNS data. These ResourceRecordSets override any other DNS behavior for the matched name; in particular they override private zones, the public internet, and GCP internal DNS. No SOA nor NS types are allowed."
        },
        "kind": {
          "readOnly": true,
          "default": "dns#responsePolicyRule",
          "type": "string"
        },
        "ruleName": {
          "type": "string",
          "description": "An identifier for this rule. Must be unique with the ResponsePolicy."
        },
        "dnsName": {
          "description": "The DNS name (wildcard or exact) to apply this rule to. Must be unique within the Response Policy Rule.",
          "type": "string"
        },
        "behavior": {
          "description": "Answer this query with a behavior rather than DNS data.",
          "type": "string",
          "enum": [
            "behaviorUnspecified",
            "bypassResponsePolicy"
          ]
        }
      }
    },
    "ResponsePolicyRuleLocalData": {
      "type": "object",
      "properties": {
        "localDatas": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ResourceRecordSet"
          },
          "description": "All resource record sets for this selector, one per resource record type. The name must match the dns_name."
        }
      }
    }
  }
}