testConnection method

Future<TestConnectionResponse> testConnection({
  1. required String connectorId,
})

Tests whether your SFTP connector is set up successfully. We highly recommend that you call this operation to test your ability to transfer files between local Amazon Web Services storage and a trading partner's SFTP server.

May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter connectorId : The unique identifier for the connector.

Implementation

Future<TestConnectionResponse> testConnection({
  required String connectorId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.TestConnection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConnectorId': connectorId,
    },
  );

  return TestConnectionResponse.fromJson(jsonResponse.body);
}