feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The consent stores command group for the Cloud Healthcare API CLI."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class ConsentStores(base.Group):
"""Manage Cloud Healthcare API consent stores."""

View File

@@ -0,0 +1,37 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Add an IAM policy binding to a Cloud Healthcare API consent store.
description: |
Add an IAM policy binding to a Cloud Healthcare API consent store.
examples: |
To add an IAM policy binding for the role of 'roles/editor' for the user 'test-user@gmail.com'
on the consent store 'test-consent-store', run:
$ {command} test-consent-store --dataset=test-dataset --member='user:test-user@gmail.com' --role='roles/editor'
To add an IAM policy binding for the role of 'roles/healthcare.consentEditor' for the user
'test-user@gmail.com' on the consent store 'test-consent-store', and have it expire at the end
of the year 2020, run:
$ {command} test-consent-store --dataset=test-dataset --member='user:test-user@gmail.com' --role='roles/healthcare.consentEditor' --condition='expression=request.time < timestamp("2021-01-01T00:00:00Z"),title=expires_end_of_2020,description=Expires at midnight on 2020-12-31'
See https://cloud.google.com/iam/docs/managing-policies for details of
policy role and member types.
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to add an IAM policy binding to.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
iam:
enable_condition: true

View File

@@ -0,0 +1,39 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Check the consent for a particular data ID.
description: Check if a particular data ID of a user data mapping in the given Cloud Healthcare API consent store is consented for a given use.
examples: |
To check if the data ID 'test-data-id' in the consent-store 'test-consent-store' can be used
given request attributes {"organization":"admins", "use_case":"research"}, run:
$ {command} test-consent-store --data-id=test-data-id --request-attributes=organization=admins,use_case=research --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
method: checkDataAccess
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store where the requested data-id is stored.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
params:
- arg_name: data-id
api_field: checkDataAccessRequest.dataId
required: true
help_text: |
The unique identifier of the data to check access for.
- arg_name: request-attributes
metavar: KEY=VALUE
api_field: checkDataAccessRequest.requestAttributes
type: 'googlecloudsdk.calliope.arg_parsers:ArgDict:'
help_text: |
Comma-separated list of request attributes associated with this access request. Each
attribute has the form "KEY=VALUE".

View File

@@ -0,0 +1,27 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Create a Cloud Healthcare API consent store.
description: |
Create a Cloud Healthcare API consent store.
examples: |
To create an consent store called 'test-consent-store' with labels
{"key1":"value1", "key2":"value2"}, run:
$ {command} test-consent-store --labels=key1=value1,key2=value2 --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to create.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
labels:
api_field: consentStore.labels

View File

@@ -0,0 +1,23 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Delete a Cloud Healthcare API consent store.
description: Delete a Cloud Healthcare API consent store.
examples: |
To delete the consent-store 'test-consent-store', run:
$ {command} test-consent-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to delete.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store

View File

@@ -0,0 +1,23 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Describe a Cloud Healthcare API consent store.
description: Describe a Cloud Healthcare API consent store.
examples: |
To describe the consent-store 'test-consent-store', run:
$ {command} test-consent-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to describe.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store

View File

@@ -0,0 +1,67 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Check the consents for a particular user's data.
description: Check if each matching user data mapping in the given Cloud Healthcare API consent store is consented for a given use.
examples: |
To check if the data for user 'test-user-id' in the consent-store 'test-consent-store' can be used
given request attributes {"organization":"admins", "use_case":"research"}, run:
$ {command} test-consent-store --user-id=test-user-id --request-attributes=organization=admins,use_case=research --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
method: evaluateUserConsents
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store where the requested data is stored.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
params:
- arg_name: user-id
api_field: evaluateUserConsentsRequest.userId
required: true
help_text: |
The unique identifier of the user to evaluate consents for.
- arg_name: resource-attributes
metavar: KEY=VALUE
api_field: evaluateUserConsentsRequest.resourceAttributes
type: 'googlecloudsdk.calliope.arg_parsers:ArgDict:'
help_text: |
Comma-separated list of resource attributes associated with this access request. Each
attribute has the form "KEY=VALUE". If no values are specified, then all data types are
queried.
- arg_name: request-attributes
metavar: KEY=VALUE
api_field: evaluateUserConsentsRequest.requestAttributes
type: 'googlecloudsdk.calliope.arg_parsers:ArgDict:'
help_text: |
Comma-separated list of request attributes associated with this access request. Each
attribute has the form "KEY=VALUE".
- arg_name: consent-list
type: 'googlecloudsdk.calliope.arg_parsers:ArgList:'
api_field: evaluateUserConsentsRequest.consentList.consents
help_text: |
List of user consents to evaluate the access request against. They must have the same
user_id as the data to check access for, exist in the current consent_store, and have a
state of either ACTIVE or DRAFT. A maximum of 100 consents can be provided here.
- arg_name: response-view
api_field: evaluateUserConsentsRequest.responseView
help_text: |
The requested view of information provided in the response (BASIC or FULL).
- arg_name: page-size
api_field: evaluateUserConsentsRequest.pageSize
help_text: |
Limit on the number of user data mappings to return in a single response. If zero the
default page size of 100 is used.
- arg_name: page-token
api_field: evaluateUserConsentsRequest.pageToken
help_text: |
Token to retrieve the next page of results.

