Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote healthcare consent API to GA support #4393

Merged
merged 7 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions mmv1/products/healthcare/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,8 @@ objects:
self_link: "{{dataset}}/consentStores/{{name}}"
update_verb: :PATCH
update_mask: true
min_version: beta
description: |
The Consent Management API is a tool for tracking user consents and the documentation associated with the consents.
The Consent Management API is a tool for tracking user consents and the documentation associated with the consents.
iam_policy: !ruby/object:Api::Resource::IamPolicy
method_name_separator: ':'
fetch_iam_policy_verb: :GET
Expand Down Expand Up @@ -588,7 +587,7 @@ objects:
name: 'enableConsentCreateOnUpdate'
required: false
description: |
If true, [consents.patch] [google.cloud.healthcare.v1beta1.consent.UpdateConsent] creates the consent if it does not already exist.
If true, [consents.patch] [google.cloud.healthcare.v1.consent.UpdateConsent] creates the consent if it does not already exist.
- !ruby/object:Api::Type::KeyValuePairs
name: labels
required: false
Expand All @@ -610,4 +609,4 @@ objects:
guides:
'Creating a Consent store':
'https://cloud.google.com/healthcare/docs/how-tos/consent'
api: 'https://cloud.google.com/healthcare/docs/reference/rest/v1beta1/projects.locations.datasets.consentStores'
api: 'https://cloud.google.com/healthcare/docs/reference/rest/v1/projects.locations.datasets.consentStores'
6 changes: 2 additions & 4 deletions mmv1/products/healthcare/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,23 @@ overrides: !ruby/object:Overrides::ResourceOverrides
custom_import: templates/terraform/custom_import/healthcare_hl7_v2_store.go.erb
ConsentStore: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{dataset}}/consentStores/{{name}}"
import_format: ["{{dataset}}/consentStores/{{name}}", "{{name}}"]
import_format: ["{{%dataset}}/consentStores/{{name}}"]
examples:
- !ruby/object:Provider::Terraform::Examples
name: "healthcare_consent_store_basic"
min_version: "beta"
primary_resource_id: "my-consent"
primary_resource_name: "fmt.Sprintf(\"projects/%s/locations/%s/datasets/tf-test-my-dataset%s\", getTestProjectFromEnv(), getTestRegionFromEnv(), context[\"random_suffix\"]) , fmt.Sprintf(\"tf-test-my-consent-store%s\", context[\"random_suffix\"])"
vars:
dataset_id: "my-dataset"
consent_id: "my-consent-store"
- !ruby/object:Provider::Terraform::Examples
name: "healthcare_consent_store_full"
min_version: "beta"
primary_resource_id: "my-consent"
vars:
dataset_id: "my-dataset"
consent_id: "my-consent-store"
- !ruby/object:Provider::Terraform::Examples
name: "healthcare_consent_store_iam"
min_version: "beta"
primary_resource_id: "my-consent"
vars:
dataset_id: "my-dataset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
import_format = individual_url
end
params = extract_identifiers(import_format.gsub('{{name}}', "{{#{object.name.underscore}}}"))
import_url = import_format.gsub(/({{)(\w+)(}})/, '%s').gsub(object.__product.base_url, '')
import_url = import_format.gsub(/({{)%?(\w+)(}})/, '%s').gsub(object.__product.base_url, '')
-%>
<% import_qualifiers = [] -%>
<% params.each_with_index do |param, i| -%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
resource "google_healthcare_dataset" "dataset" {
provider = google-beta

location = "us-central1"
name = "<%= ctx[:vars]['dataset_id'] %>"
}

resource "google_healthcare_consent_store" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

dataset = google_healthcare_dataset.dataset.id
name = "<%= ctx[:vars]['consent_id'] %>"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@

resource "google_healthcare_dataset" "dataset" {
provider = google-beta

location = "us-central1"
name = "<%= ctx[:vars]['dataset_id'] %>"
}

resource "google_healthcare_consent_store" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

dataset = google_healthcare_dataset.dataset.id
name = "<%= ctx[:vars]['consent_id'] %>"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
resource "google_healthcare_dataset" "dataset" {
provider = google-beta

location = "us-central1"
name = "<%= ctx[:vars]['dataset_id'] %>"
}

resource "google_healthcare_consent_store" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

dataset = google_healthcare_dataset.dataset.id
name = "<%= ctx[:vars]['consent_id'] %>"
}

resource "google_service_account" "test-account" {
provider = google-beta

account_id = "<%= ctx[:vars]['account_id'] %>"
display_name = "Test Service Account"
}

resource "google_healthcare_consent_store_iam_member" "test-iam" {
provider = google-beta

dataset = google_healthcare_dataset.dataset.id
consent_store_id = google_healthcare_consent_store.<%= ctx[:primary_resource_id] %>.name
role = "roles/editor"
Expand Down