catalog_items
Creates, updates, deletes, gets or lists a catalog_items
resource.
Overview
Name | catalog_items |
Type | Resource |
Id | google.recommendationengine.catalog_items |
Fields
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. |
description | string | Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB. |
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"] } ] |
itemAttributes | object | FeatureMap represents extra features that customers want to include in the recommendation model for catalogs/user events as categorical/numerical features. |
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 | ProductCatalogItem captures item metadata specific to retail products. |
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
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_locations_catalogs_catalog_items_get | SELECT | catalogItemsId, catalogsId, locationsId, projectsId | Gets a specific catalog item. |
projects_locations_catalogs_catalog_items_list | SELECT | catalogsId, locationsId, projectsId | Gets a list of catalog items. |
projects_locations_catalogs_catalog_items_create | INSERT | catalogsId, locationsId, projectsId | Creates a catalog item. |
projects_locations_catalogs_catalog_items_delete | DELETE | catalogItemsId, catalogsId, locationsId, projectsId | Deletes a catalog item. |
projects_locations_catalogs_catalog_items_patch | UPDATE | catalogItemsId, catalogsId, locationsId, projectsId | Updates a catalog item. Partial updating is supported. Non-existing items will be created. |
projects_locations_catalogs_catalog_items_import | EXEC | catalogsId, locationsId, projectsId | 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. |
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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: categoryHierarchies
value:
- - name: categories
value:
- string
- name: title
value: string
- name: description
value: string
- name: itemAttributes
value:
- name: categoricalFeatures
value: object
- name: numericalFeatures
value: object
- name: languageCode
value: string
- name: tags
value:
- string
- name: itemGroupId
value: string
- name: productMetadata
value:
- name: exactPrice
value:
- name: displayPrice
value: number
- name: originalPrice
value: number
- name: priceRange
value:
- name: min
value: number
- name: max
value: number
- name: costs
value: object
- name: currencyCode
value: string
- name: stockState
value: string
- name: availableQuantity
value: string
- name: canonicalProductUri
value: string
- name: images
value:
- - name: uri
value: string
- name: height
value: integer
- name: width
value: integer
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 }}';