batchPutGatewayRateLimits method
Atomically creates or updates multiple rate limits for a gateway. The operation updates existing limits with matching keys and creates new limits for new keys. If the operation fails, the service applies no changes. Retry the request after resolving the issue.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter gatewayIdentifier :
The unique identifier of the gateway.
Parameter rateLimits :
Complete set of rate limits for this gateway. Replaces all existing limits
atomically.
Parameter clientToken :
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.
Implementation
Future<BatchPutGatewayRateLimitsResponse> batchPutGatewayRateLimits({
required String gatewayIdentifier,
required List<BatchPutLimitEntry> rateLimits,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'rateLimits': rateLimits,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/gateways/${Uri.encodeComponent(gatewayIdentifier)}/rate-limits/batch',
exceptionFnMap: _exceptionFns,
);
return BatchPutGatewayRateLimitsResponse.fromJson(response);
}