consents
Creates, updates, deletes, gets or lists a consents
resource.
Overview
Name | consents |
Type | Resource |
Id | google.healthcare.consents |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Resource name of the Consent, of the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id} . Cannot be changed after creation. |
consentArtifact | string | Required. The resource name of the Consent artifact that contains proof of the end user's consent, of the form projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consentArtifacts/{consent_artifact_id} . |
expireTime | string | Timestamp in UTC of when this Consent is considered expired. |
metadata | object | Optional. User-supplied key-value pairs used to organize Consent resources. Metadata keys must: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - begin with a letter - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes Metadata values must be: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes No more than 64 metadata entries can be associated with a given consent. |
policies | array | Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions. |
revisionCreateTime | string | Output only. The timestamp that the revision was created. |
revisionId | string | Output only. The revision ID of the Consent. The format is an 8-character hexadecimal string. Refer to a specific revision of a Consent by appending @{revision_id} to the Consent's resource name. |
state | string | Required. Indicates the current state of this Consent. |
ttl | string | Input only. The time to live for this Consent from when it is created. |
userId | string | Required. User's UUID provided by the client. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | consentStoresId, consentsId, datasetsId, locationsId, projectsId | Gets the specified revision of a Consent, or the latest revision if revision_id is not specified in the resource name. |
list | SELECT | consentStoresId, datasetsId, locationsId, projectsId | Lists the Consent in the given consent store, returning each Consent's latest revision. |
create | INSERT | consentStoresId, datasetsId, locationsId, projectsId | Creates a new Consent in the parent consent store. |
delete | DELETE | consentStoresId, consentsId, datasetsId, locationsId, projectsId | Deletes the Consent and its revisions. To keep a record of the Consent but mark it inactive, see [RevokeConsent]. To delete a revision of a Consent, see [DeleteConsentRevision]. This operation does not delete the related Consent artifact. |
patch | UPDATE | consentStoresId, consentsId, datasetsId, locationsId, projectsId | Updates the latest revision of the specified Consent by committing a new revision with the changes. A FAILED_PRECONDITION error occurs if the latest revision of the specified Consent is in the REJECTED or REVOKED state. |
activate | EXEC | consentStoresId, consentsId, datasetsId, locationsId, projectsId | Activates the latest revision of the specified Consent by committing a new revision with state updated to ACTIVE . If the latest revision of the specified Consent is in the ACTIVE state, no new revision is committed. A FAILED_PRECONDITION error occurs if the latest revision of the specified Consent is in the REJECTED or REVOKED state. |
reject | EXEC | consentStoresId, consentsId, datasetsId, locationsId, projectsId | Rejects the latest revision of the specified Consent by committing a new revision with state updated to REJECTED . If the latest revision of the specified Consent is in the REJECTED state, no new revision is committed. A FAILED_PRECONDITION error occurs if the latest revision of the specified Consent is in the ACTIVE or REVOKED state. |
revoke | EXEC | consentStoresId, consentsId, datasetsId, locationsId, projectsId | Revokes the latest revision of the specified Consent by committing a new revision with state updated to REVOKED . If the latest revision of the specified Consent is in the REVOKED state, no new revision is committed. A FAILED_PRECONDITION error occurs if the latest revision of the given consent is in DRAFT or REJECTED state. |
SELECT
examples
Lists the Consent in the given consent store, returning each Consent's latest revision.
SELECT
name,
consentArtifact,
expireTime,
metadata,
policies,
revisionCreateTime,
revisionId,
state,
ttl,
userId
FROM google.healthcare.consents
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 consents
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.healthcare.consents (
consentStoresId,
datasetsId,
locationsId,
projectsId,
name,
userId,
policies,
consentArtifact,
state,
expireTime,
ttl,
metadata
)
SELECT
'{{ consentStoresId }}',
'{{ datasetsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ userId }}',
'{{ policies }}',
'{{ consentArtifact }}',
'{{ state }}',
'{{ expireTime }}',
'{{ ttl }}',
'{{ metadata }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: revisionId
value: string
- name: revisionCreateTime
value: string
- name: userId
value: string
- name: policies
value:
- - name: resourceAttributes
value:
- - name: attributeDefinitionId
value: string
- name: values
value:
- string
- name: authorizationRule
value:
- name: expression
value: string
- name: title
value: string
- name: description
value: string
- name: location
value: string
- name: consentArtifact
value: string
- name: state
value: string
- name: expireTime
value: string
- name: ttl
value: string
- name: metadata
value: object
UPDATE
example
Updates a consents
resource.
/*+ update */
UPDATE google.healthcare.consents
SET
name = '{{ name }}',
userId = '{{ userId }}',
policies = '{{ policies }}',
consentArtifact = '{{ consentArtifact }}',
state = '{{ state }}',
expireTime = '{{ expireTime }}',
ttl = '{{ ttl }}',
metadata = '{{ metadata }}'
WHERE
consentStoresId = '{{ consentStoresId }}'
AND consentsId = '{{ consentsId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified consents
resource.
/*+ delete */
DELETE FROM google.healthcare.consents
WHERE consentStoresId = '{{ consentStoresId }}'
AND consentsId = '{{ consentsId }}'
AND datasetsId = '{{ datasetsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';