Skip to main content

controls

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

Overview

Namecontrols
TypeResource
Idgoogle.discoveryengine.controls

Fields

NameDatatypeDescription
namestringImmutable. Fully qualified name projects/*/locations/global/dataStore/*/controls/*
associatedServingConfigIdsarrayOutput only. List of all ServingConfig IDs this control is attached to. May take up to 10 minutes to update after changes.
boostActionobjectAdjusts order of products in returned list.
conditionsarrayDetermines when the associated action will trigger. Omit to always apply the action. Currently only a single condition may be specified. Otherwise an INVALID ARGUMENT error is thrown.
displayNamestringRequired. Human readable name. The identifier used in UI views. Must be UTF-8 encoded string. Length limit is 128 characters. Otherwise an INVALID ARGUMENT error is thrown.
filterActionobjectSpecified which products may be included in results. Uses same filter as boost.
redirectActionobjectRedirects a shopper to the provided URI.
solutionTypestringRequired. Immutable. What solution the control belongs to. Must be compatible with vertical of resource. Otherwise an INVALID ARGUMENT error is thrown.
synonymsActionobjectCreates a set of terms that will act as synonyms of one another. Example: "happy" will also be considered as "glad", "glad" will also be considered as "happy".
useCasesarraySpecifies the use case for the control. Affects what condition fields can be set. Only applies to SOLUTION_TYPE_SEARCH. Currently only allow one use case per control. Must be set when solution_type is SolutionType.SOLUTION_TYPE_SEARCH.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_collections_data_stores_controls_getSELECTcollectionsId, controlsId, dataStoresId, locationsId, projectsIdGets a Control.
projects_locations_collections_data_stores_controls_listSELECTcollectionsId, dataStoresId, locationsId, projectsIdLists all Controls by their parent DataStore.
projects_locations_collections_engines_controls_getSELECTcollectionsId, controlsId, enginesId, locationsId, projectsIdGets a Control.
projects_locations_collections_engines_controls_listSELECTcollectionsId, enginesId, locationsId, projectsIdLists all Controls by their parent DataStore.
projects_locations_data_stores_controls_getSELECTcontrolsId, dataStoresId, locationsId, projectsIdGets a Control.
projects_locations_data_stores_controls_listSELECTdataStoresId, locationsId, projectsIdLists all Controls by their parent DataStore.
projects_locations_collections_data_stores_controls_createINSERTcollectionsId, dataStoresId, locationsId, projectsIdCreates a Control. By default 1000 controls are allowed for a data store. A request can be submitted to adjust this limit. If the Control to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_collections_engines_controls_createINSERTcollectionsId, enginesId, locationsId, projectsIdCreates a Control. By default 1000 controls are allowed for a data store. A request can be submitted to adjust this limit. If the Control to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_data_stores_controls_createINSERTdataStoresId, locationsId, projectsIdCreates a Control. By default 1000 controls are allowed for a data store. A request can be submitted to adjust this limit. If the Control to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_collections_data_stores_controls_deleteDELETEcollectionsId, controlsId, dataStoresId, locationsId, projectsIdDeletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.
projects_locations_collections_engines_controls_deleteDELETEcollectionsId, controlsId, enginesId, locationsId, projectsIdDeletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.
projects_locations_data_stores_controls_deleteDELETEcontrolsId, dataStoresId, locationsId, projectsIdDeletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.
projects_locations_collections_data_stores_controls_patchUPDATEcollectionsId, controlsId, dataStoresId, locationsId, projectsIdUpdates a Control. Control action type cannot be changed. If the Control to update does not exist, a NOT_FOUND error is returned.
projects_locations_collections_engines_controls_patchUPDATEcollectionsId, controlsId, enginesId, locationsId, projectsIdUpdates a Control. Control action type cannot be changed. If the Control to update does not exist, a NOT_FOUND error is returned.
projects_locations_data_stores_controls_patchUPDATEcontrolsId, dataStoresId, locationsId, projectsIdUpdates a Control. Control action type cannot be changed. If the Control to update does not exist, a NOT_FOUND error is returned.

SELECT examples

Lists all Controls by their parent DataStore.

SELECT
name,
associatedServingConfigIds,
boostAction,
conditions,
displayName,
filterAction,
redirectAction,
solutionType,
synonymsAction,
useCases
FROM google.discoveryengine.controls
WHERE dataStoresId = '{{ dataStoresId }}'
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.discoveryengine.controls (
dataStoresId,
locationsId,
projectsId,
boostAction,
filterAction,
redirectAction,
synonymsAction,
name,
displayName,
solutionType,
useCases,
conditions
)
SELECT
'{{ dataStoresId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ boostAction }}',
'{{ filterAction }}',
'{{ redirectAction }}',
'{{ synonymsAction }}',
'{{ name }}',
'{{ displayName }}',
'{{ solutionType }}',
'{{ useCases }}',
'{{ conditions }}'
;

UPDATE example

Updates a controls resource.

/*+ update */
UPDATE google.discoveryengine.controls
SET
boostAction = '{{ boostAction }}',
filterAction = '{{ filterAction }}',
redirectAction = '{{ redirectAction }}',
synonymsAction = '{{ synonymsAction }}',
name = '{{ name }}',
displayName = '{{ displayName }}',
solutionType = '{{ solutionType }}',
useCases = '{{ useCases }}',
conditions = '{{ conditions }}'
WHERE
controlsId = '{{ controlsId }}'
AND dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified controls resource.

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