Skip to main content

rule_sets

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

Overview

Namerule_sets
TypeResource
Idgoogle.contentwarehouse.rule_sets

Fields

NameDatatypeDescription
namestringThe resource name of the rule set. Managed internally. Format: projects/{project_number}/locations/{location}/ruleSet/{rule_set_id}. The name is ignored when creating a rule set.
descriptionstringShort description of the rule-set.
rulesarrayList of rules given by the customer.
sourcestringSource of the rules i.e., customer name.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, ruleSetsIdGets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
listSELECTlocationsId, projectsIdLists rulesets.
createINSERTlocationsId, projectsIdCreates a ruleset.
deleteDELETElocationsId, projectsId, ruleSetsIdDeletes a ruleset. Returns NOT_FOUND if the document does not exist.
patchUPDATElocationsId, projectsId, ruleSetsIdUpdates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset is non-empty and does not equal the existing name.

SELECT examples

Lists rulesets.

SELECT
name,
description,
rules,
source
FROM google.contentwarehouse.rule_sets
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.contentwarehouse.rule_sets (
locationsId,
projectsId,
source,
description,
name,
rules
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ source }}',
'{{ description }}',
'{{ name }}',
'{{ rules }}'
;

UPDATE example

Updates a rule_sets resource.

/*+ update */
UPDATE google.contentwarehouse.rule_sets
SET
ruleSet = '{{ ruleSet }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND ruleSetsId = '{{ ruleSetsId }}';

DELETE example

Deletes the specified rule_sets resource.

/*+ delete */
DELETE FROM google.contentwarehouse.rule_sets
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND ruleSetsId = '{{ ruleSetsId }}';