controls
Creates, updates, deletes, gets or lists a controls
resource.
Overview
Name | controls |
Type | Resource |
Id | google.retail.controls |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_catalogs_controls_get
- projects_locations_catalogs_controls_list
Successful response
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 control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes". (id: GoogleCloudRetailV2Rule) |
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. |
Successful response
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 control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes". (id: GoogleCloudRetailV2Rule) |
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
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_catalogs_controls_get | select | projectsId , locationsId , catalogsId , controlsId | Gets a Control. | |
projects_locations_catalogs_controls_list | select | projectsId , locationsId , catalogsId | pageSize , pageToken , filter | Lists all Controls by their parent Catalog. |
projects_locations_catalogs_controls_create | insert | projectsId , locationsId , catalogsId | controlId | Creates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned. |
projects_locations_catalogs_controls_patch | update | projectsId , locationsId , catalogsId , controlsId | updateMask | 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. |
projects_locations_catalogs_controls_delete | delete | projectsId , locationsId , catalogsId , controlsId | Deletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned. |
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.
Name | Datatype | Description |
---|---|---|
catalogsId | string | |
controlsId | string | |
locationsId | string | |
projectsId | string | |
controlId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_catalogs_controls_get
- projects_locations_catalogs_controls_list
Gets a Control.
SELECT
name,
associatedServingConfigIds,
displayName,
rule,
searchSolutionUseCase,
solutionTypes
FROM google.retail.controls
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND catalogsId = '{{ catalogsId }}' -- required
AND controlsId = '{{ controlsId }}' -- required;
Lists all Controls by their parent Catalog.
SELECT
name,
associatedServingConfigIds,
displayName,
rule,
searchSolutionUseCase,
solutionTypes
FROM google.retail.controls
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND catalogsId = '{{ catalogsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- projects_locations_catalogs_controls_create
- Manifest
Creates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned.
INSERT INTO google.retail.controls (
data__name,
data__displayName,
data__rule,
data__solutionTypes,
data__searchSolutionUseCase,
projectsId,
locationsId,
catalogsId,
controlId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ rule }}',
'{{ solutionTypes }}',
'{{ searchSolutionUseCase }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ catalogsId }}',
'{{ controlId }}'
RETURNING
name,
associatedServingConfigIds,
displayName,
rule,
searchSolutionUseCase,
solutionTypes
;
# Description fields are for documentation purposes
- name: controls
props:
- name: projectsId
value: string
description: Required parameter for the controls resource.
- name: locationsId
value: string
description: Required parameter for the controls resource.
- name: catalogsId
value: string
description: Required parameter for the controls resource.
- name: name
value: string
description: >
Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`
- name: displayName
value: string
description: >
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.
- name: rule
value: object
description: >
A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes".
- name: solutionTypes
value: array
description: >
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.
- name: searchSolutionUseCase
value: array
description: >
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.
- name: controlId
value: string
UPDATE
examples
- projects_locations_catalogs_controls_patch
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.
UPDATE google.retail.controls
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__rule = '{{ rule }}',
data__solutionTypes = '{{ solutionTypes }}',
data__searchSolutionUseCase = '{{ searchSolutionUseCase }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND controlsId = '{{ controlsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
associatedServingConfigIds,
displayName,
rule,
searchSolutionUseCase,
solutionTypes;
DELETE
examples
- projects_locations_catalogs_controls_delete
Deletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.
DELETE FROM google.retail.controls
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND controlsId = '{{ controlsId }}' --required;