# Retail V2 API - Class Google::Cloud::Retail::V2::GenerativeQuestionService::Client (v2.9.0)

2.9.0 (latest) 2.8.1 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.3.0 1.2.0 1.1.0 1.0.1 0.21.0 0.20.0 0.19.0 0.18.2 0.17.0 0.16.1 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.4 Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::GenerativeQuestionService::Client.

Client for the GenerativeQuestionService service.


<br />

Service for managing LLM generated questions in search serving.

## Inherits

- Object

## Includes

- [Google::Cloud::Retail::V2::GenerativeQuestionService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Paths)

## Methods

### .configure

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

Configure the GenerativeQuestionService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration "Google::Cloud::Retail::V2::GenerativeQuestionService::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-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all GenerativeQuestionService clients
::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_update_generative_question_configs

    def batch_update_generative_question_configs(request, options = nil) -> ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse
    def batch_update_generative_question_configs(parent: nil, requests: nil) -> ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse

Allows management of multiple questions.
**Overloads**

    def batch_update_generative_question_configs(request, options = nil) -> ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse

Pass arguments to `batch_update_generative_question_configs` via a request object, either of type [BatchUpdateGenerativeQuestionConfigsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-BatchUpdateGenerativeQuestionConfigsRequest "Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-BatchUpdateGenerativeQuestionConfigsRequest), ::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 batch_update_generative_question_configs(parent: nil, requests: nil) -> ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse

Pass arguments to `batch_update_generative_question_configs` 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) --- Optional. Resource name of the parent catalog. Format: projects/{project}/locations/{location}/catalogs/{catalog}
- **requests** (::Array\<[::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UpdateGenerativeQuestionConfigRequest), ::Hash\>) --- Required. The updates question configs.
**Yields**

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

- **response** ([::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-BatchUpdateGenerativeQuestionConfigsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-BatchUpdateGenerativeQuestionConfigsResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new

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

# The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.
p result
```

### #configure

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

Configure the GenerativeQuestionService 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-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client#Google__Cloud__Retail__V2__GenerativeQuestionService__Client_configure_class_ "Google::Cloud::Retail::V2::GenerativeQuestionService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration "Google::Cloud::Retail::V2::GenerativeQuestionService::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-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration))

### #get_generative_questions_feature_config

    def get_generative_questions_feature_config(request, options = nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig
    def get_generative_questions_feature_config(catalog: nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig

Manages overal generative question feature state -- enables toggling
feature on and off.
**Overloads**

    def get_generative_questions_feature_config(request, options = nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig

Pass arguments to `get_generative_questions_feature_config` via a request object, either of type [Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GetGenerativeQuestionsFeatureConfigRequest "Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GetGenerativeQuestionsFeatureConfigRequest), ::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_generative_questions_feature_config(catalog: nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig

Pass arguments to `get_generative_questions_feature_config` 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**

- **catalog** (::String) --- Required. Resource name of the parent catalog. Format: projects/{project}/locations/{location}/catalogs/{catalog}
**Yields**

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

- **response** ([::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionsFeatureConfig))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionsFeatureConfig))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new

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

# The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.
p result
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_generative_question_configs

    def list_generative_question_configs(request, options = nil) -> ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse
    def list_generative_question_configs(parent: nil) -> ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse

Returns all questions for a given catalog.
**Overloads**

    def list_generative_question_configs(request, options = nil) -> ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse

Pass arguments to `list_generative_question_configs` via a request object, either of type [ListGenerativeQuestionConfigsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListGenerativeQuestionConfigsRequest "Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListGenerativeQuestionConfigsRequest), ::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 list_generative_question_configs(parent: nil) -> ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse

Pass arguments to `list_generative_question_configs` 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**

- **parent** (::String) --- Required. Resource name of the parent catalog. Format: projects/{project}/locations/{location}/catalogs/{catalog}
**Yields**

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

- **response** ([::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListGenerativeQuestionConfigsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListGenerativeQuestionConfigsResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new

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

# The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.
p result
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Client)

### #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_generative_question_config

    def update_generative_question_config(request, options = nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionConfig
    def update_generative_question_config(generative_question_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionConfig

Allows management of individual questions.
**Overloads**

    def update_generative_question_config(request, options = nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionConfig

Pass arguments to `update_generative_question_config` via a request object, either of type [UpdateGenerativeQuestionConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UpdateGenerativeQuestionConfigRequest "Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UpdateGenerativeQuestionConfigRequest), ::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_generative_question_config(generative_question_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionConfig

Pass arguments to `update_generative_question_config` 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**

- **generative_question_config** ([::Google::Cloud::Retail::V2::GenerativeQuestionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionConfig), ::Hash) --- Required. The question to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Optional. Indicates which fields in the provided [GenerativeQuestionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionConfig "Google::Cloud::Retail::V2::GenerativeQuestionConfig (class)") to update. The following are NOT supported:


  - [GenerativeQuestionConfig.frequency](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionConfig#Google__Cloud__Retail__V2__GenerativeQuestionConfig_frequency_instance_ "Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency (method)")

  If not set or empty, all supported fields are updated.
**Yields**

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

- **response** ([::Google::Cloud::Retail::V2::GenerativeQuestionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionConfig))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Retail::V2::GenerativeQuestionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionConfig))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new

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

# The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig.
p result
```

### #update_generative_questions_feature_config

    def update_generative_questions_feature_config(request, options = nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig
    def update_generative_questions_feature_config(generative_questions_feature_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig

Manages overal generative question feature state -- enables toggling
feature on and off.
**Overloads**

    def update_generative_questions_feature_config(request, options = nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig

Pass arguments to `update_generative_questions_feature_config` via a request object, either of type [UpdateGenerativeQuestionsFeatureConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UpdateGenerativeQuestionsFeatureConfigRequest "Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UpdateGenerativeQuestionsFeatureConfigRequest), ::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_generative_questions_feature_config(generative_questions_feature_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig

Pass arguments to `update_generative_questions_feature_config` 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**

- **generative_questions_feature_config** ([::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionsFeatureConfig), ::Hash) --- Required. The configuration managing the feature state.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Optional. Indicates which fields in the provided [GenerativeQuestionsFeatureConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionsFeatureConfig "Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig (class)") to update. If not set or empty, all supported fields are updated.
**Yields**

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

- **response** ([::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionsFeatureConfig))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionsFeatureConfig))
**Raises**

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

Basic example

```ruby
require "google/cloud/retail/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new

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

# The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.
p result
```