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

The following fields are returned by SELECT queries:

Successful response

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.
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"] } ]
descriptionstringOptional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.
itemAttributesobjectOptional. 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. (id: GoogleCloudRecommendationengineV1beta1FeatureMap)
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.
productMetadataobjectOptional. Metadata specific to retail products. (id: GoogleCloudRecommendationengineV1beta1ProductCatalogItem)
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

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_catalogs_catalog_items_getselectprojectsId, locationsId, catalogsId, catalogItemsIdGets a specific catalog item.
projects_locations_catalogs_catalog_items_listselectprojectsId, locationsId, catalogsIdpageSize, pageToken, filterGets a list of catalog items.
projects_locations_catalogs_catalog_items_createinsertprojectsId, locationsId, catalogsIdCreates a catalog item.
projects_locations_catalogs_catalog_items_patchupdateprojectsId, locationsId, catalogsId, catalogItemsIdupdateMaskUpdates a catalog item. Partial updating is supported. Non-existing items will be created.
projects_locations_catalogs_catalog_items_deletedeleteprojectsId, locationsId, catalogsId, catalogItemsIdDeletes a catalog item.
projects_locations_catalogs_catalog_items_importexecprojectsId, locationsId, catalogsIdBulk 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
catalogItemsIdstring
catalogsIdstring
locationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a specific catalog item.

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

INSERT examples

Creates a catalog item.

INSERT INTO google.recommendationengine.catalog_items (
data__id,
data__categoryHierarchies,
data__title,
data__description,
data__itemAttributes,
data__languageCode,
data__tags,
data__itemGroupId,
data__productMetadata,
projectsId,
locationsId,
catalogsId
)
SELECT
'{{ id }}',
'{{ categoryHierarchies }}',
'{{ title }}',
'{{ description }}',
'{{ itemAttributes }}',
'{{ languageCode }}',
'{{ tags }}',
'{{ itemGroupId }}',
'{{ productMetadata }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ catalogsId }}'
RETURNING
id,
categoryHierarchies,
description,
itemAttributes,
itemGroupId,
languageCode,
productMetadata,
tags,
title
;

UPDATE examples

Updates a catalog item. Partial updating is supported. Non-existing items will be created.

UPDATE google.recommendationengine.catalog_items
SET
data__id = '{{ id }}',
data__categoryHierarchies = '{{ categoryHierarchies }}',
data__title = '{{ title }}',
data__description = '{{ description }}',
data__itemAttributes = '{{ itemAttributes }}',
data__languageCode = '{{ languageCode }}',
data__tags = '{{ tags }}',
data__itemGroupId = '{{ itemGroupId }}',
data__productMetadata = '{{ productMetadata }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND catalogItemsId = '{{ catalogItemsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
id,
categoryHierarchies,
description,
itemAttributes,
itemGroupId,
languageCode,
productMetadata,
tags,
title;

DELETE examples

Deletes a catalog item.

DELETE FROM google.recommendationengine.catalog_items
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND catalogItemsId = '{{ catalogItemsId }}' --required;

Lifecycle Methods

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.

EXEC google.recommendationengine.catalog_items.projects_locations_catalogs_catalog_items_import 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@catalogsId='{{ catalogsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}",
"inputConfig": "{{ inputConfig }}",
"errorsConfig": "{{ errorsConfig }}",
"updateMask": "{{ updateMask }}"
}';