deleteDataset method

Future<DeleteDatasetResponse> deleteDataset({
  1. required String datasetId,
  2. String? clientToken,
  3. String? workspaceName,
})

Deletes a dataset. This can't be undone. Deleting a session dataset also deletes the underlying time series data in the session. You can't delete a session dataset while a curated dataset references its data segments. First delete the curated dataset or disassociate the data segments. Deleting a curated dataset doesn't delete the underlying data in the source session datasets.

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

Parameter datasetId : The ID of 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 workspaceName : The name of the workspace that contains the dataset.

Implementation

Future<DeleteDatasetResponse> deleteDataset({
  required String datasetId,
  String? clientToken,
  String? workspaceName,
}) async {
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
    if (workspaceName != null) 'workspaceName': [workspaceName],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/datasets/${Uri.encodeComponent(datasetId)}',
    queryParams: $query,
    hostPrefix: 'api.',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteDatasetResponse.fromJson(response);
}