Developer Knowledge API . documents

Instance Methods

batchGet(names=None, x__xgafv=None)

Retrieves multiple documents, each with its full Markdown content.

close()

Close httplib2 connections.

get(name, x__xgafv=None)

Retrieves a single document with its full Markdown content.

searchDocumentChunks(pageSize=None, pageToken=None, query=None, x__xgafv=None)

Searches for developer knowledge across Google's developer documentation. This method returns document chunks based on the user's query. There can be many chunks of the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.

searchDocumentChunks_next()

Retrieves the next page of results.

Method Details

batchGet(names=None, x__xgafv=None)
Retrieves multiple documents, each with its full Markdown content.

Args:
  names: string, Required. 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` (repeated)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for DeveloperKnowledge.BatchGetDocuments.
  "documents": [ # Documents requested.
    { # A Document represents a piece of content from the Developer Knowledge corpus.
      "content": "A String", # Output only. The full content of the document in Markdown format.
      "description": "A String", # Output only. A description of the document.
      "name": "A String", # Identifier. The resource name of the document. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
      "uri": "A String", # Output only. The URI of the content, such as `docs.cloud.google.com/storage/docs/creating-buckets`.
    },
  ],
}
close()
Close httplib2 connections.
get(name, x__xgafv=None)
Retrieves a single document with its full Markdown content.

Args:
  name: string, Required. The name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Document represents a piece of content from the Developer Knowledge corpus.
  "content": "A String", # Output only. The full content of the document in Markdown format.
  "description": "A String", # Output only. A description of the document.
  "name": "A String", # Identifier. The resource name of the document. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
  "uri": "A String", # Output only. The URI of the content, such as `docs.cloud.google.com/storage/docs/creating-buckets`.
}
searchDocumentChunks(pageSize=None, pageToken=None, query=None, x__xgafv=None)
Searches for developer knowledge across Google's developer documentation. This method returns document chunks based on the user's query. There can be many chunks of the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.

Args:
  pageSize: integer, Optional. The maximum number of results to return. The service may return fewer than this value. If unspecified, at most 5 results will be returned. The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT error.
  pageToken: string, Optional. A page token, received from a previous `SearchDocumentChunks` call. Provide this to retrieve the subsequent page.
  query: string, Required. The raw query string provided by the user, such as "How to create a Cloud Storage bucket?".
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for DeveloperKnowledge.SearchDocumentChunks.
  "nextPageToken": "A String", # Optional. A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
  "results": [ # The search results for the given query. Each DocumentChunk in this list contains a snippet of content relevant to the search query. Use the DocumentChunk.parent field of each result with DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to retrieve the full document content.
    { # A DocumentChunk represents a piece of content from a Document in the DeveloperKnowledge corpus. To fetch the entire document content, pass the `parent` to DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments.
      "content": "A String", # Output only. The content of the document chunk.
      "id": "A String", # Output only. The ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.
      "parent": "A String", # Output only. The resource name of the document this chunk is from. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
    },
  ],
}
searchDocumentChunks_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.