consents
Creates, updates, deletes, gets or lists a consents
resource.
Overview
Name | consents |
Type | Resource |
Id | google.healthcare.consents |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
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 (google-datetime) | 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 (google-datetime) | 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 (google-duration) | Input only. The time to live for this Consent from when it is created. |
userId | string | Required. User's UUID provided by the client. |
Successful response
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 (google-datetime) | 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 (google-datetime) | 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 (google-duration) | 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
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , datasetsId , consentStoresId , consentsId | Gets the specified revision of a Consent, or the latest revision if revision_id is not specified in the resource name. | |
list | select | projectsId , locationsId , datasetsId , consentStoresId | pageSize , pageToken , filter | Lists the Consent in the given consent store, returning each Consent's latest revision. |
create | insert | projectsId , locationsId , datasetsId , consentStoresId | Creates a new Consent in the parent consent store. | |
patch | update | projectsId , locationsId , datasetsId , consentStoresId , consentsId | updateMask | 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. |
delete | delete | projectsId , locationsId , datasetsId , consentStoresId , consentsId | 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. | |
activate | exec | projectsId , locationsId , datasetsId , consentStoresId , consentsId | 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 | projectsId , locationsId , datasetsId , consentStoresId , consentsId | 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 | projectsId , locationsId , datasetsId , consentStoresId , consentsId | 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. |
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 |
---|---|---|
consentStoresId | string | |
consentsId | string | |
datasetsId | string | |
locationsId | string | |
projectsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets the specified revision of a Consent, or the latest revision if revision_id
is not specified in the resource name.
SELECT
name,
consentArtifact,
expireTime,
metadata,
policies,
revisionCreateTime,
revisionId,
state,
ttl,
userId
FROM google.healthcare.consents
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND datasetsId = '{{ datasetsId }}' -- required
AND consentStoresId = '{{ consentStoresId }}' -- required
AND consentsId = '{{ consentsId }}' -- required;
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 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 Consent in the parent consent store.
INSERT INTO google.healthcare.consents (
data__name,
data__userId,
data__policies,
data__consentArtifact,
data__state,
data__expireTime,
data__ttl,
data__metadata,
projectsId,
locationsId,
datasetsId,
consentStoresId
)
SELECT
'{{ name }}',
'{{ userId }}',
'{{ policies }}',
'{{ consentArtifact }}',
'{{ state }}',
'{{ expireTime }}',
'{{ ttl }}',
'{{ metadata }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ datasetsId }}',
'{{ consentStoresId }}'
RETURNING
name,
consentArtifact,
expireTime,
metadata,
policies,
revisionCreateTime,
revisionId,
state,
ttl,
userId
;
# Description fields are for documentation purposes
- name: consents
props:
- name: projectsId
value: string
description: Required parameter for the consents resource.
- name: locationsId
value: string
description: Required parameter for the consents resource.
- name: datasetsId
value: string
description: Required parameter for the consents resource.
- name: consentStoresId
value: string
description: Required parameter for the consents resource.
- name: name
value: string
description: >
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.
- name: userId
value: string
description: >
Required. User's UUID provided by the client.
- name: policies
value: array
description: >
Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions.
- name: consentArtifact
value: string
description: >
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}`.
- name: state
value: string
description: >
Required. Indicates the current state of this Consent.
valid_values: ['STATE_UNSPECIFIED', 'ACTIVE', 'ARCHIVED', 'REVOKED', 'DRAFT', 'REJECTED']
- name: expireTime
value: string
description: >
Timestamp in UTC of when this Consent is considered expired.
- name: ttl
value: string
description: >
Input only. The time to live for this Consent from when it is created.
- name: metadata
value: object
description: >
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.
UPDATE
examples
- patch
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.
UPDATE google.healthcare.consents
SET
data__name = '{{ name }}',
data__userId = '{{ userId }}',
data__policies = '{{ policies }}',
data__consentArtifact = '{{ consentArtifact }}',
data__state = '{{ state }}',
data__expireTime = '{{ expireTime }}',
data__ttl = '{{ ttl }}',
data__metadata = '{{ metadata }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND consentStoresId = '{{ consentStoresId }}' --required
AND consentsId = '{{ consentsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
consentArtifact,
expireTime,
metadata,
policies,
revisionCreateTime,
revisionId,
state,
ttl,
userId;
DELETE
examples
- delete
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.
DELETE FROM google.healthcare.consents
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required
AND consentStoresId = '{{ consentStoresId }}' --required
AND consentsId = '{{ consentsId }}' --required;
Lifecycle Methods
- activate
- reject
- revoke
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.
EXEC google.healthcare.consents.activate
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required,
@consentStoresId='{{ consentStoresId }}' --required,
@consentsId='{{ consentsId }}' --required
@@json=
'{
"consentArtifact": "{{ consentArtifact }}",
"expireTime": "{{ expireTime }}",
"ttl": "{{ ttl }}"
}';
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.
EXEC google.healthcare.consents.reject
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required,
@consentStoresId='{{ consentStoresId }}' --required,
@consentsId='{{ consentsId }}' --required
@@json=
'{
"consentArtifact": "{{ consentArtifact }}"
}';
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.
EXEC google.healthcare.consents.revoke
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required,
@consentStoresId='{{ consentStoresId }}' --required,
@consentsId='{{ consentsId }}' --required
@@json=
'{
"consentArtifact": "{{ consentArtifact }}"
}';