importDataset method

Future<ImportDatasetResponse> importDataset({
  1. required String sourceDatasetArn,
  2. String? clientToken,
  3. String? datasetName,
  4. String? serverSideKmsKeyId,
  5. List<Tag>? tags,
})

Imports a dataset.

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

Parameter sourceDatasetArn : The Amazon Resource Name (ARN) of the dataset to import.

Parameter clientToken : A unique identifier for the request. If you do not set the client request token, Amazon Lookout for Equipment generates one.

Parameter datasetName : The name of the machine learning dataset to be created. If the dataset already exists, Amazon Lookout for Equipment overwrites the existing dataset. If you don't specify this field, it is filled with the name of the source dataset.

Parameter serverSideKmsKeyId : Provides the identifier of the KMS key key used to encrypt model data by Amazon Lookout for Equipment.

Parameter tags : Any tags associated with the dataset to be created.

Implementation

Future<ImportDatasetResponse> importDataset({
  required String sourceDatasetArn,
  String? clientToken,
  String? datasetName,
  String? serverSideKmsKeyId,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSLookoutEquipmentFrontendService.ImportDataset'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SourceDatasetArn': sourceDatasetArn,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (datasetName != null) 'DatasetName': datasetName,
      if (serverSideKmsKeyId != null)
        'ServerSideKmsKeyId': serverSideKmsKeyId,
      if (tags != null) 'Tags': tags,
    },
  );

  return ImportDatasetResponse.fromJson(jsonResponse.body);
}