Skip to content

Commit babe6dc

Browse files
Add notification_config.send_for_bulk_import field to google_healthcare_dicom_store (#10855) (#7457)
[upstream:c85842ff834e4f0e19a29038aa1baea8fcb393d1] Signed-off-by: Modular Magician <[email protected]>
1 parent 0b2a414 commit babe6dc

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

google-beta/services/healthcare/resource_healthcare_dicom_store.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ was published. Notifications are only sent if the topic is non-empty. Topic name
108108
project. [email protected] must have publisher permissions on the given
109109
Cloud Pub/Sub topic. Not having adequate permissions will cause the calls that send notifications to fail.`,
110110
},
111+
"send_for_bulk_import": {
112+
Type: schema.TypeBool,
113+
Optional: true,
114+
Description: `Indicates whether or not to send Pub/Sub notifications on bulk import. Only supported for DICOM imports.`,
115+
},
111116
},
112117
},
113118
},
@@ -474,12 +479,18 @@ func flattenHealthcareDicomStoreNotificationConfig(v interface{}, d *schema.Reso
474479
transformed := make(map[string]interface{})
475480
transformed["pubsub_topic"] =
476481
flattenHealthcareDicomStoreNotificationConfigPubsubTopic(original["pubsubTopic"], d, config)
482+
transformed["send_for_bulk_import"] =
483+
flattenHealthcareDicomStoreNotificationConfigSendForBulkImport(original["sendForBulkImport"], d, config)
477484
return []interface{}{transformed}
478485
}
479486
func flattenHealthcareDicomStoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
480487
return v
481488
}
482489

490+
func flattenHealthcareDicomStoreNotificationConfigSendForBulkImport(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
491+
return v
492+
}
493+
483494
func flattenHealthcareDicomStoreStreamConfigs(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
484495
if v == nil {
485496
return v
@@ -554,13 +565,24 @@ func expandHealthcareDicomStoreNotificationConfig(v interface{}, d tpgresource.T
554565
transformed["pubsubTopic"] = transformedPubsubTopic
555566
}
556567

568+
transformedSendForBulkImport, err := expandHealthcareDicomStoreNotificationConfigSendForBulkImport(original["send_for_bulk_import"], d, config)
569+
if err != nil {
570+
return nil, err
571+
} else if val := reflect.ValueOf(transformedSendForBulkImport); val.IsValid() && !tpgresource.IsEmptyValue(val) {
572+
transformed["sendForBulkImport"] = transformedSendForBulkImport
573+
}
574+
557575
return transformed, nil
558576
}
559577

560578
func expandHealthcareDicomStoreNotificationConfigPubsubTopic(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
561579
return v, nil
562580
}
563581

582+
func expandHealthcareDicomStoreNotificationConfigSendForBulkImport(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
583+
return v, nil
584+
}
585+
564586
func expandHealthcareDicomStoreStreamConfigs(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
565587
l := v.([]interface{})
566588
req := make([]interface{}, 0, len(l))

google-beta/services/healthcare/resource_healthcare_dicom_store_generated_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ resource "google_healthcare_dicom_store" "default" {
116116
dataset = google_healthcare_dataset.dataset.id
117117
118118
notification_config {
119-
pubsub_topic = google_pubsub_topic.topic.id
119+
pubsub_topic = google_pubsub_topic.topic.id
120+
send_for_bulk_import = true
120121
}
121122
122123
labels = {

google-beta/services/healthcare/resource_healthcare_dicom_store_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ resource "google_healthcare_dicom_store" "default" {
144144
dataset = google_healthcare_dataset.dataset.id
145145
146146
notification_config {
147-
pubsub_topic = google_pubsub_topic.topic.id
147+
pubsub_topic = google_pubsub_topic.topic.id
148+
send_for_bulk_import = true
148149
}
149150
150151
labels = {
@@ -192,6 +193,10 @@ func testAccCheckGoogleHealthcareDicomStoreUpdate(t *testing.T, pubsubTopic stri
192193
if topicName != pubsubTopic {
193194
return fmt.Errorf("dicomStore 'NotificationConfig' not updated ('%s' != '%s'): %s", topicName, pubsubTopic, gcpResourceUri)
194195
}
196+
197+
if !response.NotificationConfig.SendForBulkImport {
198+
return fmt.Errorf("dicomStore 'NotificationConfig.SendForBulkImport' not changed to true: %s", gcpResourceUri)
199+
}
195200
}
196201

197202
if !foundResource {

website/docs/r/healthcare_dicom_store.html.markdown

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ resource "google_healthcare_dicom_store" "default" {
7777
dataset = google_healthcare_dataset.dataset.id
7878
7979
notification_config {
80-
pubsub_topic = google_pubsub_topic.topic.id
80+
pubsub_topic = google_pubsub_topic.topic.id
81+
send_for_bulk_import = true
8182
}
8283
8384
labels = {
@@ -179,6 +180,10 @@ The following arguments are supported:
179180
project. [email protected] must have publisher permissions on the given
180181
Cloud Pub/Sub topic. Not having adequate permissions will cause the calls that send notifications to fail.
181182

183+
* `send_for_bulk_import` -
184+
(Optional)
185+
Indicates whether or not to send Pub/Sub notifications on bulk import. Only supported for DICOM imports.
186+
182187
<a name="nested_stream_configs"></a>The `stream_configs` block supports:
183188

184189
* `bigquery_destination` -

0 commit comments

Comments
 (0)