NAME

Google::Cloud::Retail::V2beta::Common - Compiled Protocol Buffers messages for google/cloud/retail/v2beta/common.proto

SYNOPSIS

use Google::Cloud::Retail::V2beta::Common;

my $msg = Google::Cloud::Retail::V2beta::Common::Condition->new({
    query_terms => $query_terms,
    active_time_range => $active_time_range,
    page_categories => $page_categories,
});

# Read or update a field
my $val = $msg->query_terms();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Retail::V2beta::Common::Condition->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/retail/v2beta/common.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Retail::V2beta::Common::Condition

Metadata that is used to define a condition that triggers an action. A valid condition must specify at least one of 'query_terms' or 'products_filter'. If multiple fields are specified, the condition is met if all the fields are satisfied e.g. if a set of query terms and product_filter are set, then only items matching the product_filter for requests with a query matching the query terms wil get boosted.

Inherits from Protobuf::Message.

Accessors

  • $msg->query_terms() / $msg->query_terms($value)

    Type: Message (Google::Cloud::Retail::V2beta::Common::Condition::QueryTerm)

    A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).

  • $msg->active_time_range() / $msg->active_time_range($value)

    Type: Message (Google::Cloud::Retail::V2beta::Common::Condition::TimeRange)

    Range of time(s) specifying when Condition is active. Condition true if any time range matches.

  • $msg->page_categories() / $msg->page_categories($value)

    Type: String

    Used to support browse uses cases. A list (up to 10 entries) of categories or departments. The format should be the same as [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories];

Google::Cloud::Retail::V2beta::Common::Rule

A rule is a condition-action pair

* A condition defines when a rule is to be triggered. * An action specifies what occurs on that trigger. Currently rules only work for [controls][google.cloud.retail.v2beta.Control] with [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Retail::V2beta::Common::Audience

An intended audience of the [Product][google.cloud.retail.v2beta.Product] for whom it's sold.

Inherits from Protobuf::Message.

Accessors

  • $msg->genders() / $msg->genders($value)

    Type: String

    The genders of the audience. Strongly encouraged to use the standard values: "male", "female", "unisex".

    At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

    Google Merchant Center property [gender](https://support.google.com/merchants/answer/6324479). Schema.org property [Product.audience.suggestedGender](https://schema.org/suggestedGender).

  • $msg->age_groups() / $msg->age_groups($value)

    Type: String

    The age groups of the audience. Strongly encouraged to use the standard values: "newborn" (up to 3 months old), "infant" (3–12 months old), "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically teens or older).

    At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

    Google Merchant Center property [age_group](https://support.google.com/merchants/answer/6324463). Schema.org property [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).

Google::Cloud::Retail::V2beta::Common::ColorInfo

The color information of a [Product][google.cloud.retail.v2beta.Product].

Inherits from Protobuf::Message.

Accessors

  • $msg->color_families() / $msg->color_families($value)

    Type: String

    The standard color families. Strongly recommended to use the following standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed". Normally it is expected to have only 1 color family. May consider using single "Mixed" instead of multiple values.

    A maximum of 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

    Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color).

    The colorFamilies field as a system attribute is not a required field but strongly recommended to be specified. Google Search models treat this field as more important than a custom product attribute when specified.

  • $msg->colors() / $msg->colors($value)

    Type: String

    The color display names, which may be different from standard color family names, such as the color aliases used in the website frontend. Normally it is expected to have only 1 color. May consider using single "Mixed" instead of multiple values.

    A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

    Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color).

Google::Cloud::Retail::V2beta::Common::CustomAttribute

A custom attribute that is not explicitly modeled in [Product][google.cloud.retail.v2beta.Product].

Inherits from Protobuf::Message.

Accessors

  • $msg->text() / $msg->text($value)

    Type: String

    The textual values of this custom attribute. For example, `["yellow", "green"]` when the key is "color".

    Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is returned.

    Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be set. Otherwise, an INVALID_ARGUMENT error is returned.

  • $msg->numbers() / $msg->numbers($value)

    Type: Double

    The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is "lengths_cm".

    Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be set. Otherwise, an INVALID_ARGUMENT error is returned.

  • $msg->searchable() / $msg->searchable($value)

    Type: Bool

    This field is normally ignored unless [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] of the [Catalog][google.cloud.retail.v2beta.Catalog] is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].

    This field is ignored in a [UserEvent][google.cloud.retail.v2beta.UserEvent].

    Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is set. Otherwise, a INVALID_ARGUMENT error is returned.

  • $msg->indexable() / $msg->indexable($value)

    Type: Bool

    This field is normally ignored unless [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] of the [Catalog][google.cloud.retail.v2beta.Catalog] is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are indexed, so that they can be filtered, faceted or boosted in [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].

    This field is ignored in a [UserEvent][google.cloud.retail.v2beta.UserEvent].

    See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter], [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs] and [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec] for more details.

