batchDelete method Null safety

Future<Empty> batchDelete(
  1. BatchDeletePermissionsRequest request,
  2. String parent,
  3. {String? $fields}
)

Deletes one or more permissions on the note.

The specified entities will immediately lose access. A permission with the OWNER role can't be removed. If removing a permission fails, then the entire request fails and no changes are made. Returns a 400 bad request error if a specified permission does not exist on the note.

request - The metadata request object.

Request parameters:

parent - The parent resource shared by all permissions being deleted. Format: notes/{note} If this is set, the parent of all of the permissions specified in the DeletePermissionRequest messages must match this field. Value must have pattern ^notes/\[^/\]+$.

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

Completes with a Empty.

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<Empty> batchDelete(
  BatchDeletePermissionsRequest request,
  core.String parent, {
  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 =
      'v1/' + core.Uri.encodeFull('$parent') + '/permissions:batchDelete';

  final _response = await _requester.request(
    _url,
    'POST',
    body: _body,
    queryParams: _queryParams,
  );
  return Empty.fromJson(_response as core.Map<core.String, core.dynamic>);
}