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

Add support for setting sendPreviousResourceOnDelete for FHIR store notification configs. #8507

Merged
merged 2 commits into from
Aug 2, 2023
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
8 changes: 8 additions & 0 deletions mmv1/products/healthcare/FhirStore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,11 @@ properties:
full FHIR resource. When a resource change is too large or during heavy traffic, only the resource name will be
sent. Clients should always check the "payloadType" label from a Pub/Sub message to determine whether
it needs to fetch the full resource as a separate operation.
- !ruby/object:Api::Type::Boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test that specifies this in the update test for this resource? Just to check that the functionality works during update, especially going from specifying this field to not specifying it.

It can be added to the existing update test here: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/tests/resource_healthcare_fhir_store_test.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added it correctly but let me know if there is something else you had in mind!

name: sendPreviousResourceOnDelete
description: |
Whether to send full FHIR resource to this Pub/Sub topic for deleting FHIR resource. Note that setting this to
true does not guarantee that all previous resources will be sent in the format of full FHIR resource. When a
resource change is too large or during heavy traffic, only the resource name will be sent. Clients should always
check the "payloadType" label from a Pub/Sub message to determine whether it needs to fetch the full previous
resource as a separate operation.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ resource "google_healthcare_fhir_store" "default" {
}

notification_configs {
pubsub_topic = "${google_pubsub_topic.topic.id}"
send_full_resource = true
pubsub_topic = "${google_pubsub_topic.topic.id}"
send_full_resource = true
send_previous_resource_on_delete = true
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% autogen_exception -%>
package google

import (
Expand Down Expand Up @@ -152,6 +153,14 @@ resource "google_healthcare_fhir_store" "default" {
pubsub_topic = google_pubsub_topic.topic.id
}

<% unless version == "ga" -%>
notification_configs {
pubsub_topic = google_pubsub_topic.topic.id
send_full_resource = true
send_previous_resource_on_delete = true
}

<% end -%>
labels = {
label1 = "labelvalue1"
}
Expand Down