delete method

Future<Folder> delete(
  1. String name, {
  2. String? $fields,
})

Requests deletion of a Folder.

The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an empty Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have resourcemanager.folders.delete permission on the identified folder.

Request parameters:

name - Required. the resource name of the Folder to be deleted. Must be of the form folders/{folder_id}. Value must have pattern ^folders/\[^/\]+$.

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

Completes with a Folder.

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<Folder> delete(
  core.String name, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$name');

  final response_ = await _requester.request(
    url_,
    'DELETE',
    queryParams: queryParams_,
  );
  return Folder.fromJson(response_ as core.Map<core.String, core.dynamic>);
}