Skip to main content

consent_stores

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

Overview

Nameconsent_stores
TypeResource
Idgoogle.healthcare.consent_stores

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Resource name of the consent store, of the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}. Cannot be changed after creation.
defaultConsentTtlstring (google-duration)Optional. Default time to live for Consents created in this store. Must be at least 24 hours. Updating this field will not affect the expiration time of existing consents.
enableConsentCreateOnUpdatebooleanOptional. If true, UpdateConsent creates the Consent if it does not already exist. If unspecified, defaults to false.
labelsobjectOptional. User-supplied key-value pairs used to organize consent stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}. Label values must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}. No more than 64 labels can be associated with a given store. For more information: https://cloud.google.com/healthcare/docs/how-tos/labeling-resources

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, datasetsId, consentStoresIdGets the specified consent store.
listselectprojectsId, locationsId, datasetsIdpageSize, pageToken, filterLists the consent stores in the specified dataset.
createinsertprojectsId, locationsId, datasetsIdconsentStoreIdCreates a new consent store in the parent dataset. Attempting to create a consent store with the same ID as an existing store fails with an ALREADY_EXISTS error.
patchupdateprojectsId, locationsId, datasetsId, consentStoresIdupdateMaskUpdates the specified consent store.
deletedeleteprojectsId, locationsId, datasetsId, consentStoresIdDeletes the specified consent store and removes all the consent store's data.
check_data_accessexecprojectsId, locationsId, datasetsId, consentStoresIdChecks if a particular data_id of a User data mapping in the specified consent store is consented for the specified use.
query_accessible_dataexecprojectsId, locationsId, datasetsId, consentStoresIdQueries all data_ids that are consented for a specified use in the given consent store and writes them to a specified destination. The returned Operation includes a progress counter for the number of User data mappings processed. If the request is successful, a detailed response is returned of type QueryAccessibleDataResponse, contained in the response field when the operation finishes. The metadata field type is OperationMetadata. Errors are logged to Cloud Logging (see Viewing error logs in Cloud Logging). For example, the following sample log entry shows a failed to evaluate consent policy error that occurred during a QueryAccessibleData call to consent store projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}. json jsonPayload: { @type: "type.googleapis.com/google.cloud.healthcare.logging.QueryAccessibleDataLogEntry" error: { code: 9 message: "failed to evaluate consent policy" } resourceName: "projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}" } logName: "projects/{project_id}/logs/healthcare.googleapis.com%2Fquery_accessible_data" operation: { id: "projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/operations/{operation_id}" producer: "healthcare.googleapis.com/QueryAccessibleData" } receiveTimestamp: "TIMESTAMP" resource: { labels: { consent_store_id: "{consent_store_id}" dataset_id: "{dataset_id}" location: "{location_id}" project_id: "{project_id}" } type: "healthcare_consent_store" } severity: "ERROR" timestamp: "TIMESTAMP"
evaluate_user_consentsexecprojectsId, locationsId, datasetsId, consentStoresIdEvaluates the user's Consents for all matching User data mappings. Note: User data mappings are indexed asynchronously, which can cause a slight delay between the time mappings are created or updated and when they are included in EvaluateUserConsents results.

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
consentStoresIdstring
datasetsIdstring
locationsIdstring
projectsIdstring
consentStoreIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the specified consent store.

SELECT
name,
defaultConsentTtl,
enableConsentCreateOnUpdate,
labels
FROM google.healthcare.consent_stores
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND datasetsId = '{{ datasetsId }}' -- required
AND consentStoresId = '{{ consentStoresId }}' -- required;

INSERT examples

Creates a new consent store in the parent dataset. Attempting to create a consent store with the same ID as an existing store fails with an ALREADY_EXISTS error.

INSERT INTO google.healthcare.consent_stores (
data__name,
data__defaultConsentTtl,
data__labels,
data__enableConsentCreateOnUpdate,
projectsId,
locationsId,
datasetsId,
consentStoreId
)
SELECT
'{{ name }}',
'{{ defaultConsentTtl }}',
'{{ labels }}',
{{ enableConsentCreateOnUpdate }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ datasetsId }}',
'{{ consentStoreId }}'
RETURNING
name,
defaultConsentTtl,
enableConsentCreateOnUpdate,
labels
;

UPDATE examples

Updates the specified consent store.

UPDATE google.healthcare.consent_stores
SET
data__name = '{{ name }}',
data__defaultConsentTtl = '{{ defaultConsentTtl }}',
data__labels = '{{ labels }}',
data__enableConsentCreateOnUpdate = {{ enableConsentCreateOnUpdate }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND consentStoresId = '{{ consentStoresId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
defaultConsentTtl,
enableConsentCreateOnUpdate,
labels;

DELETE examples

Deletes the specified consent store and removes all the consent store's data.

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

Lifecycle Methods

Checks if a particular data_id of a User data mapping in the specified consent store is consented for the specified use.

EXEC google.healthcare.consent_stores.check_data_access 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required,
@consentStoresId='{{ consentStoresId }}' --required
@@json=
'{
"dataId": "{{ dataId }}",
"requestAttributes": "{{ requestAttributes }}",
"consentList": "{{ consentList }}",
"responseView": "{{ responseView }}"
}';