disassociateAccounts method

Future<DisassociateAccountsResponse> disassociateAccounts({
  1. required List<String> accountIds,
  2. String? clientToken,
})

Disassociates member accounts from your organization's management account, removing centralized automation capabilities. Once disassociated, organization rules no longer apply to the member account, and the management account (or delegated administrator) cannot create Automation rules for that account.

May throw AccessDeniedException. May throw ForbiddenException. May throw IdempotencyTokenInUseException. May throw IdempotentParameterMismatchException. May throw InternalServerException. May throw InvalidParameterValueException. May throw NotManagementAccountException. May throw OptInRequiredException. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter accountIds : The IDs of the member accounts to disassociate.

Parameter clientToken : A unique identifier to ensure idempotency of the request.

Implementation

Future<DisassociateAccountsResponse> disassociateAccounts({
  required List<String> accountIds,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'ComputeOptimizerAutomationService.DisassociateAccounts'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'accountIds': accountIds,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );

  return DisassociateAccountsResponse.fromJson(jsonResponse.body);
}