- [Resource: Document](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.SCHEMA_REPRESENTATION)
  - [Content](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Content)
    - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Content.SCHEMA_REPRESENTATION)
  - [AclInfo](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AclInfo)
    - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AclInfo.SCHEMA_REPRESENTATION)
  - [AccessRestriction](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AccessRestriction)
    - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AccessRestriction.SCHEMA_REPRESENTATION)
  - [Principal](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Principal)
    - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Principal.SCHEMA_REPRESENTATION)
  - [IndexStatus](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.IndexStatus)
    - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.IndexStatus.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#METHODS_SUMMARY)

## Resource: Document

Document captures all raw metadata information of items to be recommended or searched.

| JSON representation |
|---|
| ``` { "name": string, "id": string, "schemaId": string, "content": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Content`) }, "parentDocumentId": string, "derivedStructData": { object }, "aclInfo": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AclInfo`) }, "indexTime": string, "indexStatus": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.IndexStatus`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "structData": { object }, "jsonData": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}/documents/{documentId}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. |
| `id` | `string` Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 128 characters. |
| `schemaId` | `string` The identifier of the schema located in the same data store. |
| `content` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Content`)`` The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store. |
| `parentDocumentId` | `string` The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. |
| `derivedStructData` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. |
| `aclInfo` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AclInfo`)`` Access control information for the document. |
| `indexTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the document was last indexed. If this field is populated, it means the document has been indexed. While documents typically become searchable within seconds of indexing, it can sometimes take up to a few hours. If this field is not populated, it means the document has never been indexed. 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"`. |
| `indexStatus` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.IndexStatus`)`` Output only. The index status of the document. - If document is indexed successfully, the indexTime field is populated. - Otherwise, if document is not indexed due to errors, the errorSamples field is populated. - Otherwise, if document's index is in progress, the pendingMessage field is populated. |
| Data representation. One of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.FIELDS.struct_data` or `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.FIELDS.json_data` should be provided otherwise an `INVALID_ARGUMENT` error is thrown. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `structData` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` The structured JSON data for the document. It should conform to the registered `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.schemas#Schema` or an `INVALID_ARGUMENT` error is thrown. |
| `jsonData` | `string` The JSON string representation of the document. It should conform to the registered `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.schemas#Schema` or an `INVALID_ARGUMENT` error is thrown. |
| End of mutually exclusive fields. ||

### Content

Unstructured data linked to this document.

| JSON representation |
|---|
| ``` { "mimeType": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "rawBytes": string, "uri": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `mimeType` | `string` The MIME type of the content. Supported types: - `application/pdf` (PDF, only native PDFs are supported for now) - `text/html` (HTML) - `text/plain` (TXT) - `application/xml` or `text/xml` (XML) - `application/json` (JSON) - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) - `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX) - `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) The following types are supported only if layout parser is enabled in the data store: - `image/bmp` (BMP) - `image/gif` (GIF) - `image/jpeg` (JPEG) - `image/png` (PNG) - `image/tiff` (TIFF) See <https://www.iana.org/assignments/media-types/media-types.xhtml>. |
| The content of the unstructured document. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `rawBytes` | `string (https://developers.google.com/discovery/v1/type-format format)` The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / \~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&()'-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See <https://developers.google.com/protocol-buffers/docs/proto3#json>. A base64-encoded string. |
| `uri` | `string` The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats. |
| End of mutually exclusive fields. ||

### AclInfo

ACL Information of the Document.

| JSON representation |
|---|
| ``` { "readers": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AccessRestriction`) } ] } ``` |

| Fields ||
|---|---|
| `readers[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.AccessRestriction`)`` Readers of the document. |

### AccessRestriction

AclRestriction to model complex inheritance restrictions.

Example: Modeling a "Both Permit" inheritance, where to access a child document, user needs to have access to parent document.

Document Hierarchy - Space_S --\> Page_P.

Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2

Space_S ACL Restriction - { "aclInfo": { "readers": \[ { "principals": \[ { "groupId": "group_1" }, { "userId": "user_1" } \] } \] } }

Page_P ACL Restriction. { "aclInfo": { "readers": \[ { "principals": \[ { "groupId": "group_2" }, { "groupId": "group_3" }, { "userId": "user_2" } \], }, { "principals": \[ { "groupId": "group_1" }, { "userId": "user_1" } \], } \] } }

| JSON representation |
|---|
| ``` { "principals": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Principal`) } ], "idpWide": boolean } ``` |

| Fields ||
|---|---|
| `principals[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document.Principal`)`` List of principals. |
| `idpWide` | `boolean` All users within the Identity Provider. |

### Principal

Principal identifier of a user or a group.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "userId": string, "groupId": string, "externalEntityId": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| Union field principal. Principal can be a user or a group. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `userId` | `string` User identifier. For Google Workspace user account, userId should be the google workspace user email. For non-google identity provider user account, userId is the mapped user identifier configured during the workforcepool config. |
| `groupId` | `string` Group identifier. For Google Workspace user account, groupId should be the google workspace group email. For non-google identity provider user account, groupId is the mapped group identifier configured during the workforcepool config. |
| `externalEntityId` | `string` For 3P application identities which are not present in the customer identity provider. |
| End of mutually exclusive fields. ||

### IndexStatus

Index status of the document.

| JSON representation |
|---|
| ``` { "indexTime": string, "errorSamples": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/ListOperationsResponse#Status`) } ], "pendingMessage": string } ``` |

| Fields ||
|---|---|
| `indexTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The time when the document was indexed. If this field is populated, it means the document has been indexed. While documents typically become searchable within seconds of indexing, it can sometimes take up to a few hours. 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"`. |
| `errorSamples[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/Shared.Types/ListOperationsResponse#Status`)`` A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors. |
| `pendingMessage` | `string` Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/create` | Creates a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/delete` | Deletes a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/get` | Gets a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/import` | Bulk import of multiple `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`s. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/list` | Gets a list of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`s. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/patch` | Updates a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents/purge` | Permanently deletes all selected `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.collections.dataStores.branches.documents#Document`s in a branch. |