Skip to main content

attribute_definitions

Creates, updates, deletes, gets or lists an attribute_definitions resource.

Overview

Nameattribute_definitions
TypeResource
Idgoogle.healthcare.attribute_definitions

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. 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.
allowedValuesarrayRequired. 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.
categorystringRequired. The category of the attribute. The value of this field cannot be changed after creation.
consentDefaultValuesarrayOptional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
dataMappingDefaultValuestringOptional. 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.
descriptionstringOptional. A description of the attribute.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, datasetsId, consentStoresId, attributeDefinitionsIdGets the specified Attribute definition.
listselectprojectsId, locationsId, datasetsId, consentStoresIdpageSize, pageToken, filterLists the Attribute definitions in the specified consent store.
createinsertprojectsId, locationsId, datasetsId, consentStoresIdattributeDefinitionIdCreates a new Attribute definition in the parent consent store.
patchupdateprojectsId, locationsId, datasetsId, consentStoresId, attributeDefinitionsIdupdateMaskUpdates the specified Attribute definition.
deletedeleteprojectsId, locationsId, datasetsId, consentStoresId, attributeDefinitionsIdDeletes the specified Attribute definition. Fails if the Attribute definition is referenced by any User data mapping, or the latest revision of any Consent.

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.

NameDatatypeDescription
attributeDefinitionsIdstring
consentStoresIdstring
datasetsIdstring
locationsIdstring
projectsIdstring
attributeDefinitionIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the specified Attribute definition.

SELECT
name,
allowedValues,
category,
consentDefaultValues,
dataMappingDefaultValue,
description
FROM google.healthcare.attribute_definitions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND datasetsId = '{{ datasetsId }}' -- required
AND consentStoresId = '{{ consentStoresId }}' -- required
AND attributeDefinitionsId = '{{ attributeDefinitionsId }}' -- required;

INSERT examples

Creates a new Attribute definition in the parent consent store.

INSERT INTO google.healthcare.attribute_definitions (
data__name,
data__description,
data__category,
data__allowedValues,
data__consentDefaultValues,
data__dataMappingDefaultValue,
projectsId,
locationsId,
datasetsId,
consentStoresId,
attributeDefinitionId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ category }}',
'{{ allowedValues }}',
'{{ consentDefaultValues }}',
'{{ dataMappingDefaultValue }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ datasetsId }}',
'{{ consentStoresId }}',
'{{ attributeDefinitionId }}'
RETURNING
name,
allowedValues,
category,
consentDefaultValues,
dataMappingDefaultValue,
description
;

UPDATE examples

Updates the specified Attribute definition.

UPDATE google.healthcare.attribute_definitions
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__category = '{{ category }}',
data__allowedValues = '{{ allowedValues }}',
data__consentDefaultValues = '{{ consentDefaultValues }}',
data__dataMappingDefaultValue = '{{ dataMappingDefaultValue }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND consentStoresId = '{{ consentStoresId }}' --required
AND attributeDefinitionsId = '{{ attributeDefinitionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
allowedValues,
category,
consentDefaultValues,
dataMappingDefaultValue,
description;

DELETE examples

Deletes the specified Attribute definition. Fails if the Attribute definition is referenced by any User data mapping, or the latest revision of any Consent.

DELETE FROM google.healthcare.attribute_definitions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND consentStoresId = '{{ consentStoresId }}' --required
AND attributeDefinitionsId = '{{ attributeDefinitionsId }}' --required;