# Google Developers Knowledge V1 Client - Class DocumentChunk (0.1.0)

Reference documentation and code samples for the Google Developers Knowledge V1 Client class DocumentChunk.

A DocumentChunk represents a piece of content from a
[Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) in the DeveloperKnowledge
corpus. To fetch the entire document content, pass the `parent` to
[DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__)
or
[DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__).

Generated from protobuf message `google.developers.knowledge.v1.DocumentChunk`

## Namespace

Google \\ Developers \\ Knowledge \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Output only. Contains the resource name of the document this chunk is from. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| `↳ id` | `string` Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time. |
| `↳ content` | `string` Output only. Contains the content of the document chunk. |
| `↳ document` | `https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document` Output only. Represents metadata about the [Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) this chunk is from. The [DocumentView](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.DocumentView) of this [Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) message will be set to `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients do not need to call [DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__) or [DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__) if they only need the metadata fields. Otherwise, clients should use [DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__) or [DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__) to fetch the full document content. |

### getParent

Output only. Contains the resource name of the document this chunk is from.

Format: `documents/{uri_without_scheme}`
Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`

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

### setParent

Output only. Contains the resource name of the document this chunk is from.

Format: `documents/{uri_without_scheme}`
Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`

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

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

### getId

Output only. Specifies the ID of this chunk within the document. The chunk
ID is unique within a document, but not globally unique across documents.

The chunk ID is not stable and may change over time.

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

### setId

Output only. Specifies the ID of this chunk within the document. The chunk
ID is unique within a document, but not globally unique across documents.

The chunk ID is not stable and may change over time.

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

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

### getContent

Output only. Contains the content of the document chunk.

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

### setContent

Output only. Contains the content of the document chunk.

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

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

### getDocument

Output only. Represents metadata about the
[Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) this chunk is from. The
[DocumentView](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.DocumentView) of this
[Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) message will be set to
`DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients
do not need to call
[DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__)
or
[DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__)
if they only need the metadata fields. Otherwise, clients should use
[DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__)
or
[DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__)
to fetch the full document content.

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

### hasDocument

### clearDocument

### setDocument

Output only. Represents metadata about the
[Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) this chunk is from. The
[DocumentView](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.DocumentView) of this
[Document](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Document) message will be set to
`DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients
do not need to call
[DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__)
or
[DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__)
if they only need the metadata fields. Otherwise, clients should use
[DeveloperKnowledge.GetDocument](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__getDocument__)
or
[DeveloperKnowledge.BatchGetDocuments](https://docs.cloud.google.com/php/docs/reference/developers-knowledge/latest/V1.Client.DeveloperKnowledgeClient#_Google_Developers_Knowledge_V1_Client_DeveloperKnowledgeClient__batchGetDocuments__)
to fetch the full document content.

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

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