Class Rule.PinAction (2.64.0)

public static final class Rule.PinAction extends GeneratedMessageV3 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.v2beta.Rule.PinAction

Static Fields

PIN_MAP_FIELD_NUMBER

public static final int PIN_MAP_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Rule.PinAction getDefaultInstance()
Returns
Type Description
Rule.PinAction

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Rule.PinAction.Builder newBuilder()
Returns
Type Description
Rule.PinAction.Builder

newBuilder(Rule.PinAction prototype)

public static Rule.PinAction.Builder newBuilder(Rule.PinAction prototype)
Parameter
Name Description
prototype Rule.PinAction
Returns
Type Description
Rule.PinAction.Builder

parseDelimitedFrom(InputStream input)

public static Rule.PinAction parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Rule.PinAction parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Rule.PinAction parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Rule.PinAction parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Rule.PinAction parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Rule.PinAction parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Rule.PinAction parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Rule.PinAction parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Rule.PinAction parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Rule.PinAction parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Rule.PinAction parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Rule.PinAction parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Rule.PinAction
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Rule.PinAction> parser()
Returns
Type Description
Parser<PinAction>

Methods

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
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Rule.PinAction getDefaultInstanceForType()
Returns
Type Description
Rule.PinAction

getParserForType()

public Parser<Rule.PinAction> getParserForType()
Returns
Type Description
Parser<PinAction>
Overrides

getPinMap() (deprecated)

public Map<Long,String> getPinMap()

Use #getPinMapMap() instead.

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

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
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.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Rule.PinAction.Builder newBuilderForType()
Returns
Type Description
Rule.PinAction.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Rule.PinAction.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Rule.PinAction.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Rule.PinAction.Builder toBuilder()
Returns
Type Description
Rule.PinAction.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException