delete method

Future<Empty> delete(
  1. String name, {
  2. bool? currentDocument_exists,
  3. String? currentDocument_updateTime,
  4. String? $fields,
})

Deletes a document.

Request parameters:

name - Required. The resource name of the Document to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}. Value must have pattern ^projects/\[^/\]+/databases/\[^/\]+/documents/\[^/\]+/.*$.

currentDocument_exists - When set to true, the target document must exist. When set to false, the target document must not exist.

currentDocument_updateTime - When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned.

$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> delete(
  core.String name, {
  core.bool? currentDocument_exists,
  core.String? currentDocument_updateTime,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (currentDocument_exists != null)
      'currentDocument.exists': ['${currentDocument_exists}'],
    if (currentDocument_updateTime != null)
      'currentDocument.updateTime': [currentDocument_updateTime],
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v1/' + core.Uri.encodeFull('$name');

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