batchGet method

Future<BatchGetDocumentsResponse> batchGet({
  1. List<String>? names,
  2. String? view,
  3. String? $fields,
})

Retrieves multiple documents, each with its full Markdown content.

Request parameters:

names - Required. Specifies the names of the documents to retrieve. A maximum of 20 documents can be retrieved in a batch. The documents are returned in the same order as the names in the request. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets Each name must not exceed 500 characters; values longer than 500 characters will result in an INVALID_ARGUMENT error.

view - Optional. Specifies the DocumentView of the document. If unspecified, DeveloperKnowledge.BatchGetDocuments defaults to DOCUMENT_VIEW_CONTENT. Possible string values are:

  • "DOCUMENT_VIEW_UNSPECIFIED" : The default / unset value. See each API method for its default value if DocumentView is not specified.
  • "DOCUMENT_VIEW_BASIC" : Includes only the basic metadata fields: - name - uri - data_source - title - description - update_time - view - content_length_bytes This is the default of view for DeveloperKnowledge.SearchDocumentChunks.
  • "DOCUMENT_VIEW_FULL" : Includes all Document fields.
  • "DOCUMENT_VIEW_CONTENT" : Includes the DOCUMENT_VIEW_BASIC fields and the content field. This is the default of view for DeveloperKnowledge.GetDocument and DeveloperKnowledge.BatchGetDocuments.

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

Completes with a BatchGetDocumentsResponse.

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<BatchGetDocumentsResponse> batchGet({
  core.List<core.String>? names,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'names': ?names,
    'view': ?view == null ? null : [view],
    'fields': ?$fields == null ? null : [$fields],
  };

  const url_ = 'v1/documents:batchGet';

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