updateUsageLimit method

Future<UpdateUsageLimitResponse> updateUsageLimit({
  1. required String usageLimitId,
  2. int? amount,
  3. UsageLimitBreachAction? breachAction,
})

Update a usage limit in Amazon Redshift Serverless. You can't update the usage type or period of a usage limit.

May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter usageLimitId : The identifier of the usage limit to update.

Parameter amount : The new limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.

Parameter breachAction : The new action that Amazon Redshift Serverless takes when the limit is reached.

Implementation

Future<UpdateUsageLimitResponse> updateUsageLimit({
  required String usageLimitId,
  int? amount,
  UsageLimitBreachAction? breachAction,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RedshiftServerless.UpdateUsageLimit'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'usageLimitId': usageLimitId,
      if (amount != null) 'amount': amount,
      if (breachAction != null) 'breachAction': breachAction.value,
    },
  );

  return UpdateUsageLimitResponse.fromJson(jsonResponse.body);
}