Skip to main content

catalogs

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

Overview

Namecatalogs
TypeResource
Idgoogle.retail.catalogs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Immutable. The fully qualified resource name of the catalog.
displayNamestringRequired. Immutable. The catalog display name. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
productLevelConfigobjectRequired. The product level configuration. (id: GoogleCloudRetailV2ProductLevelConfig)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_catalogs_listselectprojectsId, locationsIdpageSize, pageTokenLists all the Catalogs associated with the project.
projects_locations_catalogs_patchupdateprojectsId, locationsId, catalogsIdupdateMaskUpdates the Catalogs.
projects_locations_catalogs_export_analytics_metricsexecprojectsId, locationsId, catalogsIdExports analytics metrics. Operation.response is of type ExportAnalyticsMetricsResponse. Operation.metadata is of type ExportMetadata.
projects_locations_catalogs_set_default_branchexecprojectsId, locationsId, catalogsIdSet a specified branch id as default branch. API methods such as SearchService.Search, ProductService.GetProduct, ProductService.ListProducts will treat requests using "default_branch" to the actual branch id set as default. For example, if projects/*/locations/*/catalogs/*/branches/1 is set as default, setting SearchRequest.branch to projects/*/locations/*/catalogs/*/branches/default_branch is equivalent to setting SearchRequest.branch to projects/*/locations/*/catalogs/*/branches/1. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using projects/*/locations/*/catalogs/*/branches/default_branch as SearchRequest.branch to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}.
projects_locations_catalogs_complete_queryexecprojectsId, locationsId, catalogsIdquery, visitorId, languageCodes, deviceType, dataset, maxSuggestions, enableAttributeSuggestions, entityCompletes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

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
catalogsIdstring
locationsIdstring
projectsIdstring
datasetstring
deviceTypestring
enableAttributeSuggestionsboolean
entitystring
languageCodesstring
maxSuggestionsinteger (int32)
pageSizeinteger (int32)
pageTokenstring
querystring
updateMaskstring (google-fieldmask)
visitorIdstring

SELECT examples

Lists all the Catalogs associated with the project.

SELECT
name,
displayName,
productLevelConfig
FROM google.retail.catalogs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';

UPDATE examples

Updates the Catalogs.

UPDATE google.retail.catalogs
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__productLevelConfig = '{{ productLevelConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
productLevelConfig;

Lifecycle Methods

Exports analytics metrics. Operation.response is of type ExportAnalyticsMetricsResponse. Operation.metadata is of type ExportMetadata.

EXEC google.retail.catalogs.projects_locations_catalogs_export_analytics_metrics 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@catalogsId='{{ catalogsId }}' --required
@@json=
'{
"outputConfig": "{{ outputConfig }}",
"filter": "{{ filter }}"
}';