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

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.
defaultConsentTtlstringOptional. 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

NameAccessible byRequired ParamsDescription
getSELECTconsentStoresId, datasetsId, locationsId, projectsIdGets the specified consent store.
listSELECTdatasetsId, locationsId, projectsIdLists the consent stores in the specified dataset.
createINSERTdatasetsId, locationsId, projectsIdCreates 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.
deleteDELETEconsentStoresId, datasetsId, locationsId, projectsIdDeletes the specified consent store and removes all the consent store's data.
patchUPDATEconsentStoresId, datasetsId, locationsId, projectsIdUpdates the specified consent store.
check_data_accessEXECconsentStoresId, datasetsId, locationsId, projectsIdChecks if a particular data_id of a User data mapping in the specified consent store is consented for the specified use.
evaluate_user_consentsEXECconsentStoresId, datasetsId, locationsId, projectsIdEvaluates 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.
query_accessible_dataEXECconsentStoresId, datasetsId, locationsId, projectsIdQueries 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"

SELECT examples

Lists the consent stores in the specified dataset.

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

INSERT example

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

/*+ create */
INSERT INTO google.healthcare.consent_stores (
datasetsId,
locationsId,
projectsId,
name,
defaultConsentTtl,
labels,
enableConsentCreateOnUpdate
)
SELECT
'{{ datasetsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ defaultConsentTtl }}',
'{{ labels }}',
{{ enableConsentCreateOnUpdate }}
;

UPDATE example

Updates a consent_stores resource.

/*+ update */
UPDATE google.healthcare.consent_stores
SET
name = '{{ name }}',
defaultConsentTtl = '{{ defaultConsentTtl }}',
labels = '{{ labels }}',
enableConsentCreateOnUpdate = true|false
WHERE
consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified consent_stores resource.

/*+ delete */
DELETE FROM google.healthcare.consent_stores
WHERE consentStoresId = '{{ consentStoresId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';