# Google Cloud Dialogflow V2 Client - Class AnnotatedMessagePart (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 AnnotatedMessagePart.

Represents a part of a message possibly annotated with an entity. The part
can be an entity or purely a part of the message between two entities or
message start/end.

Generated from protobuf message `google.cloud.dialogflow.v2.AnnotatedMessagePart`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `string` A part of a message possibly annotated with an entity. |
| `↳ entity_type` | `string` The [Dialogflow system entity type](https://cloud.google.com/dialogflow/docs/reference/system-entities) of this message part. If this is empty, Dialogflow could not annotate the phrase part with a system entity. |
| `↳ formatted_value` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Value` The [Dialogflow system entity formatted value](https://cloud.google.com/dialogflow/docs/reference/system-entities) of this message part. For example for a system entity of type `\@sys.unit-currency`, this may contain: ``` { "amount": 5, "currency": "USD" } ``` <br /> |

### getText

A part of a message possibly annotated with an entity.

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

### setText

A part of a message possibly annotated with an entity.

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

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

### getEntityType

The [Dialogflow system entity
type](https://cloud.google.com/dialogflow/docs/reference/system-entities)
of this message part. If this is empty, Dialogflow could not annotate the
phrase part with a system entity.

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

### setEntityType

The [Dialogflow system entity
type](https://cloud.google.com/dialogflow/docs/reference/system-entities)
of this message part. If this is empty, Dialogflow could not annotate the
phrase part with a system entity.

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

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

### getFormattedValue

The [Dialogflow system entity formatted value](https://cloud.google.com/dialogflow/docs/reference/system-entities) of
this message part. For example for a system entity of type
`\@sys.unit-currency`, this may contain:

```
{
  "amount": 5,
  "currency": "USD"
}
```

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

### hasFormattedValue

### clearFormattedValue

### setFormattedValue

The [Dialogflow system entity formatted value](https://cloud.google.com/dialogflow/docs/reference/system-entities) of
this message part. For example for a system entity of type
`\@sys.unit-currency`, this may contain:

```
{
  "amount": 5,
  "currency": "USD"
}
```

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

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