# Retail V2 API - Class Google::Cloud::Retail::V2::CatalogService::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::CatalogService::Client.

Client for the CatalogService service.


<br />

Service for managing catalog configuration.

## Inherits

- Object

## Includes

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

## Methods

### .configure

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

Configure the CatalogService Client class.


<br />

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

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

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

### #add_catalog_attribute

    def add_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
    def add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

Adds the specified
[CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to the
[AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)").


<br />

If the [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to add
already exists, an ALREADY_EXISTS error is returned.
**Overloads**

    def add_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

- **request** ([::Google::Cloud::Retail::V2::AddCatalogAttributeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AddCatalogAttributeRequest), ::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 add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

- **attributes_config** (::String) --- Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
- **catalog_attribute** ([::Google::Cloud::Retail::V2::CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute), ::Hash) --- Required. The [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to add.
**Yields**

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

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

- ([::Google::Cloud::Retail::V2::AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig))
**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::CatalogService::Client.new

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

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

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

### #configure

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

Configure the CatalogService 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-CatalogService-Client#Google__Cloud__Retail__V2__CatalogService__Client_configure_class_ "Google::Cloud::Retail::V2::CatalogService::Client.configure (method)").

<br />

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

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

### #get_attributes_config

    def get_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
    def get_attributes_config(name: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

Gets an [AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)").
**Overloads**

    def get_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

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

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

- **name** (::String) --- Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
**Yields**

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

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

- ([::Google::Cloud::Retail::V2::AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig))
**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::CatalogService::Client.new

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

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

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

### #get_completion_config

    def get_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
    def get_completion_config(name: nil) -> ::Google::Cloud::Retail::V2::CompletionConfig

Gets a [CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig "Google::Cloud::Retail::V2::CompletionConfig (class)").
**Overloads**

    def get_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig

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

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

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

- **name** (::String) --- Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
**Yields**

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

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

- ([::Google::Cloud::Retail::V2::CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig))
**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::CatalogService::Client.new

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

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

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

### #get_default_branch

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

Get which branch is currently default branch set by
[CatalogService.SetDefaultBranch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogService-Client#Google__Cloud__Retail__V2__CatalogService__Client_set_default_branch_instance_ "Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch (method)")
method under a specified parent catalog.
**Overloads**

    def get_default_branch(request, options = nil) -> ::Google::Cloud::Retail::V2::GetDefaultBranchResponse

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

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

Pass arguments to `get_default_branch` 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) --- The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.
**Yields**

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

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

- ([::Google::Cloud::Retail::V2::GetDefaultBranchResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GetDefaultBranchResponse))
**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::CatalogService::Client.new

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

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

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

### #initialize

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

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

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

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

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

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

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

### #list_catalogs

    def list_catalogs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>
    def list_catalogs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>

Lists all the {::Google::Cloud::Retail::V2::Catalog Catalog}s associated with
the project.
**Overloads**

    def list_catalogs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>

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

- **request** ([::Google::Cloud::Retail::V2::ListCatalogsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListCatalogsRequest), ::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_catalogs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>

Pass arguments to `list_catalogs` 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 account resource name with an associated location.


  If the caller does not have permission to list
  {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless
  of whether or not this location exists, a PERMISSION_DENIED error is
  returned.
- **page_size** (::Integer) --- Maximum number of [Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog "Google::Cloud::Retail::V2::Catalog (class)")s to return. If unspecified, defaults to 50. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000.


  If this field is negative, an INVALID_ARGUMENT is returned.
- **page_token** (::String) --- A page token [ListCatalogsResponse.next_page_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ListCatalogsResponse#Google__Cloud__Retail__V2__ListCatalogsResponse_next_page_token_instance_ "Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token (method)"), received from a previous [CatalogService.ListCatalogs](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogService-Client#Google__Cloud__Retail__V2__CatalogService__Client_list_catalogs_instance_ "Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [CatalogService.ListCatalogs](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogService-Client#Google__Cloud__Retail__V2__CatalogService__Client_list_catalogs_instance_ "Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs (method)")
  must match the call that provided the page token. Otherwise, an
  INVALID_ARGUMENT error is returned.
**Yields**

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

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

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Retail::V2::Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog)\>)
**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::CatalogService::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Retail::V2::Catalog.
  p item
end
```

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

### #remove_catalog_attribute

    def remove_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
    def remove_catalog_attribute(attributes_config: nil, key: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

Removes the specified
[CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") from the
[AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)").


<br />

If the [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to
remove does not exist, a NOT_FOUND error is returned.
**Overloads**

    def remove_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

- **request** ([::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-RemoveCatalogAttributeRequest), ::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 remove_catalog_attribute(attributes_config: nil, key: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

- **attributes_config** (::String) --- Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
- **key** (::String) --- Required. The attribute name key of the [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to remove.
**Yields**

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

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

- ([::Google::Cloud::Retail::V2::AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig))
**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::CatalogService::Client.new

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

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

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

### #replace_catalog_attribute

    def replace_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
    def replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

Replaces the specified
[CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") in the
[AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)") by updating the
catalog attribute with the same
[CatalogAttribute.key](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute#Google__Cloud__Retail__V2__CatalogAttribute_key_instance_ "Google::Cloud::Retail::V2::CatalogAttribute#key (method)").


<br />

If the [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to
replace does not exist, a NOT_FOUND error is returned.
**Overloads**

    def replace_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

- **request** ([::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ReplaceCatalogAttributeRequest), ::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 replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

- **attributes_config** (::String) --- Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
- **catalog_attribute** ([::Google::Cloud::Retail::V2::CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute), ::Hash) --- Required. The updated [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)").
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [CatalogAttribute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogAttribute "Google::Cloud::Retail::V2::CatalogAttribute (class)") to update. The following are NOT supported:


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

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

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

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

- ([::Google::Cloud::Retail::V2::AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig))
**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::CatalogService::Client.new

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

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

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

### #set_default_branch

    def set_default_branch(request, options = nil) -> ::Google::Protobuf::Empty
    def set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) -> ::Google::Protobuf::Empty

Set a specified branch id as default branch. API methods such as
[SearchService.Search](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchService-Client#Google__Cloud__Retail__V2__SearchService__Client_search_instance_ "Google::Cloud::Retail::V2::SearchService::Client#search (method)"),
[ProductService.GetProduct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Client#Google__Cloud__Retail__V2__ProductService__Client_get_product_instance_ "Google::Cloud::Retail::V2::ProductService::Client#get_product (method)"),
[ProductService.ListProducts](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Client#Google__Cloud__Retail__V2__ProductService__Client_list_products_instance_ "Google::Cloud::Retail::V2::ProductService::Client#list_products (method)")
will treat requests using "default_branch" to the actual branch id set as
default.

For example, if `projects//locations//catalogs//branches/1` is set as
default, setting
[SearchRequest.branch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchRequest#Google__Cloud__Retail__V2__SearchRequest_branch_instance_ "Google::Cloud::Retail::V2::SearchRequest#branch (method)") to
`projects//locations//catalogs//branches/default_branch` is equivalent
to setting
[SearchRequest.branch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchRequest#Google__Cloud__Retail__V2__SearchRequest_branch_instance_ "Google::Cloud::Retail::V2::SearchRequest#branch (method)") to
`projects//locations//catalogs/*/branches/1`.

Using multiple branches can be useful when developers would like
to have a staging branch to test and verify for future usage. When it
becomes ready, developers switch on the staging branch using this API
while keeping using
`projects//locations//catalogs/*/branches/default_branch` as
[SearchRequest.branch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchRequest#Google__Cloud__Retail__V2__SearchRequest_branch_instance_ "Google::Cloud::Retail::V2::SearchRequest#branch (method)") to
route the traffic to this staging branch.

CAUTION: If you have live predict/search traffic, switching the default
branch could potentially cause outages if the ID space of the new branch
is very different from the old one.

More specifically:

- PredictionService will only return product IDs from branch {newBranch}.
- SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set).
- UserEventService will only join events with products from branch {newBranch}.
**Overloads**

    def set_default_branch(request, options = nil) -> ::Google::Protobuf::Empty

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

- **request** ([::Google::Cloud::Retail::V2::SetDefaultBranchRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetDefaultBranchRequest), ::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 set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) -> ::Google::Protobuf::Empty

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

- **catalog** (::String) --- Full resource name of the catalog, such as `projects/*/locations/global/catalogs/default_catalog`.
- **branch_id** (::String) --- The final component of the resource name of a branch.


  This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
  error is returned.

  If there are no sufficient active products in the targeted branch and
  [force](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetDefaultBranchRequest#Google__Cloud__Retail__V2__SetDefaultBranchRequest_force_instance_ "Google::Cloud::Retail::V2::SetDefaultBranchRequest#force (method)") is not set, a
  FAILED_PRECONDITION error is returned.
- **note** (::String) --- Some note on this request, this can be retrieved by [CatalogService.GetDefaultBranch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogService-Client#Google__Cloud__Retail__V2__CatalogService__Client_get_default_branch_instance_ "Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch (method)") before next valid default branch set occurs.


  This field must be a UTF-8 encoded string with a length limit of 1,000
  characters. Otherwise, an INVALID_ARGUMENT error is returned.
- **force** (::Boolean) --- If set to true, it permits switching to a branch with [branch_id](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SetDefaultBranchRequest#Google__Cloud__Retail__V2__SetDefaultBranchRequest_branch_id_instance_ "Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id (method)") even if it has no sufficient active products.
**Yields**

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

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

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-Empty))
**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::CatalogService::Client.new

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

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

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_attributes_config

    def update_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
    def update_attributes_config(attributes_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

Updates the [AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)").


<br />

The catalog attributes in the request will be updated in the catalog, or
inserted if they do not exist. Existing catalog attributes not included in
the request will remain unchanged. Attributes that are assigned to
products, but do not exist at the catalog level, are always included in the
response. The product attribute is assigned default values for missing
catalog attribute fields, e.g., searchable and dynamic facetable options.
**Overloads**

    def update_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig

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

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

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

- **attributes_config** ([::Google::Cloud::Retail::V2::AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig), ::Hash) --- Required. The [AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)") to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig "Google::Cloud::Retail::V2::AttributesConfig (class)") to update. The following is the only supported field:


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

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

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

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

- ([::Google::Cloud::Retail::V2::AttributesConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AttributesConfig))
**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::CatalogService::Client.new

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

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

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

### #update_catalog

    def update_catalog(request, options = nil) -> ::Google::Cloud::Retail::V2::Catalog
    def update_catalog(catalog: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::Catalog

Updates the {::Google::Cloud::Retail::V2::Catalog Catalog}s.
**Overloads**

    def update_catalog(request, options = nil) -> ::Google::Cloud::Retail::V2::Catalog

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

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

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

- **catalog** ([::Google::Cloud::Retail::V2::Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog), ::Hash) --- Required. The [Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog "Google::Cloud::Retail::V2::Catalog (class)") to update.


  If the caller does not have permission to update the
  [Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog "Google::Cloud::Retail::V2::Catalog (class)"), regardless of whether or not it
  exists, a PERMISSION_DENIED error is returned.

  If the [Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog "Google::Cloud::Retail::V2::Catalog (class)") to update does not exist,
  a NOT_FOUND error is returned.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog "Google::Cloud::Retail::V2::Catalog (class)") to update.


  If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  is returned.
**Yields**

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

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

- ([::Google::Cloud::Retail::V2::Catalog](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Catalog))
**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::CatalogService::Client.new

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

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

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

### #update_completion_config

    def update_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
    def update_completion_config(completion_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::CompletionConfig

Updates the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}s.
**Overloads**

    def update_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig

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

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

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

- **completion_config** ([::Google::Cloud::Retail::V2::CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig), ::Hash) --- Required. The [CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig "Google::Cloud::Retail::V2::CompletionConfig (class)") to update.


  If the caller does not have permission to update the
  [CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig "Google::Cloud::Retail::V2::CompletionConfig (class)"), then a
  PERMISSION_DENIED error is returned.

  If the [CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig "Google::Cloud::Retail::V2::CompletionConfig (class)") to
  update does not exist, a NOT_FOUND error is returned.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided [CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig "Google::Cloud::Retail::V2::CompletionConfig (class)") to update. The following are the only supported fields:


  - [CompletionConfig.matching_order](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig#Google__Cloud__Retail__V2__CompletionConfig_matching_order_instance_ "Google::Cloud::Retail::V2::CompletionConfig#matching_order (method)")
  - [CompletionConfig.max_suggestions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig#Google__Cloud__Retail__V2__CompletionConfig_max_suggestions_instance_ "Google::Cloud::Retail::V2::CompletionConfig#max_suggestions (method)")
  - [CompletionConfig.min_prefix_length](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig#Google__Cloud__Retail__V2__CompletionConfig_min_prefix_length_instance_ "Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length (method)")
  - [CompletionConfig.auto_learning](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig#Google__Cloud__Retail__V2__CompletionConfig_auto_learning_instance_ "Google::Cloud::Retail::V2::CompletionConfig#auto_learning (method)")

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

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

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

- ([::Google::Cloud::Retail::V2::CompletionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionConfig))
**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::CatalogService::Client.new

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

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

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