undelete method

Future<Folder> undelete(
  1. UndeleteFolderRequest request,
  2. String name, {
  3. String? $fields,
})

Cancels the deletion request for a Folder.

This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

request - The metadata request object.

Request parameters:

name - Required. The resource name of the Folder to undelete. 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> undelete(
  UndeleteFolderRequest request,
  core.String name, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

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

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