# BigQuery Data QnA V1alpha API - Class Google::Cloud::DataQnA::V1alpha::QuestionService::Client (v0.13.0)

0.13.0 (latest) 0.12.0 0.11.1 0.10.0 0.9.1 0.8.0 0.7.2 0.6.2 0.5.0 0.4.0 0.3.0 0.2.6 Reference documentation and code samples for the BigQuery Data QnA V1alpha API class Google::Cloud::DataQnA::V1alpha::QuestionService::Client.

Client for the QuestionService service.


Service to interpret natural language queries.
The service allows to create `Question` resources that are interpreted and
are filled with one or more interpretations if the question could be
interpreted. Once a `Question` resource is created and has at least one
interpretation, an interpretation can be chosen for execution, which
triggers a query to the backend (for BigQuery, it will create a job).
Upon successful execution of that interpretation, backend specific
information will be returned so that the client can retrieve the results
from the backend.

The `Question` resources are named `projects//locations//questions/*`.

<br />

The `Question` resource has a singletion sub-resource `UserFeedback` named
`projects//locations//questions/*/userFeedback`, which allows access to
user feedback.

## Inherits

- Object

## Includes

- [Google::Cloud::DataQnA::V1alpha::QuestionService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the QuestionService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration "Google::Cloud::DataQnA::V1alpha::QuestionService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all QuestionService clients
::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the QuestionService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client#Google__Cloud__DataQnA__V1alpha__QuestionService__Client_configure_class_ "Google::Cloud::DataQnA::V1alpha::QuestionService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration "Google::Cloud::DataQnA::V1alpha::QuestionService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration))

### #create_question

    def create_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
    def create_question(parent: nil, question: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Creates a question.
**Overloads**

    def create_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Pass arguments to `create_question` via a request object, either of type [CreateQuestionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-CreateQuestionRequest "Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-CreateQuestionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_question(parent: nil, question: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Pass arguments to `create_question` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The name of the project this data source reference belongs to. Example: `projects/foo/locations/bar`
- **question** ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question), ::Hash) --- Required. The question to create.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dataqna/v1alpha"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest.new

# Call the create_question method.
result = client.create_question request

# The returned object is of type Google::Cloud::DataQnA::V1alpha::Question.
p result
```

### #execute_question

    def execute_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
    def execute_question(name: nil, interpretation_index: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Executes an interpretation.
**Overloads**

    def execute_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Pass arguments to `execute_question` via a request object, either of type [ExecuteQuestionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-ExecuteQuestionRequest "Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-ExecuteQuestionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def execute_question(name: nil, interpretation_index: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Pass arguments to `execute_question` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The unique identifier for the question. Example: `projects/foo/locations/bar/questions/1234`
- **interpretation_index** (::Integer) --- Required. Index of the interpretation to execute.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dataqna/v1alpha"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest.new

# Call the execute_question method.
result = client.execute_question request

# The returned object is of type Google::Cloud::DataQnA::V1alpha::Question.
p result
```

### #get_question

    def get_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question
    def get_question(name: nil, read_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Gets a previously created question.
**Overloads**

    def get_question(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Pass arguments to `get_question` via a request object, either of type [GetQuestionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-GetQuestionRequest "Google::Cloud::DataQnA::V1alpha::GetQuestionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DataQnA::V1alpha::GetQuestionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-GetQuestionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_question(name: nil, read_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::Question

Pass arguments to `get_question` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The unique identifier for the question. Example: `projects/foo/locations/bar/questions/1234`
- **read_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields to be retrieved.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DataQnA::V1alpha::Question](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-Question))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dataqna/v1alpha"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataQnA::V1alpha::GetQuestionRequest.new

# Call the get_question method.
result = client.get_question request

# The returned object is of type Google::Cloud::DataQnA::V1alpha::Question.
p result
```

### #get_user_feedback

    def get_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
    def get_user_feedback(name: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback

Gets previously created user feedback.
**Overloads**

    def get_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback

Pass arguments to `get_user_feedback` via a request object, either of type [GetUserFeedbackRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-GetUserFeedbackRequest "Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-GetUserFeedbackRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_user_feedback(name: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback

Pass arguments to `get_user_feedback` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The unique identifier for the user feedback. User feedback is a singleton resource on a Question. Example: `projects/foo/locations/bar/questions/1234/userFeedback`
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DataQnA::V1alpha::UserFeedback](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UserFeedback))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DataQnA::V1alpha::UserFeedback](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UserFeedback))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dataqna/v1alpha"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest.new

# Call the get_user_feedback method.
result = client.get_user_feedback request

# The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new QuestionService client object.
**Yields**

- (config) --- Configure the QuestionService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-QuestionService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config|
  config.timeout = 10.0
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_user_feedback

    def update_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback
    def update_user_feedback(user_feedback: nil, update_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback

Updates user feedback. This creates user feedback if there was none before
(upsert).
**Overloads**

    def update_user_feedback(request, options = nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback

Pass arguments to `update_user_feedback` via a request object, either of type [UpdateUserFeedbackRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UpdateUserFeedbackRequest "Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UpdateUserFeedbackRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_user_feedback(user_feedback: nil, update_mask: nil) -> ::Google::Cloud::DataQnA::V1alpha::UserFeedback

Pass arguments to `update_user_feedback` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **user_feedback** ([::Google::Cloud::DataQnA::V1alpha::UserFeedback](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UserFeedback), ::Hash) --- Required. The user feedback to update. This can be called even if there is no user feedback so far. The feedback's name field is used to identify the user feedback (and the corresponding question) to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields to be updated.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DataQnA::V1alpha::UserFeedback](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UserFeedback))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DataQnA::V1alpha::UserFeedback](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataqna-v1alpha/latest/Google-Cloud-DataQnA-V1alpha-UserFeedback))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/dataqna/v1alpha"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest.new

# Call the update_user_feedback method.
result = client.update_user_feedback request

# The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback.
p result
```