emptyTrash method

Future<void> emptyTrash({
  1. String? driveId,
  2. bool? enforceSingleParent,
  3. String? $fields,
})

Permanently deletes all of the user's trashed files.

Request parameters:

driveId - If set, empties the trash of the provided shared drive.

enforceSingleParent - Deprecated: If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item is placed under its owner's root.

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

  const url_ = 'files/trash';

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