REST Resource: documents

Resource: Document

A document uploaded for automated review. Documents are immutable post-creation; to review a new version, create a new Document.

JSON representation
{
  "name": string,
  "displayName": string,
  "createTime": string,
  "latestReviewSummary": {
    object (ReviewSummary)
  },

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "driveSource": {
    object (DriveSource)
  }
  // End of mutually exclusive fields.
}
Fields
name

string

Identifier. Resource name in format documents/{document}.

displayName

string

Optional. User-provided display title or filename for the document.

createTime

string (Timestamp format)

Output only. Timestamp when the document was initially created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

latestReviewSummary

object (ReviewSummary)

Output only. Summary of the most recent review run for this document, if any. Populated by documents.get and documents.list; unset on the document returned by media.upload, which has no reviews yet.

The source of the document content. Exactly one source must be provided. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
driveSource

object (DriveSource)

Optional. Reference to a Google Drive file to import.

End of mutually exclusive fields.

DriveSource

Configuration for importing a document directly from Google Drive.

JSON representation
{
  "fileId": string,
  "revisionId": string,
  "resourceKey": string,
  "resourceKeySet": boolean
}
Fields
fileId

string

Required. Immutable. The Google Drive file ID (e.g. "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"). For Google Drive shortcuts, callers must pass the resolved target file's fileId and resourceKey.

revisionId

string

Optional. Input only. Immutable. Importing a specific revision is not currently supported; non-empty values return INVALID_ARGUMENT.

resourceKey

string

Optional. Input only. Immutable. Resource key (^[a-zA-Z0-9_-]{1,128}$) required to access certain older link-shared Google Drive files returned by the Google Drive Picker (for shortcuts, pass the resolved target file's resource key). Never persisted in database records or returned in Document resources (see companion field resourceKeySet, AIP-147).

resourceKeySet

boolean

Output only. Indicates whether a resource key was provided for this Drive source.

ReviewSummary

Lightweight summary of a Review execution run for display in Document views.

JSON representation
{
  "review": string,
  "state": enum (State),
  "createTime": string
}
Fields
review

string

Output only. Resource name of the Review.

state

enum (State)

Output only. Current review lifecycle state.

createTime

string (Timestamp format)

Output only. Timestamp when this review attempt was initiated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

Methods

delete

Deletes a document and its stored content.

estimateReviewCost

Estimates what a review of a document would cost on the caller's Gemini API key.

get

Retrieves document metadata.

list

Lists documents for the authenticated caller with cursor pagination.