updateBudget method

Future<void> updateBudget({
  1. required String accountId,
  2. required Budget newBudget,
})

Updates a budget. You can change every part of a budget except for the budgetName and the calculatedSpend. When you modify a budget, the calculatedSpend drops to zero until AWS has new usage data to use for forecasting.

May throw InternalErrorException. May throw InvalidParameterException. May throw NotFoundException. May throw AccessDeniedException.

Parameter accountId : The accountId that is associated with the budget that you want to update.

Parameter newBudget : The budget that you want to update your budget to.

Implementation

Future<void> updateBudget({
  required String accountId,
  required Budget newBudget,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  _s.validateStringLength(
    'accountId',
    accountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(newBudget, 'newBudget');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSBudgetServiceGateway.UpdateBudget'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccountId': accountId,
      'NewBudget': newBudget,
    },
  );
}