createBatchLoadTask method

Future<CreateBatchLoadTaskResponse> createBatchLoadTask({
  1. required DataSourceConfiguration dataSourceConfiguration,
  2. required ReportConfiguration reportConfiguration,
  3. required String targetDatabaseName,
  4. required String targetTableName,
  5. String? clientToken,
  6. DataModelConfiguration? dataModelConfiguration,
  7. int? recordVersion,
})

Creates a new Timestream batch load task. A batch load task processes data from a CSV source in an S3 location and writes to a Timestream table. A mapping from source to target is defined in a batch load task. Errors and events are written to a report at an S3 location. For the report, if the KMS key is not specified, the report will be encrypted with an S3 managed key when SSE_S3 is the option. Otherwise an error is thrown. For more information, see Amazon Web Services managed keys. Service quotas apply. For details, see code sample.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw InvalidEndpointException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter dataSourceConfiguration : Defines configuration details about the data source for a batch load task.

Parameter targetDatabaseName : Target Timestream database for a batch load task.

Parameter targetTableName : Target Timestream table for a batch load task.

Parameter clientToken :

Parameter recordVersion :

Implementation

Future<CreateBatchLoadTaskResponse> createBatchLoadTask({
  required DataSourceConfiguration dataSourceConfiguration,
  required ReportConfiguration reportConfiguration,
  required String targetDatabaseName,
  required String targetTableName,
  String? clientToken,
  DataModelConfiguration? dataModelConfiguration,
  int? recordVersion,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Timestream_20181101.CreateBatchLoadTask'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DataSourceConfiguration': dataSourceConfiguration,
      'ReportConfiguration': reportConfiguration,
      'TargetDatabaseName': targetDatabaseName,
      'TargetTableName': targetTableName,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (dataModelConfiguration != null)
        'DataModelConfiguration': dataModelConfiguration,
      if (recordVersion != null) 'RecordVersion': recordVersion,
    },
  );

  return CreateBatchLoadTaskResponse.fromJson(jsonResponse.body);
}