# Google Cloud Dialogflow V2 Client - Class Part (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class Part.

Represents a part of a training phrase.

Generated from protobuf message `google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2 \\ Intent \\ TrainingPhrase

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `string` Required. The text for this part. |
| `↳ entity_type` | `string` Optional. The entity type name prefixed with `\@`. This field is required for annotated parts of the training phrase. |
| `↳ alias` | `string` Optional. The parameter name for the value extracted from the annotated part of the example. This field is required for annotated parts of the training phrase. |
| `↳ user_defined` | `bool` Optional. Indicates whether the text was manually annotated. This field is set to true when the Dialogflow Console is used to manually annotate the part. When creating an annotated part with the API, you must set this to true. |

### getText

Required. The text for this part.

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

### setText

Required. The text for this part.

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

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

### getEntityType

Optional. The entity type name prefixed with `\@`.

This field is required for annotated parts of the training phrase.

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

### setEntityType

Optional. The entity type name prefixed with `\@`.

This field is required for annotated parts of the training phrase.

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

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

### getAlias

Optional. The parameter name for the value extracted from the
annotated part of the example.

This field is required for annotated parts of the training phrase.

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

### setAlias

Optional. The parameter name for the value extracted from the
annotated part of the example.

This field is required for annotated parts of the training phrase.

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

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

### getUserDefined

Optional. Indicates whether the text was manually annotated.

This field is set to true when the Dialogflow Console is used to
manually annotate the part. When creating an annotated part with the
API, you must set this to true.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setUserDefined

Optional. Indicates whether the text was manually annotated.

This field is set to true when the Dialogflow Console is used to
manually annotate the part. When creating an annotated part with the
API, you must set this to true.

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

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