updateSpendingLimit method
Updates an existing spending limit. You can modify the spending amount or time period. Changes take effect immediately.
May throw AccessDeniedException.
May throw InternalServiceException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter spendingLimitArn :
The Amazon Resource Name (ARN) of the spending limit to update.
Parameter clientToken :
A unique, case-sensitive identifier to ensure that the operation completes
no more than one time. If this token matches a previous request, Amazon
Braket ignores the request, but does not return an error.
Parameter spendingLimit :
The new maximum amount that can be spent on the specified device, in USD.
Parameter timePeriod :
The new time period during which the spending limit is active, including
start and end dates.
Implementation
Future<void> updateSpendingLimit({
required String spendingLimitArn,
String? clientToken,
String? spendingLimit,
TimePeriod? timePeriod,
}) async {
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (spendingLimit != null) 'spendingLimit': spendingLimit,
if (timePeriod != null) 'timePeriod': timePeriod,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/spending-limit/${Uri.encodeComponent(spendingLimitArn)}/update',
exceptionFnMap: _exceptionFns,
);
}