delete method

Future<void> delete(
  1. String bucket,
  2. String managedFolder, {
  3. bool? allowNonEmpty,
  4. String? ifMetagenerationMatch,
  5. String? ifMetagenerationNotMatch,
  6. String? $fields,
})

Permanently deletes a managed folder.

Request parameters:

bucket - Name of the bucket containing the managed folder.

managedFolder - The managed folder name/path.

allowNonEmpty - Allows the deletion of a managed folder even if it is not empty. A managed folder is empty if there are no objects or managed folders that it applies to. Callers must have storage.managedFolders.setIamPolicy permission.

ifMetagenerationMatch - If set, only deletes the managed folder if its metageneration matches this value.

ifMetagenerationNotMatch - If set, only deletes the managed folder if its metageneration does not match this value.

$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 bucket,
  core.String managedFolder, {
  core.bool? allowNonEmpty,
  core.String? ifMetagenerationMatch,
  core.String? ifMetagenerationNotMatch,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (allowNonEmpty != null) 'allowNonEmpty': ['${allowNonEmpty}'],
    if (ifMetagenerationMatch != null)
      'ifMetagenerationMatch': [ifMetagenerationMatch],
    if (ifMetagenerationNotMatch != null)
      'ifMetagenerationNotMatch': [ifMetagenerationNotMatch],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'b/' +
      commons.escapeVariable('$bucket') +
      '/managedFolders/' +
      commons.escapeVariable('$managedFolder');

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