Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRulePinAction
- Inherits:
-
Object
- Object
- Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRulePinAction
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/retail_v2beta/classes.rb,
lib/google/apis/retail_v2beta/representations.rb,
lib/google/apis/retail_v2beta/representations.rb
Overview
Pins one or more specified products to a specific position in the results. *
Rule Condition: Must specify non-empty Condition.query_terms (for search only)
or Condition.page_categories (for browse only), but can't specify both. *
Action Input: mapping of [pin_position, product_id] pairs (pin position uses
1-based indexing). * Action Result: Will pin products with matching ids to the
position specified in the final result order. Example: Suppose the query is
shoes, the Condition.query_terms is shoes and the pin_map has 1, "pid1",
then product with pid1 will be pinned to the top position in the final
results. If multiple PinActions are matched to a single request the actions
will be processed from most to least recently updated. Pins to positions
larger than the max allowed page size of 120 are not allowed.
Instance Attribute Summary collapse
-
#pin_map ⇒ Hash<String,String>
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRetailV2betaRulePinAction
constructor
A new instance of GoogleCloudRetailV2betaRulePinAction.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRetailV2betaRulePinAction
Returns a new instance of GoogleCloudRetailV2betaRulePinAction.
7346 7347 7348 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7346 def initialize(**args) update!(**args) end |
Instance Attribute Details
#pin_map ⇒ Hash<String,String>
Required. A map of positions to product_ids. Partial matches per action are
allowed, if a certain position in the map is already filled that [position,
product_id] pair will be ignored but the rest may still be applied. This case
will only occur if multiple pin actions are matched to a single request, as
the map guarantees that pin positions are unique within the same action.
Duplicate product_ids are not permitted within a single pin map. The max size
of this map is 120, equivalent to the max request page size.
Corresponds to the JSON property pinMap
7344 7345 7346 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7344 def pin_map @pin_map end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7351 7352 7353 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7351 def update!(**args) @pin_map = args[:pin_map] if args.key?(:pin_map) end |