updateBudgetAction method

Future<UpdateBudgetActionResponse> updateBudgetAction({
  1. required String accountId,
  2. required String actionId,
  3. required String budgetName,
  4. ActionThreshold? actionThreshold,
  5. ApprovalModel? approvalModel,
  6. Definition? definition,
  7. String? executionRoleArn,
  8. NotificationType? notificationType,
  9. List<Subscriber>? subscribers,
})

Updates a budget action.

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

Parameter actionId : A system-generated universally unique identifier (UUID) for the action.

Parameter approvalModel : This specifies if the action needs manual or automatic approval.

Parameter executionRoleArn : The role passed for action execution and reversion. Roles and actions must be in the same account.

Implementation

Future<UpdateBudgetActionResponse> updateBudgetAction({
  required String accountId,
  required String actionId,
  required String budgetName,
  ActionThreshold? actionThreshold,
  ApprovalModel? approvalModel,
  Definition? definition,
  String? executionRoleArn,
  NotificationType? notificationType,
  List<Subscriber>? subscribers,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  _s.validateStringLength(
    'accountId',
    accountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(actionId, 'actionId');
  _s.validateStringLength(
    'actionId',
    actionId,
    36,
    36,
    isRequired: true,
  );
  ArgumentError.checkNotNull(budgetName, 'budgetName');
  _s.validateStringLength(
    'budgetName',
    budgetName,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'executionRoleArn',
    executionRoleArn,
    32,
    618,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSBudgetServiceGateway.UpdateBudgetAction'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccountId': accountId,
      'ActionId': actionId,
      'BudgetName': budgetName,
      if (actionThreshold != null) 'ActionThreshold': actionThreshold,
      if (approvalModel != null) 'ApprovalModel': approvalModel.toValue(),
      if (definition != null) 'Definition': definition,
      if (executionRoleArn != null) 'ExecutionRoleArn': executionRoleArn,
      if (notificationType != null)
        'NotificationType': notificationType.toValue(),
      if (subscribers != null) 'Subscribers': subscribers,
    },
  );

  return UpdateBudgetActionResponse.fromJson(jsonResponse.body);
}