attribute_definitions
Creates, updates, deletes, gets or lists an attribute_definitions
resource.
Overview
Name | attribute_definitions |
Type | Resource |
Id | google.healthcare.attribute_definitions |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
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. |
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 . |
description | string | Optional. A description of the attribute. |
Successful response
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. |
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 . |
description | string | Optional. A description of the attribute. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , datasetsId , consentStoresId , attributeDefinitionsId | Gets the specified Attribute definition. | |
list | select | projectsId , locationsId , datasetsId , consentStoresId | pageSize , pageToken , filter | Lists the Attribute definitions in the specified consent store. |
create | insert | projectsId , locationsId , datasetsId , consentStoresId | attributeDefinitionId | Creates a new Attribute definition in the parent consent store. |
patch | update | projectsId , locationsId , datasetsId , consentStoresId , attributeDefinitionsId | updateMask | Updates the specified Attribute definition. |
delete | delete | projectsId , locationsId , datasetsId , consentStoresId , attributeDefinitionsId | Deletes 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.
Name | Datatype | Description |
---|---|---|
attributeDefinitionsId | string | |
consentStoresId | string | |
datasetsId | string | |
locationsId | string | |
projectsId | string | |
attributeDefinitionId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists the Attribute definitions in the specified consent store.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: attribute_definitions
props:
- name: projectsId
value: string
description: Required parameter for the attribute_definitions resource.
- name: locationsId
value: string
description: Required parameter for the attribute_definitions resource.
- name: datasetsId
value: string
description: Required parameter for the attribute_definitions resource.
- name: consentStoresId
value: string
description: Required parameter for the attribute_definitions resource.
- name: name
value: string
description: >
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.
- name: description
value: string
description: >
Optional. A description of the attribute.
- name: category
value: string
description: >
Required. The category of the attribute. The value of this field cannot be changed after creation.
valid_values: ['CATEGORY_UNSPECIFIED', 'RESOURCE', 'REQUEST']
- name: allowedValues
value: array
description: >
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.
- name: consentDefaultValues
value: array
description: >
Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
- name: dataMappingDefaultValue
value: string
description: >
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`.
- name: attributeDefinitionId
value: string
UPDATE
examples
- patch
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
- delete
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;