modifyUsageLimit method

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

Modifies a usage limit in a cluster. You can't modify the feature type or period of a usage limit.

May throw InvalidUsageLimitFault. May throw UsageLimitNotFoundFault. May throw UnsupportedOperationFault.

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

Parameter amount : The new limit amount. For more information about this parameter, see UsageLimit.

Parameter breachAction : The new action that Amazon Redshift takes when the limit is reached. For more information about this parameter, see UsageLimit.

Implementation

Future<UsageLimit> modifyUsageLimit({
  required String usageLimitId,
  int? amount,
  UsageLimitBreachAction? breachAction,
}) async {
  ArgumentError.checkNotNull(usageLimitId, 'usageLimitId');
  _s.validateStringLength(
    'usageLimitId',
    usageLimitId,
    0,
    2147483647,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['UsageLimitId'] = usageLimitId;
  amount?.also((arg) => $request['Amount'] = arg);
  breachAction?.also((arg) => $request['BreachAction'] = arg.toValue());
  final $result = await _protocol.send(
    $request,
    action: 'ModifyUsageLimit',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyUsageLimitMessage'],
    shapes: shapes,
    resultWrapper: 'ModifyUsageLimitResult',
  );
  return UsageLimit.fromXml($result);
}