{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-vpc-lattice/json-schema/amazon-vpc-lattice-batch-update-rule-request-schema.json",
  "title": "BatchUpdateRuleRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-vpc-lattice-batchupdaterule-api-openapi.yml#/components/schemas/BatchUpdateRuleRequest",
  "type": "object",
  "properties": {
    "serviceIdentifier": {
      "type": "string",
      "description": "The ID or ARN of the service."
    },
    "listenerIdentifier": {
      "type": "string",
      "description": "The ID or ARN of the listener."
    },
    "rules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RuleUpdate"
      },
      "description": "The rules for the specified listener."
    }
  },
  "required": [
    "serviceIdentifier",
    "listenerIdentifier",
    "rules"
  ],
  "$defs": {
    "FixedResponseAction": {
      "type": "object",
      "properties": {
        "statusCode": {
          "type": "integer",
          "description": "The HTTP response code. Only 404 and 500 status codes are supported."
        }
      },
      "required": [
        "statusCode"
      ]
    },
    "ForwardAction": {
      "type": "object",
      "properties": {
        "targetGroups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WeightedTargetGroup"
          },
          "description": "The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic. The default value is 1. This means that if only one target group is provided, there is no need to set the weight; 100% of the traffic goes to that target group."
        }
      },
      "required": [
        "targetGroups"
      ]
    },
    "HeaderMatch": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the header."
        },
        "match": {
          "$ref": "#/$defs/HeaderMatchType"
        },
        "caseSensitive": {
          "type": "boolean",
          "description": "Indicates whether the match is case sensitive."
        }
      },
      "required": [
        "name",
        "match"
      ]
    },
    "HeaderMatchType": {
      "type": "object",
      "properties": {
        "exact": {
          "type": "string",
          "description": "An exact type match."
        },
        "prefix": {
          "type": "string",
          "description": "A prefix type match. Matches the value with the prefix."
        },
        "contains": {
          "type": "string",
          "description": "A contains type match."
        }
      },
      "description": "Exactly one member is set."
    },
    "HttpMatch": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "description": "The HTTP method type."
        },
        "pathMatch": {
          "$ref": "#/$defs/PathMatch"
        },
        "headerMatches": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HeaderMatch"
          },
          "description": "The header matches. Matches incoming requests with rule based on request header value before applying rule action."
        }
      }
    },
    "PathMatch": {
      "type": "object",
      "properties": {
        "match": {
          "$ref": "#/$defs/PathMatchType"
        },
        "caseSensitive": {
          "type": "boolean",
          "description": "Indicates whether the match is case sensitive."
        }
      },
      "required": [
        "match"
      ]
    },
    "PathMatchType": {
      "type": "object",
      "properties": {
        "exact": {
          "type": "string",
          "description": "An exact match of the path."
        },
        "prefix": {
          "type": "string",
          "description": "A prefix match of the path."
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleAction": {
      "type": "object",
      "properties": {
        "forward": {
          "$ref": "#/$defs/ForwardAction"
        },
        "fixedResponse": {
          "$ref": "#/$defs/FixedResponseAction"
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleMatch": {
      "type": "object",
      "properties": {
        "httpMatch": {
          "$ref": "#/$defs/HttpMatch"
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleUpdate": {
      "type": "object",
      "properties": {
        "ruleIdentifier": {
          "type": "string",
          "description": "The ID or ARN of the rule."
        },
        "match": {
          "$ref": "#/$defs/RuleMatch"
        },
        "priority": {
          "type": "integer",
          "description": "The rule priority. A listener can't have multiple rules with the same priority."
        },
        "action": {
          "$ref": "#/$defs/RuleAction"
        }
      },
      "required": [
        "ruleIdentifier"
      ]
    },
    "WeightedTargetGroup": {
      "type": "object",
      "properties": {
        "targetGroupIdentifier": {
          "type": "string",
          "description": "The ID or ARN of the target group."
        },
        "weight": {
          "type": "integer",
          "description": "Only required if you specify multiple target groups for a forward action. The weight determines how requests are distributed to the target group. For example, if you specify two target groups, each with a weight of 10, each target group receives half the requests. If you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. If there's only one target group specified, then the default value is 100."
        }
      },
      "required": [
        "targetGroupIdentifier"
      ]
    }
  }
}