acceptHandshake method

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

Sends a response to the originator of a handshake agreeing to the action proposed by the handshake request.

This operation can be called only by the following principals when they also have the relevant IAM permissions:

  • Invitation to join or Approve all features request handshakes: only a principal from the member account.

    The user who calls the API for an invitation to join must have the organizations:AcceptHandshake permission. If you enabled all features in the organization, the user must also have the iam:CreateServiceLinkedRole permission so that AWS Organizations can create the required service-linked role named AWSServiceRoleForOrganizations. For more information, see AWS Organizations and Service-Linked Roles in the AWS Organizations User Guide.

  • Enable all features final confirmation handshake: only a principal from the management account.

    For more information about invitations, see Inviting an AWS Account to Join Your Organization in the AWS Organizations User Guide. For more information about requests to enable all features in the organization, see Enabling All Features in Your Organization in the AWS Organizations User Guide.

After you accept a handshake, it continues to appear in the results of relevant APIs for only 30 days. After that, it's deleted.

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

Parameter handshakeId : The unique identifier (ID) of 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 {
  ArgumentError.checkNotNull(handshakeId, 'handshakeId');
  _s.validateStringLength(
    'handshakeId',
    handshakeId,
    0,
    34,
    isRequired: true,
  );
  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);
}