controls
Creates, updates, deletes, gets or lists a controls
resource.
Overview
Name | controls |
Type | Resource |
Id | google.retail.controls |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Immutable. Fully qualified name projects/*/locations/global/catalogs/*/controls/* |
associatedServingConfigIds | array | Output 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. |
displayName | string | Required. 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. |
rule | object | A 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. |
searchSolutionUseCase | array | Specifies 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. |
solutionTypes | array | Required. 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_locations_catalogs_controls_get | SELECT | catalogsId, controlsId, locationsId, projectsId | Gets a Control. |
projects_locations_catalogs_controls_list | SELECT | catalogsId, locationsId, projectsId | Lists all Controls by their parent Catalog. |
projects_locations_catalogs_controls_create | INSERT | catalogsId, locationsId, projectsId | Creates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned. |
projects_locations_catalogs_controls_delete | DELETE | catalogsId, controlsId, locationsId, projectsId | Deletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned. |
projects_locations_catalogs_controls_patch | UPDATE | catalogsId, controlsId, locationsId, projectsId | Updates 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.retail.controls (
catalogsId,
locationsId,
projectsId,
rule,
name,
displayName,
solutionTypes,
searchSolutionUseCase
)
SELECT
'{{ catalogsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ rule }}',
'{{ name }}',
'{{ displayName }}',
'{{ solutionTypes }}',
'{{ searchSolutionUseCase }}'
;
- name: your_resource_model_name
props:
- name: rule
value:
- name: boostAction
value:
- name: boost
value: number
- name: productsFilter
value: string
- name: redirectAction
value:
- name: redirectUri
value: string
- name: onewaySynonymsAction
value:
- name: queryTerms
value:
- string
- name: synonyms
value:
- string
- name: onewayTerms
value:
- string
- name: doNotAssociateAction
value:
- name: queryTerms
value:
- string
- name: doNotAssociateTerms
value:
- string
- name: terms
value:
- string
- name: replacementAction
value:
- name: queryTerms
value:
- string
- name: replacementTerm
value: string
- name: term
value: string
- name: ignoreAction
value:
- name: ignoreTerms
value:
- string
- name: filterAction
value:
- name: filter
value: string
- name: twowaySynonymsAction
value:
- name: synonyms
value:
- string
- name: forceReturnFacetAction
value:
- name: facetPositionAdjustments
value:
- - name: attributeName
value: string
- name: position
value: integer
- name: removeFacetAction
value:
- name: attributeNames
value:
- string
- name: condition
value:
- name: queryTerms
value:
- - name: value
value: string
- name: fullMatch
value: boolean
- name: activeTimeRange
value:
- - name: startTime
value: string
- name: endTime
value: string
- name: pageCategories
value:
- string
- name: name
value: string
- name: displayName
value: string
- name: associatedServingConfigIds
value:
- string
- name: solutionTypes
value:
- string
- name: searchSolutionUseCase
value:
- string
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 }}';