updateDataset method

Future<UpdateDatasetResponse> updateDataset({
  1. required String datasetId,
  2. required String datasetName,
  3. required DatasetSource datasetSource,
  4. String? clientToken,
  5. String? datasetDescription,
})

Updates a dataset.

May throw ConflictingOperationException. May throw InternalFailureException. May throw InvalidRequestException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter datasetId : The ID of the dataset.

Parameter datasetName : The name of the dataset.

Parameter datasetSource : The data source for the dataset.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Parameter datasetDescription : A description about the dataset, and its functionality.

Implementation

Future<UpdateDatasetResponse> updateDataset({
  required String datasetId,
  required String datasetName,
  required DatasetSource datasetSource,
  String? clientToken,
  String? datasetDescription,
}) async {
  final $payload = <String, dynamic>{
    'datasetName': datasetName,
    'datasetSource': datasetSource,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (datasetDescription != null) 'datasetDescription': datasetDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/datasets/${Uri.encodeComponent(datasetId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDatasetResponse.fromJson(response);
}