delete method

Future<void> delete(
  1. String projectId,
  2. String datasetId, {
  3. bool? deleteContents,
  4. String? $fields,
})

Deletes the dataset specified by the datasetId value.

Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.

Request parameters:

projectId - Required. Project ID of the dataset being deleted Value must have pattern ^\[^/\]+$.

datasetId - Required. Dataset ID of dataset being deleted Value must have pattern ^\[^/\]+$.

deleteContents - If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False

$fields - Selector specifying which fields to include in a partial response.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<void> delete(
  core.String projectId,
  core.String datasetId, {
  core.bool? deleteContents,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (deleteContents != null) 'deleteContents': ['${deleteContents}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'projects/' +
      core.Uri.encodeFull('$projectId') +
      '/datasets/' +
      core.Uri.encodeFull('$datasetId');

  await _requester.request(
    url_,
    'DELETE',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}