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

Configures dynamic metadata that can be linked to a
[ServingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ServingConfig "Google::Cloud::Retail::V2::ServingConfig (class)") and affect search or
recommendation results at serving time.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #associated_serving_config_ids

    def associated_serving_config_ids() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Output only. List of [serving config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ServingConfig "Google::Cloud::Retail::V2::ServingConfig (class)") ids that are associated with this control in the same [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)").


  Note the association is managed via the
  [ServingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ServingConfig "Google::Cloud::Retail::V2::ServingConfig (class)"), this is an output
  only denormalized view.

### #display_name

    def display_name() -> ::String

**Returns**

- (::String) --- Required. The human readable control display name. Used in Retail UI.

  This field must be a UTF-8 encoded string with a length limit of 128
  characters. Otherwise, an INVALID_ARGUMENT error is thrown.

### #display_name=

    def display_name=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The human readable control display name. Used in Retail UI.


  This field must be a UTF-8 encoded string with a length limit of 128
  characters. Otherwise, an INVALID_ARGUMENT error is thrown.
**Returns**

- (::String) --- Required. The human readable control display name. Used in Retail UI.

  This field must be a UTF-8 encoded string with a length limit of 128
  characters. Otherwise, an INVALID_ARGUMENT error is thrown.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`
**Returns**

- (::String) --- Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`

### #rule

    def rule() -> ::Google::Cloud::Retail::V2::Rule

**Returns**

- ([::Google::Cloud::Retail::V2::Rule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule)) --- A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes".

### #rule=

    def rule=(value) -> ::Google::Cloud::Retail::V2::Rule

**Parameter**

- **value** ([::Google::Cloud::Retail::V2::Rule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule)) --- A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes".
**Returns**

- ([::Google::Cloud::Retail::V2::Rule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule)) --- A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes".

### #search_solution_use_case

    def search_solution_use_case() -> ::Array<::Google::Cloud::Retail::V2::SearchSolutionUseCase>

**Returns**

- (::Array\<[::Google::Cloud::Retail::V2::SearchSolutionUseCase](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchSolutionUseCase)\>) --- Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to [SEARCH_SOLUTION_USE_CASE_SEARCH](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchSolutionUseCase#Google__Cloud__Retail__V2__SearchSolutionUseCase__SEARCH_SOLUTION_USE_CASE_SEARCH "Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH (constant)") if not specified. Currently only allow one search_solution_use_case per control.

### #search_solution_use_case=

    def search_solution_use_case=(value) -> ::Array<::Google::Cloud::Retail::V2::SearchSolutionUseCase>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Retail::V2::SearchSolutionUseCase](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchSolutionUseCase)\>) --- Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to [SEARCH_SOLUTION_USE_CASE_SEARCH](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchSolutionUseCase#Google__Cloud__Retail__V2__SearchSolutionUseCase__SEARCH_SOLUTION_USE_CASE_SEARCH "Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH (constant)") if not specified. Currently only allow one search_solution_use_case per control.
**Returns**

- (::Array\<[::Google::Cloud::Retail::V2::SearchSolutionUseCase](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchSolutionUseCase)\>) --- Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to [SEARCH_SOLUTION_USE_CASE_SEARCH](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchSolutionUseCase#Google__Cloud__Retail__V2__SearchSolutionUseCase__SEARCH_SOLUTION_USE_CASE_SEARCH "Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH (constant)") if not specified. Currently only allow one search_solution_use_case per control.

### #solution_types

    def solution_types() -> ::Array<::Google::Cloud::Retail::V2::SolutionType>

**Returns**

- (::Array\<[::Google::Cloud::Retail::V2::SolutionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SolutionType)\>) --- Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time.


  Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
  If no solution type is provided at creation time, will default to
  [SOLUTION_TYPE_SEARCH](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SolutionType#Google__Cloud__Retail__V2__SolutionType__SOLUTION_TYPE_SEARCH "Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH (constant)").

### #solution_types=

    def solution_types=(value) -> ::Array<::Google::Cloud::Retail::V2::SolutionType>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Retail::V2::SolutionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SolutionType)\>) --- Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time.


  Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
  If no solution type is provided at creation time, will default to
  [SOLUTION_TYPE_SEARCH](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SolutionType#Google__Cloud__Retail__V2__SolutionType__SOLUTION_TYPE_SEARCH "Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH (constant)").
**Returns**

- (::Array\<[::Google::Cloud::Retail::V2::SolutionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SolutionType)\>) --- Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time.


  Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
  If no solution type is provided at creation time, will default to
  [SOLUTION_TYPE_SEARCH](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SolutionType#Google__Cloud__Retail__V2__SolutionType__SOLUTION_TYPE_SEARCH "Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH (constant)").