catalog_items
Creates, updates, deletes, gets or lists a catalog_items
resource.
Overview
Name | catalog_items |
Type | Resource |
Id | google.recommendationengine.catalog_items |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_catalogs_catalog_items_get
- projects_locations_catalogs_catalog_items_list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | 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. |
categoryHierarchies | array | 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 ["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"] } ] |
description | string | Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB. |
itemAttributes | object | 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. (id: GoogleCloudRecommendationengineV1beta1FeatureMap) |
itemGroupId | string | 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. |
languageCode | string | 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. |
productMetadata | object | Optional. Metadata specific to retail products. (id: GoogleCloudRecommendationengineV1beta1ProductCatalogItem) |
tags | array | 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. |
title | string | Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | 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. |
categoryHierarchies | array | 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 ["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"] } ] |
description | string | Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB. |
itemAttributes | object | 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. (id: GoogleCloudRecommendationengineV1beta1FeatureMap) |
itemGroupId | string | 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. |
languageCode | string | 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. |
productMetadata | object | Optional. Metadata specific to retail products. (id: GoogleCloudRecommendationengineV1beta1ProductCatalogItem) |
tags | array | 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. |
title | string | Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_catalogs_catalog_items_get | select | projectsId , locationsId , catalogsId , catalogItemsId | Gets a specific catalog item. | |
projects_locations_catalogs_catalog_items_list | select | projectsId , locationsId , catalogsId | pageSize , pageToken , filter | Gets a list of catalog items. |
projects_locations_catalogs_catalog_items_create | insert | projectsId , locationsId , catalogsId | Creates a catalog item. | |
projects_locations_catalogs_catalog_items_patch | update | projectsId , locationsId , catalogsId , catalogItemsId | updateMask | Updates a catalog item. Partial updating is supported. Non-existing items will be created. |
projects_locations_catalogs_catalog_items_delete | delete | projectsId , locationsId , catalogsId , catalogItemsId | Deletes a catalog item. | |
projects_locations_catalogs_catalog_items_import | exec | projectsId , locationsId , catalogsId | 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. |
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.
Name | Datatype | Description |
---|---|---|
catalogItemsId | string | |
catalogsId | string | |
locationsId | string | |
projectsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_catalogs_catalog_items_get
- projects_locations_catalogs_catalog_items_list
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;
Gets a list of catalog items.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- projects_locations_catalogs_catalog_items_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: catalog_items
props:
- name: projectsId
value: string
description: Required parameter for the catalog_items resource.
- name: locationsId
value: string
description: Required parameter for the catalog_items resource.
- name: catalogsId
value: string
description: Required parameter for the catalog_items resource.
- name: id
value: string
description: >
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.
- name: categoryHierarchies
value: array
description: >
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 ["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"] } ]
- name: title
value: string
description: >
Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.
- name: description
value: string
description: >
Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.
- name: itemAttributes
value: object
description: >
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.
- name: languageCode
value: string
description: >
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.
- name: tags
value: array
description: >
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.
- name: itemGroupId
value: string
description: >
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](https://cloud.google.com/recommendations-ai/docs/catalog#item-group-id).
- name: productMetadata
value: object
description: >
Optional. Metadata specific to retail products.
UPDATE
examples
- projects_locations_catalogs_catalog_items_patch
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
- projects_locations_catalogs_catalog_items_delete
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
- projects_locations_catalogs_catalog_items_import
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 }}"
}';