declineHandshake method

Future<DeclineHandshakeResponse> declineHandshake({
  1. required String handshakeId,
})

Declines a Handshake.

Only the account that receives a handshake can call this operation. The sender of the handshake can use CancelHandshake to cancel if the handshake hasn't yet been responded to.

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 decline. You can get the ID from the ListHandshakesForAccount operation.

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

Implementation

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

  return DeclineHandshakeResponse.fromJson(jsonResponse.body);
}