documents
Creates, updates, deletes, gets or lists a documents resource.
Overview
| Name | documents |
| Type | Resource |
| Id | google.developerknowledge.documents |
Fields
The following fields are returned by SELECT queries:
- get
- batch_get
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. Contains the resource name of the document. Format: documents/{uri_without_scheme} Example: documents/docs.cloud.google.com/storage/docs/creating-buckets |
content | string | Output only. Contains the full content of the document in Markdown format. |
contentLengthBytes | integer (int32) | Output only. The length of the content field in bytes. |
dataSource | string | Output only. Specifies the data source of the document. Example data source: firebase.google.com |
description | string | Output only. Provides a description of the document. |
title | string | Output only. Provides the title of the document. |
updateTime | string (google-datetime) | Output only. Represents the timestamp when the content or metadata of the document was last updated. |
uri | string | Output only. Provides the URI of the content, such as docs.cloud.google.com/storage/docs/creating-buckets. |
view | string | Output only. Specifies the DocumentView of the document. (DOCUMENT_VIEW_UNSPECIFIED, DOCUMENT_VIEW_BASIC, DOCUMENT_VIEW_FULL, DOCUMENT_VIEW_CONTENT) |
| Name | Datatype | Description |
|---|---|---|
documents | array | Contains the documents requested. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | documentsId | view | Retrieves a single document with its full Markdown content. |
batch_get | select | names, view | Retrieves multiple documents, each with its full Markdown content. | |
search_document_chunks | exec | query, pageSize, filter, pageToken | Searches for developer knowledge across Google's developer documentation. Returns DocumentChunks based on the user's query. There may be many chunks from the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
documentsId | string | |
filter | string | |
names | string | |
pageSize | integer (int32) | |
pageToken | string | |
query | string | |
view | string |
SELECT examples
- get
- batch_get
Retrieves a single document with its full Markdown content.
SELECT
name,
content,
contentLengthBytes,
dataSource,
description,
title,
updateTime,
uri,
view
FROM google.developerknowledge.documents
WHERE documentsId = '{{ documentsId }}' -- required
AND view = '{{ view }}'
;
Retrieves multiple documents, each with its full Markdown content.
SELECT
documents
FROM google.developerknowledge.documents
WHERE names = '{{ names }}'
AND view = '{{ view }}'
;
Lifecycle Methods
- search_document_chunks
Searches for developer knowledge across Google's developer documentation. Returns DocumentChunks based on the user's query. There may be many chunks from the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.
EXEC google.developerknowledge.documents.search_document_chunks
@query='{{ query }}',
@pageSize='{{ pageSize }}',
@filter='{{ filter }}',
@pageToken='{{ pageToken }}'
;