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 back self_link to vpc access and healthcare #10808

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
6 changes: 6 additions & 0 deletions .changelog/5564.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:bug
healthcare: Added back `self_link` functionality which was accidentally removed in `4.0.0` release.
```
```release-note:bug
vpcaccess: Added back `self_link` functionality which was accidentally removed in `4.0.0` release.
```
6 changes: 5 additions & 1 deletion google/resource_healthcare_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,14 @@ func expandHealthcareDatasetTimeZone(v interface{}, d TerraformResourceData, con
}

func resourceHealthcareDatasetDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
// Modify the name to be the user specified form.
// Take the returned long form of the name and use it as `self_link`.
// Then modify the name to be the user specified form.
// We can't just ignore_read on `name` as the linter will
// complain that the returned `res` is never used afterwards.
// Some field needs to be actually set, and we chose `name`.
if err := d.Set("self_link", res["name"].(string)); err != nil {
return nil, fmt.Errorf("Error setting self_link: %s", err)
}
res["name"] = d.Get("name").(string)
return res, nil
}
6 changes: 5 additions & 1 deletion google/resource_healthcare_dicom_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,14 @@ func expandHealthcareDicomStoreNotificationConfigPubsubTopic(v interface{}, d Te
}

func resourceHealthcareDicomStoreDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
// Modify the name to be the user specified form.
// Take the returned long form of the name and use it as `self_link`.
// Then modify the name to be the user specified form.
// We can't just ignore_read on `name` as the linter will
// complain that the returned `res` is never used afterwards.
// Some field needs to be actually set, and we chose `name`.
if err := d.Set("self_link", res["name"].(string)); err != nil {
return nil, fmt.Errorf("Error setting self_link: %s", err)
}
res["name"] = d.Get("name").(string)
return res, nil
}
6 changes: 5 additions & 1 deletion google/resource_healthcare_fhir_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,14 @@ func expandHealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigRecurs
}

func resourceHealthcareFhirStoreDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
// Modify the name to be the user specified form.
// Take the returned long form of the name and use it as `self_link`.
// Then modify the name to be the user specified form.
// We can't just ignore_read on `name` as the linter will
// complain that the returned `res` is never used afterwards.
// Some field needs to be actually set, and we chose `name`.
if err := d.Set("self_link", res["name"].(string)); err != nil {
return nil, fmt.Errorf("Error setting self_link: %s", err)
}
res["name"] = d.Get("name").(string)
return res, nil
}
6 changes: 5 additions & 1 deletion google/resource_healthcare_hl7_v2_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,14 @@ func expandHealthcareHl7V2StoreNotificationConfigPubsubTopic(v interface{}, d Te
}

func resourceHealthcareHl7V2StoreDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) {
// Modify the name to be the user specified form.
// Take the returned long form of the name and use it as `self_link`.
// Then modify the name to be the user specified form.
// We can't just ignore_read on `name` as the linter will
// complain that the returned `res` is never used afterwards.
// Some field needs to be actually set, and we chose `name`.
if err := d.Set("self_link", res["name"].(string)); err != nil {
return nil, fmt.Errorf("Error setting self_link: %s", err)
}
res["name"] = d.Get("name").(string)
return res, nil
}
6 changes: 5 additions & 1 deletion google/resource_vpc_access_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,14 @@ func resourceVPCAccessConnectorEncoder(d *schema.ResourceData, meta interface{},
}

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