createDataSetImportTask method
Starts a data set import task for a specific application.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter applicationId :
The unique identifier of the application for which you want to import data
sets.
Parameter importConfig :
The data set import task configuration.
Parameter clientToken :
Unique, case-sensitive identifier you provide to ensure the idempotency of
the request to create a data set import. The service generates the
clientToken when the API call is triggered. The token expires after one
hour, so if you retry the API within this timeframe with the same
clientToken, you will get the same response. The service also handles
deleting the clientToken after it expires.
Implementation
Future<CreateDataSetImportTaskResponse> createDataSetImportTask({
required String applicationId,
required DataSetImportConfig importConfig,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'importConfig': importConfig,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/dataset-import-task',
exceptionFnMap: _exceptionFns,
);
return CreateDataSetImportTaskResponse.fromJson(response);
}