Skip to main content

catalog_items

Creates, updates, deletes, gets or lists a catalog_items resource.

Overview

Namecatalog_items
TypeResource
Idgoogle.recommendationengine.catalog_items

Fields

NameDatatypeDescription
idstringRequired. 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.
descriptionstringOptional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.
categoryHierarchiesarrayRequired. 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 ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as: "categoryHierarchies": [ { "categories": ["Shoes & Accessories", "Shoes"]}, { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } ]
itemAttributesobjectFeatureMap represents extra features that customers want to include in the recommendation model for catalogs/user events as categorical/numerical features.
itemGroupIdstringOptional. 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.
languageCodestringOptional. 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.
productMetadataobjectProductCatalogItem captures item metadata specific to retail products.
tagsarrayOptional. 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.
titlestringRequired. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_catalogs_catalog_items_getSELECTcatalogItemsId, catalogsId, locationsId, projectsIdGets a specific catalog item.
projects_locations_catalogs_catalog_items_listSELECTcatalogsId, locationsId, projectsIdGets a list of catalog items.
projects_locations_catalogs_catalog_items_createINSERTcatalogsId, locationsId, projectsIdCreates a catalog item.
projects_locations_catalogs_catalog_items_deleteDELETEcatalogItemsId, catalogsId, locationsId, projectsIdDeletes a catalog item.
projects_locations_catalogs_catalog_items_patchUPDATEcatalogItemsId, catalogsId, locationsId, projectsIdUpdates a catalog item. Partial updating is supported. Non-existing items will be created.
projects_locations_catalogs_catalog_items_importEXECcatalogsId, locationsId, projectsIdBulk 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.

SELECT examples

Gets a list of catalog items.

SELECT
id,
description,
categoryHierarchies,
itemAttributes,
itemGroupId,
languageCode,
productMetadata,
tags,
title
FROM google.recommendationengine.catalog_items
WHERE catalogsId = '{{ catalogsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new catalog_items resource.

/*+ create */
INSERT INTO google.recommendationengine.catalog_items (
catalogsId,
locationsId,
projectsId,
categoryHierarchies,
title,
description,
itemAttributes,
languageCode,
tags,
itemGroupId,
productMetadata
)
SELECT
'{{ catalogsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ categoryHierarchies }}',
'{{ title }}',
'{{ description }}',
'{{ itemAttributes }}',
'{{ languageCode }}',
'{{ tags }}',
'{{ itemGroupId }}',
'{{ productMetadata }}'
;

UPDATE example

Updates a catalog_items resource.

/*+ update */
UPDATE google.recommendationengine.catalog_items
SET
categoryHierarchies = '{{ categoryHierarchies }}',
title = '{{ title }}',
description = '{{ description }}',
itemAttributes = '{{ itemAttributes }}',
languageCode = '{{ languageCode }}',
tags = '{{ tags }}',
itemGroupId = '{{ itemGroupId }}',
productMetadata = '{{ productMetadata }}'
WHERE
catalogItemsId = '{{ catalogItemsId }}'
AND catalogsId = '{{ catalogsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified catalog_items resource.

/*+ delete */
DELETE FROM google.recommendationengine.catalog_items
WHERE catalogItemsId = '{{ catalogItemsId }}'
AND catalogsId = '{{ catalogsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';