acceptHandshake method

Future<AcceptHandshakeResponse> acceptHandshake({
  1. required String handshakeId,
})

Accepts a handshake by sending an ACCEPTED response to the sender. You can view accepted handshakes in API responses for 30 days before they are deleted.

Only the management account can accept the following handshakes:

  • Enable all features final confirmation (APPROVE_ALL_FEATURES)
  • Billing transfer (TRANSFER_RESPONSIBILITY)
For more information, see Enabling all features and Responding to a billing transfer invitation in the Organizations User Guide.

Only a member account can accept the following handshakes:

  • Invitation to join (INVITE)
  • Approve all features request (ENABLE_ALL_FEATURES)
For more information, see Responding to invitations and Enabling all features in the Organizations User Guide.

When a handshake is accepted, Organizations logs membership events in CloudTrail, available only in the management account's event history. If the account was standalone and joined a new organization, an AccountJoinedOrganization event is logged with joinedMethod:Invited and joinedTime fields. If the account departed one organization and joined another, both an AccountDepartedOrganization event with departedMethod:Left and departedTime and an AccountJoinedOrganization event with joinedMethod:Invited and joinedTime are logged in their respective management accounts.

May throw AccessDeniedException. May throw AccessDeniedForDependencyException. May throw AWSOrganizationsNotInUseException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw HandshakeAlreadyInStateException. May throw HandshakeConstraintViolationException. May throw HandshakeNotFoundException. May throw InvalidHandshakeTransitionException. May throw InvalidInputException. May throw MasterCannotLeaveOrganizationException. May throw ServiceException. May throw TooManyRequestsException.

Parameter handshakeId : ID for the handshake that you want to accept.

The regex pattern for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.

Implementation

Future<AcceptHandshakeResponse> acceptHandshake({
  required String handshakeId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.AcceptHandshake'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HandshakeId': handshakeId,
    },
  );

  return AcceptHandshakeResponse.fromJson(jsonResponse.body);
}