Google::Cloud::Retail::V2beta::Common::FulfillmentInfo

Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods.

Inherits from Protobuf::Message.

Accessors

  • $msg->type() / $msg->type($value)

    Type: String

    The fulfillment type, including commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI.

    Supported values:

    * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * "custom-type-4" * "custom-type-5"

    If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.

  • $msg->place_ids() / $msg->place_ids($value)

    Type: String

    The IDs for this [type][google.cloud.retail.v2beta.FulfillmentInfo.type], such as the store IDs for [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2beta.FulfillmentInfo.type] or the region IDs for [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2beta.FulfillmentInfo.type].

    A maximum of 3000 values are allowed. Each value must be a string with a length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.

Google::Cloud::Retail::V2beta::Common::Image

[Product][google.cloud.retail.v2beta.Product] image. Recommendations AI and Retail Search use product images to improve prediction and search results. Product images can be returned in results, and are shown in prediction or search previews in the console. Please try to provide correct product images and avoid using images with size too small.

Inherits from Protobuf::Message.

Accessors

  • $msg->uri() / $msg->uri($value)

    Type: String

    Required. URI of the image.

    This field must be a valid UTF-8 encoded URI with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

    Google Merchant Center property [image_link](https://support.google.com/merchants/answer/6324350). Schema.org property [Product.image](https://schema.org/image).

  • $msg->height() / $msg->height($value)

    Type: Int32

    Height of the image in number of pixels.

    This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.

  • $msg->width() / $msg->width($value)

    Type: Int32

    Width of the image in number of pixels.

    This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.

Google::Cloud::Retail::V2beta::Common::Interval

A floating point interval.

Inherits from Protobuf::Message.

Accessors

  • $msg->minimum() / $msg->minimum($value)

    Type: Double

    Inclusive lower bound.

  • $msg->exclusive_minimum() / $msg->exclusive_minimum($value)

    Type: Double

    Exclusive lower bound.

  • $msg->maximum() / $msg->maximum($value)

    Type: Double

    Inclusive upper bound.

  • $msg->exclusive_maximum() / $msg->exclusive_maximum($value)

    Type: Double

    Exclusive upper bound.

Google::Cloud::Retail::V2beta::Common::PriceInfo

The price information of a [Product][google.cloud.retail.v2beta.Product].

Inherits from Protobuf::Message.

Accessors

  • $msg->currency_code() / $msg->currency_code($value)

    Type: String

    The 3-letter currency code defined in [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html).

    If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.

    The [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] [Product][google.cloud.retail.v2beta.Product]s with the same [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id] must share the same [currency_code][google.cloud.retail.v2beta.PriceInfo.currency_code]. Otherwise, a FAILED_PRECONDITION error is returned.

  • $msg->price() / $msg->price($value)

    Type: Float

    Price of the product.

    Google Merchant Center property [price](https://support.google.com/merchants/answer/6324371). Schema.org property [Offer.price](https://schema.org/price).

  • $msg->original_price() / $msg->original_price($value)

    Type: Float

    Price of the product without any discount. If zero, by default set to be the [price][google.cloud.retail.v2beta.PriceInfo.price]. If set, [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] should be greater than or equal to [price][google.cloud.retail.v2beta.PriceInfo.price], otherwise an INVALID_ARGUMENT error is thrown.

  • $msg->cost() / $msg->cost($value)

    Type: Float

    The costs associated with the sale of a particular product. Used for gross profit reporting.

    * Profit = [price][google.cloud.retail.v2beta.PriceInfo.price] - [cost][google.cloud.retail.v2beta.PriceInfo.cost]

    Google Merchant Center property [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).

  • $msg->price_effective_time() / $msg->price_effective_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price] starts to be effective. This can be set as a future timestamp, and the [price][google.cloud.retail.v2beta.PriceInfo.price] is only used for search after [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time]. If so, the [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must be set and [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is used before [price_effective_time][google.cloud.retail.v2beta.PriceInfo.price_effective_time].

    Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always effective because it will cause additional latency during search.

  • $msg->price_expire_time() / $msg->price_expire_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The timestamp when the [price][google.cloud.retail.v2beta.PriceInfo.price] stops to be effective. The [price][google.cloud.retail.v2beta.PriceInfo.price] is used for search before [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time]. If this field is set, the [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] must be set and [original_price][google.cloud.retail.v2beta.PriceInfo.original_price] is used after [price_expire_time][google.cloud.retail.v2beta.PriceInfo.price_expire_time].

    Do not set if [price][google.cloud.retail.v2beta.PriceInfo.price] is always effective because it will cause additional latency during search.

  • $msg->price_range() / $msg->price_range($value)

    Type: Message (Google::Cloud::Retail::V2beta::Common::PriceInfo::PriceRange)

    Output only. The price range of all the child [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] [Product][google.cloud.retail.v2beta.Product]s grouped together on the [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] [Product][google.cloud.retail.v2beta.Product]. Only populated for [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] [Product][google.cloud.retail.v2beta.Product]s.

    Note: This field is OUTPUT_ONLY for [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct]. Do not set this field in API requests.

Google::Cloud::Retail::V2beta::Common::Rating

The rating of a [Product][google.cloud.retail.v2beta.Product].

Inherits from Protobuf::Message.

Accessors

  • $msg->rating_count() / $msg->rating_count($value)

    Type: Int32

    The total number of ratings. This value is independent of the value of [rating_histogram][google.cloud.retail.v2beta.Rating.rating_histogram].

    This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.

  • $msg->average_rating() / $msg->average_rating($value)

    Type: Float

    The average rating of the [Product][google.cloud.retail.v2beta.Product].

    The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is returned.

  • $msg->rating_histogram() / $msg->rating_histogram($value)

    Type: Int32

    List of rating counts per rating value (index = rating - 1). The list is empty if there is no rating. If the list is non-empty, its size is always 5. Otherwise, an INVALID_ARGUMENT error is returned.

    For example, [41, 14, 13, 47, 303]. It means that the [Product][google.cloud.retail.v2beta.Product] got 41 ratings with 1 star, 14 ratings with 2 star, and so on.

Google::Cloud::Retail::V2beta::Common::UserInfo

Information of an end user.

Inherits from Protobuf::Message.

Accessors

  • $msg->user_id() / $msg->user_id($value)

    Type: String

    Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don't set for anonymous users.

    Always use a hashed value for this ID.

    Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.

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

  • $msg->ip_address() / $msg->ip_address($value)

    Type: String

    The end user's IP address. This field is used to extract location information for personalization.

    This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an INVALID_ARGUMENT error is returned.

    This should not be set when:

    * setting [SearchRequest.user_info][google.cloud.retail.v2beta.SearchRequest.user_info]. * using the JavaScript tag in [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent] or if [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request] is set.

  • $msg->user_agent() / $msg->user_agent($value)

    Type: String

    User agent as included in the HTTP header. The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

    This should not be set when using the client side event reporting with GTM or JavaScript tag in [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent] or if [direct_user_request][google.cloud.retail.v2beta.UserInfo.direct_user_request] is set.

  • $msg->direct_user_request() / $msg->direct_user_request($value)

    Type: Bool

    True if the request is made directly from the end user, in which case the [ip_address][google.cloud.retail.v2beta.UserInfo.ip_address] and [user_agent][google.cloud.retail.v2beta.UserInfo.user_agent] can be populated from the HTTP request. This flag should be set only if the API request is made directly from the end user such as a mobile app (and not if a gateway or a server is processing and pushing the user events).

    This should not be set when using the JavaScript tag in [UserEventService.CollectUserEvent][google.cloud.retail.v2beta.UserEventService.CollectUserEvent].

Google::Cloud::Retail::V2beta::Common::LocalInventory

The inventory information at a place (e.g. a store) identified by a place ID.

Inherits from Protobuf::Message.

Accessors

  • $msg->place_id() / $msg->place_id($value)

    Type: String

    Optional. The place ID for the current set of inventory information.

  • $msg->price_info() / $msg->price_info($value)

    Type: Message (Google::Cloud::Retail::V2beta::Common::PriceInfo)

    Optional. Product price and cost information.

    Google Merchant Center property [price](https://support.google.com/merchants/answer/6324371).

  • $msg->attributes() / $msg->attributes($value)

    Type: Message (Google::Cloud::Retail::V2beta::Common::LocalInventory::AttributesEntry)

    Optional. Additional local inventory attributes, for example, store name, promotion tags, etc.

    This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

    * At most 30 attributes are allowed. * The key must be a UTF-8 encoded string with a length limit of 32 characters. * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, key0LikeThis or KEY_1_LIKE_THIS. * The attribute values must be of the same type (text or number). * Only 1 value is allowed for each attribute. * For text values, the length limit is 256 UTF-8 characters. * The attribute does not support search. The `searchable` field should be unset or set to false. * The max summed total bytes of custom attribute keys and values per product is 5MiB.

  • $msg->fulfillment_types() / $msg->fulfillment_types($value)

    Type: String

    Optional. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI.

    Supported values:

    * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * "custom-type-4" * "custom-type-5"

    If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.

    All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

Google::Cloud::Retail::V2beta::Common::PinControlMetadata

Metadata for pinning to be returned in the response. This is used for distinguishing between applied vs dropped pins.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Retail::V2beta::Common::StringList

A list of string values.

Inherits from Protobuf::Message.

Accessors

  • $msg->values() / $msg->values($value)

    Type: String

    String values.

Google::Cloud::Retail::V2beta::Common::DoubleList

A message with a list of double values.

Inherits from Protobuf::Message.

Accessors

  • $msg->values() / $msg->values($value)

    Type: Double

    The list of double values.

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Retail::V2beta::Common::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.