startRemoteMove method

Future<StartRemoteMoveResponse> startRemoteMove({
  1. required String connectorId,
  2. required String sourcePath,
  3. required String targetPath,
})

Moves or renames a file or directory on the remote SFTP server.

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

Parameter connectorId : The unique identifier for the connector.

Parameter sourcePath : The absolute path of the file or directory to move or rename. You can only specify one path per call to this operation.

Parameter targetPath : The absolute path for the target of the move/rename operation.

Implementation

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

  return StartRemoteMoveResponse.fromJson(jsonResponse.body);
}