Skip to main content

controls

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

Overview

Namecontrols
TypeResource
Idgoogle.retail.controls

Fields

NameDatatypeDescription
namestringImmutable. Fully qualified name projects/*/locations/global/catalogs/*/controls/*
associatedServingConfigIdsarrayOutput only. List of serving config ids that are associated with this control in the same Catalog. Note the association is managed via the ServingConfig, this is an output only denormalized view.
displayNamestringRequired. The human readable control display name. Used in Retail UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown.
ruleobjectA rule is a condition-action pair A condition defines when a rule is to be triggered. An action specifies what occurs on that trigger. Currently rules only work for controls with SOLUTION_TYPE_SEARCH.
searchSolutionUseCasearraySpecifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow one search_solution_use_case per control.
solutionTypesarrayRequired. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time. Only SOLUTION_TYPE_SEARCH value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_catalogs_controls_getSELECTcatalogsId, controlsId, locationsId, projectsIdGets a Control.
projects_locations_catalogs_controls_listSELECTcatalogsId, locationsId, projectsIdLists all Controls by their parent Catalog.
projects_locations_catalogs_controls_createINSERTcatalogsId, locationsId, projectsIdCreates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_catalogs_controls_deleteDELETEcatalogsId, controlsId, locationsId, projectsIdDeletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.
projects_locations_catalogs_controls_patchUPDATEcatalogsId, controlsId, locationsId, projectsIdUpdates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.

SELECT examples

Lists all Controls by their parent Catalog.

SELECT
name,
associatedServingConfigIds,
displayName,
rule,
searchSolutionUseCase,
solutionTypes
FROM google.retail.controls
WHERE catalogsId = '{{ catalogsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.retail.controls (
catalogsId,
locationsId,
projectsId,
rule,
name,
displayName,
solutionTypes,
searchSolutionUseCase
)
SELECT
'{{ catalogsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ rule }}',
'{{ name }}',
'{{ displayName }}',
'{{ solutionTypes }}',
'{{ searchSolutionUseCase }}'
;

UPDATE example

Updates a controls resource.

/*+ update */
UPDATE google.retail.controls
SET
rule = '{{ rule }}',
name = '{{ name }}',
displayName = '{{ displayName }}',
solutionTypes = '{{ solutionTypes }}',
searchSolutionUseCase = '{{ searchSolutionUseCase }}'
WHERE
catalogsId = '{{ catalogsId }}'
AND controlsId = '{{ controlsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified controls resource.

/*+ delete */
DELETE FROM google.retail.controls
WHERE catalogsId = '{{ catalogsId }}'
AND controlsId = '{{ controlsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';