# Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client (v0.28.0)

0.28.0 (latest) 0.27.0 0.26.0 0.25.0 0.24.0 0.23.1 0.22.0 0.21.0 0.20.1 0.19.1 0.18.0 0.17.0 0.16.0 0.15.0 0.14.2 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.2 0.6.0 0.5.0 0.4.0 0.3.0 0.2.1 0.1.0 Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.

REST client for the SearchTuningService service.


<br />

Service for search tuning.

## Inherits

- Object

## Includes

- [Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Paths)

## Methods

### .configure

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

Configure the SearchTuningService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::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-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all SearchTuningService clients
::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the SearchTuningService 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-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client#Google__Cloud__DiscoveryEngine__V1beta__SearchTuningService__Rest__Client_configure_class_ "Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::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-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration))

### #initialize

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

Create a new SearchTuningService REST client object.
**Yields**

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_custom_models

    def list_custom_models(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse
    def list_custom_models(data_store: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse

Gets a list of all the custom models.
**Overloads**

    def list_custom_models(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse

Pass arguments to `list_custom_models` via a request object, either of type [ListCustomModelsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCustomModelsRequest "Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCustomModelsRequest), ::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_custom_models(data_store: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse

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

- **data_store** (::String) --- Required. The resource name of the parent Data Store, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. This field is used to identify the data store where to fetch the models from.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCustomModelsResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCustomModelsResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse.
p result
```

### #location_client

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

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

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

### #logger

    def logger() -> Logger

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

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-SearchTuningService-Rest-Operations))

### #train_custom_model

    def train_custom_model(request, options = nil) -> ::Gapic::Operation
    def train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil) -> ::Gapic::Operation

Trains a custom model.
**Overloads**

    def train_custom_model(request, options = nil) -> ::Gapic::Operation

Pass arguments to `train_custom_model` via a request object, either of type [TrainCustomModelRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TrainCustomModelRequest "Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TrainCustomModelRequest), ::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 train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil) -> ::Gapic::Operation

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

- **gcs_training_input** ([::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest::GcsTrainingInput](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TrainCustomModelRequest-GcsTrainingInput), ::Hash) --- Cloud Storage training input.
- **data_store** (::String) --- Required. The resource name of the Data Store, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. This field is used to identify the data store where to train the models.
- **model_type** (::String) ---

  Model to be trained. Supported values are:
  - **search-tuning**: Fine tuning the search system based on data provided.
- **error_config** ([::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ImportErrorConfig), ::Hash) --- The desired location of errors incurred during the data ingestion and training.
- **model_id** (::String) --- If not provided, a UUID will be generated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

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

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest.new

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)