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

Represents a message posted into a conversation.

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

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Optional. The unique identifier of the message. Format: `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>/messages/<Message ID>`. |
| `↳ content` | `string` Required. The message content. |
| `↳ language_code` | `string` Optional. The message language. This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". |
| `↳ participant` | `string` Output only. The participant that sends this message. |
| `↳ participant_role` | `int` Output only. The role of the participant. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the message was created in Contact Center AI. |
| `↳ send_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Optional. The time when the message was sent. For voice messages, this is the time when an utterance started. |
| `↳ message_annotation` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.MessageAnnotation` Output only. The annotation for the message. |
| `↳ sentiment_analysis` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.SentimentAnalysisResult` Output only. The sentiment analysis result for the message. |

### getName

Optional. The unique identifier of the message.

Format: `projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>/messages/<Message ID>`.

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

### setName

Optional. The unique identifier of the message.

Format: `projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>/messages/<Message ID>`.

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

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

### getContent

Required. The message content.

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

### setContent

Required. The message content.

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

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

### getLanguageCode

Optional. The message language.

This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
language tag. Example: "en-US".

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

### setLanguageCode

Optional. The message language.

This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
language tag. Example: "en-US".

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

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

### getParticipant

Output only. The participant that sends this message.

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

### setParticipant

Output only. The participant that sends this message.

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

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

### getParticipantRole

Output only. The role of the participant.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Role](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Participant.Role). |

### setParticipantRole

Output only. The role of the participant.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Role](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Participant.Role). |

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

### getCreateTime

Output only. The time when the message was created in Contact Center AI.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time when the message was created in Contact Center AI.

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

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

### getSendTime

Optional. The time when the message was sent. For voice messages, this is
the time when an utterance started.

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

### hasSendTime

### clearSendTime

### setSendTime

Optional. The time when the message was sent. For voice messages, this is
the time when an utterance started.

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

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

### getMessageAnnotation

Output only. The annotation for the message.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.MessageAnnotation|null` |   |

### hasMessageAnnotation

### clearMessageAnnotation

### setMessageAnnotation

Output only. The annotation for the message.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.MessageAnnotation` |

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

### getSentimentAnalysis

Output only. The sentiment analysis result for the message.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.SentimentAnalysisResult|null` |   |

### hasSentimentAnalysis

### clearSentimentAnalysis

### setSentimentAnalysis

Output only. The sentiment analysis result for the message.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.SentimentAnalysisResult` |

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