attribute_definitions
Creates, updates, deletes, gets or lists a attribute_definitions
resource.
Overview
Name | attribute_definitions |
Type | Resource |
Id | google.healthcare.attribute_definitions |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of the Attribute definition, of the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id} . Cannot be changed after creation. |
description | string | Optional. A description of the attribute. |
allowedValues | array | Required. Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation. |
category | string | Required. The category of the attribute. The value of this field cannot be changed after creation. |
consentDefaultValues | array | Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value. |
dataMappingDefaultValue | string | Optional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category RESOURCE . |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | attributeDefinitionsId, consentStoresId, datasetsId, locationsId, projectsId | Gets the specified Attribute definition. |
list | SELECT | consentStoresId, datasetsId, locationsId, projectsId | Lists the Attribute definitions in the specified consent store. |
create | INSERT | consentStoresId, datasetsId, locationsId, projectsId | Creates a new Attribute definition in the parent consent store. |
delete | DELETE | attributeDefinitionsId, consentStoresId, datasetsId, locationsId, projectsId | Deletes the specified Attribute definition. Fails if the Attribute definition is referenced by any User data mapping, or the latest revision of any Consent. |
patch | UPDATE | attributeDefinitionsId, consentStoresId, datasetsId, locationsId, projectsId | Updates the specified Attribute definition. |
SELECT
examples
Lists the Attribute definitions in the specified consent store.
SELECT
name,
description,
allowedValues,
category,
consentDefaultValues,
dataMappingDefaultValue
FROM google.healthcare.attribute_definitions
WHERE consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new attribute_definitions
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.healthcare.attribute_definitions (
consentStoresId,
datasetsId,
locationsId,
projectsId,
name,
description,
category,
allowedValues,
consentDefaultValues,
dataMappingDefaultValue
)
SELECT
'{{ consentStoresId }}',
'{{ datasetsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ category }}',
'{{ allowedValues }}',
'{{ consentDefaultValues }}',
'{{ dataMappingDefaultValue }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: description
value: string
- name: category
value: string
- name: allowedValues
value:
- string
- name: consentDefaultValues
value:
- string
- name: dataMappingDefaultValue
value: string
UPDATE
example
Updates a attribute_definitions
resource.
/*+ update */
UPDATE google.healthcare.attribute_definitions
SET
name = '{{ name }}',
description = '{{ description }}',
category = '{{ category }}',
allowedValues = '{{ allowedValues }}',
consentDefaultValues = '{{ consentDefaultValues }}',
dataMappingDefaultValue = '{{ dataMappingDefaultValue }}'
WHERE
attributeDefinitionsId = '{{ attributeDefinitionsId }}'
AND consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified attribute_definitions
resource.
/*+ delete */
DELETE FROM google.healthcare.attribute_definitions
WHERE attributeDefinitionsId = '{{ attributeDefinitionsId }}'
AND consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';