- [Resource: Document](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.branches.documents#Document)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.dataStores.branches.documents#Document.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.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. ||

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1beta/projects.locations.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.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.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.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.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.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.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. |