deleteOrganization method

Future<void> deleteOrganization()

Deletes the organization. You can delete an organization only by using credentials from the management account. The organization must be empty of member accounts.

When an organization is deleted, Organizations logs a membership event in CloudTrail. The event is an AccountDepartedOrganization event with departedMethod:Left and departedTime. This event is available only in the management account's event history.

May throw AccessDeniedException. May throw AWSOrganizationsNotInUseException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw InvalidInputException. May throw OrganizationNotEmptyException. May throw ServiceException. May throw TooManyRequestsException.

Implementation

Future<void> deleteOrganization() async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.DeleteOrganization'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
  );
}