{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-batch-put-gateway-rate-limits-request-schema.json",
  "title": "BatchPutGatewayRateLimitsRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-rate-limits-api-openapi.yml#/components/schemas/BatchPutGatewayRateLimitsRequest",
  "type": "object",
  "properties": {
    "gatewayIdentifier": {
      "type": "string",
      "description": "The unique identifier of the gateway."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency."
    },
    "rateLimits": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BatchPutLimitEntry"
      },
      "description": "The complete set of rate limits for this gateway. This operation replaces all existing rate limits in a single request. If the operation fails, no rate limits are changed."
    }
  },
  "required": [
    "gatewayIdentifier",
    "rateLimits"
  ],
  "$defs": {
    "BatchPutLimitEntry": {
      "type": "object",
      "properties": {
        "rateLimitId": {
          "type": "string",
          "description": "The unique identifier of the rate limit. If provided, the service uses it for upsert matching against existing rate limits."
        },
        "description": {
          "type": "string",
          "description": "An optional human-readable description for this rate limit. If not provided, the rate limit is created without a description."
        },
        "dimensionKeys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The ordered list of dimension key names that define the scope of this rate limit."
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LimitEntry"
          },
          "description": "The list of rule entries that map dimension values to rate configurations."
        }
      },
      "required": [
        "dimensionKeys",
        "entries"
      ]
    },
    "LimitEntry": {
      "type": "object",
      "properties": {
        "dimensions": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A map of dimension names to dimension values for this rule entry. Keys must match the parent rate limit's dimension keys. Values may use * as a wildcard, but only in trailing positions based on the dimension keys ordering."
        },
        "requests": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RateConfig"
          },
          "description": "The request rate limit configuration. Specifies the maximum number of requests allowed per time period."
        },
        "tokens": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RateConfig"
          },
          "description": "The token rate limit configuration. Specifies the maximum number of tokens allowed per time period."
        },
        "connections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RateConfig"
          },
          "description": "The connection rate limit configuration. Specifies the maximum number of concurrent connections allowed."
        }
      },
      "required": [
        "dimensions"
      ]
    },
    "RateConfig": {
      "type": "object",
      "properties": {
        "rate": {
          "type": "number",
          "description": "The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed."
        },
        "period": {
          "type": "string",
          "enum": [
            "second",
            "minute"
          ],
          "description": "The time period for the rate limit. Valid values: second—Measures the rate limit over a one-second window. minute—Measures the rate limit over a one-minute window."
        }
      },
      "required": [
        "rate",
        "period"
      ]
    }
  }
}