View File

@@ -0,0 +1,23 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Retrieve the IAM policy for a Cloud Healthcare API consent store.
description: Retrieve the IAM policy for a Cloud Healthcare API consent store.
examples: |
To print the IAM policy for the consent store 'test-consent-store', run:
$ {command} test-consent-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store whose IAM policy to fetch.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store

View File

@@ -0,0 +1,34 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: List Cloud Healthcare API consent stores.
description: List Cloud Healthcare API consent stores.
examples: |
To list the consent stores in 'test-dataset' with a filter 'key1=value1' on labels, run:
$ {command} --filter="labels.key1=value1" --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
response:
id_field: name
arguments:
resource:
help_text: The dataset to list the consent stores for.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dataset
output:
format: |
table(
name.scope("consentStores"):label=ID,
labels,
name.scope("locations").segment(0):label=LOCATION
)

View File

@@ -0,0 +1,52 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Queries all accessible data IDs.
description: Queries all data IDs that are consented for a given use in the given Cloud Healthcare API consent store and writes them to a specified destination.
examples: |
To query all data IDs in the consent-store 'test-consent-store' that can be used given request
attributes {"organization":"admins", "use_case":"research"} and resource attributes
{"anonymity":"identified"}, and write the result file to "gs://test-bucket/folder", run:
$ {command} test-consent-store --gcs-uri=gs://test-bucket/folder --request-attributes=organization=admins,use_case=research --resource-attributes=anonymity=identified --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
method: queryAccessibleData
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to retrieve user data mappings from.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
params:
- arg_name: gcs-uri
api_field: queryAccessibleDataRequest.gcsDestination.uriPrefix
required: true
help_text: |
The Cloud Storage destination for the result file. The Cloud Healthcare API service account
must have the `roles/storage.objectAdmin` Cloud IAM role for this Cloud Storage location.
- arg_name: resource-attributes
metavar: KEY=VALUE
api_field: queryAccessibleDataRequest.resourceAttributes
type: 'googlecloudsdk.calliope.arg_parsers:ArgDict:'
help_text: |
Comma-separated list of resources attributes associated with the type of data being
requested. Each attribute has the form "KEY=VALUE". If no values are specified, then all
data types are included in the output.
- arg_name: request-attributes
metavar: KEY=VALUE
api_field: queryAccessibleDataRequest.requestAttributes
type: 'googlecloudsdk.calliope.arg_parsers:ArgDict:'
help_text: |
Comma-separated list of request attributes associated with this access request. Each
attribute has the form "KEY=VALUE".
async:
collection: healthcare.projects.locations.datasets.operations

View File

@@ -0,0 +1,37 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Remove an IAM policy binding from a Cloud Healthcare API consent store.
description: |
Remove an IAM policy binding from a Cloud Healthcare API consent store.
examples: |
To remove an IAM policy binding for the role of 'roles/editor' for the user
'test-user@gmail.com' on the consent store 'test-consent-store', run:
$ {command} test-consent-store --dataset=test-dataset --member='user:test-user@gmail.com' --role='roles/editor'
To remove an IAM policy binding for the role of 'roles/healthcare.consentEditor' for the user
'test-user@gmail.com' on the consent store 'test-consent-store' and matches a specific
condition, run:
$ {command} test-consent-store --dataset=test-dataset --member='user:test-user@gmail.com' --role='roles/healthcare.consentEditor' --condition='expression=request.time < timestamp("2021-01-01T00:00:00Z"),title=expires_end_of_2020,description=Expires at midnight on 2020-12-31'
See https://cloud.google.com/iam/docs/managing-policies for details of
policy role and member types.
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to remove an IAM policy binding from.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
iam:
enable_condition: true

View File

@@ -0,0 +1,27 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Set the IAM policy for a Cloud Healthcare API consent store.
description: Set the IAM policy for a Cloud Healthcare API consent store.
examples: |
The following command will read am IAM policy defined in a JSON file
'policy.json' and set it for the consent store 'test-consent-store':
$ {command} test-consent-store policy.json --dataset=test-dataset
See https://cloud.google.com/iam/docs/managing-policies for details of the
policy file format and contents.
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store whose IAM policy to set.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store

View File

@@ -0,0 +1,30 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Update a Cloud Healthcare API consent store.
description: |
Update a Cloud Healthcare API consent store.
examples: |
To update the consent store 'test-consent-store' with labels
{"key1":"value1", "key2":"value2"}, run:
$ {command} test-consent-store --update-labels=key1=value1,key2=value2 --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.consentStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API consent store to update.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:consent_store
labels:
api_field: consentStore.labels
update:
read_modify_update: true