# Google Cloud Discovery Engine V1 Client - Class Document (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class Document.

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

Generated from protobuf message `google.cloud.discoveryengine.v1.Document`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ struct_data` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` The structured JSON data for the document. It should conform to the registered [Schema](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an `INVALID_ARGUMENT` error is thrown. |
| `↳ json_data` | `string` The JSON string representation of the document. It should conform to the registered [Schema](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an `INVALID_ARGUMENT` error is thrown. |
| `↳ name` | `string` Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 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. |
| `↳ schema_id` | `string` The identifier of the schema located in the same data store. |
| `↳ content` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.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. |
| `↳ parent_document_id` | `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. |
| `↳ derived_struct_data` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. |
| `↳ acl_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.AclInfo` Access control information for the document. |
| `↳ index_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed. |
| `↳ index_status` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.IndexStatus` Output only. The index status of the document. \* \* If document is indexed successfully, the index_time field is populated. \* \* Otherwise, if document is not indexed due to errors, the error_samples field is populated. \* \* Otherwise, if document's index is in progress, the pending_message field is populated. |

### getStructData

The structured JSON data for the document. It should conform to the
registered [Schema](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an
`INVALID_ARGUMENT` error is thrown.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct|null` |   |

### hasStructData

### setStructData

The structured JSON data for the document. It should conform to the
registered [Schema](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an
`INVALID_ARGUMENT` error is thrown.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getJsonData

The JSON string representation of the document. It should conform to the
registered [Schema](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an
`INVALID_ARGUMENT` error is thrown.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasJsonData

### setJsonData

The JSON string representation of the document. It should conform to the
registered [Schema](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Schema) or an
`INVALID_ARGUMENT` error is thrown.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getName

Immutable. The full resource name of the document.

Format:
`projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
This field must be a UTF-8 encoded string with a length limit of 1024
characters.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Immutable. The full resource name of the document.

Format:
`projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
This field must be a UTF-8 encoded string with a length limit of 1024
characters.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getId

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setId

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSchemaId

The identifier of the schema located in the same data store.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSchemaId

The identifier of the schema located in the same data store.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getContent

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.Content|null` |   |

### hasContent

### clearContent

### setContent

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.Content` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getParentDocumentId

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setParentDocumentId

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDerivedStructData

Output only. This field is OUTPUT_ONLY.

It contains derived data that are not in the original input document.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct|null` |   |

### hasDerivedStructData

### clearDerivedStructData

### setDerivedStructData

Output only. This field is OUTPUT_ONLY.

It contains derived data that are not in the original input document.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Struct` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAclInfo

Access control information for the document.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.AclInfo|null` |   |

### hasAclInfo

### clearAclInfo

### setAclInfo

Access control information for the document.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.AclInfo` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getIndexTime

Output only. The last time the document was indexed. If this field is set,
the document could be returned in search results.

This field is OUTPUT_ONLY. If this field is not populated, it means the
document has never been indexed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasIndexTime

### clearIndexTime

### setIndexTime

Output only. The last time the document was indexed. If this field is set,
the document could be returned in search results.

This field is OUTPUT_ONLY. If this field is not populated, it means the
document has never been indexed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getIndexStatus

Output only. The index status of the document.

- If document is indexed successfully, the index_time field is populated.
- Otherwise, if document is not indexed due to errors, the error_samples field is populated.
- Otherwise, if document's index is in progress, the pending_message field is populated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.IndexStatus|null` |   |

### hasIndexStatus

### clearIndexStatus

### setIndexStatus

Output only. The index status of the document.

- If document is indexed successfully, the index_time field is populated.
- Otherwise, if document is not indexed due to errors, the error_samples field is populated.
- Otherwise, if document's index is in progress, the pending_message field is populated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document.IndexStatus` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getData

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |