Skip to content

Commit 9eef5a4

Browse files
Add back self_link to vpc access and healthcare (#5564) (#10808)
Signed-off-by: Modular Magician <[email protected]>
1 parent d2f87bb commit 9eef5a4

6 files changed

+31
-5
lines changed

.changelog/5564.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:bug
2+
healthcare: Added back `self_link` functionality which was accidentally removed in `4.0.0` release.
3+
```
4+
```release-note:bug
5+
vpcaccess: Added back `self_link` functionality which was accidentally removed in `4.0.0` release.
6+
```

google/resource_healthcare_dataset.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,14 @@ func expandHealthcareDatasetTimeZone(v interface{}, d TerraformResourceData, con
322322
}
323323

324324
func resourceHealthcareDatasetDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
325-
// Modify the name to be the user specified form.
325+
// Take the returned long form of the name and use it as `self_link`.
326+
// Then modify the name to be the user specified form.
326327
// We can't just ignore_read on `name` as the linter will
327328
// complain that the returned `res` is never used afterwards.
328329
// Some field needs to be actually set, and we chose `name`.
330+
if err := d.Set("self_link", res["name"].(string)); err != nil {
331+
return nil, fmt.Errorf("Error setting self_link: %s", err)
332+
}
329333
res["name"] = d.Get("name").(string)
330334
return res, nil
331335
}

google/resource_healthcare_dicom_store.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,14 @@ func expandHealthcareDicomStoreNotificationConfigPubsubTopic(v interface{}, d Te
386386
}
387387

388388
func resourceHealthcareDicomStoreDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
389-
// Modify the name to be the user specified form.
389+
// Take the returned long form of the name and use it as `self_link`.
390+
// Then modify the name to be the user specified form.
390391
// We can't just ignore_read on `name` as the linter will
391392
// complain that the returned `res` is never used afterwards.
392393
// Some field needs to be actually set, and we chose `name`.
394+
if err := d.Set("self_link", res["name"].(string)); err != nil {
395+
return nil, fmt.Errorf("Error setting self_link: %s", err)
396+
}
393397
res["name"] = d.Get("name").(string)
394398
return res, nil
395399
}

google/resource_healthcare_fhir_store.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,14 @@ func expandHealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigRecurs
801801
}
802802

803803
func resourceHealthcareFhirStoreDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
804-
// Modify the name to be the user specified form.
804+
// Take the returned long form of the name and use it as `self_link`.
805+
// Then modify the name to be the user specified form.
805806
// We can't just ignore_read on `name` as the linter will
806807
// complain that the returned `res` is never used afterwards.
807808
// Some field needs to be actually set, and we chose `name`.
809+
if err := d.Set("self_link", res["name"].(string)); err != nil {
810+
return nil, fmt.Errorf("Error setting self_link: %s", err)
811+
}
808812
res["name"] = d.Get("name").(string)
809813
return res, nil
810814
}

google/resource_healthcare_hl7_v2_store.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,14 @@ func expandHealthcareHl7V2StoreNotificationConfigPubsubTopic(v interface{}, d Te
681681
}
682682

683683
func resourceHealthcareHl7V2StoreDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
684-
// Modify the name to be the user specified form.
684+
// Take the returned long form of the name and use it as `self_link`.
685+
// Then modify the name to be the user specified form.
685686
// We can't just ignore_read on `name` as the linter will
686687
// complain that the returned `res` is never used afterwards.
687688
// Some field needs to be actually set, and we chose `name`.
689+
if err := d.Set("self_link", res["name"].(string)); err != nil {
690+
return nil, fmt.Errorf("Error setting self_link: %s", err)
691+
}
688692
res["name"] = d.Get("name").(string)
689693
return res, nil
690694
}

google/resource_vpc_access_connector.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,14 @@ func resourceVPCAccessConnectorEncoder(d *schema.ResourceData, meta interface{},
434434
}
435435

436436
func resourceVPCAccessConnectorDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
437-
// Modify the name to be the user specified form.
437+
// Take the returned long form of the name and use it as `self_link`.
438+
// Then modify the name to be the user specified form.
438439
// We can't just ignore_read on `name` as the linter will
439440
// complain that the returned `res` is never used afterwards.
440441
// Some field needs to be actually set, and we chose `name`.
442+
if err := d.Set("self_link", res["name"].(string)); err != nil {
443+
return nil, fmt.Errorf("Error setting self_link: %s", err)
444+
}
441445
res["name"] = d.Get("name").(string)
442446
return res, nil
443447
}

0 commit comments

Comments
 (0)