blob: ec6b5aef80b9c34a1bebe81415dcd81824042999 [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="recommendationengine_v1beta1.html">Recommendations AI</a> . <a href="recommendationengine_v1beta1.projects.html">projects</a> . <a href="recommendationengine_v1beta1.projects.locations.html">locations</a> . <a href="recommendationengine_v1beta1.projects.locations.catalogs.html">catalogs</a> . <a href="recommendationengine_v1beta1.projects.locations.catalogs.catalogItems.html">catalogItems</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Creates a catalog item.</p>
<p class="toc_element">
<code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
<p class="firstline">Deletes a catalog item.</p>
<p class="toc_element">
<code><a href="#get">get(name, x__xgafv=None)</a></code></p>
<p class="firstline">Gets a specific catalog item.</p>
<p class="toc_element">
<code><a href="#getGroupIdItems">getGroupIdItems(parent, itemGroupId=None, x__xgafv=None)</a></code></p>
<p class="firstline">Method for getting the catalog items associated with item group id.</p>
<p class="toc_element">
<code><a href="#import_">import_(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Bulk import of multiple catalog items. Request processing may be</p>
<p class="toc_element">
<code><a href="#list">list(parent, filter=None, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p>
<p class="firstline">Gets a list of catalog items.</p>
<p class="toc_element">
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
<code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
<p class="firstline">Updates a catalog item. Partial updating is supported. Non-existing</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
<pre>Creates a catalog item.
Args:
parent: string, Required. The parent catalog resource name, such as
&quot;projects/*/locations/global/catalogs/default_catalog&quot;. (required)
body: object, The request body.
The object takes the form of:
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
}</pre>
</div>
<div class="method">
<code class="details" id="delete">delete(name, x__xgafv=None)</code>
<pre>Deletes a catalog item.
Args:
name: string, Required. Full resource name of catalog item, such as
&quot;projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id&quot;. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A generic empty message that you can re-use to avoid defining duplicated
# empty messages in your APIs. A typical example is to use it as the request
# or the response type of an API method. For instance:
#
# service Foo {
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
# }
#
# The JSON representation for `Empty` is empty JSON object `{}`.
}</pre>
</div>
<div class="method">
<code class="details" id="get">get(name, x__xgafv=None)</code>
<pre>Gets a specific catalog item.
Args:
name: string, Required. Full resource name of catalog item, such as
&quot;projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id&quot;. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
}</pre>
</div>
<div class="method">
<code class="details" id="getGroupIdItems">getGroupIdItems(parent, itemGroupId=None, x__xgafv=None)</code>
<pre>Method for getting the catalog items associated with item group id.
Args:
parent: string, Required. Parent resource name of group id item, such as
&quot;projects/*/locations/global/catalogs/default_catalog&quot;. (required)
itemGroupId: string, Required. Catalog item identifier for prediction results.
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 GetCatalogItemsWithItemGroupId method.
&quot;canonicalCatalogItem&quot;: { # CatalogItem captures all metadata information of items to be recommended. # The canonical catalog item representing all items associated with the item
# group id.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
},
&quot;catalogItems&quot;: [ # The list of catalog items associated with the item group id.
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
},
],
}</pre>
</div>
<div class="method">
<code class="details" id="import_">import_(parent, body=None, x__xgafv=None)</code>
<pre>Bulk import of multiple catalog items. Request processing may be
synchronous. No partial updating supported. Non-existing items will be
created.
Operation.response is of type ImportResponse. Note that it is
possible for a subset of the items to be successfully updated.
Args:
parent: string, Required. &quot;projects/1234/locations/global/catalogs/default_catalog&quot;
If no updateMask is specified, requires catalogItems.create permission.
If updateMask is specified, requires catalogItems.update permission. (required)
body: object, The request body.
The object takes the form of:
{ # Request message for Import methods.
&quot;updateMask&quot;: &quot;A String&quot;, # Optional. Indicates which fields in the provided imported &#x27;items&#x27; to update. If not
# set, will by default update all fields.
&quot;inputConfig&quot;: { # The input config source. # Required. The desired input location of the data.
&quot;userEventInlineSource&quot;: { # The inline source for the input config for ImportUserEvents method. # The Inline source for the input content for UserEvents.
&quot;userEvents&quot;: [ # Optional. A list of user events to import. Recommended max of 10k items.
{ # UserEvent captures all metadata information recommendation engine needs to
# know about how end users interact with customers&#x27; website.
&quot;productEventDetail&quot;: { # ProductEventDetail captures user event information specific to retail # Optional. Retail product specific user event metadata.
#
# This field is required for the following event types:
#
# * `add-to-cart`
# * `add-to-list`
# * `category-page-view`
# * `checkout-start`
# * `detail-page-view`
# * `purchase-complete`
# * `refund`
# * `remove-from-cart`
# * `remove-from-list`
# * `search`
#
# This field is optional for the following event types:
#
# * `page-visit`
# * `shopping-cart-page-view` - note that &#x27;product_event_detail&#x27; should be
# set for this unless the shopping cart is empty.
#
# This field is not allowed for the following event types:
#
# * `home-page-view`
# products.
&quot;pageCategories&quot;: [ # Required for `category-page-view` events. Other event types should not set
# this field.
# The categories associated with a category page.
# Category pages include special pages such as sales or promotions. For
# instance, a special sale page may have the category hierarchy:
# categories : [&quot;Sales&quot;, &quot;2017 Black Friday Deals&quot;].
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;purchaseTransaction&quot;: { # A transaction represents the entire purchase transaction. # Optional. A transaction represents the entire purchase transaction.
# Required for `purchase-complete` events. Optional for `checkout-start`
# events. Other event types should not set this field.
&quot;taxes&quot;: { # Optional. All the taxes associated with the transaction.
&quot;a_key&quot;: 3.14,
},
&quot;id&quot;: &quot;A String&quot;, # Optional. The transaction ID with a length limit of 128 bytes.
&quot;currencyCode&quot;: &quot;A String&quot;, # Required. Currency code. Use three-character ISO-4217 code. This field
# is not required if the event type is `refund`.
&quot;revenue&quot;: 3.14, # Required. Total 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. This field
# is not required if the event type is `refund`.
&quot;costs&quot;: { # Optional. All the costs associated with the product. These can be
# manufacturing costs, shipping expenses not borne by the end user, or any
# other costs.
#
# Total product cost such that
# profit = revenue - (sum(taxes) + sum(costs))
# If product_cost is not set, then
# profit = revenue - tax - shipping - sum(CatalogItem.costs).
#
# If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
# based profit *cannot* be calculated for this Transaction.
&quot;a_key&quot;: 3.14,
},
},
&quot;searchQuery&quot;: &quot;A String&quot;, # Required for `search` events. Other event types should not set this field.
# The user&#x27;s search query as UTF-8 encoded text with a length limit of 5 KiB.
&quot;productDetails&quot;: [ # The main product details related to the event.
#
# This field is required for the following event types:
#
# * `add-to-cart`
# * `add-to-list`
# * `checkout-start`
# * `detail-page-view`
# * `purchase-complete`
# * `refund`
# * `remove-from-cart`
# * `remove-from-list`
#
# This field is optional for the following event types:
#
# * `page-visit`
# * `shopping-cart-page-view` - note that &#x27;product_details&#x27; should be set for
# this unless the shopping cart is empty.
# * `search` (highly encouraged)
#
# 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 broswing 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 broswing the whole page yet.
#
# This field is not allowed for the following event types:
#
# * `category-page-view`
# * `home-page-view`
{ # Detailed product information associated with a user event.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Extra features associated with a product in the user event.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
# characters.
&quot;originalPrice&quot;: 3.14, # Optional. Original price of the product. If provided, this will override
# the original price in Catalog for this product.
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Item stock state. If provided, this overrides the stock state
# in Catalog for items in this event.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product (e.g. discounted price). If
# provided, this will override the display price in Catalog for this product.
&quot;availableQuantity&quot;: 42, # Optional. Quantity of the products in stock when a user event happens.
# Optional. If provided, this overrides the available quantity in Catalog for
# this event. and can only be set if `stock_status` is set to `IN_STOCK`.
#
# Note that if an item is out of stock, you must set the `stock_state` field
# to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
# sufficient to mark the item out of stock.
&quot;quantity&quot;: 42, # Optional. 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 `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
# `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
# types.
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Currency code for price/costs. Use three-character ISO-4217
# code. Required only if originalPrice or displayPrice is set.
},
],
&quot;cartId&quot;: &quot;A String&quot;, # Optional. 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`, `remove-from-cart`,
# `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
&quot;listId&quot;: &quot;A String&quot;, # Required for `add-to-list` and `remove-from-list` events. The id or name of
# the list that the item is being added to or removed from. Other event types
# should not set this field.
},
&quot;eventType&quot;: &quot;A String&quot;, # Required. User event type. Allowed values are:
#
# * `add-to-cart` Products being added to cart.
# * `add-to-list` Items being added to a list (shopping list, favorites
# etc).
# * `category-page-view` Special pages such as sale or promotion pages
# viewed.
# * `checkout-start` User starting a checkout process.
# * `detail-page-view` Products detail page viewed.
# * `home-page-view` Homepage viewed.
# * `page-visit` Generic page visits not included in the event types above.
# * `purchase-complete` User finishing a purchase.
# * `refund` Purchased items being refunded or returned.
# * `remove-from-cart` Products being removed from cart.
# * `remove-from-list` Items being removed from a list.
# * `search` Product search.
# * `shopping-cart-page-view` User viewing a shopping cart.
# * `impression` List of items displayed. Used by Google Tag Manager.
&quot;userInfo&quot;: { # Information of end users. # Required. User information.
&quot;ipAddress&quot;: &quot;A String&quot;, # Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
# IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
# set when using the javascript pixel or if `direct_user_request` is set.
# Used to extract location information for personalization.
&quot;directUserRequest&quot;: True or False, # Optional. Indicates if the request is made directly from the end user
# in which case the user_agent and ip_address fields can be populated
# from the HTTP request. This should *not* be set when using the javascript
# pixel. 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).
&quot;userAgent&quot;: &quot;A String&quot;, # Optional. User agent as included in the HTTP header. UTF-8 encoded string
# with a length limit of 1 KiB.
#
# This should *not* be set when using the JavaScript pixel or if
# `directUserRequest` is set.
&quot;visitorId&quot;: &quot;A String&quot;, # Required. A unique identifier for tracking visitors with a length limit of
# 128 bytes.
#
# For example, this could be implemented with a 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.
# Maximum length 128 bytes. Cannot be empty.
&quot;userId&quot;: &quot;A String&quot;, # Optional. Unique identifier for logged-in user with a length limit of 128
# bytes. Required only for logged-in users.
},
&quot;eventTime&quot;: &quot;A String&quot;, # Optional. Only required for ImportUserEvents method. Timestamp of user
# event created.
&quot;eventDetail&quot;: { # User event details shared by all recommendation types. # Optional. User event detailed information common across different
# recommendation types.
&quot;pageViewId&quot;: &quot;A String&quot;, # Optional. 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. This `pageViewId` will be
# automatically generated if using the JavaScript pixel.
&quot;uri&quot;: &quot;A String&quot;, # Optional. Complete url (window.location.href) of the user&#x27;s current page.
# When using the JavaScript pixel, this value is filled in automatically.
# Maximum length 5KB.
&quot;referrerUri&quot;: &quot;A String&quot;, # Optional. The referrer url of the current page. When using
# the JavaScript pixel, this value is filled in automatically.
&quot;recommendationToken&quot;: &quot;A String&quot;, # Optional. Recommendation token included in the recommendation prediction
# response.
#
# This field enables accurate attribution of recommendation model
# performance.
#
# This token enables us to accurately attribute page view or purchase back to
# the event and the particular predict response containing this
# clicked/purchased item. If user clicks on product K in the recommendation
# results, pass the `PredictResponse.recommendationToken` property as a url
# parameter to product K&#x27;s page. When recording events on product K&#x27;s page,
# log the PredictResponse.recommendation_token to this field.
#
# Optional, but highly encouraged for user events that are the result of a
# recommendation prediction query.
&quot;experimentIds&quot;: [ # Optional. 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 Recommendation
# Engine system, using different recommendation models).
&quot;A String&quot;,
],
&quot;eventAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Extra user event features to include in the recommendation
# model.
#
# 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.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
},
&quot;eventSource&quot;: &quot;A String&quot;, # Optional. This field should *not* be set when using JavaScript pixel
# or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
},
],
},
&quot;gcsSource&quot;: { # Google Cloud Storage location for input content. # Google Cloud Storage location for the input content.
# format.
&quot;jsonSchema&quot;: &quot;A String&quot;, # Optional. The schema to use when parsing the data from the source.
#
# Supported values for catalog imports:
#
# 1: &quot;catalog_recommendations_ai&quot; using
# https://cloud.google.com/recommendations-ai/docs/upload-catalog#json
# (Default for catalogItems.import)
#
# 2: &quot;catalog_merchant_center&quot; using
# https://cloud.google.com/recommendations-ai/docs/upload-catalog#mc
#
# Supported values for user events imports:
#
# 1: &quot;user_events_recommendations_ai&quot; using
# https://cloud.google.com/recommendations-ai/docs/manage-user-events#import
# (Default for userEvents.import)
&quot;inputUris&quot;: [ # Required. Google Cloud Storage URIs to input files. URI can be up to
# 2000 characters long. URIs can match the full object path (for example,
# gs://bucket/directory/object.json) or a pattern matching one or more
# files, such as gs://bucket/directory/*.json. A request can
# contain at most 100 files, and each file can be up to 2 GB. See
# [Importing catalog information](/recommendations-ai/docs/upload-catalog)
# for the expected file format and setup instructions.
&quot;A String&quot;,
],
},
&quot;catalogInlineSource&quot;: { # The inline source for the input config for ImportCatalogItems method. # The Inline source for the input content for Catalog items.
&quot;catalogItems&quot;: [ # Optional. A list of catalog items to update/create. Recommended max of 10k
# items.
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
},
],
},
&quot;bigQuerySource&quot;: { # BigQuery source import data from. # BigQuery input source.
&quot;projectId&quot;: &quot;A String&quot;, # Optional. The project id (can be project # or id) that the BigQuery source is in. If
# not specified, inherits the project id from the parent request.
&quot;tableId&quot;: &quot;A String&quot;, # Required. The BigQuery table to copy the data from.
&quot;datasetId&quot;: &quot;A String&quot;, # Required. The BigQuery data set to copy the data from.
&quot;dataSchema&quot;: &quot;A String&quot;, # Optional. The schema to use when parsing the data from the source.
#
# Supported values for catalog imports:
#
# 1: &quot;catalog_recommendations_ai&quot; using
# https://cloud.google.com/recommendations-ai/docs/upload-catalog#json
# (Default for catalogItems.import)
#
# 2: &quot;catalog_merchant_center&quot; using
# https://cloud.google.com/recommendations-ai/docs/upload-catalog#mc
#
# Supported values for user event imports:
#
# 1: &quot;user_events_recommendations_ai&quot; using
# https://cloud.google.com/recommendations-ai/docs/manage-user-events#import
# (Default for userEvents.import)
&quot;gcsStagingDir&quot;: &quot;A String&quot;, # Required. Intermediate gcs dir used for the import.
# .
},
},
&quot;requestId&quot;: &quot;A String&quot;, # Optional. Unique identifier provided by client, within the ancestor
# dataset scope. Ensures idempotency and used for request deduplication.
# Server-generated if unspecified. Up to 128 characters long. This is
# returned as google.longrunning.Operation.name in the response.
&quot;errorsConfig&quot;: { # Configuration of destination for Import related errors. # Optional. The desired location of errors incurred during the Import.
&quot;gcsPrefix&quot;: &quot;A String&quot;, # Google Cloud Storage path for import errors. This must be an empty,
# existing Cloud Storage bucket. Import errors will be written to a file in
# this bucket, one per line, as a JSON-encoded
# `google.rpc.Status` message.
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a
# network API call.
&quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
# originally returns it. If you use the default HTTP mapping, the
# `name` should be a resource name ending with `operations/{unique_id}`.
&quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
# contains progress information and common metadata such as create time.
# Some services might not provide such metadata. Any method that returns a
# long-running operation should document the metadata type, if any.
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
},
&quot;response&quot;: { # The normal response of the operation in case of success. If the original
# method returns no data on success, such as `Delete`, the response is
# `google.protobuf.Empty`. If the original method is standard
# `Get`/`Create`/`Update`, the response should be the resource. For other
# methods, the response should have the type `XxxResponse`, where `Xxx`
# is the original method name. For example, if the original method name
# is `TakeSnapshot()`, the inferred response type is
# `TakeSnapshotResponse`.
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
},
&quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
# If `true`, the operation is completed, and either `error` or `response` is
# available.
&quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
# different programming environments, including REST APIs and RPC APIs. It is
# used by [gRPC](https://github.com/grpc). Each `Status` message contains
# three pieces of data: error code, error message, and error details.
#
# You can find out more about this error model and how to work with it in the
# [API Design Guide](https://cloud.google.com/apis/design/errors).
&quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
# message types for APIs to use.
{
&quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
},
],
&quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
&quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
# user-facing error message should be localized and sent in the
# google.rpc.Status.details field, or localized by the client.
},
}</pre>
</div>
<div class="method">
<code class="details" id="list">list(parent, filter=None, pageToken=None, pageSize=None, x__xgafv=None)</code>
<pre>Gets a list of catalog items.
Args:
parent: string, Required. The parent catalog resource name, such as
&quot;projects/*/locations/global/catalogs/default_catalog&quot;. (required)
filter: string, Optional. A filter to apply on the list results.
pageToken: string, Optional. The previous ListCatalogItemsResponse.next_page_token.
pageSize: integer, Optional. Maximum number of results to return per page. If zero, the
service will choose a reasonable default.
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 ListCatalogItems method.
&quot;catalogItems&quot;: [ # The catalog items.
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
},
],
&quot;nextPageToken&quot;: &quot;A String&quot;, # If empty, the list is complete. If nonempty, the token to pass to the next
# request&#x27;s ListCatalogItemRequest.page_token.
}</pre>
</div>
<div class="method">
<code class="details" id="list_next">list_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>
<div class="method">
<code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
<pre>Updates a catalog item. Partial updating is supported. Non-existing
items will be created.
Args:
name: string, Required. Full resource name of catalog item, such as
&quot;projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id&quot;. (required)
body: object, The request body.
The object takes the form of:
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
}
updateMask: string, Optional. Indicates which fields in the provided &#x27;item&#x27; to update. If not
set, will by default update all fields.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # CatalogItem captures all metadata information of items to be recommended.
&quot;languageCode&quot;: &quot;A String&quot;, # Optional. Deprecated. The model automatically detects the text language. Your
# catalog can include text in different languages, but duplicating
# catalog items to provide text in multiple languages can result in
# degraded model performance.
&quot;tags&quot;: [ # Optional. Filtering tags associated with the catalog item. Each tag should
# be a UTF-8 encoded string with a length limit of 1 KiB.
#
# This tag can be used for filtering recommendation results by passing the
# tag as part of the predict request filter.
&quot;A String&quot;,
],
&quot;itemGroupId&quot;: &quot;A String&quot;, # Optional. Variant group identifier for prediction results. UTF-8 encoded
# string with a length limit of 128 bytes.
#
# This field must be enabled before it can be used. [Learn
# more](/recommendations-ai/docs/catalog#item-group-id).
&quot;categoryHierarchies&quot;: [ # Required. Catalog item categories. This field is repeated for supporting
# one catalog item belonging to several parallel category hierarchies.
#
# 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;categoryHierarchies&quot;: [
# { &quot;categories&quot;: [&quot;Shoes &amp; Accessories&quot;, &quot;Shoes&quot;]},
# { &quot;categories&quot;: [&quot;Sports &amp; Fitness&quot;, &quot;Athletic Clothing&quot;, &quot;Shoes&quot;] }
# ]
{ # Category represents catalog item category hierarchy.
&quot;categories&quot;: [ # Required. Catalog item categories. Each category should be a UTF-8
# encoded string with a length limit of 2 KiB.
#
# Note that the order in the list denotes the specificity (from least to
# most specific).
&quot;A String&quot;,
],
},
],
&quot;id&quot;: &quot;A String&quot;, # Required. Catalog item identifier. UTF-8 encoded string with a length limit
# of 128 bytes.
#
# This id must be unique among all catalog items within the same catalog. It
# should also be used when logging user events in order for the user events
# to be joined with the Catalog.
&quot;itemAttributes&quot;: { # FeatureMap represents extra features that customers want to include in the # Optional. Highly encouraged. Extra catalog item attributes to be
# included in the recommendation model. For example, for retail 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 item attributes here.
# recommendation model for catalogs/user events as categorical/numerical
# features.
&quot;numericalFeatures&quot;: { # Numerical features. Some examples would be the height/weight of a product,
# or age of a customer.
#
# Feature names must be UTF-8 encoded strings.
#
# For example: `{ &quot;lengths_cm&quot;: {&quot;value&quot;:[2.3, 15.4]},
# &quot;heights_cm&quot;: {&quot;value&quot;:[8.1, 6.4]} }`
&quot;a_key&quot;: { # A list of float features.
&quot;value&quot;: [ # Float feature value.
3.14,
],
},
},
&quot;categoricalFeatures&quot;: { # Categorical features that can take on one of a limited number of possible
# values. Some examples would be the brand/maker of a product, or country of
# a customer.
#
# Feature names and values must be UTF-8 encoded strings.
#
# For example: `{ &quot;colors&quot;: {&quot;value&quot;: [&quot;yellow&quot;, &quot;green&quot;]},
# &quot;sizes&quot;: {&quot;value&quot;:[&quot;S&quot;, &quot;M&quot;]}`
&quot;a_key&quot;: { # A list of string features.
&quot;value&quot;: [ # String feature value with a length limit of 128 bytes.
&quot;A String&quot;,
],
},
},
},
&quot;title&quot;: &quot;A String&quot;, # Required. Catalog item title. UTF-8 encoded string with a length limit of 1
# KiB.
&quot;description&quot;: &quot;A String&quot;, # Optional. Catalog item description. UTF-8 encoded string with a length
# limit of 5 KiB.
&quot;productMetadata&quot;: { # ProductCatalogItem captures item metadata specific to retail products. # Optional. Metadata specific to retail products.
&quot;images&quot;: [ # Optional. Product images for the catalog item.
{ # Catalog item thumbnail/detail image.
&quot;uri&quot;: &quot;A String&quot;, # Required. URL of the image with a length limit of 5 KiB.
&quot;height&quot;: 42, # Optional. Height of the image in number of pixels.
&quot;width&quot;: 42, # Optional. Width of the image in number of pixels.
},
],
&quot;priceRange&quot;: { # Product price range when there are a range of prices for different # Optional. The product price range.
# variations of the same product.
&quot;max&quot;: 3.14, # Required. The maximum product price.
&quot;min&quot;: 3.14, # Required. The minimum product price.
},
&quot;stockState&quot;: &quot;A String&quot;, # Optional. Online stock state of the catalog item. Default is `IN_STOCK`.
&quot;canonicalProductUri&quot;: &quot;A String&quot;, # Optional. Canonical URL directly linking to the item detail page with a
# length limit of 5 KiB..
&quot;currencyCode&quot;: &quot;A String&quot;, # Optional. Only required if the price is set. Currency code for price/costs. Use
# three-character ISO-4217 code.
&quot;costs&quot;: { # Optional. A map to pass the costs associated with the product.
#
# For example:
# {&quot;manufacturing&quot;: 45.5} The profit of selling this item is computed like
# so:
#
# * If &#x27;exactPrice&#x27; is provided, profit = displayPrice - sum(costs)
# * If &#x27;priceRange&#x27; is provided, profit = minPrice - sum(costs)
&quot;a_key&quot;: 3.14,
},
&quot;availableQuantity&quot;: &quot;A String&quot;, # Optional. The available quantity of the item.
&quot;exactPrice&quot;: { # Exact product price. # Optional. The exact product price.
&quot;originalPrice&quot;: 3.14, # Optional. Price of the product without any discount. If zero, by default
# set to be the &#x27;displayPrice&#x27;.
&quot;displayPrice&quot;: 3.14, # Optional. Display price of the product.
},
},
}</pre>
</div>
</body></html>