public static final class Rule.PinAction.Builder extends GeneratedMessageV3.Builder<Rule.PinAction.Builder> implements Rule.PinActionOrBuilder
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.
Protobuf type google.cloud.retail.v2alpha.Rule.PinAction
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Rule.PinAction.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public Rule.PinAction build()
buildPartial()
public Rule.PinAction buildPartial()
clear()
public Rule.PinAction.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public Rule.PinAction.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public Rule.PinAction.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearPinMap()
public Rule.PinAction.Builder clearPinMap()
clone()
public Rule.PinAction.Builder clone()
Overrides
containsPinMap(long key)
public boolean containsPinMap(long key)
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter |
Name |
Description |
key |
long
|
getDefaultInstanceForType()
public Rule.PinAction getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getMutablePinMap() (deprecated)
public Map<Long,String> getMutablePinMap()
Use alternate mutation accessors instead.
Returns |
Type |
Description |
Map<java.lang.Long,String> |
|
getPinMap() (deprecated)
public Map<Long,String> getPinMap()
Returns |
Type |
Description |
Map<java.lang.Long,String> |
|
getPinMapCount()
public int getPinMapCount()
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Returns |
Type |
Description |
int |
|
getPinMapMap()
public Map<Long,String> getPinMapMap()
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Returns |
Type |
Description |
Map<java.lang.Long,String> |
|
getPinMapOrDefault(long key, String defaultValue)
public String getPinMapOrDefault(long key, String defaultValue)
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Parameters |
Name |
Description |
key |
long
|
defaultValue |
String
|
Returns |
Type |
Description |
String |
|
getPinMapOrThrow(long key)
public String getPinMapOrThrow(long key)
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter |
Name |
Description |
key |
long
|
Returns |
Type |
Description |
String |
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
internalGetMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
internalGetMutableMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(Rule.PinAction other)
public Rule.PinAction.Builder mergeFrom(Rule.PinAction other)
public Rule.PinAction.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public Rule.PinAction.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Rule.PinAction.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
putAllPinMap(Map<Long,String> values)
public Rule.PinAction.Builder putAllPinMap(Map<Long,String> values)
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter |
Name |
Description |
values |
Map<java.lang.Long,String>
|
putPinMap(long key, String value)
public Rule.PinAction.Builder putPinMap(long key, String value)
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
removePinMap(long key)
public Rule.PinAction.Builder removePinMap(long key)
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.
map<int64, string> pin_map = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter |
Name |
Description |
key |
long
|
setField(Descriptors.FieldDescriptor field, Object value)
public Rule.PinAction.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Rule.PinAction.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final Rule.PinAction.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides