blob: be8c64fbf256af1a11041dc8eba46aad6cec51d6 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="retail_v2beta.html">Retail API</a> . <a href="retail_v2beta.projects.html">projects</a> . <a href="retail_v2beta.projects.locations.html">locations</a> . <a href="retail_v2beta.projects.locations.catalogs.html">catalogs</a> . <a href="retail_v2beta.projects.locations.catalogs.placements.html">placements</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#predict">predict(placement, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Makes a recommendation prediction.</p>
<p class="toc_element">
<code><a href="#search">search(placement, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Performs a search. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.</p>
<p class="toc_element">
<code><a href="#search_next">search_next(previous_request, previous_response)</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="predict">predict(placement, body=None, x__xgafv=None)</code>
<pre>Makes a recommendation prediction.
Args:
placement: string, Required. Full resource name of the format: {name=projects/*/locations/global/catalogs/default_catalog/placements/*} The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements (required)
body: object, The request body.
The object takes the form of:
{ # Request message for Predict method.
&quot;filter&quot;: &quot;A String&quot;, # Filter for restricting prediction results with a length limit of 5,000 characters. Accepts values for tags and the `filterOutOfStockItems` flag. * Tag expressions. Restricts predictions to products that match all of the specified tags. Boolean operators `OR` and `NOT` are supported if the expression is enclosed in parentheses, and must be separated from the tag values by a space. `-&quot;tagA&quot;` is also supported and is equivalent to `NOT &quot;tagA&quot;`. Tag values must be double quoted UTF-8 encoded strings with a size limit of 1,000 characters. Note: &quot;Recently viewed&quot; models don&#x27;t support tag filtering at the moment. * filterOutOfStockItems. Restricts predictions to products that do not have a stockState value of OUT_OF_STOCK. Examples: * tag=(&quot;Red&quot; OR &quot;Blue&quot;) tag=&quot;New-Arrival&quot; tag=(NOT &quot;promotional&quot;) * filterOutOfStockItems tag=(-&quot;promotional&quot;) * filterOutOfStockItems If your filter blocks all prediction results, nothing will be returned. If you want generic (unfiltered) popular products to be returned instead, set `strictFiltering` to false in `PredictRequest.params`.
&quot;labels&quot;: { # The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;pageSize&quot;: 42, # Maximum number of results to return per page. Set this property to the number of prediction results needed. If zero, the service will choose a reasonable default. The maximum allowed value is 100. Values above 100 will be coerced to 100.
&quot;pageToken&quot;: &quot;A String&quot;, # The previous PredictResponse.next_page_token.
&quot;params&quot;: { # Additional domain specific parameters for the predictions. Allowed values: * `returnProduct`: Boolean. If set to true, the associated product object will be returned in the `results.metadata` field in the prediction response. * `returnScore`: Boolean. If set to true, the prediction &#x27;score&#x27; corresponding to each returned product will be set in the `results.metadata` field in the prediction response. The given &#x27;score&#x27; indicates the probability of an product being clicked/purchased given the user&#x27;s context and history. * `strictFiltering`: Boolean. True by default. If set to false, the service will return generic (unfiltered) popular products instead of empty if your filter blocks all prediction results. * `priceRerankLevel`: String. Default empty. If set to be non-empty, then it needs to be one of {&#x27;no-price-reranking&#x27;, &#x27;low-price-reranking&#x27;, &#x27;medium-price-reranking&#x27;, &#x27;high-price-reranking&#x27;}. This gives request-level control and adjusts prediction results based on product price. * `diversityLevel`: String. Default empty. If set to be non-empty, then it needs to be one of {&#x27;no-diversity&#x27;, &#x27;low-diversity&#x27;, &#x27;medium-diversity&#x27;, &#x27;high-diversity&#x27;, &#x27;auto-diversity&#x27;}. This gives request-level control and adjusts prediction results based on product category.
&quot;a_key&quot;: &quot;&quot;,
},
&quot;userEvent&quot;: { # UserEvent captures all metadata information Retail API needs to know about how end users interact with customers&#x27; website. # Required. Context about the user, what they are looking at and what action they took to trigger the predict request. Note that this user event detail won&#x27;t be ingested to userEvent logs. Thus, a separate userEvent write request is required for event logging.
&quot;attributes&quot;: { # Extra user event features to include in the recommendation model. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned: * The key must be a UTF-8 encoded string with a length limit of 5,000 characters. * For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters. * For number attributes, at most 400 values are allowed. For product recommendation, an example of extra user information is traffic_channel, i.e. how user arrives at the site. Users can arrive at the site by coming to the site directly, or coming through Google search, and etc.
&quot;a_key&quot;: { # A custom attribute that is not explicitly modeled in Product.
&quot;indexable&quot;: True or False, # If true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.
&quot;numbers&quot;: [ # The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is &quot;lengths_cm&quot;. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned.
3.14,
],
&quot;searchable&quot;: True or False, # If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.
&quot;text&quot;: [ # The textual values of this custom attribute. For example, `[&quot;yellow&quot;, &quot;green&quot;]` when the key is &quot;color&quot;. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
},
},
&quot;attributionToken&quot;: &quot;A String&quot;, # Highly recommended for user events that are the result of PredictionService.Predict. This field enables accurate attribution of recommendation model performance. The value must be a valid PredictResponse.attribution_token for user events that are the result of PredictionService.Predict. The value must be a valid SearchResponse.attribution_token for user events that are the result of SearchService.Search. This token enables us to accurately attribute page view or purchase back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass PredictResponse.attribution_token as a URL parameter to product K&#x27;s page. When recording events on product K&#x27;s page, log the PredictResponse.attribution_token to this field.
&quot;cartId&quot;: &quot;A String&quot;, # The ID or name of the associated shopping cart. This ID is used to associate multiple items added or present in the cart before purchase. This can only be set for `add-to-cart`, `purchase-complete`, or `shopping-cart-page-view` events.
&quot;completionDetail&quot;: { # Detailed completion information including completion attribution token and clicked completion info. # The main auto-completion details related to the event. This field should be set for `search` event when autocomplete function is enabled and the user clicks a suggestion for search.
&quot;completionAttributionToken&quot;: &quot;A String&quot;, # Completion attribution token in CompleteQueryResponse.attribution_token.
&quot;selectedPosition&quot;: 42, # End user selected CompleteQueryResponse.CompletionResult.suggestion position, starting from 0.
&quot;selectedSuggestion&quot;: &quot;A String&quot;, # End user selected CompleteQueryResponse.CompletionResult.suggestion.
},
&quot;eventTime&quot;: &quot;A String&quot;, # Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
&quot;eventType&quot;: &quot;A String&quot;, # Required. User event type. Allowed values are: * `add-to-cart`: Products being added to cart. * `category-page-view`: Special pages such as sale or promotion pages viewed. * `detail-page-view`: Products detail page viewed. * `home-page-view`: Homepage viewed. * `promotion-offered`: Promotion is offered to a user. * `promotion-not-offered`: Promotion is not offered to a user. * `purchase-complete`: User finishing a purchase. * `search`: Product search. * `shopping-cart-page-view`: User viewing a shopping cart.
&quot;experimentIds&quot;: [ # A list of identifiers for the independent experiment groups this user event belongs to. This is used to distinguish between user events associated with different experiment setups (e.g. using Retail API, using different recommendation models).
&quot;A String&quot;,
],
&quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the products being filtered. See SearchRequest.filter for definition and syntax. The value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;offset&quot;: 42, # An integer that specifies the current offset for pagination (the 0-indexed starting location, amongst the products deemed by the API as relevant). See SearchRequest.offset for definition. If this field is negative, an INVALID_ARGUMENT is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;orderBy&quot;: &quot;A String&quot;, # The order in which products are returned. See SearchRequest.order_by for definition and syntax. The value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;pageCategories&quot;: [ # The categories associated with a category page. To represent full path of category, use &#x27;&gt;&#x27; sign to separate different hierarchies. If &#x27;&gt;&#x27; is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: &quot;pageCategories&quot; : [&quot;Sales &gt; 2017 Black Friday Deals&quot;]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
&quot;pageViewId&quot;: &quot;A String&quot;, # A unique ID of a web page view. This should be kept the same for all user events triggered from the same pageview. For example, an item detail page view could trigger multiple events as the user is browsing the page. The `pageViewId` property should be kept the same for all these events so that they can be grouped together properly. When using the client side event reporting with JavaScript pixel and Google Tag Manager, this value is filled in automatically.
&quot;productDetails&quot;: [ # The main product details related to the event. This field is required for the following event types: * `add-to-cart` * `detail-page-view` * `purchase-complete` In a `search` event, this field represents the products returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a new `search` event with different product_details is desired. The end user may have not finished browsing the whole page yet.
{ # Detailed product information associated with a user event.
&quot;product&quot;: { # Product captures all metadata information of items to be recommended or searched. # Required. Product information. Required field(s): * Product.id Optional override field(s): * Product.price_info If any supported optional fields are provided, we will treat them as a full override when looking up product information from the catalog. Thus, it is important to ensure that the overriding fields are accurate and complete. All other product fields are ignored and instead populated via catalog lookup after event ingestion.
&quot;attributes&quot;: { # Highly encouraged. Extra product attributes to be included. For example, for products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the attributes here. Features that can take on one of a limited number of possible values. Two types of features can be set are: Textual features. some examples would be the brand/maker of a product, or country of a customer. Numerical features. Some examples would be the height/weight of a product, or age of a customer. For example: `{ &quot;vendor&quot;: {&quot;text&quot;: [&quot;vendor123&quot;, &quot;vendor456&quot;]}, &quot;lengths_cm&quot;: {&quot;numbers&quot;:[2.3, 15.4]}, &quot;heights_cm&quot;: {&quot;numbers&quot;:[8.1, 6.4]} }`. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned: * Max entries count: 200. * The key must be a UTF-8 encoded string with a length limit of 128 characters. * For indexable attribute, the key must match the pattern: `a-zA-Z0-9*`. For example, `key0LikeThis` or `KEY_1_LIKE_THIS`. * For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters. * For number attributes, at most 400 values are allowed.
&quot;a_key&quot;: { # A custom attribute that is not explicitly modeled in Product.
&quot;indexable&quot;: True or False, # If true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.
&quot;numbers&quot;: [ # The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is &quot;lengths_cm&quot;. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned.
3.14,
],
&quot;searchable&quot;: True or False, # If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.
&quot;text&quot;: [ # The textual values of this custom attribute. For example, `[&quot;yellow&quot;, &quot;green&quot;]` when the key is &quot;color&quot;. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
},
},
&quot;audience&quot;: { # An intended audience of the Product for whom it&#x27;s sold. # The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
&quot;ageGroups&quot;: [ # The age groups of the audience. Strongly encouraged to use the standard values: &quot;newborn&quot; (up to 3 months old), &quot;infant&quot; (3–12 months old), &quot;toddler&quot; (1–5 years old), &quot;kids&quot; (5–13 years old), &quot;adult&quot; (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).
&quot;A String&quot;,
],
&quot;genders&quot;: [ # The genders of the audience. Strongly encouraged to use the standard values: &quot;male&quot;, &quot;female&quot;, &quot;unisex&quot;. 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).
&quot;A String&quot;,
],
},
&quot;availability&quot;: &quot;A String&quot;, # The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property [availability](https://support.google.com/merchants/answer/6324448). Schema.org property [Offer.availability](https://schema.org/availability).
&quot;availableQuantity&quot;: 42, # The available quantity of the item.
&quot;availableTime&quot;: &quot;A String&quot;, # The timestamp when this Product becomes available for SearchService.Search.
&quot;brands&quot;: [ # The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [brand](https://support.google.com/merchants/answer/6324351). Schema.org property [Product.brand](https://schema.org/brand).
&quot;A String&quot;,
],
&quot;categories&quot;: [ # Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use &#x27;&gt;&#x27; sign to separate different hierarchies. If &#x27;&gt;&#x27; is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both [&quot;Shoes &amp; Accessories&quot; -&gt; &quot;Shoes&quot;] and [&quot;Sports &amp; Fitness&quot; -&gt; &quot;Athletic Clothing&quot; -&gt; &quot;Shoes&quot;], it could be represented as: &quot;categories&quot;: [ &quot;Shoes &amp; Accessories &gt; Shoes&quot;, &quot;Sports &amp; Fitness &gt; Athletic Clothing &gt; Shoes&quot; ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
&quot;A String&quot;,
],
&quot;collectionMemberIds&quot;: [ # The id of the collection members when type is Type.COLLECTION. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
&quot;A String&quot;,
],
&quot;colorInfo&quot;: { # The color information of a Product. # The color of the product. Corresponding properties: Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color).
&quot;colorFamilies&quot;: [ # The standard color families. Strongly recommended to use the following standard color groups: &quot;Red&quot;, &quot;Pink&quot;, &quot;Orange&quot;, &quot;Yellow&quot;, &quot;Purple&quot;, &quot;Green&quot;, &quot;Cyan&quot;, &quot;Blue&quot;, &quot;Brown&quot;, &quot;White&quot;, &quot;Gray&quot;, &quot;Black&quot; and &quot;Mixed&quot;. Normally it is expected to have only 1 color family. May consider using single &quot;Mixed&quot; 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).
&quot;A String&quot;,
],
&quot;colors&quot;: [ # 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 &quot;Mixed&quot; instead of multiple values. A maximum of 25 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).
&quot;A String&quot;,
],
},
&quot;conditions&quot;: [ # The condition of the product. Strongly encouraged to use the standard values: &quot;new&quot;, &quot;refurbished&quot;, &quot;used&quot;. A maximum of 5 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [condition](https://support.google.com/merchants/answer/6324469). Schema.org property [Offer.itemCondition](https://schema.org/itemCondition).
&quot;A String&quot;,
],
&quot;description&quot;: &quot;A String&quot;, # Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [description](https://support.google.com/merchants/answer/6324468). Schema.org property [Product.description](https://schema.org/description).
&quot;expireTime&quot;: &quot;A String&quot;, # The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property [expiration_date](https://support.google.com/merchants/answer/6324499).
&quot;fulfillmentInfo&quot;: [ # Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
{ # Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods.
&quot;placeIds&quot;: [ # The IDs for this type, such as the store IDs for FulfillmentInfo.type.pickup-in-store or the region IDs for FulfillmentInfo.type.same-day-delivery. 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 &quot;store1&quot; or &quot;REGION-2&quot;. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
&quot;type&quot;: &quot;A String&quot;, # 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: * &quot;pickup-in-store&quot; * &quot;ship-to-store&quot; * &quot;same-day-delivery&quot; * &quot;next-day-delivery&quot; * &quot;custom-type-1&quot; * &quot;custom-type-2&quot; * &quot;custom-type-3&quot; * &quot;custom-type-4&quot; * &quot;custom-type-5&quot; If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.
},
],
&quot;gtin&quot;: &quot;A String&quot;, # The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [gtin](https://support.google.com/merchants/answer/6324461). Schema.org property [Product.isbn](https://schema.org/isbn), [Product.gtin8](https://schema.org/gtin8), [Product.gtin12](https://schema.org/gtin12), [Product.gtin13](https://schema.org/gtin13), or [Product.gtin14](https://schema.org/gtin14). If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
&quot;id&quot;: &quot;A String&quot;, # Immutable. Product identifier, which is the final component of name. For example, this field is &quot;id_1&quot;, if name is `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [id](https://support.google.com/merchants/answer/6324405). Schema.org property [Product.sku](https://schema.org/sku).
&quot;images&quot;: [ # Product images for the product.Highly recommended to put the main image to the first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property [image_link](https://support.google.com/merchants/answer/6324350). Schema.org property [Product.image](https://schema.org/image).
{ # Product thumbnail/detail image.
&quot;height&quot;: 42, # Height of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;uri&quot;: &quot;A String&quot;, # 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).
&quot;width&quot;: 42, # Width of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
},
],
&quot;languageCode&quot;: &quot;A String&quot;, # Language of the title/description and other string attributes. Use language tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to &quot;en-US&quot; if unset.
&quot;materials&quot;: [ # The material of the product. For example, &quot;leather&quot;, &quot;wooden&quot;. A maximum of 20 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. Corresponding properties: Google Merchant Center property [material](https://support.google.com/merchants/answer/6324410). Schema.org property [Product.material](https://schema.org/material).
&quot;A String&quot;,
],
&quot;name&quot;: &quot;A String&quot;, # Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
&quot;patterns&quot;: [ # The pattern or graphic print of the product. For example, &quot;striped&quot;, &quot;polka dot&quot;, &quot;paisley&quot;. A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [pattern](https://support.google.com/merchants/answer/6324483). Schema.org property [Product.pattern](https://schema.org/pattern).
&quot;A String&quot;,
],
&quot;priceInfo&quot;: { # The price information of a Product. # Product price and cost information. Corresponding properties: Google Merchant Center property [price](https://support.google.com/merchants/answer/6324371).
&quot;cost&quot;: 3.14, # The costs associated with the sale of a particular product. Used for gross profit reporting. * Profit = price - cost Google Merchant Center property [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
&quot;currencyCode&quot;: &quot;A String&quot;, # 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 Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.
&quot;originalPrice&quot;: 3.14, # Price of the product without any discount. If zero, by default set to be the price.
&quot;price&quot;: 3.14, # 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).
&quot;priceEffectiveTime&quot;: &quot;A String&quot;, # The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time. Do not set if price is always effective because it will cause additional latency during search.
&quot;priceExpireTime&quot;: &quot;A String&quot;, # The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time. Do not set if price is always effective because it will cause additional latency during search.
&quot;priceRange&quot;: { # The price range of all variant Product having the same Product.primary_product_id. # Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
&quot;originalPrice&quot;: { # A floating point interval. # The inclusive Product.pricing_info.original_price internal of all variant Product having the same Product.primary_product_id.
&quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
&quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
&quot;maximum&quot;: 3.14, # Inclusive upper bound.
&quot;minimum&quot;: 3.14, # Inclusive lower bound.
},
&quot;price&quot;: { # A floating point interval. # The inclusive Product.pricing_info.price interval of all variant Product having the same Product.primary_product_id.
&quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
&quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
&quot;maximum&quot;: 3.14, # Inclusive upper bound.
&quot;minimum&quot;: 3.14, # Inclusive lower bound.
},
},
},
&quot;primaryProductId&quot;: &quot;A String&quot;, # Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [item_group_id](https://support.google.com/merchants/answer/6324507). Schema.org property [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
&quot;promotions&quot;: [ # The promotions applied to the product. A maximum of 10 values are allowed per Product.
{ # Promotion information.
&quot;promotionId&quot;: &quot;A String&quot;, # ID of the promotion. For example, &quot;free gift&quot;. The value value must be a UTF-8 encoded string with a length limit of 128 characters, and match the pattern: `a-zA-Z*`. For example, id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [promotion](https://support.google.com/merchants/answer/7050148).
},
],
&quot;publishTime&quot;: &quot;A String&quot;, # The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
&quot;rating&quot;: { # The rating of a Product. # The rating of this product.
&quot;averageRating&quot;: 3.14, # The average rating of the Product. The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;ratingCount&quot;: 42, # The total number of ratings. This value is independent of the value of rating_histogram. This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;ratingHistogram&quot;: [ # 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 got 41 ratings with 1 star, 14 ratings with 2 star, and so on.
42,
],
},
&quot;retrievableFields&quot;: &quot;A String&quot;, # Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form &quot;attributes.key&quot; where &quot;key&quot; is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse may increase response payload size and serving latency.
&quot;sizes&quot;: [ # The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in &quot;US:MENS:M&quot;, &quot;US&quot; represents size system; &quot;MENS&quot; represents size type; &quot;M&quot; represents size value. In &quot;GIRLS:27&quot;, size system is empty; &quot;GIRLS&quot; represents size type; &quot;27&quot; represents size value. In &quot;32 inches&quot;, both size system and size type are empty, while size value is &quot;32 inches&quot;. A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [size](https://support.google.com/merchants/answer/6324492), [size_type](https://support.google.com/merchants/answer/6324497), and [size_system](https://support.google.com/merchants/answer/6324502). Schema.org property [Product.size](https://schema.org/size).
&quot;A String&quot;,
],
&quot;tags&quot;: [ # Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
&quot;A String&quot;,
],
&quot;title&quot;: &quot;A String&quot;, # Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [title](https://support.google.com/merchants/answer/6324415). Schema.org property [Product.name](https://schema.org/name).
&quot;ttl&quot;: &quot;A String&quot;, # Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
&quot;type&quot;: &quot;A String&quot;, # Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
&quot;uri&quot;: &quot;A String&quot;, # Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [link](https://support.google.com/merchants/answer/6324416). Schema.org property [Offer.url](https://schema.org/url).
&quot;variants&quot;: [ # Output only. Product variants grouped together on primary product which share similar product attributes. It&#x27;s automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
# Object with schema name: GoogleCloudRetailV2betaProduct
],
},
&quot;quantity&quot;: 42, # Quantity of the product associated with the user event. For example, this field will be 2 if two products are added to the shopping cart for `purchase-complete` event. Required for `add-to-cart` and `purchase-complete` event types.
},
],
&quot;purchaseTransaction&quot;: { # A transaction represents the entire purchase transaction. # A transaction represents the entire purchase transaction. Required for `purchase-complete` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;cost&quot;: 3.14, # All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that: * Profit = revenue - tax - cost
&quot;currencyCode&quot;: &quot;A String&quot;, # Required. Currency code. Use three-character ISO-4217 code.
&quot;id&quot;: &quot;A String&quot;, # The transaction ID with a length limit of 128 characters.
&quot;revenue&quot;: 3.14, # Required. Total non-zero revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations.
&quot;tax&quot;: 3.14, # All the taxes associated with the transaction.
},
&quot;referrerUri&quot;: &quot;A String&quot;, # The referrer URL of the current page. When using the client side event reporting with JavaScript pixel and Google Tag Manager, this value is filled in automatically.
&quot;searchQuery&quot;: &quot;A String&quot;, # The user&#x27;s search query. See SearchRequest.query for definition. The value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;sessionId&quot;: &quot;A String&quot;, # A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the sesion_id: 1. If user has no activity for 30 min, a new session_id should be assigned. 2. The session_id should be unique across users, suggest use uuid or add visitor_id as prefix.
&quot;uri&quot;: &quot;A String&quot;, # Complete URL (window.location.href) of the user&#x27;s current page. When using the client side event reporting with JavaScript pixel and Google Tag Manager, this value is filled in automatically. Maximum length 5,000 characters.
&quot;userInfo&quot;: { # Information of an end user. # User information.
&quot;directUserRequest&quot;: True or False, # True if the request is made directly from the end user, in which case the ip_address and 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.
&quot;ipAddress&quot;: &quot;A String&quot;, # The end user&#x27;s IP address. Required for getting SearchResponse.sponsored_results. This field is used to extract location information for personalization. This field must be either an IPv4 address (e.g. &quot;104.133.9.80&quot;) or an IPv6 address (e.g. &quot;2001:0db8:85a3:0000:0000:8a2e:0370:7334&quot;). Otherwise, an INVALID_ARGUMENT error is returned. This should not be set when using the JavaScript tag in UserEventService.CollectUserEvent or if direct_user_request is set.
&quot;userAgent&quot;: &quot;A String&quot;, # User agent as included in the HTTP header. Required for getting SearchResponse.sponsored_results. 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 or if direct_user_request is set.
&quot;userId&quot;: &quot;A String&quot;, # Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
},
&quot;visitorId&quot;: &quot;A String&quot;, # Required. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor log in/out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. The field should not contain PII or user-data. We recommend to use Google Analystics [Client ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) for this field.
},
&quot;validateOnly&quot;: True or False, # Use validate only mode for this prediction query. If set to true, a dummy model will be used that returns arbitrary products. Note that the validate only mode should only be used for testing the API, or if the model is not ready.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for predict method.
&quot;attributionToken&quot;: &quot;A String&quot;, # A unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.
&quot;missingIds&quot;: [ # IDs of products in the request that were missing from the inventory.
&quot;A String&quot;,
],
&quot;results&quot;: [ # A list of recommended products. The order represents the ranking (from the most relevant product to the least).
{ # PredictionResult represents the recommendation prediction results.
&quot;id&quot;: &quot;A String&quot;, # ID of the recommended product
&quot;metadata&quot;: { # Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Will be set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Will be set if `returnScore` is set to true in `PredictRequest.params`.
&quot;a_key&quot;: &quot;&quot;,
},
},
],
&quot;validateOnly&quot;: True or False, # True if the validateOnly property was set in the request.
}</pre>
</div>
<div class="method">
<code class="details" id="search">search(placement, body=None, x__xgafv=None)</code>
<pre>Performs a search. This feature is only available for users who have Retail Search enabled. Please submit a form [here](https://cloud.google.com/contact) to contact cloud sales if you are interested in using Retail Search.
Args:
placement: string, Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search. (required)
body: object, The request body.
The object takes the form of:
{ # Request message for SearchService.Search method.
&quot;boostSpec&quot;: { # Boost specification to boost certain items. # Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions.
&quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a product matches multiple conditions in the specifictions, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 10.
{ # Boost applies to products which match a condition.
&quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the item a big promotion. However, it does not necessarily mean that the boosted item will be the top result at all times, nor that other items will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant items. Setting to -1.0 gives the item a big demotion. However, results that are deeply relevant might still be shown. The item will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored.
&quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost products with product ID &quot;product_1&quot; or &quot;product_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: * (id: ANY(&quot;product_1&quot;, &quot;product_2&quot;)) AND (colorFamilies: ANY(&quot;Red&quot;,&quot;Blue&quot;))
},
],
},
&quot;branch&quot;: &quot;A String&quot;, # The branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use &quot;default_branch&quot; as the branch ID or leave this field empty, to search products under the default branch.
&quot;canonicalFilter&quot;: &quot;A String&quot;, # The filter applied to every search request when quality improvement such as query expansion is needed. For example, if a query does not have enough results, an expanded query with SearchRequest.canonical_filter will be returned as a supplement of the original query. This field is strongly recommended to achieve high search quality. See SearchRequest.filter for more details about filter syntax.
&quot;dynamicFacetSpec&quot;: { # The specifications of dynamically generated facets. # The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated. This feature requires additional allowlisting. Contact Retail Search support team if you are interested in using dynamic facet feature.
&quot;mode&quot;: &quot;A String&quot;, # Mode of the DynamicFacet feature. Defaults to Mode.DISABLED if it&#x27;s unset.
},
&quot;facetSpecs&quot;: [ # Facet specifications for faceted search. If empty, no facets are returned. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.
{ # A facet specification to perform faceted search.
&quot;enableDynamicPosition&quot;: True or False, # Enables dynamic position for this facet. If set to true, the position of this facet among all facets in the response is determined by Google Retail Search. It will be ordered together with dynamic facets if dynamic facets is enabled. If set to false, the position of this facet in the response will be the same as in the request, and it will be ranked before the facets with dynamic position enable and all dynamic facets. For example, you may always want to have rating facet returned in the response, but it&#x27;s not necessarily to always display the rating facet at the top. In that case, you can set enable_dynamic_position to true so that the position of rating facet in response will be determined by Google Retail Search. Another example, assuming you have the following facets in the request: * &quot;rating&quot;, enable_dynamic_position = true * &quot;price&quot;, enable_dynamic_position = false * &quot;brands&quot;, enable_dynamic_position = false And also you have a dynamic facets enable, which will generate a facet &#x27;gender&#x27;. Then the final order of the facets in the response can be (&quot;price&quot;, &quot;brands&quot;, &quot;rating&quot;, &quot;gender&quot;) or (&quot;price&quot;, &quot;brands&quot;, &quot;gender&quot;, &quot;rating&quot;) depends on how Google Retail Search orders &quot;gender&quot; and &quot;rating&quot; facets. However, notice that &quot;price&quot; and &quot;brands&quot; will always be ranked at 1st and 2nd position since their enable_dynamic_position are false.
&quot;excludedFilterKeys&quot;: [ # List of keys to exclude when faceting. By default, FacetKey.key is not excluded from the filter unless it is listed in this field. For example, suppose there are 100 products with color facet &quot;Red&quot; and 200 products with color facet &quot;Blue&quot;. A query containing the filter &quot;colorFamilies:ANY(&quot;Red&quot;)&quot; and have &quot;colorFamilies&quot; as FacetKey.key will by default return the &quot;Red&quot; with count 100. If this field contains &quot;colorFamilies&quot;, then the query returns both the &quot;Red&quot; with count 100 and &quot;Blue&quot; with count 200, because the &quot;colorFamilies&quot; key is now excluded from the filter. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
&quot;facetKey&quot;: { # Specifies how a facet is computed. # Required. The facet key specification.
&quot;contains&quot;: [ # Only get facet values that contains the given strings. For example, suppose &quot;categories&quot; has three values &quot;Women &gt; Shoe&quot;, &quot;Women &gt; Dress&quot; and &quot;Men &gt; Shoe&quot;. If set &quot;contains&quot; to &quot;Shoe&quot;, the &quot;categories&quot; facet will give only &quot;Women &gt; Shoe&quot; and &quot;Men &gt; Shoe&quot;. Only supported on textual fields. Maximum is 10.
&quot;A String&quot;,
],
&quot;intervals&quot;: [ # Set only if values should be bucketized into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.
{ # A floating point interval.
&quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
&quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
&quot;maximum&quot;: 3.14, # Inclusive upper bound.
&quot;minimum&quot;: 3.14, # Inclusive lower bound.
},
],
&quot;key&quot;: &quot;A String&quot;, # Required. Supported textual and numerical facet keys in Product object, over which the facet values are computed. Facet key is case-sensitive. Allowed facet keys when FacetKey.query is not specified: * textual_field = * &quot;brands&quot; * &quot;categories&quot; * &quot;genders&quot; * &quot;ageGroups&quot; * &quot;availability&quot; * &quot;colorFamilies&quot; * &quot;colors&quot; * &quot;sizes&quot; * &quot;materials&quot; * &quot;patterns&quot; * &quot;conditions&quot; * &quot;attributes.key&quot; * &quot;pickupInStore&quot; * &quot;shipToStore&quot; * &quot;sameDayDelivery&quot; * &quot;nextDayDelivery&quot; * &quot;customFulfillment1&quot; * &quot;customFulfillment2&quot; * &quot;customFulfillment3&quot; * &quot;customFulfillment4&quot; * &quot;customFulfillment5&quot; * &quot;inventory(place_id,attributes.key)&quot; * numerical_field = * &quot;price&quot; * &quot;discount&quot; * &quot;rating&quot; * &quot;ratingCount&quot; * &quot;attributes.key&quot; * &quot;inventory(place_id,price)&quot; * &quot;inventory(place_id,original_price)&quot; * &quot;inventory(place_id,attributes.key)&quot;
&quot;orderBy&quot;: &quot;A String&quot;, # The order in which Facet.values are returned. Allowed values are: * &quot;count desc&quot;, which means order by Facet.FacetValue.count descending. * &quot;value desc&quot;, which means order by Facet.FacetValue.value descending. Only applies to textual facets. If not set, textual values are sorted in [natural order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals; FulfillmentInfo.place_ids are sorted in the order given by FacetSpec.FacetKey.restricted_values.
&quot;prefixes&quot;: [ # Only get facet values that start with the given string prefix. For example, suppose &quot;categories&quot; has three values &quot;Women &gt; Shoe&quot;, &quot;Women &gt; Dress&quot; and &quot;Men &gt; Shoe&quot;. If set &quot;prefixes&quot; to &quot;Women&quot;, the &quot;categories&quot; facet will give only &quot;Women &gt; Shoe&quot; and &quot;Women &gt; Dress&quot;. Only supported on textual fields. Maximum is 10.
&quot;A String&quot;,
],
&quot;query&quot;: &quot;A String&quot;, # The query that is used to compute facet for the given facet key. When provided, it will override the default behavior of facet computation. The query syntax is the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Notice that there is no limitation on FacetKey.key when query is specified. In the response, FacetValue.value will be always &quot;1&quot; and FacetValue.count will be the number of results that matches the query. For example, you can set a customized facet for &quot;shipToStore&quot;, where FacetKey.key is &quot;customizedShipToStore&quot;, and FacetKey.query is &quot;availability: ANY(\&quot;IN_STOCK\&quot;) AND shipToStore: ANY(\&quot;123\&quot;)&quot;. Then the facet will count the products that are both in stock and ship to store &quot;123&quot;.
&quot;restrictedValues&quot;: [ # Only get facet for the given restricted values. For example, when using &quot;pickupInStore&quot; as key and set restricted values to [&quot;store123&quot;, &quot;store456&quot;], only facets for &quot;store123&quot; and &quot;store456&quot; are returned. Only supported on textual fields and fulfillments. Maximum is 20. Must be set for the fulfillment facet keys: * pickupInStore * shipToStore * sameDayDelivery * nextDayDelivery * customFulfillment1 * customFulfillment2 * customFulfillment3 * customFulfillment4 * customFulfillment5
&quot;A String&quot;,
],
},
&quot;limit&quot;: 42, # Maximum of facet values that should be returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 will be coerced to 300. If this field is negative, an INVALID_ARGUMENT is returned.
},
],
&quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the products being filtered. Filter expression is case-sensitive. See more details at this [user guide](https://cloud.google.com/retail/docs/filter-and-order#filter). If this field is unrecognizable, an INVALID_ARGUMENT is returned.
&quot;offset&quot;: 42, # A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Products deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an INVALID_ARGUMENT is returned.
&quot;orderBy&quot;: &quot;A String&quot;, # The order in which products are returned. Products can be ordered by a field in an Product object. Leave it unset if ordered by relevance. OrderBy expression is case-sensitive. See more details at this [user guide](https://cloud.google.com/retail/docs/filter-and-order#order). If this field is unrecognizable, an INVALID_ARGUMENT is returned.
&quot;pageCategories&quot;: [ # The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use &#x27;&gt;&#x27; sign to separate different hierarchies. If &#x27;&gt;&#x27; is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: &quot;pageCategories&quot; : [&quot;Sales &gt; 2017 Black Friday Deals&quot;].
&quot;A String&quot;,
],
&quot;pageSize&quot;: 42, # Maximum number of Products to return. If unspecified, defaults to a reasonable value. The maximum allowed value is 120. Values above 120 will be coerced to 120. If this field is negative, an INVALID_ARGUMENT is returned.
&quot;pageToken&quot;: &quot;A String&quot;, # A page token SearchResponse.next_page_token, received from a previous SearchService.Search call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;query&quot;: &quot;A String&quot;, # Raw search query.
&quot;queryExpansionSpec&quot;: { # Specification to determine under which conditions query expansion should occur. # The query expansion specification that specifies the conditions under which query expansion will occur. See more details at this [user guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
&quot;condition&quot;: &quot;A String&quot;, # The condition under which query expansion should occur. Default to Condition.DISABLED.
&quot;pinUnexpandedResults&quot;: True or False, # Whether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.
},
&quot;searchMode&quot;: &quot;A String&quot;, # The search mode of the search request. If not specified, a single search request triggers both product search and faceted search.
&quot;userInfo&quot;: { # Information of an end user. # User information.
&quot;directUserRequest&quot;: True or False, # True if the request is made directly from the end user, in which case the ip_address and 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.
&quot;ipAddress&quot;: &quot;A String&quot;, # The end user&#x27;s IP address. Required for getting SearchResponse.sponsored_results. This field is used to extract location information for personalization. This field must be either an IPv4 address (e.g. &quot;104.133.9.80&quot;) or an IPv6 address (e.g. &quot;2001:0db8:85a3:0000:0000:8a2e:0370:7334&quot;). Otherwise, an INVALID_ARGUMENT error is returned. This should not be set when using the JavaScript tag in UserEventService.CollectUserEvent or if direct_user_request is set.
&quot;userAgent&quot;: &quot;A String&quot;, # User agent as included in the HTTP header. Required for getting SearchResponse.sponsored_results. 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 or if direct_user_request is set.
&quot;userId&quot;: &quot;A String&quot;, # Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
},
&quot;variantRollupKeys&quot;: [ # The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of &quot;fulfillmentType.fulfillmentId&quot;. E.g., in &quot;pickupInStore.store123&quot;, &quot;pickupInStore&quot; is fulfillment type and &quot;store123&quot; is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;pickup-in-store&quot;. * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;ship-to-store&quot;. * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;same-day-delivery&quot;. * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;next-day-delivery&quot;. * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;custom-type-1&quot;. * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;custom-type-2&quot;. * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;custom-type-3&quot;. * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;custom-type-4&quot;. * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type &quot;custom-type-5&quot;. If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
&quot;visitorId&quot;: &quot;A String&quot;, # Required. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This should be the same identifier as UserEvent.visitor_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for SearchService.Search method.
&quot;appliedControls&quot;: [ # The fully qualified resource name of applied [controls](https://cloud.google.com/retail/docs/serving-control-rules).
&quot;A String&quot;,
],
&quot;attributionToken&quot;: &quot;A String&quot;, # A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.
&quot;correctedQuery&quot;: &quot;A String&quot;, # If spell correction applies, the corrected query. Otherwise, empty.
&quot;facets&quot;: [ # Results of facets requested by user.
{ # A facet result.
&quot;dynamicFacet&quot;: True or False, # Whether the facet is dynamically generated.
&quot;key&quot;: &quot;A String&quot;, # The key for this facet. E.g., &quot;colorFamilies&quot; or &quot;price&quot; or &quot;attributes.attr1&quot;.
&quot;values&quot;: [ # The facet values for this field.
{ # A facet value which contains value names and their count.
&quot;count&quot;: &quot;A String&quot;, # Number of items that have this facet value.
&quot;interval&quot;: { # A floating point interval. # Interval value for a facet, such as [10, 20) for facet &quot;price&quot;.
&quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
&quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
&quot;maximum&quot;: 3.14, # Inclusive upper bound.
&quot;minimum&quot;: 3.14, # Inclusive lower bound.
},
&quot;value&quot;: &quot;A String&quot;, # Text value of a facet, such as &quot;Black&quot; for facet &quot;colorFamilies&quot;.
},
],
},
],
&quot;nextPageToken&quot;: &quot;A String&quot;, # A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
&quot;queryExpansionInfo&quot;: { # Information describing query expansion including whether expansion has occurred. # Query expansion information for the returned results.
&quot;expandedQuery&quot;: True or False, # Bool describing whether query expansion has occurred.
&quot;pinnedResultCount&quot;: &quot;A String&quot;, # Number of pinned results. This field will only be set when expansion happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true.
},
&quot;redirectUri&quot;: &quot;A String&quot;, # The URI of a customer-defined redirect page. If redirect action is triggered, no search will be performed, and only redirect_uri and attribution_token will be set in the response.
&quot;results&quot;: [ # A list of matched items. The order represents the ranking.
{ # Represents the search results.
&quot;id&quot;: &quot;A String&quot;, # Product.id of the searched Product.
&quot;matchingVariantCount&quot;: 42, # The count of matched variant Products.
&quot;matchingVariantFields&quot;: { # If a variant Product matches the search query, this map indicates which Product fields are matched. The key is the Product.name, the value is a field mask of the matched Product fields. If matched attributes cannot be determined, this map will be empty. For example, a key &quot;sku1&quot; with field mask &quot;products.color_info&quot; indicates there is a match between &quot;sku1&quot; ColorInfo and the query.
&quot;a_key&quot;: &quot;A String&quot;,
},
&quot;product&quot;: { # Product captures all metadata information of items to be recommended or searched. # The product data snippet in the search response. Only Product.name is guaranteed to be populated. Product.variants contains the product variants that match the search query. If there are multiple product variants matching the query, top 5 most relevant product variants are returned and ordered by relevancy. If relevancy can be deternmined, use matching_variant_fields to look up matched product variants fields. If relevancy cannot be determined, e.g. when searching &quot;shoe&quot; all products in a shoe product can be a match, 5 product variants are returned but order is meaningless.
&quot;attributes&quot;: { # Highly encouraged. Extra product attributes to be included. For example, for products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the attributes here. Features that can take on one of a limited number of possible values. Two types of features can be set are: Textual features. some examples would be the brand/maker of a product, or country of a customer. Numerical features. Some examples would be the height/weight of a product, or age of a customer. For example: `{ &quot;vendor&quot;: {&quot;text&quot;: [&quot;vendor123&quot;, &quot;vendor456&quot;]}, &quot;lengths_cm&quot;: {&quot;numbers&quot;:[2.3, 15.4]}, &quot;heights_cm&quot;: {&quot;numbers&quot;:[8.1, 6.4]} }`. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned: * Max entries count: 200. * The key must be a UTF-8 encoded string with a length limit of 128 characters. * For indexable attribute, the key must match the pattern: `a-zA-Z0-9*`. For example, `key0LikeThis` or `KEY_1_LIKE_THIS`. * For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters. * For number attributes, at most 400 values are allowed.
&quot;a_key&quot;: { # A custom attribute that is not explicitly modeled in Product.
&quot;indexable&quot;: True or False, # If true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.
&quot;numbers&quot;: [ # The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is &quot;lengths_cm&quot;. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned.
3.14,
],
&quot;searchable&quot;: True or False, # If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.
&quot;text&quot;: [ # The textual values of this custom attribute. For example, `[&quot;yellow&quot;, &quot;green&quot;]` when the key is &quot;color&quot;. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
},
},
&quot;audience&quot;: { # An intended audience of the Product for whom it&#x27;s sold. # The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product.
&quot;ageGroups&quot;: [ # The age groups of the audience. Strongly encouraged to use the standard values: &quot;newborn&quot; (up to 3 months old), &quot;infant&quot; (3–12 months old), &quot;toddler&quot; (1–5 years old), &quot;kids&quot; (5–13 years old), &quot;adult&quot; (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).
&quot;A String&quot;,
],
&quot;genders&quot;: [ # The genders of the audience. Strongly encouraged to use the standard values: &quot;male&quot;, &quot;female&quot;, &quot;unisex&quot;. 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).
&quot;A String&quot;,
],
},
&quot;availability&quot;: &quot;A String&quot;, # The online availability of the Product. Default to Availability.IN_STOCK. Corresponding properties: Google Merchant Center property [availability](https://support.google.com/merchants/answer/6324448). Schema.org property [Offer.availability](https://schema.org/availability).
&quot;availableQuantity&quot;: 42, # The available quantity of the item.
&quot;availableTime&quot;: &quot;A String&quot;, # The timestamp when this Product becomes available for SearchService.Search.
&quot;brands&quot;: [ # The brands of the product. A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [brand](https://support.google.com/merchants/answer/6324351). Schema.org property [Product.brand](https://schema.org/brand).
&quot;A String&quot;,
],
&quot;categories&quot;: [ # Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use &#x27;&gt;&#x27; sign to separate different hierarchies. If &#x27;&gt;&#x27; is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both [&quot;Shoes &amp; Accessories&quot; -&gt; &quot;Shoes&quot;] and [&quot;Sports &amp; Fitness&quot; -&gt; &quot;Athletic Clothing&quot; -&gt; &quot;Shoes&quot;], it could be represented as: &quot;categories&quot;: [ &quot;Shoes &amp; Accessories &gt; Shoes&quot;, &quot;Sports &amp; Fitness &gt; Athletic Clothing &gt; Shoes&quot; ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436
&quot;A String&quot;,
],
&quot;collectionMemberIds&quot;: [ # The id of the collection members when type is Type.COLLECTION. Should not set it for other types. A maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is return.
&quot;A String&quot;,
],
&quot;colorInfo&quot;: { # The color information of a Product. # The color of the product. Corresponding properties: Google Merchant Center property [color](https://support.google.com/merchants/answer/6324487). Schema.org property [Product.color](https://schema.org/color).
&quot;colorFamilies&quot;: [ # The standard color families. Strongly recommended to use the following standard color groups: &quot;Red&quot;, &quot;Pink&quot;, &quot;Orange&quot;, &quot;Yellow&quot;, &quot;Purple&quot;, &quot;Green&quot;, &quot;Cyan&quot;, &quot;Blue&quot;, &quot;Brown&quot;, &quot;White&quot;, &quot;Gray&quot;, &quot;Black&quot; and &quot;Mixed&quot;. Normally it is expected to have only 1 color family. May consider using single &quot;Mixed&quot; 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).
&quot;A String&quot;,
],
&quot;colors&quot;: [ # 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 &quot;Mixed&quot; instead of multiple values. A maximum of 25 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).
&quot;A String&quot;,
],
},
&quot;conditions&quot;: [ # The condition of the product. Strongly encouraged to use the standard values: &quot;new&quot;, &quot;refurbished&quot;, &quot;used&quot;. A maximum of 5 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [condition](https://support.google.com/merchants/answer/6324469). Schema.org property [Offer.itemCondition](https://schema.org/itemCondition).
&quot;A String&quot;,
],
&quot;description&quot;: &quot;A String&quot;, # Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [description](https://support.google.com/merchants/answer/6324468). Schema.org property [Product.description](https://schema.org/description).
&quot;expireTime&quot;: &quot;A String&quot;, # The timestamp when this product becomes unavailable for SearchService.Search. If it is set, the Product is not available for SearchService.Search after expire_time. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts. expire_time must be later than available_time and publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding properties: Google Merchant Center property [expiration_date](https://support.google.com/merchants/answer/6324499).
&quot;fulfillmentInfo&quot;: [ # Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is returned.
{ # Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods.
&quot;placeIds&quot;: [ # The IDs for this type, such as the store IDs for FulfillmentInfo.type.pickup-in-store or the region IDs for FulfillmentInfo.type.same-day-delivery. 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 &quot;store1&quot; or &quot;REGION-2&quot;. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;A String&quot;,
],
&quot;type&quot;: &quot;A String&quot;, # 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: * &quot;pickup-in-store&quot; * &quot;ship-to-store&quot; * &quot;same-day-delivery&quot; * &quot;next-day-delivery&quot; * &quot;custom-type-1&quot; * &quot;custom-type-2&quot; * &quot;custom-type-3&quot; * &quot;custom-type-4&quot; * &quot;custom-type-5&quot; If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.
},
],
&quot;gtin&quot;: &quot;A String&quot;, # The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [gtin](https://support.google.com/merchants/answer/6324461). Schema.org property [Product.isbn](https://schema.org/isbn), [Product.gtin8](https://schema.org/gtin8), [Product.gtin12](https://schema.org/gtin12), [Product.gtin13](https://schema.org/gtin13), or [Product.gtin14](https://schema.org/gtin14). If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
&quot;id&quot;: &quot;A String&quot;, # Immutable. Product identifier, which is the final component of name. For example, this field is &quot;id_1&quot;, if name is `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [id](https://support.google.com/merchants/answer/6324405). Schema.org property [Product.sku](https://schema.org/sku).
&quot;images&quot;: [ # Product images for the product.Highly recommended to put the main image to the first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property [image_link](https://support.google.com/merchants/answer/6324350). Schema.org property [Product.image](https://schema.org/image).
{ # Product thumbnail/detail image.
&quot;height&quot;: 42, # Height of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;uri&quot;: &quot;A String&quot;, # 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).
&quot;width&quot;: 42, # Width of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
},
],
&quot;languageCode&quot;: &quot;A String&quot;, # Language of the title/description and other string attributes. Use language tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to &quot;en-US&quot; if unset.
&quot;materials&quot;: [ # The material of the product. For example, &quot;leather&quot;, &quot;wooden&quot;. A maximum of 20 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. Corresponding properties: Google Merchant Center property [material](https://support.google.com/merchants/answer/6324410). Schema.org property [Product.material](https://schema.org/material).
&quot;A String&quot;,
],
&quot;name&quot;: &quot;A String&quot;, # Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.
&quot;patterns&quot;: [ # The pattern or graphic print of the product. For example, &quot;striped&quot;, &quot;polka dot&quot;, &quot;paisley&quot;. A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [pattern](https://support.google.com/merchants/answer/6324483). Schema.org property [Product.pattern](https://schema.org/pattern).
&quot;A String&quot;,
],
&quot;priceInfo&quot;: { # The price information of a Product. # Product price and cost information. Corresponding properties: Google Merchant Center property [price](https://support.google.com/merchants/answer/6324371).
&quot;cost&quot;: 3.14, # The costs associated with the sale of a particular product. Used for gross profit reporting. * Profit = price - cost Google Merchant Center property [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
&quot;currencyCode&quot;: &quot;A String&quot;, # 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 Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.
&quot;originalPrice&quot;: 3.14, # Price of the product without any discount. If zero, by default set to be the price.
&quot;price&quot;: 3.14, # 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).
&quot;priceEffectiveTime&quot;: &quot;A String&quot;, # The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time. Do not set if price is always effective because it will cause additional latency during search.
&quot;priceExpireTime&quot;: &quot;A String&quot;, # The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time. Do not set if price is always effective because it will cause additional latency during search.
&quot;priceRange&quot;: { # The price range of all variant Product having the same Product.primary_product_id. # Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
&quot;originalPrice&quot;: { # A floating point interval. # The inclusive Product.pricing_info.original_price internal of all variant Product having the same Product.primary_product_id.
&quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
&quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
&quot;maximum&quot;: 3.14, # Inclusive upper bound.
&quot;minimum&quot;: 3.14, # Inclusive lower bound.
},
&quot;price&quot;: { # A floating point interval. # The inclusive Product.pricing_info.price interval of all variant Product having the same Product.primary_product_id.
&quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
&quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
&quot;maximum&quot;: 3.14, # Inclusive upper bound.
&quot;minimum&quot;: 3.14, # Inclusive lower bound.
},
},
},
&quot;primaryProductId&quot;: &quot;A String&quot;, # Variant group identifier. Must be an id, with the same parent branch with this product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field can only be empty or set to the same value as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 products are allowed to share the same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [item_group_id](https://support.google.com/merchants/answer/6324507). Schema.org property [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
&quot;promotions&quot;: [ # The promotions applied to the product. A maximum of 10 values are allowed per Product.
{ # Promotion information.
&quot;promotionId&quot;: &quot;A String&quot;, # ID of the promotion. For example, &quot;free gift&quot;. The value value must be a UTF-8 encoded string with a length limit of 128 characters, and match the pattern: `a-zA-Z*`. For example, id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [promotion](https://support.google.com/merchants/answer/7050148).
},
],
&quot;publishTime&quot;: &quot;A String&quot;, # The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from available_time, given it purely describes product freshness regardless of when it is available on search and recommendation.
&quot;rating&quot;: { # The rating of a Product. # The rating of this product.
&quot;averageRating&quot;: 3.14, # The average rating of the Product. The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;ratingCount&quot;: 42, # The total number of ratings. This value is independent of the value of rating_histogram. This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
&quot;ratingHistogram&quot;: [ # 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 got 41 ratings with 1 star, 14 ratings with 2 star, and so on.
42,
],
},
&quot;retrievableFields&quot;: &quot;A String&quot;, # Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form &quot;attributes.key&quot; where &quot;key&quot; is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse may increase response payload size and serving latency.
&quot;sizes&quot;: [ # The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in &quot;US:MENS:M&quot;, &quot;US&quot; represents size system; &quot;MENS&quot; represents size type; &quot;M&quot; represents size value. In &quot;GIRLS:27&quot;, size system is empty; &quot;GIRLS&quot; represents size type; &quot;27&quot; represents size value. In &quot;32 inches&quot;, both size system and size type are empty, while size value is &quot;32 inches&quot;. A maximum of 20 values are allowed per Product. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [size](https://support.google.com/merchants/answer/6324492), [size_type](https://support.google.com/merchants/answer/6324497), and [size_system](https://support.google.com/merchants/answer/6324502). Schema.org property [Product.size](https://schema.org/size).
&quot;A String&quot;,
],
&quot;tags&quot;: [ # Custom tags associated with the product. At most 250 values are allowed per Product. This value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can be used for filtering recommendation results by passing the tag as part of the PredictRequest.filter. Corresponding properties: Google Merchant Center property [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
&quot;A String&quot;,
],
&quot;title&quot;: &quot;A String&quot;, # Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [title](https://support.google.com/merchants/answer/6324415). Schema.org property [Product.name](https://schema.org/name).
&quot;ttl&quot;: &quot;A String&quot;, # Input only. The TTL (time to live) of the product. If it is set, it must be a non-negative value, and expire_time is set as current timestamp plus ttl. The derived expire_time is returned in the output and ttl is left blank when retrieving the Product. If it is set, the product is not available for SearchService.Search after current timestamp plus ttl. However, the product can still be retrieved by ProductService.GetProduct and ProductService.ListProducts.
&quot;type&quot;: &quot;A String&quot;, # Immutable. The type of the product. Default to Catalog.product_level_config.ingestion_product_type if unset.
&quot;uri&quot;: &quot;A String&quot;, # Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [link](https://support.google.com/merchants/answer/6324416). Schema.org property [Offer.url](https://schema.org/url).
&quot;variants&quot;: [ # Output only. Product variants grouped together on primary product which share similar product attributes. It&#x27;s automatically grouped by primary_product_id for all the product variants. Only populated for Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.
# Object with schema name: GoogleCloudRetailV2betaProduct
],
},
&quot;variantRollupValues&quot;: { # The rollup matching variant Product attributes. The key is one of the SearchRequest.variant_rollup_keys. The values are the merged and de-duplicated Product attributes. Notice that the rollup values are respect filter. For example, when filtering by &quot;colorFamilies:ANY(\&quot;red\&quot;)&quot; and rollup &quot;colorFamilies&quot;, only &quot;red&quot; is returned. For textual and numerical attributes, the rollup values is a list of string or double values with type google.protobuf.ListValue. For example, if there are two variants with colors &quot;red&quot; and &quot;blue&quot;, the rollup values are { key: &quot;colorFamilies&quot; value { list_value { values { string_value: &quot;red&quot; } values { string_value: &quot;blue&quot; } } } } For FulfillmentInfo, the rollup values is a double value with type google.protobuf.Value. For example, `{key: &quot;pickupInStore.store1&quot; value { number_value: 10 }}` means a there are 10 variants in this product are available in the store &quot;store1&quot;.
&quot;a_key&quot;: &quot;&quot;,
},
},
],
&quot;totalSize&quot;: 42, # The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.
}</pre>
</div>
<div class="method">
<code class="details" id="search_next">search_next(previous_request, previous_response)</code>
<pre>Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call &#x27;execute()&#x27; on to request the next
page. Returns None if there are no more items in the collection.
</pre>
</div>
</body></html>