delete method

Future<Operation> delete(
  1. String name, {
  2. String? connectorName,
  3. bool? debugOptions_enableDebugging,
  4. String? mode,
  5. String? version,
  6. String? $fields,
})

Deletes Item resource for the specified resource name.

This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source.

Request parameters:

name - Required. The name of the item to delete. Format: datasources/{source_id}/items/{item_id} Value must have pattern ^datasources/\[^/\]+/items/\[^/\]+$.

connectorName - The name of connector making this call. Format: datasources/{source_id}/connectors/{ID}

debugOptions_enableDebugging - If you are asked by Google to help with debugging, set this field. Otherwise, ignore this field.

mode - Required. The RequestMode for this request. Possible string values are:

  • "UNSPECIFIED" : The priority is not specified in the update request. Leaving priority unspecified results in an update failure.
  • "SYNCHRONOUS" : For real-time updates.
  • "ASYNCHRONOUS" : For changes that are executed after the response is sent back to the caller.

version - Required. The incremented version of the item to delete from the index. The indexing system stores the version from the datasource as a byte string and compares the Item version in the index to the version of the queued Item using lexical ordering. Cloud Search Indexing won't delete any queued item with a version value that is less than or equal to the version of the currently indexed item. The maximum length for this field is 1024 bytes. For information on how item version affects the deletion process, refer to Handle revisions after manual deletes.

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

Completes with a Operation.

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<Operation> delete(
  core.String name, {
  core.String? connectorName,
  core.bool? debugOptions_enableDebugging,
  core.String? mode,
  core.String? version,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (connectorName != null) 'connectorName': [connectorName],
    if (debugOptions_enableDebugging != null)
      'debugOptions.enableDebugging': ['${debugOptions_enableDebugging}'],
    if (mode != null) 'mode': [mode],
    if (version != null) 'version': [version],
    if ($fields != null) 'fields': [$fields],
  };

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

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