# Google Cloud Retail V2 Client - Class UserAnswer (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class UserAnswer.

This field specifies the current user answer during the conversational
filtering search. This can be either user selected from suggested answers
or user input plain text.

Generated from protobuf message `google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ ConversationalSearchRequest

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text_answer` | `string` This field specifies the incremental input text from the user during the conversational search. |
| `↳ selected_answer` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchRequest.UserAnswer.SelectedAnswer` Optional. This field specifies the selected answer during the conversational search. This should be a subset of ConversationalSearchResponse.followup_question.suggested_answers. |

### getTextAnswer

This field specifies the incremental input text from the user during
the conversational search.

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

### hasTextAnswer

### setTextAnswer

This field specifies the incremental input text from the user during
the conversational search.

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

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

### getSelectedAnswer

Optional. This field specifies the selected answer during the
conversational search. This should be a subset of
ConversationalSearchResponse.followup_question.suggested_answers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchRequest.UserAnswer.SelectedAnswer|null` |   |

### hasSelectedAnswer

### setSelectedAnswer

Optional. This field specifies the selected answer during the
conversational search. This should be a subset of
ConversationalSearchResponse.followup_question.suggested_answers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.ConversationalSearchRequest.UserAnswer.SelectedAnswer` |

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

### getType

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