cancelHandshake method

Future<CancelHandshakeResponse> cancelHandshake({
  1. required String handshakeId,
})

Cancels a Handshake.

Only the account that sent a handshake can call this operation. The recipient of the handshake can't cancel it, but can use DeclineHandshake to decline. After a handshake is canceled, the recipient can no longer respond to the handshake.

You can view canceled handshakes in API responses for 30 days before they are deleted.

May throw AccessDeniedException. May throw ConcurrentModificationException. May throw HandshakeAlreadyInStateException. May throw HandshakeNotFoundException. May throw InvalidHandshakeTransitionException. May throw InvalidInputException. May throw ServiceException. May throw TooManyRequestsException.

Parameter handshakeId : ID for the handshake that you want to cancel. You can get the ID from the ListHandshakesForOrganization operation.

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

Implementation

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

  return CancelHandshakeResponse.fromJson(jsonResponse.body);
}