# Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse (v2.8.0)

2.8.0 (latest) 2.7.0 2.6.2 2.5.0 2.4.0 2.3.1 2.2.0 2.1.1 2.0.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.

Response message for
[ConversationalSearchService.AnswerQuery](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ConversationalSearchService-Client#Google__Cloud__DiscoveryEngine__V1__ConversationalSearchService__Client_answer_query_instance_ "Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query (method)")
method.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #answer

    def answer() -> ::Google::Cloud::DiscoveryEngine::V1::Answer

**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Answer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Answer)) --- Answer resource object. If [AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest-QueryUnderstandingSpec-QueryRephraserSpec#Google__Cloud__DiscoveryEngine__V1__AnswerQueryRequest__QueryUnderstandingSpec__QueryRephraserSpec_max_rephrase_steps_instance_ "Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec#max_rephrase_steps (method)") is greater than 1, use [Answer.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Answer#Google__Cloud__DiscoveryEngine__V1__Answer_name_instance_ "Google::Cloud::DiscoveryEngine::V1::Answer#name (method)") to fetch answer information using [ConversationalSearchService.GetAnswer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ConversationalSearchService-Client#Google__Cloud__DiscoveryEngine__V1__ConversationalSearchService__Client_get_answer_instance_ "Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer (method)") API.

### #answer=

    def answer=(value) -> ::Google::Cloud::DiscoveryEngine::V1::Answer

**Parameter**

- **value** ([::Google::Cloud::DiscoveryEngine::V1::Answer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Answer)) --- Answer resource object. If [AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest-QueryUnderstandingSpec-QueryRephraserSpec#Google__Cloud__DiscoveryEngine__V1__AnswerQueryRequest__QueryUnderstandingSpec__QueryRephraserSpec_max_rephrase_steps_instance_ "Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec#max_rephrase_steps (method)") is greater than 1, use [Answer.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Answer#Google__Cloud__DiscoveryEngine__V1__Answer_name_instance_ "Google::Cloud::DiscoveryEngine::V1::Answer#name (method)") to fetch answer information using [ConversationalSearchService.GetAnswer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ConversationalSearchService-Client#Google__Cloud__DiscoveryEngine__V1__ConversationalSearchService__Client_get_answer_instance_ "Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer (method)") API.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Answer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Answer)) --- Answer resource object. If [AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest-QueryUnderstandingSpec-QueryRephraserSpec#Google__Cloud__DiscoveryEngine__V1__AnswerQueryRequest__QueryUnderstandingSpec__QueryRephraserSpec_max_rephrase_steps_instance_ "Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec#max_rephrase_steps (method)") is greater than 1, use [Answer.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Answer#Google__Cloud__DiscoveryEngine__V1__Answer_name_instance_ "Google::Cloud::DiscoveryEngine::V1::Answer#name (method)") to fetch answer information using [ConversationalSearchService.GetAnswer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ConversationalSearchService-Client#Google__Cloud__DiscoveryEngine__V1__ConversationalSearchService__Client_get_answer_instance_ "Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer (method)") API.

### #answer_query_token

    def answer_query_token() -> ::String

**Returns**

- (::String) --- A global unique ID used for logging.

### #answer_query_token=

    def answer_query_token=(value) -> ::String

**Parameter**

- **value** (::String) --- A global unique ID used for logging.
**Returns**

- (::String) --- A global unique ID used for logging.

### #session

    def session() -> ::Google::Cloud::DiscoveryEngine::V1::Session

**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Session)) --- Session resource object. It will be only available when session field is set and valid in the [AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest "Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest (class)") request.

### #session=

    def session=(value) -> ::Google::Cloud::DiscoveryEngine::V1::Session

**Parameter**

- **value** ([::Google::Cloud::DiscoveryEngine::V1::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Session)) --- Session resource object. It will be only available when session field is set and valid in the [AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest "Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest (class)") request.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Session](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Session)) --- Session resource object. It will be only available when session field is set and valid in the [AnswerQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AnswerQueryRequest "Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest (class)") request.