diff --git a/.changelog/3007.txt b/.changelog/3007.txt new file mode 100644 index 00000000000..a7b352630a2 --- /dev/null +++ b/.changelog/3007.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +secretmanager: added `secret` and `secret_version` resources and `secret_version` datasource +``` diff --git a/google/data_source_monitoring_notification_channel.go b/google/data_source_monitoring_notification_channel.go index 645f1081055..fe550c81034 100644 --- a/google/data_source_monitoring_notification_channel.go +++ b/google/data_source_monitoring_notification_channel.go @@ -97,7 +97,7 @@ func dataSourceMonitoringNotificationChannelRead(d *schema.ResourceData, meta in } res := channels[0].(map[string]interface{}) - name := flattenMonitoringNotificationChannelName(res["name"], d).(string) + name := flattenMonitoringNotificationChannelName(res["name"], d, config).(string) d.Set("name", name) d.SetId(name) diff --git a/google/data_source_secret_manager_secret_version.go b/google/data_source_secret_manager_secret_version.go new file mode 100644 index 00000000000..71664db3c87 --- /dev/null +++ b/google/data_source_secret_manager_secret_version.go @@ -0,0 +1 @@ +package google diff --git a/google/data_source_secret_manager_secret_version_test.go b/google/data_source_secret_manager_secret_version_test.go new file mode 100644 index 00000000000..71664db3c87 --- /dev/null +++ b/google/data_source_secret_manager_secret_version_test.go @@ -0,0 +1 @@ +package google diff --git a/google/iam_binary_authorization_attestor_generated_test.go b/google/iam_binary_authorization_attestor_generated_test.go index 77f2590e648..3a5f98ad6d5 100644 --- a/google/iam_binary_authorization_attestor_generated_test.go +++ b/google/iam_binary_authorization_attestor_generated_test.go @@ -156,8 +156,8 @@ resource "google_container_analysis_note" "note" { } resource "google_binary_authorization_attestor_iam_member" "foo" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -210,9 +210,9 @@ data "google_iam_policy" "foo" { } resource "google_binary_authorization_attestor_iam_policy" "foo" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -259,9 +259,9 @@ data "google_iam_policy" "foo" { } resource "google_binary_authorization_attestor_iam_policy" "foo" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -305,8 +305,8 @@ resource "google_container_analysis_note" "note" { } resource "google_binary_authorization_attestor_iam_binding" "foo" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -352,8 +352,8 @@ resource "google_container_analysis_note" "note" { } resource "google_binary_authorization_attestor_iam_binding" "foo" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_cloud_functions_cloud_function_generated_test.go b/google/iam_cloud_functions_cloud_function_generated_test.go index 4856c35af0d..c675410ca4f 100644 --- a/google/iam_cloud_functions_cloud_function_generated_test.go +++ b/google/iam_cloud_functions_cloud_function_generated_test.go @@ -146,9 +146,9 @@ resource "google_cloudfunctions_function" "function" { } resource "google_cloudfunctions_function_iam_member" "foo" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -188,10 +188,10 @@ data "google_iam_policy" "foo" { } resource "google_cloudfunctions_function_iam_policy" "foo" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -225,10 +225,10 @@ data "google_iam_policy" "foo" { } resource "google_cloudfunctions_function_iam_policy" "foo" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -259,9 +259,9 @@ resource "google_cloudfunctions_function" "function" { } resource "google_cloudfunctions_function_iam_binding" "foo" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -294,9 +294,9 @@ resource "google_cloudfunctions_function" "function" { } resource "google_cloudfunctions_function_iam_binding" "foo" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_cloud_run_service_generated_test.go b/google/iam_cloud_run_service_generated_test.go index a7ee9bcbd17..d78f66340d9 100644 --- a/google/iam_cloud_run_service_generated_test.go +++ b/google/iam_cloud_run_service_generated_test.go @@ -141,9 +141,9 @@ resource "google_cloud_run_service" "default" { } resource "google_cloud_run_service_iam_member" "foo" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -178,10 +178,10 @@ data "google_iam_policy" "foo" { } resource "google_cloud_run_service_iam_policy" "foo" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -210,10 +210,10 @@ data "google_iam_policy" "foo" { } resource "google_cloud_run_service_iam_policy" "foo" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -239,9 +239,9 @@ resource "google_cloud_run_service" "default" { } resource "google_cloud_run_service_iam_binding" "foo" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -269,9 +269,9 @@ resource "google_cloud_run_service" "default" { } resource "google_cloud_run_service_iam_binding" "foo" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_compute_instance_generated_test.go b/google/iam_compute_instance_generated_test.go index 1f6ceece9ab..5a2fd07051b 100644 --- a/google/iam_compute_instance_generated_test.go +++ b/google/iam_compute_instance_generated_test.go @@ -136,9 +136,9 @@ resource "google_compute_instance" "default" { } resource "google_compute_instance_iam_member" "foo" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -171,10 +171,10 @@ data "google_iam_policy" "foo" { } resource "google_compute_instance_iam_policy" "foo" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -201,10 +201,10 @@ data "google_iam_policy" "foo" { } resource "google_compute_instance_iam_policy" "foo" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -228,9 +228,9 @@ resource "google_compute_instance" "default" { } resource "google_compute_instance_iam_binding" "foo" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -256,9 +256,9 @@ resource "google_compute_instance" "default" { } resource "google_compute_instance_iam_binding" "foo" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_compute_subnetwork_generated_test.go b/google/iam_compute_subnetwork_generated_test.go index fa4f9c8ead8..6d2554badae 100644 --- a/google/iam_compute_subnetwork_generated_test.go +++ b/google/iam_compute_subnetwork_generated_test.go @@ -136,9 +136,9 @@ resource "google_compute_network" "custom-test" { } resource "google_compute_subnetwork_iam_member" "foo" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -171,10 +171,10 @@ data "google_iam_policy" "foo" { } resource "google_compute_subnetwork_iam_policy" "foo" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -201,10 +201,10 @@ data "google_iam_policy" "foo" { } resource "google_compute_subnetwork_iam_policy" "foo" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -228,9 +228,9 @@ resource "google_compute_network" "custom-test" { } resource "google_compute_subnetwork_iam_binding" "foo" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -256,9 +256,9 @@ resource "google_compute_network" "custom-test" { } resource "google_compute_subnetwork_iam_binding" "foo" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_iap_app_engine_service_generated_test.go b/google/iam_iap_app_engine_service_generated_test.go index 470cbc28a11..4590459bf78 100644 --- a/google/iam_iap_app_engine_service_generated_test.go +++ b/google/iam_iap_app_engine_service_generated_test.go @@ -255,7 +255,7 @@ resource "google_iap_app_engine_service_iam_policy" "foo" { project = "${google_app_engine_standard_app_version.version.project}" app_id = "${google_app_engine_standard_app_version.version.project}" service = "${google_app_engine_standard_app_version.version.service}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -321,7 +321,7 @@ resource "google_iap_app_engine_service_iam_policy" "foo" { project = "${google_app_engine_standard_app_version.version.project}" app_id = "${google_app_engine_standard_app_version.version.project}" service = "${google_app_engine_standard_app_version.version.service}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + policy_data = data.google_iam_policy.foo.policy_data } `, context) } diff --git a/google/iam_iap_app_engine_version_generated_test.go b/google/iam_iap_app_engine_version_generated_test.go index 7138fc33719..bbfe3a00618 100644 --- a/google/iam_iap_app_engine_version_generated_test.go +++ b/google/iam_iap_app_engine_version_generated_test.go @@ -200,7 +200,7 @@ resource "google_iap_app_engine_version_iam_policy" "foo" { app_id = "${google_app_engine_standard_app_version.version.project}" service = "${google_app_engine_standard_app_version.version.service}" version_id = "${google_app_engine_standard_app_version.version.version_id}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -243,7 +243,7 @@ resource "google_iap_app_engine_version_iam_policy" "foo" { app_id = "${google_app_engine_standard_app_version.version.project}" service = "${google_app_engine_standard_app_version.version.service}" version_id = "${google_app_engine_standard_app_version.version.version_id}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + policy_data = data.google_iam_policy.foo.policy_data } `, context) } diff --git a/google/iam_iap_tunnel_instance_generated_test.go b/google/iam_iap_tunnel_instance_generated_test.go index 6d700ae079f..e3b5d150bb0 100644 --- a/google/iam_iap_tunnel_instance_generated_test.go +++ b/google/iam_iap_tunnel_instance_generated_test.go @@ -136,9 +136,9 @@ resource "google_compute_instance" "tunnelvm" { } resource "google_iap_tunnel_instance_iam_member" "foo" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -171,10 +171,10 @@ data "google_iam_policy" "foo" { } resource "google_iap_tunnel_instance_iam_policy" "foo" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -201,10 +201,10 @@ data "google_iam_policy" "foo" { } resource "google_iap_tunnel_instance_iam_policy" "foo" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -228,9 +228,9 @@ resource "google_compute_instance" "tunnelvm" { } resource "google_iap_tunnel_instance_iam_binding" "foo" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -256,9 +256,9 @@ resource "google_compute_instance" "tunnelvm" { } resource "google_iap_tunnel_instance_iam_binding" "foo" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_iap_web_backend_service_generated_test.go b/google/iam_iap_web_backend_service_generated_test.go index aa039512982..02efbbedbfd 100644 --- a/google/iam_iap_web_backend_service_generated_test.go +++ b/google/iam_iap_web_backend_service_generated_test.go @@ -132,8 +132,8 @@ resource "google_compute_http_health_check" "default" { } resource "google_iap_web_backend_service_iam_member" "foo" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -162,9 +162,9 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_backend_service_iam_policy" "foo" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -187,9 +187,9 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_backend_service_iam_policy" "foo" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -209,8 +209,8 @@ resource "google_compute_http_health_check" "default" { } resource "google_iap_web_backend_service_iam_binding" "foo" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -232,8 +232,8 @@ resource "google_compute_http_health_check" "default" { } resource "google_iap_web_backend_service_iam_binding" "foo" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_iap_web_generated_test.go b/google/iam_iap_web_generated_test.go index 55ce2a04037..c39c5911674 100644 --- a/google/iam_iap_web_generated_test.go +++ b/google/iam_iap_web_generated_test.go @@ -134,7 +134,7 @@ resource "google_project_service" "project_service" { } resource "google_iap_web_iam_member" "foo" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -162,8 +162,8 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_iam_policy" "foo" { - project = "${google_project_service.project_service.project}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_project_service.project_service.project + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -185,8 +185,8 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_iam_policy" "foo" { - project = "${google_project_service.project_service.project}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_project_service.project_service.project + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -205,7 +205,7 @@ resource "google_project_service" "project_service" { } resource "google_iap_web_iam_binding" "foo" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -226,7 +226,7 @@ resource "google_project_service" "project_service" { } resource "google_iap_web_iam_binding" "foo" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_iap_web_type_app_engine_generated_test.go b/google/iam_iap_web_type_app_engine_generated_test.go index a8ec5a8282d..e82cfa7fd08 100644 --- a/google/iam_iap_web_type_app_engine_generated_test.go +++ b/google/iam_iap_web_type_app_engine_generated_test.go @@ -142,8 +142,8 @@ resource "google_app_engine_application" "app" { } resource "google_iap_web_type_app_engine_iam_member" "foo" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -176,9 +176,9 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_type_app_engine_iam_policy" "foo" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -205,9 +205,9 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_type_app_engine_iam_policy" "foo" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -231,8 +231,8 @@ resource "google_app_engine_application" "app" { } resource "google_iap_web_type_app_engine_iam_binding" "foo" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -258,8 +258,8 @@ resource "google_app_engine_application" "app" { } resource "google_iap_web_type_app_engine_iam_binding" "foo" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_iap_web_type_compute_generated_test.go b/google/iam_iap_web_type_compute_generated_test.go index 464c7547917..21f4501682e 100644 --- a/google/iam_iap_web_type_compute_generated_test.go +++ b/google/iam_iap_web_type_compute_generated_test.go @@ -134,7 +134,7 @@ resource "google_project_service" "project_service" { } resource "google_iap_web_type_compute_iam_member" "foo" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -162,8 +162,8 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_type_compute_iam_policy" "foo" { - project = "${google_project_service.project_service.project}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_project_service.project_service.project + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -185,8 +185,8 @@ data "google_iam_policy" "foo" { } resource "google_iap_web_type_compute_iam_policy" "foo" { - project = "${google_project_service.project_service.project}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_project_service.project_service.project + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -205,7 +205,7 @@ resource "google_project_service" "project_service" { } resource "google_iap_web_type_compute_iam_binding" "foo" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -226,7 +226,7 @@ resource "google_project_service" "project_service" { } resource "google_iap_web_type_compute_iam_binding" "foo" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_pubsub_topic_generated_test.go b/google/iam_pubsub_topic_generated_test.go index 767791d62c8..41236d8e18d 100644 --- a/google/iam_pubsub_topic_generated_test.go +++ b/google/iam_pubsub_topic_generated_test.go @@ -128,8 +128,8 @@ resource "google_pubsub_topic" "example" { } resource "google_pubsub_topic_iam_member" "foo" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -154,9 +154,9 @@ data "google_iam_policy" "foo" { } resource "google_pubsub_topic_iam_policy" "foo" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -175,9 +175,9 @@ data "google_iam_policy" "foo" { } resource "google_pubsub_topic_iam_policy" "foo" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -193,8 +193,8 @@ resource "google_pubsub_topic" "example" { } resource "google_pubsub_topic_iam_binding" "foo" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -212,8 +212,8 @@ resource "google_pubsub_topic" "example" { } resource "google_pubsub_topic_iam_binding" "foo" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_runtime_config_config_generated_test.go b/google/iam_runtime_config_config_generated_test.go index 74aee9f95ce..591d892bda2 100644 --- a/google/iam_runtime_config_config_generated_test.go +++ b/google/iam_runtime_config_config_generated_test.go @@ -125,8 +125,8 @@ resource "google_runtimeconfig_config" "config" { } resource "google_runtimeconfig_config_iam_member" "foo" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -148,9 +148,9 @@ data "google_iam_policy" "foo" { } resource "google_runtimeconfig_config_iam_policy" "foo" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -166,9 +166,9 @@ data "google_iam_policy" "foo" { } resource "google_runtimeconfig_config_iam_policy" "foo" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -181,8 +181,8 @@ resource "google_runtimeconfig_config" "config" { } resource "google_runtimeconfig_config_iam_binding" "foo" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -197,8 +197,8 @@ resource "google_runtimeconfig_config" "config" { } resource "google_runtimeconfig_config_iam_binding" "foo" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_source_repo_repository_generated_test.go b/google/iam_source_repo_repository_generated_test.go index 535fe0a4dc7..4036ef4d468 100644 --- a/google/iam_source_repo_repository_generated_test.go +++ b/google/iam_source_repo_repository_generated_test.go @@ -124,8 +124,8 @@ resource "google_sourcerepo_repository" "my-repo" { } resource "google_sourcerepo_repository_iam_member" "foo" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -146,9 +146,9 @@ data "google_iam_policy" "foo" { } resource "google_sourcerepo_repository_iam_policy" "foo" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -163,9 +163,9 @@ data "google_iam_policy" "foo" { } resource "google_sourcerepo_repository_iam_policy" "foo" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -177,8 +177,8 @@ resource "google_sourcerepo_repository" "my-repo" { } resource "google_sourcerepo_repository_iam_binding" "foo" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -192,8 +192,8 @@ resource "google_sourcerepo_repository" "my-repo" { } resource "google_sourcerepo_repository_iam_binding" "foo" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/iam_storage_bucket_generated_test.go b/google/iam_storage_bucket_generated_test.go index 1a9b361ba7e..dec2214a413 100644 --- a/google/iam_storage_bucket_generated_test.go +++ b/google/iam_storage_bucket_generated_test.go @@ -129,7 +129,7 @@ resource "google_storage_bucket" "default" { } resource "google_storage_bucket_iam_member" "foo" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "%{role}" member = "user:admin@hashicorptest.com" } @@ -155,8 +155,8 @@ data "google_iam_policy" "foo" { } resource "google_storage_bucket_iam_policy" "foo" { - bucket = "${google_storage_bucket.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + bucket = google_storage_bucket.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -172,8 +172,8 @@ data "google_iam_policy" "foo" { } resource "google_storage_bucket_iam_policy" "foo" { - bucket = "${google_storage_bucket.default.name}" - policy_data = "${data.google_iam_policy.foo.policy_data}" + bucket = google_storage_bucket.default.name + policy_data = data.google_iam_policy.foo.policy_data } `, context) } @@ -186,7 +186,7 @@ resource "google_storage_bucket" "default" { } resource "google_storage_bucket_iam_binding" "foo" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "%{role}" members = ["user:admin@hashicorptest.com"] } @@ -201,7 +201,7 @@ resource "google_storage_bucket" "default" { } resource "google_storage_bucket_iam_binding" "foo" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "%{role}" members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] } diff --git a/google/resource_access_context_manager_access_level.go b/google/resource_access_context_manager_access_level.go index dfc2496102b..5777be23b4d 100644 --- a/google/resource_access_context_manager_access_level.go +++ b/google/resource_access_context_manager_access_level.go @@ -309,16 +309,16 @@ func resourceAccessContextManagerAccessLevelRead(d *schema.ResourceData, meta in return handleNotFoundError(err, d, fmt.Sprintf("AccessContextManagerAccessLevel %q", d.Id())) } - if err := d.Set("title", flattenAccessContextManagerAccessLevelTitle(res["title"], d)); err != nil { + if err := d.Set("title", flattenAccessContextManagerAccessLevelTitle(res["title"], d, config)); err != nil { return fmt.Errorf("Error reading AccessLevel: %s", err) } - if err := d.Set("description", flattenAccessContextManagerAccessLevelDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenAccessContextManagerAccessLevelDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading AccessLevel: %s", err) } - if err := d.Set("basic", flattenAccessContextManagerAccessLevelBasic(res["basic"], d)); err != nil { + if err := d.Set("basic", flattenAccessContextManagerAccessLevelBasic(res["basic"], d, config)); err != nil { return fmt.Errorf("Error reading AccessLevel: %s", err) } - if err := d.Set("name", flattenAccessContextManagerAccessLevelName(res["name"], d)); err != nil { + if err := d.Set("name", flattenAccessContextManagerAccessLevelName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading AccessLevel: %s", err) } @@ -438,15 +438,15 @@ func resourceAccessContextManagerAccessLevelImport(d *schema.ResourceData, meta return []*schema.ResourceData{d}, nil } -func flattenAccessContextManagerAccessLevelTitle(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelTitle(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasic(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasic(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -456,12 +456,12 @@ func flattenAccessContextManagerAccessLevelBasic(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["combining_function"] = - flattenAccessContextManagerAccessLevelBasicCombiningFunction(original["combiningFunction"], d) + flattenAccessContextManagerAccessLevelBasicCombiningFunction(original["combiningFunction"], d, config) transformed["conditions"] = - flattenAccessContextManagerAccessLevelBasicConditions(original["conditions"], d) + flattenAccessContextManagerAccessLevelBasicConditions(original["conditions"], d, config) return []interface{}{transformed} } -func flattenAccessContextManagerAccessLevelBasicCombiningFunction(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicCombiningFunction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return "AND" } @@ -469,7 +469,7 @@ func flattenAccessContextManagerAccessLevelBasicCombiningFunction(v interface{}, return v } -func flattenAccessContextManagerAccessLevelBasicConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -482,32 +482,32 @@ func flattenAccessContextManagerAccessLevelBasicConditions(v interface{}, d *sch continue } transformed = append(transformed, map[string]interface{}{ - "ip_subnetworks": flattenAccessContextManagerAccessLevelBasicConditionsIpSubnetworks(original["ipSubnetworks"], d), - "required_access_levels": flattenAccessContextManagerAccessLevelBasicConditionsRequiredAccessLevels(original["requiredAccessLevels"], d), - "members": flattenAccessContextManagerAccessLevelBasicConditionsMembers(original["members"], d), - "negate": flattenAccessContextManagerAccessLevelBasicConditionsNegate(original["negate"], d), - "device_policy": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicy(original["devicePolicy"], d), + "ip_subnetworks": flattenAccessContextManagerAccessLevelBasicConditionsIpSubnetworks(original["ipSubnetworks"], d, config), + "required_access_levels": flattenAccessContextManagerAccessLevelBasicConditionsRequiredAccessLevels(original["requiredAccessLevels"], d, config), + "members": flattenAccessContextManagerAccessLevelBasicConditionsMembers(original["members"], d, config), + "negate": flattenAccessContextManagerAccessLevelBasicConditionsNegate(original["negate"], d, config), + "device_policy": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicy(original["devicePolicy"], d, config), }) } return transformed } -func flattenAccessContextManagerAccessLevelBasicConditionsIpSubnetworks(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsIpSubnetworks(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsRequiredAccessLevels(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsRequiredAccessLevels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsMembers(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsMembers(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsNegate(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsNegate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -517,32 +517,32 @@ func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicy(v interfa } transformed := make(map[string]interface{}) transformed["require_screen_lock"] = - flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireScreenLock(original["requireScreenLock"], d) + flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireScreenLock(original["requireScreenLock"], d, config) transformed["allowed_encryption_statuses"] = - flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedEncryptionStatuses(original["allowedEncryptionStatuses"], d) + flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedEncryptionStatuses(original["allowedEncryptionStatuses"], d, config) transformed["allowed_device_management_levels"] = - flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedDeviceManagementLevels(original["allowedDeviceManagementLevels"], d) + flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedDeviceManagementLevels(original["allowedDeviceManagementLevels"], d, config) transformed["os_constraints"] = - flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraints(original["osConstraints"], d) + flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraints(original["osConstraints"], d, config) transformed["require_admin_approval"] = - flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireAdminApproval(original["requireAdminApproval"], d) + flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireAdminApproval(original["requireAdminApproval"], d, config) transformed["require_corp_owned"] = - flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireCorpOwned(original["requireCorpOwned"], d) + flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireCorpOwned(original["requireCorpOwned"], d, config) return []interface{}{transformed} } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireScreenLock(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireScreenLock(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedEncryptionStatuses(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedEncryptionStatuses(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedDeviceManagementLevels(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedDeviceManagementLevels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraints(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraints(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -555,29 +555,29 @@ func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstrai continue } transformed = append(transformed, map[string]interface{}{ - "minimum_version": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(original["minimumVersion"], d), - "os_type": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(original["osType"], d), + "minimum_version": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(original["minimumVersion"], d, config), + "os_type": flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(original["osType"], d, config), }) } return transformed } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireAdminApproval(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireAdminApproval(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireCorpOwned(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireCorpOwned(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessLevelName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessLevelName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_access_context_manager_access_policy.go b/google/resource_access_context_manager_access_policy.go index fb3fbe3af1a..67230319dee 100644 --- a/google/resource_access_context_manager_access_policy.go +++ b/google/resource_access_context_manager_access_policy.go @@ -146,19 +146,19 @@ func resourceAccessContextManagerAccessPolicyRead(d *schema.ResourceData, meta i return handleNotFoundError(err, d, fmt.Sprintf("AccessContextManagerAccessPolicy %q", d.Id())) } - if err := d.Set("name", flattenAccessContextManagerAccessPolicyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenAccessContextManagerAccessPolicyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading AccessPolicy: %s", err) } - if err := d.Set("create_time", flattenAccessContextManagerAccessPolicyCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenAccessContextManagerAccessPolicyCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading AccessPolicy: %s", err) } - if err := d.Set("update_time", flattenAccessContextManagerAccessPolicyUpdateTime(res["updateTime"], d)); err != nil { + if err := d.Set("update_time", flattenAccessContextManagerAccessPolicyUpdateTime(res["updateTime"], d, config)); err != nil { return fmt.Errorf("Error reading AccessPolicy: %s", err) } - if err := d.Set("parent", flattenAccessContextManagerAccessPolicyParent(res["parent"], d)); err != nil { + if err := d.Set("parent", flattenAccessContextManagerAccessPolicyParent(res["parent"], d, config)); err != nil { return fmt.Errorf("Error reading AccessPolicy: %s", err) } - if err := d.Set("title", flattenAccessContextManagerAccessPolicyTitle(res["title"], d)); err != nil { + if err := d.Set("title", flattenAccessContextManagerAccessPolicyTitle(res["title"], d, config)); err != nil { return fmt.Errorf("Error reading AccessPolicy: %s", err) } @@ -256,26 +256,26 @@ func resourceAccessContextManagerAccessPolicyImport(d *schema.ResourceData, meta return []*schema.ResourceData{d}, nil } -func flattenAccessContextManagerAccessPolicyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessPolicyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenAccessContextManagerAccessPolicyCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessPolicyCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessPolicyUpdateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessPolicyUpdateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessPolicyParent(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessPolicyParent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerAccessPolicyTitle(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerAccessPolicyTitle(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_access_context_manager_service_perimeter.go b/google/resource_access_context_manager_service_perimeter.go index 990630d4e03..dd2580be8b0 100644 --- a/google/resource_access_context_manager_service_perimeter.go +++ b/google/resource_access_context_manager_service_perimeter.go @@ -252,25 +252,25 @@ func resourceAccessContextManagerServicePerimeterRead(d *schema.ResourceData, me return handleNotFoundError(err, d, fmt.Sprintf("AccessContextManagerServicePerimeter %q", d.Id())) } - if err := d.Set("title", flattenAccessContextManagerServicePerimeterTitle(res["title"], d)); err != nil { + if err := d.Set("title", flattenAccessContextManagerServicePerimeterTitle(res["title"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } - if err := d.Set("description", flattenAccessContextManagerServicePerimeterDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenAccessContextManagerServicePerimeterDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } - if err := d.Set("create_time", flattenAccessContextManagerServicePerimeterCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenAccessContextManagerServicePerimeterCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } - if err := d.Set("update_time", flattenAccessContextManagerServicePerimeterUpdateTime(res["updateTime"], d)); err != nil { + if err := d.Set("update_time", flattenAccessContextManagerServicePerimeterUpdateTime(res["updateTime"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } - if err := d.Set("perimeter_type", flattenAccessContextManagerServicePerimeterPerimeterType(res["perimeterType"], d)); err != nil { + if err := d.Set("perimeter_type", flattenAccessContextManagerServicePerimeterPerimeterType(res["perimeterType"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } - if err := d.Set("status", flattenAccessContextManagerServicePerimeterStatus(res["status"], d)); err != nil { + if err := d.Set("status", flattenAccessContextManagerServicePerimeterStatus(res["status"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } - if err := d.Set("name", flattenAccessContextManagerServicePerimeterName(res["name"], d)); err != nil { + if err := d.Set("name", flattenAccessContextManagerServicePerimeterName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ServicePerimeter: %s", err) } @@ -390,23 +390,23 @@ func resourceAccessContextManagerServicePerimeterImport(d *schema.ResourceData, return []*schema.ResourceData{d}, nil } -func flattenAccessContextManagerServicePerimeterTitle(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterTitle(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterUpdateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterUpdateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterPerimeterType(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterPerimeterType(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return "PERIMETER_TYPE_REGULAR" } @@ -414,7 +414,7 @@ func flattenAccessContextManagerServicePerimeterPerimeterType(v interface{}, d * return v } -func flattenAccessContextManagerServicePerimeterStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -424,26 +424,26 @@ func flattenAccessContextManagerServicePerimeterStatus(v interface{}, d *schema. } transformed := make(map[string]interface{}) transformed["resources"] = - flattenAccessContextManagerServicePerimeterStatusResources(original["resources"], d) + flattenAccessContextManagerServicePerimeterStatusResources(original["resources"], d, config) transformed["access_levels"] = - flattenAccessContextManagerServicePerimeterStatusAccessLevels(original["accessLevels"], d) + flattenAccessContextManagerServicePerimeterStatusAccessLevels(original["accessLevels"], d, config) transformed["restricted_services"] = - flattenAccessContextManagerServicePerimeterStatusRestrictedServices(original["restrictedServices"], d) + flattenAccessContextManagerServicePerimeterStatusRestrictedServices(original["restrictedServices"], d, config) return []interface{}{transformed} } -func flattenAccessContextManagerServicePerimeterStatusResources(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterStatusResources(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterStatusAccessLevels(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterStatusAccessLevels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterStatusRestrictedServices(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterStatusRestrictedServices(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAccessContextManagerServicePerimeterName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAccessContextManagerServicePerimeterName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_app_engine_application_url_dispatch_rules.go b/google/resource_app_engine_application_url_dispatch_rules.go index e28b2a4c735..8897c9bfc55 100644 --- a/google/resource_app_engine_application_url_dispatch_rules.go +++ b/google/resource_app_engine_application_url_dispatch_rules.go @@ -155,7 +155,7 @@ func resourceAppEngineApplicationUrlDispatchRulesRead(d *schema.ResourceData, me return fmt.Errorf("Error reading ApplicationUrlDispatchRules: %s", err) } - if err := d.Set("dispatch_rules", flattenAppEngineApplicationUrlDispatchRulesDispatchRules(res["dispatchRules"], d)); err != nil { + if err := d.Set("dispatch_rules", flattenAppEngineApplicationUrlDispatchRulesDispatchRules(res["dispatchRules"], d, config)); err != nil { return fmt.Errorf("Error reading ApplicationUrlDispatchRules: %s", err) } @@ -266,7 +266,7 @@ func resourceAppEngineApplicationUrlDispatchRulesImport(d *schema.ResourceData, return []*schema.ResourceData{d}, nil } -func flattenAppEngineApplicationUrlDispatchRulesDispatchRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineApplicationUrlDispatchRulesDispatchRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -279,22 +279,22 @@ func flattenAppEngineApplicationUrlDispatchRulesDispatchRules(v interface{}, d * continue } transformed = append(transformed, map[string]interface{}{ - "domain": flattenAppEngineApplicationUrlDispatchRulesDispatchRulesDomain(original["domain"], d), - "path": flattenAppEngineApplicationUrlDispatchRulesDispatchRulesPath(original["path"], d), - "service": flattenAppEngineApplicationUrlDispatchRulesDispatchRulesService(original["service"], d), + "domain": flattenAppEngineApplicationUrlDispatchRulesDispatchRulesDomain(original["domain"], d, config), + "path": flattenAppEngineApplicationUrlDispatchRulesDispatchRulesPath(original["path"], d, config), + "service": flattenAppEngineApplicationUrlDispatchRulesDispatchRulesService(original["service"], d, config), }) } return transformed } -func flattenAppEngineApplicationUrlDispatchRulesDispatchRulesDomain(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineApplicationUrlDispatchRulesDispatchRulesDomain(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineApplicationUrlDispatchRulesDispatchRulesPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineApplicationUrlDispatchRulesDispatchRulesPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineApplicationUrlDispatchRulesDispatchRulesService(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineApplicationUrlDispatchRulesDispatchRulesService(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_app_engine_domain_mapping.go b/google/resource_app_engine_domain_mapping.go index a555c3b9cb5..62cc1bae099 100644 --- a/google/resource_app_engine_domain_mapping.go +++ b/google/resource_app_engine_domain_mapping.go @@ -225,16 +225,16 @@ func resourceAppEngineDomainMappingRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("name", flattenAppEngineDomainMappingName(res["name"], d)); err != nil { + if err := d.Set("name", flattenAppEngineDomainMappingName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("ssl_settings", flattenAppEngineDomainMappingSslSettings(res["sslSettings"], d)); err != nil { + if err := d.Set("ssl_settings", flattenAppEngineDomainMappingSslSettings(res["sslSettings"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("resource_records", flattenAppEngineDomainMappingResourceRecords(res["resourceRecords"], d)); err != nil { + if err := d.Set("resource_records", flattenAppEngineDomainMappingResourceRecords(res["resourceRecords"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("domain_name", flattenAppEngineDomainMappingDomainName(res["id"], d)); err != nil { + if err := d.Set("domain_name", flattenAppEngineDomainMappingDomainName(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } @@ -344,11 +344,11 @@ func resourceAppEngineDomainMappingImport(d *schema.ResourceData, meta interface return []*schema.ResourceData{d}, nil } -func flattenAppEngineDomainMappingName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingSslSettings(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingSslSettings(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -358,26 +358,26 @@ func flattenAppEngineDomainMappingSslSettings(v interface{}, d *schema.ResourceD } transformed := make(map[string]interface{}) transformed["certificate_id"] = - flattenAppEngineDomainMappingSslSettingsCertificateId(original["certificateId"], d) + flattenAppEngineDomainMappingSslSettingsCertificateId(original["certificateId"], d, config) transformed["ssl_management_type"] = - flattenAppEngineDomainMappingSslSettingsSslManagementType(original["sslManagementType"], d) + flattenAppEngineDomainMappingSslSettingsSslManagementType(original["sslManagementType"], d, config) transformed["pending_managed_certificate_id"] = - flattenAppEngineDomainMappingSslSettingsPendingManagedCertificateId(original["pendingManagedCertificateId"], d) + flattenAppEngineDomainMappingSslSettingsPendingManagedCertificateId(original["pendingManagedCertificateId"], d, config) return []interface{}{transformed} } -func flattenAppEngineDomainMappingSslSettingsCertificateId(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingSslSettingsCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingSslSettingsSslManagementType(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingSslSettingsSslManagementType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingSslSettingsPendingManagedCertificateId(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingSslSettingsPendingManagedCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingResourceRecords(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingResourceRecords(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -390,26 +390,26 @@ func flattenAppEngineDomainMappingResourceRecords(v interface{}, d *schema.Resou continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenAppEngineDomainMappingResourceRecordsName(original["name"], d), - "rrdata": flattenAppEngineDomainMappingResourceRecordsRrdata(original["rrdata"], d), - "type": flattenAppEngineDomainMappingResourceRecordsType(original["type"], d), + "name": flattenAppEngineDomainMappingResourceRecordsName(original["name"], d, config), + "rrdata": flattenAppEngineDomainMappingResourceRecordsRrdata(original["rrdata"], d, config), + "type": flattenAppEngineDomainMappingResourceRecordsType(original["type"], d, config), }) } return transformed } -func flattenAppEngineDomainMappingResourceRecordsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingResourceRecordsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingResourceRecordsRrdata(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingResourceRecordsRrdata(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingResourceRecordsType(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingResourceRecordsType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineDomainMappingDomainName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineDomainMappingDomainName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_app_engine_firewall_rule.go b/google/resource_app_engine_firewall_rule.go index 1a0dc61f591..b4e98db215d 100644 --- a/google/resource_app_engine_firewall_rule.go +++ b/google/resource_app_engine_firewall_rule.go @@ -157,16 +157,16 @@ func resourceAppEngineFirewallRuleRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading FirewallRule: %s", err) } - if err := d.Set("description", flattenAppEngineFirewallRuleDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenAppEngineFirewallRuleDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading FirewallRule: %s", err) } - if err := d.Set("source_range", flattenAppEngineFirewallRuleSourceRange(res["sourceRange"], d)); err != nil { + if err := d.Set("source_range", flattenAppEngineFirewallRuleSourceRange(res["sourceRange"], d, config)); err != nil { return fmt.Errorf("Error reading FirewallRule: %s", err) } - if err := d.Set("action", flattenAppEngineFirewallRuleAction(res["action"], d)); err != nil { + if err := d.Set("action", flattenAppEngineFirewallRuleAction(res["action"], d, config)); err != nil { return fmt.Errorf("Error reading FirewallRule: %s", err) } - if err := d.Set("priority", flattenAppEngineFirewallRulePriority(res["priority"], d)); err != nil { + if err := d.Set("priority", flattenAppEngineFirewallRulePriority(res["priority"], d, config)); err != nil { return fmt.Errorf("Error reading FirewallRule: %s", err) } @@ -290,19 +290,19 @@ func resourceAppEngineFirewallRuleImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenAppEngineFirewallRuleDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineFirewallRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineFirewallRuleSourceRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineFirewallRuleSourceRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineFirewallRuleAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineFirewallRuleAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineFirewallRulePriority(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineFirewallRulePriority(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { diff --git a/google/resource_app_engine_standard_app_version.go b/google/resource_app_engine_standard_app_version.go index 479a04cf7ad..ddd23a35164 100644 --- a/google/resource_app_engine_standard_app_version.go +++ b/google/resource_app_engine_standard_app_version.go @@ -441,22 +441,22 @@ func resourceAppEngineStandardAppVersionRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading StandardAppVersion: %s", err) } - if err := d.Set("name", flattenAppEngineStandardAppVersionName(res["name"], d)); err != nil { + if err := d.Set("name", flattenAppEngineStandardAppVersionName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading StandardAppVersion: %s", err) } - if err := d.Set("version_id", flattenAppEngineStandardAppVersionVersionId(res["id"], d)); err != nil { + if err := d.Set("version_id", flattenAppEngineStandardAppVersionVersionId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading StandardAppVersion: %s", err) } - if err := d.Set("runtime", flattenAppEngineStandardAppVersionRuntime(res["runtime"], d)); err != nil { + if err := d.Set("runtime", flattenAppEngineStandardAppVersionRuntime(res["runtime"], d, config)); err != nil { return fmt.Errorf("Error reading StandardAppVersion: %s", err) } - if err := d.Set("runtime_api_version", flattenAppEngineStandardAppVersionRuntimeApiVersion(res["runtimeApiVersion"], d)); err != nil { + if err := d.Set("runtime_api_version", flattenAppEngineStandardAppVersionRuntimeApiVersion(res["runtimeApiVersion"], d, config)); err != nil { return fmt.Errorf("Error reading StandardAppVersion: %s", err) } - if err := d.Set("handlers", flattenAppEngineStandardAppVersionHandlers(res["handlers"], d)); err != nil { + if err := d.Set("handlers", flattenAppEngineStandardAppVersionHandlers(res["handlers"], d, config)); err != nil { return fmt.Errorf("Error reading StandardAppVersion: %s", err) } - if err := d.Set("libraries", flattenAppEngineStandardAppVersionLibraries(res["libraries"], d)); err != nil { + if err := d.Set("libraries", flattenAppEngineStandardAppVersionLibraries(res["libraries"], d, config)); err != nil { return fmt.Errorf("Error reading StandardAppVersion: %s", err) } @@ -651,23 +651,23 @@ func resourceAppEngineStandardAppVersionImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenAppEngineStandardAppVersionName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionVersionId(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionVersionId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionRuntime(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionRuntime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionRuntimeApiVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionRuntimeApiVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlers(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -680,38 +680,38 @@ func flattenAppEngineStandardAppVersionHandlers(v interface{}, d *schema.Resourc continue } transformed = append(transformed, map[string]interface{}{ - "url_regex": flattenAppEngineStandardAppVersionHandlersUrlRegex(original["urlRegex"], d), - "security_level": flattenAppEngineStandardAppVersionHandlersSecurityLevel(original["securityLevel"], d), - "login": flattenAppEngineStandardAppVersionHandlersLogin(original["login"], d), - "auth_fail_action": flattenAppEngineStandardAppVersionHandlersAuthFailAction(original["authFailAction"], d), - "redirect_http_response_code": flattenAppEngineStandardAppVersionHandlersRedirectHttpResponseCode(original["redirectHttpResponseCode"], d), - "script": flattenAppEngineStandardAppVersionHandlersScript(original["script"], d), - "static_files": flattenAppEngineStandardAppVersionHandlersStaticFiles(original["staticFiles"], d), + "url_regex": flattenAppEngineStandardAppVersionHandlersUrlRegex(original["urlRegex"], d, config), + "security_level": flattenAppEngineStandardAppVersionHandlersSecurityLevel(original["securityLevel"], d, config), + "login": flattenAppEngineStandardAppVersionHandlersLogin(original["login"], d, config), + "auth_fail_action": flattenAppEngineStandardAppVersionHandlersAuthFailAction(original["authFailAction"], d, config), + "redirect_http_response_code": flattenAppEngineStandardAppVersionHandlersRedirectHttpResponseCode(original["redirectHttpResponseCode"], d, config), + "script": flattenAppEngineStandardAppVersionHandlersScript(original["script"], d, config), + "static_files": flattenAppEngineStandardAppVersionHandlersStaticFiles(original["staticFiles"], d, config), }) } return transformed } -func flattenAppEngineStandardAppVersionHandlersUrlRegex(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersUrlRegex(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersSecurityLevel(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersSecurityLevel(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersLogin(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersLogin(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersAuthFailAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersAuthFailAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersRedirectHttpResponseCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersRedirectHttpResponseCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersScript(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersScript(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -721,14 +721,14 @@ func flattenAppEngineStandardAppVersionHandlersScript(v interface{}, d *schema.R } transformed := make(map[string]interface{}) transformed["script_path"] = - flattenAppEngineStandardAppVersionHandlersScriptScriptPath(original["scriptPath"], d) + flattenAppEngineStandardAppVersionHandlersScriptScriptPath(original["scriptPath"], d, config) return []interface{}{transformed} } -func flattenAppEngineStandardAppVersionHandlersScriptScriptPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersScriptScriptPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFiles(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFiles(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -738,50 +738,50 @@ func flattenAppEngineStandardAppVersionHandlersStaticFiles(v interface{}, d *sch } transformed := make(map[string]interface{}) transformed["path"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesPath(original["path"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesPath(original["path"], d, config) transformed["upload_path_regex"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesUploadPathRegex(original["uploadPathRegex"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesUploadPathRegex(original["uploadPathRegex"], d, config) transformed["http_headers"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesHttpHeaders(original["httpHeaders"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesHttpHeaders(original["httpHeaders"], d, config) transformed["mime_type"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesMimeType(original["mimeType"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesMimeType(original["mimeType"], d, config) transformed["expiration"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesExpiration(original["expiration"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesExpiration(original["expiration"], d, config) transformed["require_matching_file"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesRequireMatchingFile(original["requireMatchingFile"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesRequireMatchingFile(original["requireMatchingFile"], d, config) transformed["application_readable"] = - flattenAppEngineStandardAppVersionHandlersStaticFilesApplicationReadable(original["applicationReadable"], d) + flattenAppEngineStandardAppVersionHandlersStaticFilesApplicationReadable(original["applicationReadable"], d, config) return []interface{}{transformed} } -func flattenAppEngineStandardAppVersionHandlersStaticFilesPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFilesUploadPathRegex(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesUploadPathRegex(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFilesHttpHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesHttpHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFilesMimeType(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesMimeType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFilesExpiration(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesExpiration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFilesRequireMatchingFile(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesRequireMatchingFile(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionHandlersStaticFilesApplicationReadable(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionHandlersStaticFilesApplicationReadable(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionLibraries(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionLibraries(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -794,17 +794,17 @@ func flattenAppEngineStandardAppVersionLibraries(v interface{}, d *schema.Resour continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenAppEngineStandardAppVersionLibrariesName(original["name"], d), - "version": flattenAppEngineStandardAppVersionLibrariesVersion(original["version"], d), + "name": flattenAppEngineStandardAppVersionLibrariesName(original["name"], d, config), + "version": flattenAppEngineStandardAppVersionLibrariesVersion(original["version"], d, config), }) } return transformed } -func flattenAppEngineStandardAppVersionLibrariesName(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionLibrariesName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenAppEngineStandardAppVersionLibrariesVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenAppEngineStandardAppVersionLibrariesVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_big_query_dataset.go b/google/resource_big_query_dataset.go index d4759a48899..c2afaff2be9 100644 --- a/google/resource_big_query_dataset.go +++ b/google/resource_big_query_dataset.go @@ -415,15 +415,15 @@ func resourceBigQueryDatasetRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("access", flattenBigQueryDatasetAccess(res["access"], d)); err != nil { + if err := d.Set("access", flattenBigQueryDatasetAccess(res["access"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("creation_time", flattenBigQueryDatasetCreationTime(res["creationTime"], d)); err != nil { + if err := d.Set("creation_time", flattenBigQueryDatasetCreationTime(res["creationTime"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } // Terraform must set the top level schema field, but since this object contains collapsed properties // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. - if flattenedProp := flattenBigQueryDatasetDatasetReference(res["datasetReference"], d); flattenedProp != nil { + if flattenedProp := flattenBigQueryDatasetDatasetReference(res["datasetReference"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -431,31 +431,31 @@ func resourceBigQueryDatasetRead(d *schema.ResourceData, meta interface{}) error } } } - if err := d.Set("default_table_expiration_ms", flattenBigQueryDatasetDefaultTableExpirationMs(res["defaultTableExpirationMs"], d)); err != nil { + if err := d.Set("default_table_expiration_ms", flattenBigQueryDatasetDefaultTableExpirationMs(res["defaultTableExpirationMs"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("default_partition_expiration_ms", flattenBigQueryDatasetDefaultPartitionExpirationMs(res["defaultPartitionExpirationMs"], d)); err != nil { + if err := d.Set("default_partition_expiration_ms", flattenBigQueryDatasetDefaultPartitionExpirationMs(res["defaultPartitionExpirationMs"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("description", flattenBigQueryDatasetDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenBigQueryDatasetDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("etag", flattenBigQueryDatasetEtag(res["etag"], d)); err != nil { + if err := d.Set("etag", flattenBigQueryDatasetEtag(res["etag"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("friendly_name", flattenBigQueryDatasetFriendlyName(res["friendlyName"], d)); err != nil { + if err := d.Set("friendly_name", flattenBigQueryDatasetFriendlyName(res["friendlyName"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("labels", flattenBigQueryDatasetLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenBigQueryDatasetLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("last_modified_time", flattenBigQueryDatasetLastModifiedTime(res["lastModifiedTime"], d)); err != nil { + if err := d.Set("last_modified_time", flattenBigQueryDatasetLastModifiedTime(res["lastModifiedTime"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("location", flattenBigQueryDatasetLocation(res["location"], d)); err != nil { + if err := d.Set("location", flattenBigQueryDatasetLocation(res["location"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("default_encryption_configuration", flattenBigQueryDatasetDefaultEncryptionConfiguration(res["defaultEncryptionConfiguration"], d)); err != nil { + if err := d.Set("default_encryption_configuration", flattenBigQueryDatasetDefaultEncryptionConfiguration(res["defaultEncryptionConfiguration"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -592,7 +592,7 @@ func resourceBigQueryDatasetImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenBigQueryDatasetAccess(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccess(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -605,37 +605,37 @@ func flattenBigQueryDatasetAccess(v interface{}, d *schema.ResourceData) interfa continue } transformed.Add(map[string]interface{}{ - "domain": flattenBigQueryDatasetAccessDomain(original["domain"], d), - "group_by_email": flattenBigQueryDatasetAccessGroupByEmail(original["groupByEmail"], d), - "role": flattenBigQueryDatasetAccessRole(original["role"], d), - "special_group": flattenBigQueryDatasetAccessSpecialGroup(original["specialGroup"], d), - "user_by_email": flattenBigQueryDatasetAccessUserByEmail(original["userByEmail"], d), - "view": flattenBigQueryDatasetAccessView(original["view"], d), + "domain": flattenBigQueryDatasetAccessDomain(original["domain"], d, config), + "group_by_email": flattenBigQueryDatasetAccessGroupByEmail(original["groupByEmail"], d, config), + "role": flattenBigQueryDatasetAccessRole(original["role"], d, config), + "special_group": flattenBigQueryDatasetAccessSpecialGroup(original["specialGroup"], d, config), + "user_by_email": flattenBigQueryDatasetAccessUserByEmail(original["userByEmail"], d, config), + "view": flattenBigQueryDatasetAccessView(original["view"], d, config), }) } return transformed } -func flattenBigQueryDatasetAccessDomain(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessDomain(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessGroupByEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessGroupByEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessRole(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessRole(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessSpecialGroup(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessSpecialGroup(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessUserByEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessUserByEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessView(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessView(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -645,26 +645,26 @@ func flattenBigQueryDatasetAccessView(v interface{}, d *schema.ResourceData) int } transformed := make(map[string]interface{}) transformed["dataset_id"] = - flattenBigQueryDatasetAccessViewDatasetId(original["datasetId"], d) + flattenBigQueryDatasetAccessViewDatasetId(original["datasetId"], d, config) transformed["project_id"] = - flattenBigQueryDatasetAccessViewProjectId(original["projectId"], d) + flattenBigQueryDatasetAccessViewProjectId(original["projectId"], d, config) transformed["table_id"] = - flattenBigQueryDatasetAccessViewTableId(original["tableId"], d) + flattenBigQueryDatasetAccessViewTableId(original["tableId"], d, config) return []interface{}{transformed} } -func flattenBigQueryDatasetAccessViewDatasetId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessViewDatasetId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessViewProjectId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessViewProjectId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetAccessViewTableId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetAccessViewTableId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetCreationTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetCreationTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -674,7 +674,7 @@ func flattenBigQueryDatasetCreationTime(v interface{}, d *schema.ResourceData) i return v } -func flattenBigQueryDatasetDatasetReference(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDatasetReference(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -684,14 +684,14 @@ func flattenBigQueryDatasetDatasetReference(v interface{}, d *schema.ResourceDat } transformed := make(map[string]interface{}) transformed["dataset_id"] = - flattenBigQueryDatasetDatasetReferenceDatasetId(original["datasetId"], d) + flattenBigQueryDatasetDatasetReferenceDatasetId(original["datasetId"], d, config) return []interface{}{transformed} } -func flattenBigQueryDatasetDatasetReferenceDatasetId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDatasetReferenceDatasetId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetDefaultTableExpirationMs(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDefaultTableExpirationMs(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -701,7 +701,7 @@ func flattenBigQueryDatasetDefaultTableExpirationMs(v interface{}, d *schema.Res return v } -func flattenBigQueryDatasetDefaultPartitionExpirationMs(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDefaultPartitionExpirationMs(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -711,23 +711,23 @@ func flattenBigQueryDatasetDefaultPartitionExpirationMs(v interface{}, d *schema return v } -func flattenBigQueryDatasetDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetEtag(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetEtag(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetFriendlyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetFriendlyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigQueryDatasetLastModifiedTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetLastModifiedTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -740,14 +740,14 @@ func flattenBigQueryDatasetLastModifiedTime(v interface{}, d *schema.ResourceDat // Older Datasets in BigQuery have no Location set in the API response. This may be an issue when importing // datasets created before BigQuery was available in multiple zones. We can safely assume that these datasets // are in the US, as this was the default at the time. -func flattenBigQueryDatasetLocation(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetLocation(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return "US" } return v } -func flattenBigQueryDatasetDefaultEncryptionConfiguration(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDefaultEncryptionConfiguration(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -757,10 +757,10 @@ func flattenBigQueryDatasetDefaultEncryptionConfiguration(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["kms_key_name"] = - flattenBigQueryDatasetDefaultEncryptionConfigurationKmsKeyName(original["kmsKeyName"], d) + flattenBigQueryDatasetDefaultEncryptionConfigurationKmsKeyName(original["kmsKeyName"], d, config) return []interface{}{transformed} } -func flattenBigQueryDatasetDefaultEncryptionConfigurationKmsKeyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigQueryDatasetDefaultEncryptionConfigurationKmsKeyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_bigquery_data_transfer_config.go b/google/resource_bigquery_data_transfer_config.go index e8f2969d97b..e161c12598d 100644 --- a/google/resource_bigquery_data_transfer_config.go +++ b/google/resource_bigquery_data_transfer_config.go @@ -221,28 +221,28 @@ func resourceBigqueryDataTransferConfigRead(d *schema.ResourceData, meta interfa return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("display_name", flattenBigqueryDataTransferConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenBigqueryDataTransferConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("name", flattenBigqueryDataTransferConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenBigqueryDataTransferConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("destination_dataset_id", flattenBigqueryDataTransferConfigDestinationDatasetId(res["destinationDatasetId"], d)); err != nil { + if err := d.Set("destination_dataset_id", flattenBigqueryDataTransferConfigDestinationDatasetId(res["destinationDatasetId"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("data_source_id", flattenBigqueryDataTransferConfigDataSourceId(res["dataSourceId"], d)); err != nil { + if err := d.Set("data_source_id", flattenBigqueryDataTransferConfigDataSourceId(res["dataSourceId"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("schedule", flattenBigqueryDataTransferConfigSchedule(res["schedule"], d)); err != nil { + if err := d.Set("schedule", flattenBigqueryDataTransferConfigSchedule(res["schedule"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("data_refresh_window_days", flattenBigqueryDataTransferConfigDataRefreshWindowDays(res["dataRefreshWindowDays"], d)); err != nil { + if err := d.Set("data_refresh_window_days", flattenBigqueryDataTransferConfigDataRefreshWindowDays(res["dataRefreshWindowDays"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("disabled", flattenBigqueryDataTransferConfigDisabled(res["disabled"], d)); err != nil { + if err := d.Set("disabled", flattenBigqueryDataTransferConfigDisabled(res["disabled"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } - if err := d.Set("params", flattenBigqueryDataTransferConfigParams(res["params"], d)); err != nil { + if err := d.Set("params", flattenBigqueryDataTransferConfigParams(res["params"], d, config)); err != nil { return fmt.Errorf("Error reading Config: %s", err) } @@ -368,27 +368,27 @@ func resourceBigqueryDataTransferConfigImport(d *schema.ResourceData, meta inter return []*schema.ResourceData{d}, nil } -func flattenBigqueryDataTransferConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigqueryDataTransferConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigqueryDataTransferConfigDestinationDatasetId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigDestinationDatasetId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigqueryDataTransferConfigDataSourceId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigDataSourceId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigqueryDataTransferConfigSchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigSchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigqueryDataTransferConfigDataRefreshWindowDays(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigDataRefreshWindowDays(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -398,11 +398,11 @@ func flattenBigqueryDataTransferConfigDataRefreshWindowDays(v interface{}, d *sc return v } -func flattenBigqueryDataTransferConfigDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigqueryDataTransferConfigParams(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigqueryDataTransferConfigParams(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_bigtable_app_profile.go b/google/resource_bigtable_app_profile.go index bb8bae19fd9..f70c838561e 100644 --- a/google/resource_bigtable_app_profile.go +++ b/google/resource_bigtable_app_profile.go @@ -184,16 +184,16 @@ func resourceBigtableAppProfileRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error reading AppProfile: %s", err) } - if err := d.Set("name", flattenBigtableAppProfileName(res["name"], d)); err != nil { + if err := d.Set("name", flattenBigtableAppProfileName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading AppProfile: %s", err) } - if err := d.Set("description", flattenBigtableAppProfileDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenBigtableAppProfileDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading AppProfile: %s", err) } - if err := d.Set("multi_cluster_routing_use_any", flattenBigtableAppProfileMultiClusterRoutingUseAny(res["multiClusterRoutingUseAny"], d)); err != nil { + if err := d.Set("multi_cluster_routing_use_any", flattenBigtableAppProfileMultiClusterRoutingUseAny(res["multiClusterRoutingUseAny"], d, config)); err != nil { return fmt.Errorf("Error reading AppProfile: %s", err) } - if err := d.Set("single_cluster_routing", flattenBigtableAppProfileSingleClusterRouting(res["singleClusterRouting"], d)); err != nil { + if err := d.Set("single_cluster_routing", flattenBigtableAppProfileSingleClusterRouting(res["singleClusterRouting"], d, config)); err != nil { return fmt.Errorf("Error reading AppProfile: %s", err) } @@ -287,19 +287,19 @@ func resourceBigtableAppProfileImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenBigtableAppProfileName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigtableAppProfileName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigtableAppProfileDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigtableAppProfileDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigtableAppProfileMultiClusterRoutingUseAny(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigtableAppProfileMultiClusterRoutingUseAny(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v != nil } -func flattenBigtableAppProfileSingleClusterRouting(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigtableAppProfileSingleClusterRouting(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -309,16 +309,16 @@ func flattenBigtableAppProfileSingleClusterRouting(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["cluster_id"] = - flattenBigtableAppProfileSingleClusterRoutingClusterId(original["clusterId"], d) + flattenBigtableAppProfileSingleClusterRoutingClusterId(original["clusterId"], d, config) transformed["allow_transactional_writes"] = - flattenBigtableAppProfileSingleClusterRoutingAllowTransactionalWrites(original["allowTransactionalWrites"], d) + flattenBigtableAppProfileSingleClusterRoutingAllowTransactionalWrites(original["allowTransactionalWrites"], d, config) return []interface{}{transformed} } -func flattenBigtableAppProfileSingleClusterRoutingClusterId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigtableAppProfileSingleClusterRoutingClusterId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBigtableAppProfileSingleClusterRoutingAllowTransactionalWrites(v interface{}, d *schema.ResourceData) interface{} { +func flattenBigtableAppProfileSingleClusterRoutingAllowTransactionalWrites(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_binary_authorization_attestor.go b/google/resource_binary_authorization_attestor.go index 50b19ed6114..47967370b50 100644 --- a/google/resource_binary_authorization_attestor.go +++ b/google/resource_binary_authorization_attestor.go @@ -245,13 +245,13 @@ func resourceBinaryAuthorizationAttestorRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading Attestor: %s", err) } - if err := d.Set("name", flattenBinaryAuthorizationAttestorName(res["name"], d)); err != nil { + if err := d.Set("name", flattenBinaryAuthorizationAttestorName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Attestor: %s", err) } - if err := d.Set("description", flattenBinaryAuthorizationAttestorDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenBinaryAuthorizationAttestorDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Attestor: %s", err) } - if err := d.Set("attestation_authority_note", flattenBinaryAuthorizationAttestorAttestationAuthorityNote(res["userOwnedGrafeasNote"], d)); err != nil { + if err := d.Set("attestation_authority_note", flattenBinaryAuthorizationAttestorAttestationAuthorityNote(res["userOwnedGrafeasNote"], d, config)); err != nil { return fmt.Errorf("Error reading Attestor: %s", err) } @@ -346,18 +346,18 @@ func resourceBinaryAuthorizationAttestorImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenBinaryAuthorizationAttestorName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenBinaryAuthorizationAttestorDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -367,18 +367,18 @@ func flattenBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d } transformed := make(map[string]interface{}) transformed["note_reference"] = - flattenBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(original["noteReference"], d) + flattenBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(original["noteReference"], d, config) transformed["public_keys"] = - flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(original["publicKeys"], d) + flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(original["publicKeys"], d, config) transformed["delegation_service_account_email"] = - flattenBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationServiceAccountEmail(original["delegationServiceAccountEmail"], d) + flattenBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationServiceAccountEmail(original["delegationServiceAccountEmail"], d, config) return []interface{}{transformed} } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -391,27 +391,27 @@ func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v inte continue } transformed = append(transformed, map[string]interface{}{ - "comment": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(original["comment"], d), - "id": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(original["id"], d), - "ascii_armored_pgp_public_key": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(original["asciiArmoredPgpPublicKey"], d), - "pkix_public_key": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKey(original["pkixPublicKey"], d), + "comment": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(original["comment"], d, config), + "id": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(original["id"], d, config), + "ascii_armored_pgp_public_key": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(original["asciiArmoredPgpPublicKey"], d, config), + "pkix_public_key": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKey(original["pkixPublicKey"], d, config), }) } return transformed } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -421,20 +421,20 @@ func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPub } transformed := make(map[string]interface{}) transformed["public_key_pem"] = - flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeyPublicKeyPem(original["publicKeyPem"], d) + flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeyPublicKeyPem(original["publicKeyPem"], d, config) transformed["signature_algorithm"] = - flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeySignatureAlgorithm(original["signatureAlgorithm"], d) + flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeySignatureAlgorithm(original["signatureAlgorithm"], d, config) return []interface{}{transformed} } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeyPublicKeyPem(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeyPublicKeyPem(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeySignatureAlgorithm(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysPkixPublicKeySignatureAlgorithm(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationServiceAccountEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationServiceAccountEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_binary_authorization_policy.go b/google/resource_binary_authorization_policy.go index e7580bd14aa..70612407e9b 100644 --- a/google/resource_binary_authorization_policy.go +++ b/google/resource_binary_authorization_policy.go @@ -302,19 +302,19 @@ func resourceBinaryAuthorizationPolicyRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("description", flattenBinaryAuthorizationPolicyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenBinaryAuthorizationPolicyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("global_policy_evaluation_mode", flattenBinaryAuthorizationPolicyGlobalPolicyEvaluationMode(res["globalPolicyEvaluationMode"], d)); err != nil { + if err := d.Set("global_policy_evaluation_mode", flattenBinaryAuthorizationPolicyGlobalPolicyEvaluationMode(res["globalPolicyEvaluationMode"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("admission_whitelist_patterns", flattenBinaryAuthorizationPolicyAdmissionWhitelistPatterns(res["admissionWhitelistPatterns"], d)); err != nil { + if err := d.Set("admission_whitelist_patterns", flattenBinaryAuthorizationPolicyAdmissionWhitelistPatterns(res["admissionWhitelistPatterns"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("cluster_admission_rules", flattenBinaryAuthorizationPolicyClusterAdmissionRules(res["clusterAdmissionRules"], d)); err != nil { + if err := d.Set("cluster_admission_rules", flattenBinaryAuthorizationPolicyClusterAdmissionRules(res["clusterAdmissionRules"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("default_admission_rule", flattenBinaryAuthorizationPolicyDefaultAdmissionRule(res["defaultAdmissionRule"], d)); err != nil { + if err := d.Set("default_admission_rule", flattenBinaryAuthorizationPolicyDefaultAdmissionRule(res["defaultAdmissionRule"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } @@ -421,15 +421,15 @@ func resourceBinaryAuthorizationPolicyImport(d *schema.ResourceData, meta interf return []*schema.ResourceData{d}, nil } -func flattenBinaryAuthorizationPolicyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationPolicyGlobalPolicyEvaluationMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyGlobalPolicyEvaluationMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationPolicyAdmissionWhitelistPatterns(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyAdmissionWhitelistPatterns(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -442,16 +442,16 @@ func flattenBinaryAuthorizationPolicyAdmissionWhitelistPatterns(v interface{}, d continue } transformed = append(transformed, map[string]interface{}{ - "name_pattern": flattenBinaryAuthorizationPolicyAdmissionWhitelistPatternsNamePattern(original["namePattern"], d), + "name_pattern": flattenBinaryAuthorizationPolicyAdmissionWhitelistPatternsNamePattern(original["namePattern"], d, config), }) } return transformed } -func flattenBinaryAuthorizationPolicyAdmissionWhitelistPatternsNamePattern(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyAdmissionWhitelistPatternsNamePattern(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationPolicyClusterAdmissionRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyClusterAdmissionRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -461,29 +461,29 @@ func flattenBinaryAuthorizationPolicyClusterAdmissionRules(v interface{}, d *sch original := raw.(map[string]interface{}) transformed = append(transformed, map[string]interface{}{ "cluster": k, - "evaluation_mode": flattenBinaryAuthorizationPolicyClusterAdmissionRulesEvaluationMode(original["evaluationMode"], d), - "require_attestations_by": flattenBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(original["requireAttestationsBy"], d), - "enforcement_mode": flattenBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(original["enforcementMode"], d), + "evaluation_mode": flattenBinaryAuthorizationPolicyClusterAdmissionRulesEvaluationMode(original["evaluationMode"], d, config), + "require_attestations_by": flattenBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(original["requireAttestationsBy"], d, config), + "enforcement_mode": flattenBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(original["enforcementMode"], d, config), }) } return transformed } -func flattenBinaryAuthorizationPolicyClusterAdmissionRulesEvaluationMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyClusterAdmissionRulesEvaluationMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(selfLinkNameHash, v.([]interface{})) } -func flattenBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -493,25 +493,25 @@ func flattenBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["evaluation_mode"] = - flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEvaluationMode(original["evaluationMode"], d) + flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEvaluationMode(original["evaluationMode"], d, config) transformed["require_attestations_by"] = - flattenBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(original["requireAttestationsBy"], d) + flattenBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(original["requireAttestationsBy"], d, config) transformed["enforcement_mode"] = - flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(original["enforcementMode"], d) + flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(original["enforcementMode"], d, config) return []interface{}{transformed} } -func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEvaluationMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEvaluationMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(selfLinkNameHash, v.([]interface{})) } -func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_cloud_build_trigger.go b/google/resource_cloud_build_trigger.go index f4234e8617c..8d406d94eed 100644 --- a/google/resource_cloud_build_trigger.go +++ b/google/resource_cloud_build_trigger.go @@ -534,37 +534,37 @@ func resourceCloudBuildTriggerRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("trigger_id", flattenCloudBuildTriggerTriggerId(res["id"], d)); err != nil { + if err := d.Set("trigger_id", flattenCloudBuildTriggerTriggerId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("name", flattenCloudBuildTriggerName(res["name"], d)); err != nil { + if err := d.Set("name", flattenCloudBuildTriggerName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("description", flattenCloudBuildTriggerDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenCloudBuildTriggerDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("disabled", flattenCloudBuildTriggerDisabled(res["disabled"], d)); err != nil { + if err := d.Set("disabled", flattenCloudBuildTriggerDisabled(res["disabled"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("create_time", flattenCloudBuildTriggerCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenCloudBuildTriggerCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("substitutions", flattenCloudBuildTriggerSubstitutions(res["substitutions"], d)); err != nil { + if err := d.Set("substitutions", flattenCloudBuildTriggerSubstitutions(res["substitutions"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("filename", flattenCloudBuildTriggerFilename(res["filename"], d)); err != nil { + if err := d.Set("filename", flattenCloudBuildTriggerFilename(res["filename"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("ignored_files", flattenCloudBuildTriggerIgnoredFiles(res["ignoredFiles"], d)); err != nil { + if err := d.Set("ignored_files", flattenCloudBuildTriggerIgnoredFiles(res["ignoredFiles"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("included_files", flattenCloudBuildTriggerIncludedFiles(res["includedFiles"], d)); err != nil { + if err := d.Set("included_files", flattenCloudBuildTriggerIncludedFiles(res["includedFiles"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("trigger_template", flattenCloudBuildTriggerTriggerTemplate(res["triggerTemplate"], d)); err != nil { + if err := d.Set("trigger_template", flattenCloudBuildTriggerTriggerTemplate(res["triggerTemplate"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } - if err := d.Set("build", flattenCloudBuildTriggerBuild(res["build"], d)); err != nil { + if err := d.Set("build", flattenCloudBuildTriggerBuild(res["build"], d, config)); err != nil { return fmt.Errorf("Error reading Trigger: %s", err) } @@ -696,43 +696,43 @@ func resourceCloudBuildTriggerImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenCloudBuildTriggerTriggerId(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerSubstitutions(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerSubstitutions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerFilename(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerFilename(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerIgnoredFiles(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerIgnoredFiles(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerIncludedFiles(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerIncludedFiles(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerTriggerTemplate(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplate(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -742,44 +742,44 @@ func flattenCloudBuildTriggerTriggerTemplate(v interface{}, d *schema.ResourceDa } transformed := make(map[string]interface{}) transformed["project_id"] = - flattenCloudBuildTriggerTriggerTemplateProjectId(original["projectId"], d) + flattenCloudBuildTriggerTriggerTemplateProjectId(original["projectId"], d, config) transformed["repo_name"] = - flattenCloudBuildTriggerTriggerTemplateRepoName(original["repoName"], d) + flattenCloudBuildTriggerTriggerTemplateRepoName(original["repoName"], d, config) transformed["dir"] = - flattenCloudBuildTriggerTriggerTemplateDir(original["dir"], d) + flattenCloudBuildTriggerTriggerTemplateDir(original["dir"], d, config) transformed["branch_name"] = - flattenCloudBuildTriggerTriggerTemplateBranchName(original["branchName"], d) + flattenCloudBuildTriggerTriggerTemplateBranchName(original["branchName"], d, config) transformed["tag_name"] = - flattenCloudBuildTriggerTriggerTemplateTagName(original["tagName"], d) + flattenCloudBuildTriggerTriggerTemplateTagName(original["tagName"], d, config) transformed["commit_sha"] = - flattenCloudBuildTriggerTriggerTemplateCommitSha(original["commitSha"], d) + flattenCloudBuildTriggerTriggerTemplateCommitSha(original["commitSha"], d, config) return []interface{}{transformed} } -func flattenCloudBuildTriggerTriggerTemplateProjectId(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplateProjectId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerTriggerTemplateRepoName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplateRepoName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerTriggerTemplateDir(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplateDir(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerTriggerTemplateBranchName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplateBranchName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerTriggerTemplateTagName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplateTagName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerTriggerTemplateCommitSha(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerTriggerTemplateCommitSha(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuild(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuild(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -789,28 +789,28 @@ func flattenCloudBuildTriggerBuild(v interface{}, d *schema.ResourceData) interf } transformed := make(map[string]interface{}) transformed["tags"] = - flattenCloudBuildTriggerBuildTags(original["tags"], d) + flattenCloudBuildTriggerBuildTags(original["tags"], d, config) transformed["images"] = - flattenCloudBuildTriggerBuildImages(original["images"], d) + flattenCloudBuildTriggerBuildImages(original["images"], d, config) transformed["timeout"] = - flattenCloudBuildTriggerBuildTimeout(original["timeout"], d) + flattenCloudBuildTriggerBuildTimeout(original["timeout"], d, config) transformed["step"] = - flattenCloudBuildTriggerBuildStep(original["steps"], d) + flattenCloudBuildTriggerBuildStep(original["steps"], d, config) return []interface{}{transformed} } -func flattenCloudBuildTriggerBuildTags(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildTags(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildImages(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildImages(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStep(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStep(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -823,58 +823,58 @@ func flattenCloudBuildTriggerBuildStep(v interface{}, d *schema.ResourceData) in continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenCloudBuildTriggerBuildStepName(original["name"], d), - "args": flattenCloudBuildTriggerBuildStepArgs(original["args"], d), - "env": flattenCloudBuildTriggerBuildStepEnv(original["env"], d), - "id": flattenCloudBuildTriggerBuildStepId(original["id"], d), - "entrypoint": flattenCloudBuildTriggerBuildStepEntrypoint(original["entrypoint"], d), - "dir": flattenCloudBuildTriggerBuildStepDir(original["dir"], d), - "secret_env": flattenCloudBuildTriggerBuildStepSecretEnv(original["secretEnv"], d), - "timeout": flattenCloudBuildTriggerBuildStepTimeout(original["timeout"], d), - "timing": flattenCloudBuildTriggerBuildStepTiming(original["timing"], d), - "volumes": flattenCloudBuildTriggerBuildStepVolumes(original["volumes"], d), - "wait_for": flattenCloudBuildTriggerBuildStepWaitFor(original["waitFor"], d), + "name": flattenCloudBuildTriggerBuildStepName(original["name"], d, config), + "args": flattenCloudBuildTriggerBuildStepArgs(original["args"], d, config), + "env": flattenCloudBuildTriggerBuildStepEnv(original["env"], d, config), + "id": flattenCloudBuildTriggerBuildStepId(original["id"], d, config), + "entrypoint": flattenCloudBuildTriggerBuildStepEntrypoint(original["entrypoint"], d, config), + "dir": flattenCloudBuildTriggerBuildStepDir(original["dir"], d, config), + "secret_env": flattenCloudBuildTriggerBuildStepSecretEnv(original["secretEnv"], d, config), + "timeout": flattenCloudBuildTriggerBuildStepTimeout(original["timeout"], d, config), + "timing": flattenCloudBuildTriggerBuildStepTiming(original["timing"], d, config), + "volumes": flattenCloudBuildTriggerBuildStepVolumes(original["volumes"], d, config), + "wait_for": flattenCloudBuildTriggerBuildStepWaitFor(original["waitFor"], d, config), }) } return transformed } -func flattenCloudBuildTriggerBuildStepName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepArgs(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepArgs(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepEnv(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepEnv(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepId(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepEntrypoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepEntrypoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepDir(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepDir(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepSecretEnv(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepSecretEnv(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepTiming(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepTiming(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepVolumes(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepVolumes(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -887,21 +887,21 @@ func flattenCloudBuildTriggerBuildStepVolumes(v interface{}, d *schema.ResourceD continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenCloudBuildTriggerBuildStepVolumesName(original["name"], d), - "path": flattenCloudBuildTriggerBuildStepVolumesPath(original["path"], d), + "name": flattenCloudBuildTriggerBuildStepVolumesName(original["name"], d, config), + "path": flattenCloudBuildTriggerBuildStepVolumesPath(original["path"], d, config), }) } return transformed } -func flattenCloudBuildTriggerBuildStepVolumesName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepVolumesName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepVolumesPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepVolumesPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerBuildStepWaitFor(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerBuildStepWaitFor(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_cloud_run_domain_mapping.go b/google/resource_cloud_run_domain_mapping.go index 129731e94e0..a803cdff729 100644 --- a/google/resource_cloud_run_domain_mapping.go +++ b/google/resource_cloud_run_domain_mapping.go @@ -343,13 +343,13 @@ func resourceCloudRunDomainMappingRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("status", flattenCloudRunDomainMappingStatus(res["status"], d)); err != nil { + if err := d.Set("status", flattenCloudRunDomainMappingStatus(res["status"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("spec", flattenCloudRunDomainMappingSpec(res["spec"], d)); err != nil { + if err := d.Set("spec", flattenCloudRunDomainMappingSpec(res["spec"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } - if err := d.Set("metadata", flattenCloudRunDomainMappingMetadata(res["metadata"], d)); err != nil { + if err := d.Set("metadata", flattenCloudRunDomainMappingMetadata(res["metadata"], d, config)); err != nil { return fmt.Errorf("Error reading DomainMapping: %s", err) } @@ -401,7 +401,7 @@ func resourceCloudRunDomainMappingImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenCloudRunDomainMappingStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -411,16 +411,16 @@ func flattenCloudRunDomainMappingStatus(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["conditions"] = - flattenCloudRunDomainMappingStatusConditions(original["conditions"], d) + flattenCloudRunDomainMappingStatusConditions(original["conditions"], d, config) transformed["observed_generation"] = - flattenCloudRunDomainMappingStatusObservedGeneration(original["observedGeneration"], d) + flattenCloudRunDomainMappingStatusObservedGeneration(original["observedGeneration"], d, config) transformed["resource_records"] = - flattenCloudRunDomainMappingStatusResourceRecords(original["resourceRecords"], d) + flattenCloudRunDomainMappingStatusResourceRecords(original["resourceRecords"], d, config) transformed["mapped_route_name"] = - flattenCloudRunDomainMappingStatusMappedRouteName(original["mappedRouteName"], d) + flattenCloudRunDomainMappingStatusMappedRouteName(original["mappedRouteName"], d, config) return []interface{}{transformed} } -func flattenCloudRunDomainMappingStatusConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -433,31 +433,31 @@ func flattenCloudRunDomainMappingStatusConditions(v interface{}, d *schema.Resou continue } transformed = append(transformed, map[string]interface{}{ - "message": flattenCloudRunDomainMappingStatusConditionsMessage(original["message"], d), - "status": flattenCloudRunDomainMappingStatusConditionsStatus(original["status"], d), - "reason": flattenCloudRunDomainMappingStatusConditionsReason(original["reason"], d), - "type": flattenCloudRunDomainMappingStatusConditionsType(original["type"], d), + "message": flattenCloudRunDomainMappingStatusConditionsMessage(original["message"], d, config), + "status": flattenCloudRunDomainMappingStatusConditionsStatus(original["status"], d, config), + "reason": flattenCloudRunDomainMappingStatusConditionsReason(original["reason"], d, config), + "type": flattenCloudRunDomainMappingStatusConditionsType(original["type"], d, config), }) } return transformed } -func flattenCloudRunDomainMappingStatusConditionsMessage(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusConditionsMessage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusConditionsStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusConditionsStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusConditionsReason(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusConditionsReason(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusConditionsType(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusConditionsType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusObservedGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusObservedGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -467,7 +467,7 @@ func flattenCloudRunDomainMappingStatusObservedGeneration(v interface{}, d *sche return v } -func flattenCloudRunDomainMappingStatusResourceRecords(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusResourceRecords(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -480,30 +480,30 @@ func flattenCloudRunDomainMappingStatusResourceRecords(v interface{}, d *schema. continue } transformed = append(transformed, map[string]interface{}{ - "type": flattenCloudRunDomainMappingStatusResourceRecordsType(original["type"], d), - "rrdata": flattenCloudRunDomainMappingStatusResourceRecordsRrdata(original["rrdata"], d), - "name": flattenCloudRunDomainMappingStatusResourceRecordsName(original["name"], d), + "type": flattenCloudRunDomainMappingStatusResourceRecordsType(original["type"], d, config), + "rrdata": flattenCloudRunDomainMappingStatusResourceRecordsRrdata(original["rrdata"], d, config), + "name": flattenCloudRunDomainMappingStatusResourceRecordsName(original["name"], d, config), }) } return transformed } -func flattenCloudRunDomainMappingStatusResourceRecordsType(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusResourceRecordsType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusResourceRecordsRrdata(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusResourceRecordsRrdata(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusResourceRecordsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusResourceRecordsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingStatusMappedRouteName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingStatusMappedRouteName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingSpec(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingSpec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -513,26 +513,26 @@ func flattenCloudRunDomainMappingSpec(v interface{}, d *schema.ResourceData) int } transformed := make(map[string]interface{}) transformed["force_override"] = - flattenCloudRunDomainMappingSpecForceOverride(original["forceOverride"], d) + flattenCloudRunDomainMappingSpecForceOverride(original["forceOverride"], d, config) transformed["route_name"] = - flattenCloudRunDomainMappingSpecRouteName(original["routeName"], d) + flattenCloudRunDomainMappingSpecRouteName(original["routeName"], d, config) transformed["certificate_mode"] = - flattenCloudRunDomainMappingSpecCertificateMode(original["certificateMode"], d) + flattenCloudRunDomainMappingSpecCertificateMode(original["certificateMode"], d, config) return []interface{}{transformed} } -func flattenCloudRunDomainMappingSpecForceOverride(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingSpecForceOverride(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingSpecRouteName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingSpecRouteName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingSpecCertificateMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingSpecCertificateMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingMetadata(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadata(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -542,26 +542,26 @@ func flattenCloudRunDomainMappingMetadata(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["labels"] = - flattenCloudRunDomainMappingMetadataLabels(original["labels"], d) + flattenCloudRunDomainMappingMetadataLabels(original["labels"], d, config) transformed["generation"] = - flattenCloudRunDomainMappingMetadataGeneration(original["generation"], d) + flattenCloudRunDomainMappingMetadataGeneration(original["generation"], d, config) transformed["resource_version"] = - flattenCloudRunDomainMappingMetadataResourceVersion(original["resourceVersion"], d) + flattenCloudRunDomainMappingMetadataResourceVersion(original["resourceVersion"], d, config) transformed["self_link"] = - flattenCloudRunDomainMappingMetadataSelfLink(original["selfLink"], d) + flattenCloudRunDomainMappingMetadataSelfLink(original["selfLink"], d, config) transformed["uid"] = - flattenCloudRunDomainMappingMetadataUid(original["uid"], d) + flattenCloudRunDomainMappingMetadataUid(original["uid"], d, config) transformed["namespace"] = - flattenCloudRunDomainMappingMetadataNamespace(original["namespace"], d) + flattenCloudRunDomainMappingMetadataNamespace(original["namespace"], d, config) transformed["annotations"] = - flattenCloudRunDomainMappingMetadataAnnotations(original["annotations"], d) + flattenCloudRunDomainMappingMetadataAnnotations(original["annotations"], d, config) return []interface{}{transformed} } -func flattenCloudRunDomainMappingMetadataLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingMetadataGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -571,23 +571,23 @@ func flattenCloudRunDomainMappingMetadataGeneration(v interface{}, d *schema.Res return v } -func flattenCloudRunDomainMappingMetadataResourceVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataResourceVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingMetadataSelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataSelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingMetadataUid(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataUid(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunDomainMappingMetadataNamespace(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataNamespace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("project") } -func flattenCloudRunDomainMappingMetadataAnnotations(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunDomainMappingMetadataAnnotations(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_cloud_run_service.go b/google/resource_cloud_run_service.go index b70c17bd2de..27d82e05bdd 100644 --- a/google/resource_cloud_run_service.go +++ b/google/resource_cloud_run_service.go @@ -666,7 +666,7 @@ func resourceCloudRunServiceRead(d *schema.ResourceData, meta interface{}) error // Terraform must set the top level schema field, but since this object contains collapsed properties // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. - if flattenedProp := flattenCloudRunServiceSpec(res["spec"], d); flattenedProp != nil { + if flattenedProp := flattenCloudRunServiceSpec(res["spec"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -674,10 +674,10 @@ func resourceCloudRunServiceRead(d *schema.ResourceData, meta interface{}) error } } } - if err := d.Set("status", flattenCloudRunServiceStatus(res["status"], d)); err != nil { + if err := d.Set("status", flattenCloudRunServiceStatus(res["status"], d, config)); err != nil { return fmt.Errorf("Error reading Service: %s", err) } - if err := d.Set("metadata", flattenCloudRunServiceMetadata(res["metadata"], d)); err != nil { + if err := d.Set("metadata", flattenCloudRunServiceMetadata(res["metadata"], d, config)); err != nil { return fmt.Errorf("Error reading Service: %s", err) } @@ -784,7 +784,7 @@ func resourceCloudRunServiceImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenCloudRunServiceSpec(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -794,12 +794,12 @@ func flattenCloudRunServiceSpec(v interface{}, d *schema.ResourceData) interface } transformed := make(map[string]interface{}) transformed["traffic"] = - flattenCloudRunServiceSpecTraffic(original["traffic"], d) + flattenCloudRunServiceSpecTraffic(original["traffic"], d, config) transformed["template"] = - flattenCloudRunServiceSpecTemplate(original["template"], d) + flattenCloudRunServiceSpecTemplate(original["template"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTraffic(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTraffic(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -812,18 +812,18 @@ func flattenCloudRunServiceSpecTraffic(v interface{}, d *schema.ResourceData) in continue } transformed = append(transformed, map[string]interface{}{ - "revision_name": flattenCloudRunServiceSpecTrafficRevisionName(original["revisionName"], d), - "percent": flattenCloudRunServiceSpecTrafficPercent(original["percent"], d), - "latest_revision": flattenCloudRunServiceSpecTrafficLatestRevision(original["latestRevision"], d), + "revision_name": flattenCloudRunServiceSpecTrafficRevisionName(original["revisionName"], d, config), + "percent": flattenCloudRunServiceSpecTrafficPercent(original["percent"], d, config), + "latest_revision": flattenCloudRunServiceSpecTrafficLatestRevision(original["latestRevision"], d, config), }) } return transformed } -func flattenCloudRunServiceSpecTrafficRevisionName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTrafficRevisionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTrafficPercent(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTrafficPercent(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -833,11 +833,11 @@ func flattenCloudRunServiceSpecTrafficPercent(v interface{}, d *schema.ResourceD return v } -func flattenCloudRunServiceSpecTrafficLatestRevision(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTrafficLatestRevision(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplate(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplate(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -847,12 +847,12 @@ func flattenCloudRunServiceSpecTemplate(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["metadata"] = - flattenCloudRunServiceSpecTemplateMetadata(original["metadata"], d) + flattenCloudRunServiceSpecTemplateMetadata(original["metadata"], d, config) transformed["spec"] = - flattenCloudRunServiceSpecTemplateSpec(original["spec"], d) + flattenCloudRunServiceSpecTemplateSpec(original["spec"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateMetadata(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadata(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -862,28 +862,28 @@ func flattenCloudRunServiceSpecTemplateMetadata(v interface{}, d *schema.Resourc } transformed := make(map[string]interface{}) transformed["labels"] = - flattenCloudRunServiceSpecTemplateMetadataLabels(original["labels"], d) + flattenCloudRunServiceSpecTemplateMetadataLabels(original["labels"], d, config) transformed["generation"] = - flattenCloudRunServiceSpecTemplateMetadataGeneration(original["generation"], d) + flattenCloudRunServiceSpecTemplateMetadataGeneration(original["generation"], d, config) transformed["resource_version"] = - flattenCloudRunServiceSpecTemplateMetadataResourceVersion(original["resourceVersion"], d) + flattenCloudRunServiceSpecTemplateMetadataResourceVersion(original["resourceVersion"], d, config) transformed["self_link"] = - flattenCloudRunServiceSpecTemplateMetadataSelfLink(original["selfLink"], d) + flattenCloudRunServiceSpecTemplateMetadataSelfLink(original["selfLink"], d, config) transformed["uid"] = - flattenCloudRunServiceSpecTemplateMetadataUid(original["uid"], d) + flattenCloudRunServiceSpecTemplateMetadataUid(original["uid"], d, config) transformed["namespace"] = - flattenCloudRunServiceSpecTemplateMetadataNamespace(original["namespace"], d) + flattenCloudRunServiceSpecTemplateMetadataNamespace(original["namespace"], d, config) transformed["annotations"] = - flattenCloudRunServiceSpecTemplateMetadataAnnotations(original["annotations"], d) + flattenCloudRunServiceSpecTemplateMetadataAnnotations(original["annotations"], d, config) transformed["name"] = - flattenCloudRunServiceSpecTemplateMetadataName(original["name"], d) + flattenCloudRunServiceSpecTemplateMetadataName(original["name"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateMetadataLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateMetadataGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -893,31 +893,31 @@ func flattenCloudRunServiceSpecTemplateMetadataGeneration(v interface{}, d *sche return v } -func flattenCloudRunServiceSpecTemplateMetadataResourceVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataResourceVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateMetadataSelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataSelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateMetadataUid(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataUid(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateMetadataNamespace(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataNamespace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateMetadataAnnotations(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataAnnotations(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateMetadataName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateMetadataName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpec(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -927,16 +927,16 @@ func flattenCloudRunServiceSpecTemplateSpec(v interface{}, d *schema.ResourceDat } transformed := make(map[string]interface{}) transformed["containers"] = - flattenCloudRunServiceSpecTemplateSpecContainers(original["containers"], d) + flattenCloudRunServiceSpecTemplateSpecContainers(original["containers"], d, config) transformed["container_concurrency"] = - flattenCloudRunServiceSpecTemplateSpecContainerConcurrency(original["containerConcurrency"], d) + flattenCloudRunServiceSpecTemplateSpecContainerConcurrency(original["containerConcurrency"], d, config) transformed["service_account_name"] = - flattenCloudRunServiceSpecTemplateSpecServiceAccountName(original["serviceAccountName"], d) + flattenCloudRunServiceSpecTemplateSpecServiceAccountName(original["serviceAccountName"], d, config) transformed["serving_state"] = - flattenCloudRunServiceSpecTemplateSpecServingState(original["servingState"], d) + flattenCloudRunServiceSpecTemplateSpecServingState(original["servingState"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateSpecContainers(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -949,26 +949,26 @@ func flattenCloudRunServiceSpecTemplateSpecContainers(v interface{}, d *schema.R continue } transformed = append(transformed, map[string]interface{}{ - "working_dir": flattenCloudRunServiceSpecTemplateSpecContainersWorkingDir(original["workingDir"], d), - "args": flattenCloudRunServiceSpecTemplateSpecContainersArgs(original["args"], d), - "env_from": flattenCloudRunServiceSpecTemplateSpecContainersEnvFrom(original["envFrom"], d), - "image": flattenCloudRunServiceSpecTemplateSpecContainersImage(original["image"], d), - "command": flattenCloudRunServiceSpecTemplateSpecContainersCommand(original["command"], d), - "env": flattenCloudRunServiceSpecTemplateSpecContainersEnv(original["env"], d), - "resources": flattenCloudRunServiceSpecTemplateSpecContainersResources(original["resources"], d), + "working_dir": flattenCloudRunServiceSpecTemplateSpecContainersWorkingDir(original["workingDir"], d, config), + "args": flattenCloudRunServiceSpecTemplateSpecContainersArgs(original["args"], d, config), + "env_from": flattenCloudRunServiceSpecTemplateSpecContainersEnvFrom(original["envFrom"], d, config), + "image": flattenCloudRunServiceSpecTemplateSpecContainersImage(original["image"], d, config), + "command": flattenCloudRunServiceSpecTemplateSpecContainersCommand(original["command"], d, config), + "env": flattenCloudRunServiceSpecTemplateSpecContainersEnv(original["env"], d, config), + "resources": flattenCloudRunServiceSpecTemplateSpecContainersResources(original["resources"], d, config), }) } return transformed } -func flattenCloudRunServiceSpecTemplateSpecContainersWorkingDir(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersWorkingDir(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersArgs(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersArgs(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFrom(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFrom(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -981,18 +981,18 @@ func flattenCloudRunServiceSpecTemplateSpecContainersEnvFrom(v interface{}, d *s continue } transformed = append(transformed, map[string]interface{}{ - "prefix": flattenCloudRunServiceSpecTemplateSpecContainersEnvFromPrefix(original["prefix"], d), - "config_map_ref": flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRef(original["configMapRef"], d), - "secret_ref": flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRef(original["secretRef"], d), + "prefix": flattenCloudRunServiceSpecTemplateSpecContainersEnvFromPrefix(original["prefix"], d, config), + "config_map_ref": flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRef(original["configMapRef"], d, config), + "secret_ref": flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRef(original["secretRef"], d, config), }) } return transformed } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromPrefix(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromPrefix(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRef(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRef(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1002,16 +1002,16 @@ func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRef(v inter } transformed := make(map[string]interface{}) transformed["optional"] = - flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefOptional(original["optional"], d) + flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefOptional(original["optional"], d, config) transformed["local_object_reference"] = - flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReference(original["localObjectReference"], d) + flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReference(original["localObjectReference"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefOptional(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefOptional(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReference(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReference(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1021,14 +1021,14 @@ func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObj } transformed := make(map[string]interface{}) transformed["name"] = - flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReferenceName(original["name"], d) + flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReferenceName(original["name"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReferenceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromConfigMapRefLocalObjectReferenceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRef(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRef(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1038,12 +1038,12 @@ func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRef(v interfac } transformed := make(map[string]interface{}) transformed["local_object_reference"] = - flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReference(original["localObjectReference"], d) + flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReference(original["localObjectReference"], d, config) transformed["optional"] = - flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefOptional(original["optional"], d) + flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefOptional(original["optional"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReference(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReference(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1053,26 +1053,26 @@ func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObject } transformed := make(map[string]interface{}) transformed["name"] = - flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReferenceName(original["name"], d) + flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReferenceName(original["name"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReferenceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefLocalObjectReferenceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefOptional(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvFromSecretRefOptional(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersImage(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersImage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersCommand(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersCommand(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnv(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnv(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1085,21 +1085,21 @@ func flattenCloudRunServiceSpecTemplateSpecContainersEnv(v interface{}, d *schem continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenCloudRunServiceSpecTemplateSpecContainersEnvName(original["name"], d), - "value": flattenCloudRunServiceSpecTemplateSpecContainersEnvValue(original["value"], d), + "name": flattenCloudRunServiceSpecTemplateSpecContainersEnvName(original["name"], d, config), + "value": flattenCloudRunServiceSpecTemplateSpecContainersEnvValue(original["value"], d, config), }) } return transformed } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersEnvValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersEnvValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersResources(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersResources(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1109,20 +1109,20 @@ func flattenCloudRunServiceSpecTemplateSpecContainersResources(v interface{}, d } transformed := make(map[string]interface{}) transformed["limits"] = - flattenCloudRunServiceSpecTemplateSpecContainersResourcesLimits(original["limits"], d) + flattenCloudRunServiceSpecTemplateSpecContainersResourcesLimits(original["limits"], d, config) transformed["requests"] = - flattenCloudRunServiceSpecTemplateSpecContainersResourcesRequests(original["requests"], d) + flattenCloudRunServiceSpecTemplateSpecContainersResourcesRequests(original["requests"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceSpecTemplateSpecContainersResourcesLimits(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersResourcesLimits(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainersResourcesRequests(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainersResourcesRequests(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecContainerConcurrency(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecContainerConcurrency(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1132,15 +1132,15 @@ func flattenCloudRunServiceSpecTemplateSpecContainerConcurrency(v interface{}, d return v } -func flattenCloudRunServiceSpecTemplateSpecServiceAccountName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecServiceAccountName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceSpecTemplateSpecServingState(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceSpecTemplateSpecServingState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1150,18 +1150,18 @@ func flattenCloudRunServiceStatus(v interface{}, d *schema.ResourceData) interfa } transformed := make(map[string]interface{}) transformed["conditions"] = - flattenCloudRunServiceStatusConditions(original["conditions"], d) + flattenCloudRunServiceStatusConditions(original["conditions"], d, config) transformed["url"] = - flattenCloudRunServiceStatusUrl(original["url"], d) + flattenCloudRunServiceStatusUrl(original["url"], d, config) transformed["observed_generation"] = - flattenCloudRunServiceStatusObservedGeneration(original["observedGeneration"], d) + flattenCloudRunServiceStatusObservedGeneration(original["observedGeneration"], d, config) transformed["latest_created_revision_name"] = - flattenCloudRunServiceStatusLatestCreatedRevisionName(original["latestCreatedRevisionName"], d) + flattenCloudRunServiceStatusLatestCreatedRevisionName(original["latestCreatedRevisionName"], d, config) transformed["latest_ready_revision_name"] = - flattenCloudRunServiceStatusLatestReadyRevisionName(original["latestReadyRevisionName"], d) + flattenCloudRunServiceStatusLatestReadyRevisionName(original["latestReadyRevisionName"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceStatusConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1174,35 +1174,35 @@ func flattenCloudRunServiceStatusConditions(v interface{}, d *schema.ResourceDat continue } transformed = append(transformed, map[string]interface{}{ - "message": flattenCloudRunServiceStatusConditionsMessage(original["message"], d), - "status": flattenCloudRunServiceStatusConditionsStatus(original["status"], d), - "reason": flattenCloudRunServiceStatusConditionsReason(original["reason"], d), - "type": flattenCloudRunServiceStatusConditionsType(original["type"], d), + "message": flattenCloudRunServiceStatusConditionsMessage(original["message"], d, config), + "status": flattenCloudRunServiceStatusConditionsStatus(original["status"], d, config), + "reason": flattenCloudRunServiceStatusConditionsReason(original["reason"], d, config), + "type": flattenCloudRunServiceStatusConditionsType(original["type"], d, config), }) } return transformed } -func flattenCloudRunServiceStatusConditionsMessage(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusConditionsMessage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatusConditionsStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusConditionsStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatusConditionsReason(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusConditionsReason(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatusConditionsType(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusConditionsType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatusUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatusObservedGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusObservedGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1212,15 +1212,15 @@ func flattenCloudRunServiceStatusObservedGeneration(v interface{}, d *schema.Res return v } -func flattenCloudRunServiceStatusLatestCreatedRevisionName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusLatestCreatedRevisionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceStatusLatestReadyRevisionName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceStatusLatestReadyRevisionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceMetadata(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadata(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1230,26 +1230,26 @@ func flattenCloudRunServiceMetadata(v interface{}, d *schema.ResourceData) inter } transformed := make(map[string]interface{}) transformed["labels"] = - flattenCloudRunServiceMetadataLabels(original["labels"], d) + flattenCloudRunServiceMetadataLabels(original["labels"], d, config) transformed["generation"] = - flattenCloudRunServiceMetadataGeneration(original["generation"], d) + flattenCloudRunServiceMetadataGeneration(original["generation"], d, config) transformed["resource_version"] = - flattenCloudRunServiceMetadataResourceVersion(original["resourceVersion"], d) + flattenCloudRunServiceMetadataResourceVersion(original["resourceVersion"], d, config) transformed["self_link"] = - flattenCloudRunServiceMetadataSelfLink(original["selfLink"], d) + flattenCloudRunServiceMetadataSelfLink(original["selfLink"], d, config) transformed["uid"] = - flattenCloudRunServiceMetadataUid(original["uid"], d) + flattenCloudRunServiceMetadataUid(original["uid"], d, config) transformed["namespace"] = - flattenCloudRunServiceMetadataNamespace(original["namespace"], d) + flattenCloudRunServiceMetadataNamespace(original["namespace"], d, config) transformed["annotations"] = - flattenCloudRunServiceMetadataAnnotations(original["annotations"], d) + flattenCloudRunServiceMetadataAnnotations(original["annotations"], d, config) return []interface{}{transformed} } -func flattenCloudRunServiceMetadataLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceMetadataGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1259,23 +1259,23 @@ func flattenCloudRunServiceMetadataGeneration(v interface{}, d *schema.ResourceD return v } -func flattenCloudRunServiceMetadataResourceVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataResourceVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceMetadataSelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataSelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceMetadataUid(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataUid(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudRunServiceMetadataNamespace(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataNamespace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("project") } -func flattenCloudRunServiceMetadataAnnotations(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudRunServiceMetadataAnnotations(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_cloud_scheduler_job.go b/google/resource_cloud_scheduler_job.go index 73731088696..92703db91bc 100644 --- a/google/resource_cloud_scheduler_job.go +++ b/google/resource_cloud_scheduler_job.go @@ -541,31 +541,31 @@ func resourceCloudSchedulerJobRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("name", flattenCloudSchedulerJobName(res["name"], d)); err != nil { + if err := d.Set("name", flattenCloudSchedulerJobName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("description", flattenCloudSchedulerJobDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenCloudSchedulerJobDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("schedule", flattenCloudSchedulerJobSchedule(res["schedule"], d)); err != nil { + if err := d.Set("schedule", flattenCloudSchedulerJobSchedule(res["schedule"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("time_zone", flattenCloudSchedulerJobTimeZone(res["timeZone"], d)); err != nil { + if err := d.Set("time_zone", flattenCloudSchedulerJobTimeZone(res["timeZone"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("attempt_deadline", flattenCloudSchedulerJobAttemptDeadline(res["attemptDeadline"], d)); err != nil { + if err := d.Set("attempt_deadline", flattenCloudSchedulerJobAttemptDeadline(res["attemptDeadline"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("retry_config", flattenCloudSchedulerJobRetryConfig(res["retryConfig"], d)); err != nil { + if err := d.Set("retry_config", flattenCloudSchedulerJobRetryConfig(res["retryConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("pubsub_target", flattenCloudSchedulerJobPubsubTarget(res["pubsubTarget"], d)); err != nil { + if err := d.Set("pubsub_target", flattenCloudSchedulerJobPubsubTarget(res["pubsubTarget"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("app_engine_http_target", flattenCloudSchedulerJobAppEngineHttpTarget(res["appEngineHttpTarget"], d)); err != nil { + if err := d.Set("app_engine_http_target", flattenCloudSchedulerJobAppEngineHttpTarget(res["appEngineHttpTarget"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } - if err := d.Set("http_target", flattenCloudSchedulerJobHttpTarget(res["httpTarget"], d)); err != nil { + if err := d.Set("http_target", flattenCloudSchedulerJobHttpTarget(res["httpTarget"], d, config)); err != nil { return fmt.Errorf("Error reading Job: %s", err) } @@ -618,30 +618,30 @@ func resourceCloudSchedulerJobImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenCloudSchedulerJobName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenCloudSchedulerJobDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobSchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobSchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobTimeZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobTimeZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobAttemptDeadline(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAttemptDeadline(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobRetryConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobRetryConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -651,18 +651,18 @@ func flattenCloudSchedulerJobRetryConfig(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["retry_count"] = - flattenCloudSchedulerJobRetryConfigRetryCount(original["retryCount"], d) + flattenCloudSchedulerJobRetryConfigRetryCount(original["retryCount"], d, config) transformed["max_retry_duration"] = - flattenCloudSchedulerJobRetryConfigMaxRetryDuration(original["maxRetryDuration"], d) + flattenCloudSchedulerJobRetryConfigMaxRetryDuration(original["maxRetryDuration"], d, config) transformed["min_backoff_duration"] = - flattenCloudSchedulerJobRetryConfigMinBackoffDuration(original["minBackoffDuration"], d) + flattenCloudSchedulerJobRetryConfigMinBackoffDuration(original["minBackoffDuration"], d, config) transformed["max_backoff_duration"] = - flattenCloudSchedulerJobRetryConfigMaxBackoffDuration(original["maxBackoffDuration"], d) + flattenCloudSchedulerJobRetryConfigMaxBackoffDuration(original["maxBackoffDuration"], d, config) transformed["max_doublings"] = - flattenCloudSchedulerJobRetryConfigMaxDoublings(original["maxDoublings"], d) + flattenCloudSchedulerJobRetryConfigMaxDoublings(original["maxDoublings"], d, config) return []interface{}{transformed} } -func flattenCloudSchedulerJobRetryConfigRetryCount(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobRetryConfigRetryCount(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -672,19 +672,19 @@ func flattenCloudSchedulerJobRetryConfigRetryCount(v interface{}, d *schema.Reso return v } -func flattenCloudSchedulerJobRetryConfigMaxRetryDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobRetryConfigMaxRetryDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobRetryConfigMinBackoffDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobRetryConfigMinBackoffDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobRetryConfigMaxBackoffDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobRetryConfigMaxBackoffDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobRetryConfigMaxDoublings(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobRetryConfigMaxDoublings(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -694,7 +694,7 @@ func flattenCloudSchedulerJobRetryConfigMaxDoublings(v interface{}, d *schema.Re return v } -func flattenCloudSchedulerJobPubsubTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobPubsubTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -704,26 +704,26 @@ func flattenCloudSchedulerJobPubsubTarget(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["topic_name"] = - flattenCloudSchedulerJobPubsubTargetTopicName(original["topicName"], d) + flattenCloudSchedulerJobPubsubTargetTopicName(original["topicName"], d, config) transformed["data"] = - flattenCloudSchedulerJobPubsubTargetData(original["data"], d) + flattenCloudSchedulerJobPubsubTargetData(original["data"], d, config) transformed["attributes"] = - flattenCloudSchedulerJobPubsubTargetAttributes(original["attributes"], d) + flattenCloudSchedulerJobPubsubTargetAttributes(original["attributes"], d, config) return []interface{}{transformed} } -func flattenCloudSchedulerJobPubsubTargetTopicName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobPubsubTargetTopicName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobPubsubTargetData(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobPubsubTargetData(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobPubsubTargetAttributes(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobPubsubTargetAttributes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobAppEngineHttpTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAppEngineHttpTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -733,23 +733,23 @@ func flattenCloudSchedulerJobAppEngineHttpTarget(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["http_method"] = - flattenCloudSchedulerJobAppEngineHttpTargetHttpMethod(original["httpMethod"], d) + flattenCloudSchedulerJobAppEngineHttpTargetHttpMethod(original["httpMethod"], d, config) transformed["app_engine_routing"] = - flattenCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(original["appEngineRouting"], d) + flattenCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(original["appEngineRouting"], d, config) transformed["relative_uri"] = - flattenCloudSchedulerJobAppEngineHttpTargetRelativeUri(original["relativeUri"], d) + flattenCloudSchedulerJobAppEngineHttpTargetRelativeUri(original["relativeUri"], d, config) transformed["body"] = - flattenCloudSchedulerJobAppEngineHttpTargetBody(original["body"], d) + flattenCloudSchedulerJobAppEngineHttpTargetBody(original["body"], d, config) transformed["headers"] = - flattenCloudSchedulerJobAppEngineHttpTargetHeaders(original["headers"], d) + flattenCloudSchedulerJobAppEngineHttpTargetHeaders(original["headers"], d, config) return []interface{}{transformed} } -func flattenCloudSchedulerJobAppEngineHttpTargetHttpMethod(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAppEngineHttpTargetHttpMethod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } // An `appEngineRouting` in API response is useless, so we set config values rather than api response to state. -func flattenCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -767,15 +767,15 @@ func flattenCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(v interface{}, return []interface{}{transformed} } -func flattenCloudSchedulerJobAppEngineHttpTargetRelativeUri(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAppEngineHttpTargetRelativeUri(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobAppEngineHttpTargetBody(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAppEngineHttpTargetBody(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobAppEngineHttpTargetHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobAppEngineHttpTargetHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { var headers = v.(map[string]interface{}) if v, ok := headers["User-Agent"]; ok { if v.(string) == "AppEngine-Google; (+http://code.google.com/appengine)" { @@ -800,7 +800,7 @@ func flattenCloudSchedulerJobAppEngineHttpTargetHeaders(v interface{}, d *schema return headers } -func flattenCloudSchedulerJobHttpTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -810,32 +810,32 @@ func flattenCloudSchedulerJobHttpTarget(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["uri"] = - flattenCloudSchedulerJobHttpTargetUri(original["uri"], d) + flattenCloudSchedulerJobHttpTargetUri(original["uri"], d, config) transformed["http_method"] = - flattenCloudSchedulerJobHttpTargetHttpMethod(original["httpMethod"], d) + flattenCloudSchedulerJobHttpTargetHttpMethod(original["httpMethod"], d, config) transformed["body"] = - flattenCloudSchedulerJobHttpTargetBody(original["body"], d) + flattenCloudSchedulerJobHttpTargetBody(original["body"], d, config) transformed["headers"] = - flattenCloudSchedulerJobHttpTargetHeaders(original["headers"], d) + flattenCloudSchedulerJobHttpTargetHeaders(original["headers"], d, config) transformed["oauth_token"] = - flattenCloudSchedulerJobHttpTargetOauthToken(original["oauthToken"], d) + flattenCloudSchedulerJobHttpTargetOauthToken(original["oauthToken"], d, config) transformed["oidc_token"] = - flattenCloudSchedulerJobHttpTargetOidcToken(original["oidcToken"], d) + flattenCloudSchedulerJobHttpTargetOidcToken(original["oidcToken"], d, config) return []interface{}{transformed} } -func flattenCloudSchedulerJobHttpTargetUri(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetUri(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobHttpTargetHttpMethod(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetHttpMethod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobHttpTargetBody(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetBody(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobHttpTargetHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { var headers = v.(map[string]interface{}) if v, ok := headers["User-Agent"]; ok { if v.(string) == "AppEngine-Google; (+http://code.google.com/appengine)" { @@ -860,7 +860,7 @@ func flattenCloudSchedulerJobHttpTargetHeaders(v interface{}, d *schema.Resource return headers } -func flattenCloudSchedulerJobHttpTargetOauthToken(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetOauthToken(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -870,20 +870,20 @@ func flattenCloudSchedulerJobHttpTargetOauthToken(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["service_account_email"] = - flattenCloudSchedulerJobHttpTargetOauthTokenServiceAccountEmail(original["serviceAccountEmail"], d) + flattenCloudSchedulerJobHttpTargetOauthTokenServiceAccountEmail(original["serviceAccountEmail"], d, config) transformed["scope"] = - flattenCloudSchedulerJobHttpTargetOauthTokenScope(original["scope"], d) + flattenCloudSchedulerJobHttpTargetOauthTokenScope(original["scope"], d, config) return []interface{}{transformed} } -func flattenCloudSchedulerJobHttpTargetOauthTokenServiceAccountEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetOauthTokenServiceAccountEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobHttpTargetOauthTokenScope(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetOauthTokenScope(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobHttpTargetOidcToken(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetOidcToken(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -893,16 +893,16 @@ func flattenCloudSchedulerJobHttpTargetOidcToken(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["service_account_email"] = - flattenCloudSchedulerJobHttpTargetOidcTokenServiceAccountEmail(original["serviceAccountEmail"], d) + flattenCloudSchedulerJobHttpTargetOidcTokenServiceAccountEmail(original["serviceAccountEmail"], d, config) transformed["audience"] = - flattenCloudSchedulerJobHttpTargetOidcTokenAudience(original["audience"], d) + flattenCloudSchedulerJobHttpTargetOidcTokenAudience(original["audience"], d, config) return []interface{}{transformed} } -func flattenCloudSchedulerJobHttpTargetOidcTokenServiceAccountEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetOidcTokenServiceAccountEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudSchedulerJobHttpTargetOidcTokenAudience(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudSchedulerJobHttpTargetOidcTokenAudience(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_cloud_tasks_queue.go b/google/resource_cloud_tasks_queue.go index 938f73a0930..8d6f1ed0db0 100644 --- a/google/resource_cloud_tasks_queue.go +++ b/google/resource_cloud_tasks_queue.go @@ -289,16 +289,16 @@ func resourceCloudTasksQueueRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Queue: %s", err) } - if err := d.Set("name", flattenCloudTasksQueueName(res["name"], d)); err != nil { + if err := d.Set("name", flattenCloudTasksQueueName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Queue: %s", err) } - if err := d.Set("app_engine_routing_override", flattenCloudTasksQueueAppEngineRoutingOverride(res["appEngineRoutingOverride"], d)); err != nil { + if err := d.Set("app_engine_routing_override", flattenCloudTasksQueueAppEngineRoutingOverride(res["appEngineRoutingOverride"], d, config)); err != nil { return fmt.Errorf("Error reading Queue: %s", err) } - if err := d.Set("rate_limits", flattenCloudTasksQueueRateLimits(res["rateLimits"], d)); err != nil { + if err := d.Set("rate_limits", flattenCloudTasksQueueRateLimits(res["rateLimits"], d, config)); err != nil { return fmt.Errorf("Error reading Queue: %s", err) } - if err := d.Set("retry_config", flattenCloudTasksQueueRetryConfig(res["retryConfig"], d)); err != nil { + if err := d.Set("retry_config", flattenCloudTasksQueueRetryConfig(res["retryConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Queue: %s", err) } @@ -412,7 +412,7 @@ func resourceCloudTasksQueueImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenCloudTasksQueueName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -420,7 +420,7 @@ func flattenCloudTasksQueueName(v interface{}, d *schema.ResourceData) interface } // service, version, and instance are input-only. host is output-only. -func flattenCloudTasksQueueAppEngineRoutingOverride(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueAppEngineRoutingOverride(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -438,7 +438,7 @@ func flattenCloudTasksQueueAppEngineRoutingOverride(v interface{}, d *schema.Res return []interface{}{transformed} } -func flattenCloudTasksQueueRateLimits(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRateLimits(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -448,18 +448,18 @@ func flattenCloudTasksQueueRateLimits(v interface{}, d *schema.ResourceData) int } transformed := make(map[string]interface{}) transformed["max_dispatches_per_second"] = - flattenCloudTasksQueueRateLimitsMaxDispatchesPerSecond(original["maxDispatchesPerSecond"], d) + flattenCloudTasksQueueRateLimitsMaxDispatchesPerSecond(original["maxDispatchesPerSecond"], d, config) transformed["max_concurrent_dispatches"] = - flattenCloudTasksQueueRateLimitsMaxConcurrentDispatches(original["maxConcurrentDispatches"], d) + flattenCloudTasksQueueRateLimitsMaxConcurrentDispatches(original["maxConcurrentDispatches"], d, config) transformed["max_burst_size"] = - flattenCloudTasksQueueRateLimitsMaxBurstSize(original["maxBurstSize"], d) + flattenCloudTasksQueueRateLimitsMaxBurstSize(original["maxBurstSize"], d, config) return []interface{}{transformed} } -func flattenCloudTasksQueueRateLimitsMaxDispatchesPerSecond(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRateLimitsMaxDispatchesPerSecond(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudTasksQueueRateLimitsMaxConcurrentDispatches(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRateLimitsMaxConcurrentDispatches(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -469,7 +469,7 @@ func flattenCloudTasksQueueRateLimitsMaxConcurrentDispatches(v interface{}, d *s return v } -func flattenCloudTasksQueueRateLimitsMaxBurstSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRateLimitsMaxBurstSize(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -479,7 +479,7 @@ func flattenCloudTasksQueueRateLimitsMaxBurstSize(v interface{}, d *schema.Resou return v } -func flattenCloudTasksQueueRetryConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRetryConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -489,18 +489,18 @@ func flattenCloudTasksQueueRetryConfig(v interface{}, d *schema.ResourceData) in } transformed := make(map[string]interface{}) transformed["max_attempts"] = - flattenCloudTasksQueueRetryConfigMaxAttempts(original["maxAttempts"], d) + flattenCloudTasksQueueRetryConfigMaxAttempts(original["maxAttempts"], d, config) transformed["max_retry_duration"] = - flattenCloudTasksQueueRetryConfigMaxRetryDuration(original["maxRetryDuration"], d) + flattenCloudTasksQueueRetryConfigMaxRetryDuration(original["maxRetryDuration"], d, config) transformed["min_backoff"] = - flattenCloudTasksQueueRetryConfigMinBackoff(original["minBackoff"], d) + flattenCloudTasksQueueRetryConfigMinBackoff(original["minBackoff"], d, config) transformed["max_backoff"] = - flattenCloudTasksQueueRetryConfigMaxBackoff(original["maxBackoff"], d) + flattenCloudTasksQueueRetryConfigMaxBackoff(original["maxBackoff"], d, config) transformed["max_doublings"] = - flattenCloudTasksQueueRetryConfigMaxDoublings(original["maxDoublings"], d) + flattenCloudTasksQueueRetryConfigMaxDoublings(original["maxDoublings"], d, config) return []interface{}{transformed} } -func flattenCloudTasksQueueRetryConfigMaxAttempts(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRetryConfigMaxAttempts(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -510,19 +510,19 @@ func flattenCloudTasksQueueRetryConfigMaxAttempts(v interface{}, d *schema.Resou return v } -func flattenCloudTasksQueueRetryConfigMaxRetryDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRetryConfigMaxRetryDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudTasksQueueRetryConfigMinBackoff(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRetryConfigMinBackoff(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudTasksQueueRetryConfigMaxBackoff(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRetryConfigMaxBackoff(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudTasksQueueRetryConfigMaxDoublings(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudTasksQueueRetryConfigMaxDoublings(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { diff --git a/google/resource_compute_address.go b/google/resource_compute_address.go index e8a831e1300..9412f5235ef 100644 --- a/google/resource_compute_address.go +++ b/google/resource_compute_address.go @@ -257,34 +257,34 @@ func resourceComputeAddressRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("address", flattenComputeAddressAddress(res["address"], d)); err != nil { + if err := d.Set("address", flattenComputeAddressAddress(res["address"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("address_type", flattenComputeAddressAddressType(res["addressType"], d)); err != nil { + if err := d.Set("address_type", flattenComputeAddressAddressType(res["addressType"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeAddressCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeAddressCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("description", flattenComputeAddressDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeAddressDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("name", flattenComputeAddressName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeAddressName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("purpose", flattenComputeAddressPurpose(res["purpose"], d)); err != nil { + if err := d.Set("purpose", flattenComputeAddressPurpose(res["purpose"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("network_tier", flattenComputeAddressNetworkTier(res["networkTier"], d)); err != nil { + if err := d.Set("network_tier", flattenComputeAddressNetworkTier(res["networkTier"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("subnetwork", flattenComputeAddressSubnetwork(res["subnetwork"], d)); err != nil { + if err := d.Set("subnetwork", flattenComputeAddressSubnetwork(res["subnetwork"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("users", flattenComputeAddressUsers(res["users"], d)); err != nil { + if err := d.Set("users", flattenComputeAddressUsers(res["users"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("region", flattenComputeAddressRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeAddressRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -348,11 +348,11 @@ func resourceComputeAddressImport(d *schema.ResourceData, meta interface{}) ([]* return []*schema.ResourceData{d}, nil } -func flattenComputeAddressAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressAddressType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressAddressType(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return "EXTERNAL" } @@ -360,38 +360,38 @@ func flattenComputeAddressAddressType(v interface{}, d *schema.ResourceData) int return v } -func flattenComputeAddressCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressPurpose(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressPurpose(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressNetworkTier(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressNetworkTier(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressSubnetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressSubnetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeAddressUsers(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressUsers(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_autoscaler.go b/google/resource_compute_autoscaler.go index aa6a79aea32..d787c00a385 100644 --- a/google/resource_compute_autoscaler.go +++ b/google/resource_compute_autoscaler.go @@ -318,22 +318,22 @@ func resourceComputeAutoscalerRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading Autoscaler: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeAutoscalerCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeAutoscalerCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Autoscaler: %s", err) } - if err := d.Set("name", flattenComputeAutoscalerName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeAutoscalerName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Autoscaler: %s", err) } - if err := d.Set("description", flattenComputeAutoscalerDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeAutoscalerDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Autoscaler: %s", err) } - if err := d.Set("autoscaling_policy", flattenComputeAutoscalerAutoscalingPolicy(res["autoscalingPolicy"], d)); err != nil { + if err := d.Set("autoscaling_policy", flattenComputeAutoscalerAutoscalingPolicy(res["autoscalingPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading Autoscaler: %s", err) } - if err := d.Set("target", flattenComputeAutoscalerTarget(res["target"], d)); err != nil { + if err := d.Set("target", flattenComputeAutoscalerTarget(res["target"], d, config)); err != nil { return fmt.Errorf("Error reading Autoscaler: %s", err) } - if err := d.Set("zone", flattenComputeAutoscalerZone(res["zone"], d)); err != nil { + if err := d.Set("zone", flattenComputeAutoscalerZone(res["zone"], d, config)); err != nil { return fmt.Errorf("Error reading Autoscaler: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -460,19 +460,19 @@ func resourceComputeAutoscalerImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenComputeAutoscalerCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -482,20 +482,20 @@ func flattenComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.Resource } transformed := make(map[string]interface{}) transformed["min_replicas"] = - flattenComputeAutoscalerAutoscalingPolicyMinReplicas(original["minNumReplicas"], d) + flattenComputeAutoscalerAutoscalingPolicyMinReplicas(original["minNumReplicas"], d, config) transformed["max_replicas"] = - flattenComputeAutoscalerAutoscalingPolicyMaxReplicas(original["maxNumReplicas"], d) + flattenComputeAutoscalerAutoscalingPolicyMaxReplicas(original["maxNumReplicas"], d, config) transformed["cooldown_period"] = - flattenComputeAutoscalerAutoscalingPolicyCooldownPeriod(original["coolDownPeriodSec"], d) + flattenComputeAutoscalerAutoscalingPolicyCooldownPeriod(original["coolDownPeriodSec"], d, config) transformed["cpu_utilization"] = - flattenComputeAutoscalerAutoscalingPolicyCpuUtilization(original["cpuUtilization"], d) + flattenComputeAutoscalerAutoscalingPolicyCpuUtilization(original["cpuUtilization"], d, config) transformed["metric"] = - flattenComputeAutoscalerAutoscalingPolicyMetric(original["customMetricUtilizations"], d) + flattenComputeAutoscalerAutoscalingPolicyMetric(original["customMetricUtilizations"], d, config) transformed["load_balancing_utilization"] = - flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(original["loadBalancingUtilization"], d) + flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(original["loadBalancingUtilization"], d, config) return []interface{}{transformed} } -func flattenComputeAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -505,7 +505,7 @@ func flattenComputeAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *sche return v } -func flattenComputeAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -515,7 +515,7 @@ func flattenComputeAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *sche return v } -func flattenComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -525,7 +525,7 @@ func flattenComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *s return v } -func flattenComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -535,14 +535,14 @@ func flattenComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *s } transformed := make(map[string]interface{}) transformed["target"] = - flattenComputeAutoscalerAutoscalingPolicyCpuUtilizationTarget(original["utilizationTarget"], d) + flattenComputeAutoscalerAutoscalingPolicyCpuUtilizationTarget(original["utilizationTarget"], d, config) return []interface{}{transformed} } -func flattenComputeAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -555,26 +555,26 @@ func flattenComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.Re continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeAutoscalerAutoscalingPolicyMetricName(original["metric"], d), - "target": flattenComputeAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d), - "type": flattenComputeAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d), + "name": flattenComputeAutoscalerAutoscalingPolicyMetricName(original["metric"], d, config), + "target": flattenComputeAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d, config), + "type": flattenComputeAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d, config), }) } return transformed } -func flattenComputeAutoscalerAutoscalingPolicyMetricName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMetricName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -584,21 +584,21 @@ func flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interfa } transformed := make(map[string]interface{}) transformed["target"] = - flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(original["utilizationTarget"], d) + flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(original["utilizationTarget"], d, config) return []interface{}{transformed} } -func flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAutoscalerTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeAutoscalerZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_backend_bucket.go b/google/resource_compute_backend_bucket.go index 451b1667239..45956f69135 100644 --- a/google/resource_compute_backend_bucket.go +++ b/google/resource_compute_backend_bucket.go @@ -206,22 +206,22 @@ func resourceComputeBackendBucketRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading BackendBucket: %s", err) } - if err := d.Set("bucket_name", flattenComputeBackendBucketBucketName(res["bucketName"], d)); err != nil { + if err := d.Set("bucket_name", flattenComputeBackendBucketBucketName(res["bucketName"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucket: %s", err) } - if err := d.Set("cdn_policy", flattenComputeBackendBucketCdnPolicy(res["cdnPolicy"], d)); err != nil { + if err := d.Set("cdn_policy", flattenComputeBackendBucketCdnPolicy(res["cdnPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucket: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeBackendBucketCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeBackendBucketCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucket: %s", err) } - if err := d.Set("description", flattenComputeBackendBucketDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeBackendBucketDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucket: %s", err) } - if err := d.Set("enable_cdn", flattenComputeBackendBucketEnableCdn(res["enableCdn"], d)); err != nil { + if err := d.Set("enable_cdn", flattenComputeBackendBucketEnableCdn(res["enableCdn"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucket: %s", err) } - if err := d.Set("name", flattenComputeBackendBucketName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeBackendBucketName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucket: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -347,11 +347,11 @@ func resourceComputeBackendBucketImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenComputeBackendBucketBucketName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketBucketName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendBucketCdnPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketCdnPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -361,10 +361,10 @@ func flattenComputeBackendBucketCdnPolicy(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["signed_url_cache_max_age_sec"] = - flattenComputeBackendBucketCdnPolicySignedUrlCacheMaxAgeSec(original["signedUrlCacheMaxAgeSec"], d) + flattenComputeBackendBucketCdnPolicySignedUrlCacheMaxAgeSec(original["signedUrlCacheMaxAgeSec"], d, config) return []interface{}{transformed} } -func flattenComputeBackendBucketCdnPolicySignedUrlCacheMaxAgeSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketCdnPolicySignedUrlCacheMaxAgeSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -374,19 +374,19 @@ func flattenComputeBackendBucketCdnPolicySignedUrlCacheMaxAgeSec(v interface{}, return v } -func flattenComputeBackendBucketCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendBucketDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendBucketEnableCdn(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketEnableCdn(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendBucketName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_backend_bucket_signed_url_key.go b/google/resource_compute_backend_bucket_signed_url_key.go index 53b77e84e30..411422ba45e 100644 --- a/google/resource_compute_backend_bucket_signed_url_key.go +++ b/google/resource_compute_backend_bucket_signed_url_key.go @@ -167,7 +167,7 @@ func resourceComputeBackendBucketSignedUrlKeyRead(d *schema.ResourceData, meta i return fmt.Errorf("Error reading BackendBucketSignedUrlKey: %s", err) } - if err := d.Set("name", flattenComputeBackendBucketSignedUrlKeyName(res["keyName"], d)); err != nil { + if err := d.Set("name", flattenComputeBackendBucketSignedUrlKeyName(res["keyName"], d, config)); err != nil { return fmt.Errorf("Error reading BackendBucketSignedUrlKey: %s", err) } @@ -214,7 +214,7 @@ func resourceComputeBackendBucketSignedUrlKeyDelete(d *schema.ResourceData, meta return nil } -func flattenComputeBackendBucketSignedUrlKeyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendBucketSignedUrlKeyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -282,7 +282,7 @@ func resourceComputeBackendBucketSignedUrlKeyFindNestedObjectInList(d *schema.Re "keyName": itemRaw, } - itemName := flattenComputeBackendBucketSignedUrlKeyName(item["keyName"], d) + itemName := flattenComputeBackendBucketSignedUrlKeyName(item["keyName"], d, meta.(*Config)) if !reflect.DeepEqual(itemName, expectedName) { log.Printf("[DEBUG] Skipping item with keyName= %#v, looking for %#v)", itemName, expectedName) continue diff --git a/google/resource_compute_backend_service.go b/google/resource_compute_backend_service.go index c28bf817ffe..f95edff4ab0 100644 --- a/google/resource_compute_backend_service.go +++ b/google/resource_compute_backend_service.go @@ -737,18 +737,18 @@ func resourceComputeBackendServiceRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("affinity_cookie_ttl_sec", flattenComputeBackendServiceAffinityCookieTtlSec(res["affinityCookieTtlSec"], d)); err != nil { + if err := d.Set("affinity_cookie_ttl_sec", flattenComputeBackendServiceAffinityCookieTtlSec(res["affinityCookieTtlSec"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("backend", flattenComputeBackendServiceBackend(res["backends"], d)); err != nil { + if err := d.Set("backend", flattenComputeBackendServiceBackend(res["backends"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("cdn_policy", flattenComputeBackendServiceCdnPolicy(res["cdnPolicy"], d)); err != nil { + if err := d.Set("cdn_policy", flattenComputeBackendServiceCdnPolicy(res["cdnPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } // Terraform must set the top level schema field, but since this object contains collapsed properties // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. - if flattenedProp := flattenComputeBackendServiceConnectionDraining(res["connectionDraining"], d); flattenedProp != nil { + if flattenedProp := flattenComputeBackendServiceConnectionDraining(res["connectionDraining"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -756,43 +756,43 @@ func resourceComputeBackendServiceRead(d *schema.ResourceData, meta interface{}) } } } - if err := d.Set("creation_timestamp", flattenComputeBackendServiceCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeBackendServiceCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("fingerprint", flattenComputeBackendServiceFingerprint(res["fingerprint"], d)); err != nil { + if err := d.Set("fingerprint", flattenComputeBackendServiceFingerprint(res["fingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("description", flattenComputeBackendServiceDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeBackendServiceDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("enable_cdn", flattenComputeBackendServiceEnableCDN(res["enableCDN"], d)); err != nil { + if err := d.Set("enable_cdn", flattenComputeBackendServiceEnableCDN(res["enableCDN"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("health_checks", flattenComputeBackendServiceHealthChecks(res["healthChecks"], d)); err != nil { + if err := d.Set("health_checks", flattenComputeBackendServiceHealthChecks(res["healthChecks"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("iap", flattenComputeBackendServiceIap(res["iap"], d)); err != nil { + if err := d.Set("iap", flattenComputeBackendServiceIap(res["iap"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("load_balancing_scheme", flattenComputeBackendServiceLoadBalancingScheme(res["loadBalancingScheme"], d)); err != nil { + if err := d.Set("load_balancing_scheme", flattenComputeBackendServiceLoadBalancingScheme(res["loadBalancingScheme"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("name", flattenComputeBackendServiceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeBackendServiceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("port_name", flattenComputeBackendServicePortName(res["portName"], d)); err != nil { + if err := d.Set("port_name", flattenComputeBackendServicePortName(res["portName"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("protocol", flattenComputeBackendServiceProtocol(res["protocol"], d)); err != nil { + if err := d.Set("protocol", flattenComputeBackendServiceProtocol(res["protocol"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("security_policy", flattenComputeBackendServiceSecurityPolicy(res["securityPolicy"], d)); err != nil { + if err := d.Set("security_policy", flattenComputeBackendServiceSecurityPolicy(res["securityPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("session_affinity", flattenComputeBackendServiceSessionAffinity(res["sessionAffinity"], d)); err != nil { + if err := d.Set("session_affinity", flattenComputeBackendServiceSessionAffinity(res["sessionAffinity"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("timeout_sec", flattenComputeBackendServiceTimeoutSec(res["timeoutSec"], d)); err != nil { + if err := d.Set("timeout_sec", flattenComputeBackendServiceTimeoutSec(res["timeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -1007,7 +1007,7 @@ func resourceComputeBackendServiceImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeBackendServiceAffinityCookieTtlSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceAffinityCookieTtlSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1017,7 +1017,7 @@ func flattenComputeBackendServiceAffinityCookieTtlSec(v interface{}, d *schema.R return v } -func flattenComputeBackendServiceBackend(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackend(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1030,41 +1030,41 @@ func flattenComputeBackendServiceBackend(v interface{}, d *schema.ResourceData) continue } transformed.Add(map[string]interface{}{ - "balancing_mode": flattenComputeBackendServiceBackendBalancingMode(original["balancingMode"], d), - "capacity_scaler": flattenComputeBackendServiceBackendCapacityScaler(original["capacityScaler"], d), - "description": flattenComputeBackendServiceBackendDescription(original["description"], d), - "group": flattenComputeBackendServiceBackendGroup(original["group"], d), - "max_connections": flattenComputeBackendServiceBackendMaxConnections(original["maxConnections"], d), - "max_connections_per_instance": flattenComputeBackendServiceBackendMaxConnectionsPerInstance(original["maxConnectionsPerInstance"], d), - "max_connections_per_endpoint": flattenComputeBackendServiceBackendMaxConnectionsPerEndpoint(original["maxConnectionsPerEndpoint"], d), - "max_rate": flattenComputeBackendServiceBackendMaxRate(original["maxRate"], d), - "max_rate_per_instance": flattenComputeBackendServiceBackendMaxRatePerInstance(original["maxRatePerInstance"], d), - "max_rate_per_endpoint": flattenComputeBackendServiceBackendMaxRatePerEndpoint(original["maxRatePerEndpoint"], d), - "max_utilization": flattenComputeBackendServiceBackendMaxUtilization(original["maxUtilization"], d), + "balancing_mode": flattenComputeBackendServiceBackendBalancingMode(original["balancingMode"], d, config), + "capacity_scaler": flattenComputeBackendServiceBackendCapacityScaler(original["capacityScaler"], d, config), + "description": flattenComputeBackendServiceBackendDescription(original["description"], d, config), + "group": flattenComputeBackendServiceBackendGroup(original["group"], d, config), + "max_connections": flattenComputeBackendServiceBackendMaxConnections(original["maxConnections"], d, config), + "max_connections_per_instance": flattenComputeBackendServiceBackendMaxConnectionsPerInstance(original["maxConnectionsPerInstance"], d, config), + "max_connections_per_endpoint": flattenComputeBackendServiceBackendMaxConnectionsPerEndpoint(original["maxConnectionsPerEndpoint"], d, config), + "max_rate": flattenComputeBackendServiceBackendMaxRate(original["maxRate"], d, config), + "max_rate_per_instance": flattenComputeBackendServiceBackendMaxRatePerInstance(original["maxRatePerInstance"], d, config), + "max_rate_per_endpoint": flattenComputeBackendServiceBackendMaxRatePerEndpoint(original["maxRatePerEndpoint"], d, config), + "max_utilization": flattenComputeBackendServiceBackendMaxUtilization(original["maxUtilization"], d, config), }) } return transformed } -func flattenComputeBackendServiceBackendBalancingMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendBalancingMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceBackendCapacityScaler(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendCapacityScaler(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceBackendDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceBackendGroup(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendGroup(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeBackendServiceBackendMaxConnections(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxConnections(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1074,7 +1074,7 @@ func flattenComputeBackendServiceBackendMaxConnections(v interface{}, d *schema. return v } -func flattenComputeBackendServiceBackendMaxConnectionsPerInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxConnectionsPerInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1084,7 +1084,7 @@ func flattenComputeBackendServiceBackendMaxConnectionsPerInstance(v interface{}, return v } -func flattenComputeBackendServiceBackendMaxConnectionsPerEndpoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxConnectionsPerEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1094,7 +1094,7 @@ func flattenComputeBackendServiceBackendMaxConnectionsPerEndpoint(v interface{}, return v } -func flattenComputeBackendServiceBackendMaxRate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxRate(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1104,19 +1104,19 @@ func flattenComputeBackendServiceBackendMaxRate(v interface{}, d *schema.Resourc return v } -func flattenComputeBackendServiceBackendMaxRatePerInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxRatePerInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceBackendMaxRatePerEndpoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxRatePerEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceBackendMaxUtilization(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceBackendMaxUtilization(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceCdnPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1126,12 +1126,12 @@ func flattenComputeBackendServiceCdnPolicy(v interface{}, d *schema.ResourceData } transformed := make(map[string]interface{}) transformed["cache_key_policy"] = - flattenComputeBackendServiceCdnPolicyCacheKeyPolicy(original["cacheKeyPolicy"], d) + flattenComputeBackendServiceCdnPolicyCacheKeyPolicy(original["cacheKeyPolicy"], d, config) transformed["signed_url_cache_max_age_sec"] = - flattenComputeBackendServiceCdnPolicySignedUrlCacheMaxAgeSec(original["signedUrlCacheMaxAgeSec"], d) + flattenComputeBackendServiceCdnPolicySignedUrlCacheMaxAgeSec(original["signedUrlCacheMaxAgeSec"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceCdnPolicyCacheKeyPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicyCacheKeyPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1141,44 +1141,44 @@ func flattenComputeBackendServiceCdnPolicyCacheKeyPolicy(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["include_host"] = - flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeHost(original["includeHost"], d) + flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeHost(original["includeHost"], d, config) transformed["include_protocol"] = - flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeProtocol(original["includeProtocol"], d) + flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeProtocol(original["includeProtocol"], d, config) transformed["include_query_string"] = - flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeQueryString(original["includeQueryString"], d) + flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeQueryString(original["includeQueryString"], d, config) transformed["query_string_blacklist"] = - flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringBlacklist(original["queryStringBlacklist"], d) + flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringBlacklist(original["queryStringBlacklist"], d, config) transformed["query_string_whitelist"] = - flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringWhitelist(original["queryStringWhitelist"], d) + flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringWhitelist(original["queryStringWhitelist"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeQueryString(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyIncludeQueryString(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringBlacklist(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringBlacklist(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringWhitelist(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicyCacheKeyPolicyQueryStringWhitelist(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeBackendServiceCdnPolicySignedUrlCacheMaxAgeSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCdnPolicySignedUrlCacheMaxAgeSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1188,7 +1188,7 @@ func flattenComputeBackendServiceCdnPolicySignedUrlCacheMaxAgeSec(v interface{}, return v } -func flattenComputeBackendServiceConnectionDraining(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConnectionDraining(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1198,10 +1198,10 @@ func flattenComputeBackendServiceConnectionDraining(v interface{}, d *schema.Res } transformed := make(map[string]interface{}) transformed["connection_draining_timeout_sec"] = - flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(original["drainingTimeoutSec"], d) + flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(original["drainingTimeoutSec"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1211,30 +1211,30 @@ func flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec( return v } -func flattenComputeBackendServiceCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceEnableCDN(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceEnableCDN(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceHealthChecks(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceHealthChecks(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeBackendServiceIap(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceIap(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1244,50 +1244,50 @@ func flattenComputeBackendServiceIap(v interface{}, d *schema.ResourceData) inte } transformed := make(map[string]interface{}) transformed["oauth2_client_id"] = - flattenComputeBackendServiceIapOauth2ClientId(original["oauth2ClientId"], d) + flattenComputeBackendServiceIapOauth2ClientId(original["oauth2ClientId"], d, config) transformed["oauth2_client_secret"] = - flattenComputeBackendServiceIapOauth2ClientSecret(original["oauth2ClientSecret"], d) + flattenComputeBackendServiceIapOauth2ClientSecret(original["oauth2ClientSecret"], d, config) transformed["oauth2_client_secret_sha256"] = - flattenComputeBackendServiceIapOauth2ClientSecretSha256(original["oauth2ClientSecretSha256"], d) + flattenComputeBackendServiceIapOauth2ClientSecretSha256(original["oauth2ClientSecretSha256"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceIapOauth2ClientId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceIapOauth2ClientId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceIapOauth2ClientSecret(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceIapOauth2ClientSecret(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("iap.0.oauth2_client_secret") } -func flattenComputeBackendServiceIapOauth2ClientSecretSha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceIapOauth2ClientSecretSha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceLoadBalancingScheme(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServicePortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServicePortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceSecurityPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceSecurityPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceSessionAffinity(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceSessionAffinity(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { diff --git a/google/resource_compute_backend_service_signed_url_key.go b/google/resource_compute_backend_service_signed_url_key.go index e421aeb0b04..e0c88dff0e5 100644 --- a/google/resource_compute_backend_service_signed_url_key.go +++ b/google/resource_compute_backend_service_signed_url_key.go @@ -167,7 +167,7 @@ func resourceComputeBackendServiceSignedUrlKeyRead(d *schema.ResourceData, meta return fmt.Errorf("Error reading BackendServiceSignedUrlKey: %s", err) } - if err := d.Set("name", flattenComputeBackendServiceSignedUrlKeyName(res["keyName"], d)); err != nil { + if err := d.Set("name", flattenComputeBackendServiceSignedUrlKeyName(res["keyName"], d, config)); err != nil { return fmt.Errorf("Error reading BackendServiceSignedUrlKey: %s", err) } @@ -214,7 +214,7 @@ func resourceComputeBackendServiceSignedUrlKeyDelete(d *schema.ResourceData, met return nil } -func flattenComputeBackendServiceSignedUrlKeyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceSignedUrlKeyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -282,7 +282,7 @@ func resourceComputeBackendServiceSignedUrlKeyFindNestedObjectInList(d *schema.R "keyName": itemRaw, } - itemName := flattenComputeBackendServiceSignedUrlKeyName(item["keyName"], d) + itemName := flattenComputeBackendServiceSignedUrlKeyName(item["keyName"], d, meta.(*Config)) if !reflect.DeepEqual(itemName, expectedName) { log.Printf("[DEBUG] Skipping item with keyName= %#v, looking for %#v)", itemName, expectedName) continue diff --git a/google/resource_compute_disk.go b/google/resource_compute_disk.go index 4bd7def2a8f..be3eb9cd0fc 100644 --- a/google/resource_compute_disk.go +++ b/google/resource_compute_disk.go @@ -677,61 +677,61 @@ func resourceComputeDiskRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeDiskLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeDiskLabelFingerprint(res["labelFingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeDiskCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeDiskCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("description", flattenComputeDiskDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeDiskDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("last_attach_timestamp", flattenComputeDiskLastAttachTimestamp(res["lastAttachTimestamp"], d)); err != nil { + if err := d.Set("last_attach_timestamp", flattenComputeDiskLastAttachTimestamp(res["lastAttachTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("last_detach_timestamp", flattenComputeDiskLastDetachTimestamp(res["lastDetachTimestamp"], d)); err != nil { + if err := d.Set("last_detach_timestamp", flattenComputeDiskLastDetachTimestamp(res["lastDetachTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("labels", flattenComputeDiskLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeDiskLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("name", flattenComputeDiskName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeDiskName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("size", flattenComputeDiskSize(res["sizeGb"], d)); err != nil { + if err := d.Set("size", flattenComputeDiskSize(res["sizeGb"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("users", flattenComputeDiskUsers(res["users"], d)); err != nil { + if err := d.Set("users", flattenComputeDiskUsers(res["users"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("physical_block_size_bytes", flattenComputeDiskPhysicalBlockSizeBytes(res["physicalBlockSizeBytes"], d)); err != nil { + if err := d.Set("physical_block_size_bytes", flattenComputeDiskPhysicalBlockSizeBytes(res["physicalBlockSizeBytes"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("type", flattenComputeDiskType(res["type"], d)); err != nil { + if err := d.Set("type", flattenComputeDiskType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("image", flattenComputeDiskImage(res["sourceImage"], d)); err != nil { + if err := d.Set("image", flattenComputeDiskImage(res["sourceImage"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("zone", flattenComputeDiskZone(res["zone"], d)); err != nil { + if err := d.Set("zone", flattenComputeDiskZone(res["zone"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("source_image_encryption_key", flattenComputeDiskSourceImageEncryptionKey(res["sourceImageEncryptionKey"], d)); err != nil { + if err := d.Set("source_image_encryption_key", flattenComputeDiskSourceImageEncryptionKey(res["sourceImageEncryptionKey"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("source_image_id", flattenComputeDiskSourceImageId(res["sourceImageId"], d)); err != nil { + if err := d.Set("source_image_id", flattenComputeDiskSourceImageId(res["sourceImageId"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("disk_encryption_key", flattenComputeDiskDiskEncryptionKey(res["diskEncryptionKey"], d)); err != nil { + if err := d.Set("disk_encryption_key", flattenComputeDiskDiskEncryptionKey(res["diskEncryptionKey"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("snapshot", flattenComputeDiskSnapshot(res["sourceSnapshot"], d)); err != nil { + if err := d.Set("snapshot", flattenComputeDiskSnapshot(res["sourceSnapshot"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("source_snapshot_encryption_key", flattenComputeDiskSourceSnapshotEncryptionKey(res["sourceSnapshotEncryptionKey"], d)); err != nil { + if err := d.Set("source_snapshot_encryption_key", flattenComputeDiskSourceSnapshotEncryptionKey(res["sourceSnapshotEncryptionKey"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } - if err := d.Set("source_snapshot_id", flattenComputeDiskSourceSnapshotId(res["sourceSnapshotId"], d)); err != nil { + if err := d.Set("source_snapshot_id", flattenComputeDiskSourceSnapshotId(res["sourceSnapshotId"], d, config)); err != nil { return fmt.Errorf("Error reading Disk: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -928,35 +928,35 @@ func resourceComputeDiskImport(d *schema.ResourceData, meta interface{}) ([]*sch return []*schema.ResourceData{d}, nil } -func flattenComputeDiskLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskLastAttachTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskLastAttachTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskLastDetachTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskLastDetachTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSize(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -966,14 +966,14 @@ func flattenComputeDiskSize(v interface{}, d *schema.ResourceData) interface{} { return v } -func flattenComputeDiskUsers(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskUsers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeDiskPhysicalBlockSizeBytes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskPhysicalBlockSizeBytes(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -983,25 +983,25 @@ func flattenComputeDiskPhysicalBlockSizeBytes(v interface{}, d *schema.ResourceD return v } -func flattenComputeDiskType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskType(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenComputeDiskImage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskImage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1011,30 +1011,30 @@ func flattenComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.Resourc } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeDiskSourceImageEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeDiskSourceImageEncryptionKeyRawKey(original["rawKey"], d, config) transformed["sha256"] = - flattenComputeDiskSourceImageEncryptionKeySha256(original["sha256"], d) + flattenComputeDiskSourceImageEncryptionKeySha256(original["sha256"], d, config) transformed["kms_key_self_link"] = - flattenComputeDiskSourceImageEncryptionKeyKmsKeySelfLink(original["kmsKeyName"], d) + flattenComputeDiskSourceImageEncryptionKeyKmsKeySelfLink(original["kmsKeyName"], d, config) return []interface{}{transformed} } -func flattenComputeDiskSourceImageEncryptionKeyRawKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceImageEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSourceImageEncryptionKeySha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceImageEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSourceImageEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceImageEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSourceImageId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceImageId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1044,33 +1044,33 @@ func flattenComputeDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeDiskDiskEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeDiskDiskEncryptionKeyRawKey(original["rawKey"], d, config) transformed["sha256"] = - flattenComputeDiskDiskEncryptionKeySha256(original["sha256"], d) + flattenComputeDiskDiskEncryptionKeySha256(original["sha256"], d, config) transformed["kms_key_self_link"] = - flattenComputeDiskDiskEncryptionKeyKmsKeySelfLink(original["kmsKeyName"], d) + flattenComputeDiskDiskEncryptionKeyKmsKeySelfLink(original["kmsKeyName"], d, config) return []interface{}{transformed} } -func flattenComputeDiskDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskDiskEncryptionKeySha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskDiskEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskDiskEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskDiskEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSnapshot(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSnapshot(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1080,26 +1080,26 @@ func flattenComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeDiskSourceSnapshotEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeDiskSourceSnapshotEncryptionKeyRawKey(original["rawKey"], d, config) transformed["kms_key_self_link"] = - flattenComputeDiskSourceSnapshotEncryptionKeyKmsKeySelfLink(original["kmsKeyName"], d) + flattenComputeDiskSourceSnapshotEncryptionKeyKmsKeySelfLink(original["kmsKeyName"], d, config) transformed["sha256"] = - flattenComputeDiskSourceSnapshotEncryptionKeySha256(original["sha256"], d) + flattenComputeDiskSourceSnapshotEncryptionKeySha256(original["sha256"], d, config) return []interface{}{transformed} } -func flattenComputeDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSourceSnapshotEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceSnapshotEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSourceSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeDiskSourceSnapshotId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskSourceSnapshotId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_disk_resource_policy_attachment.go b/google/resource_compute_disk_resource_policy_attachment.go index e3a13f5a921..49a871d1b35 100644 --- a/google/resource_compute_disk_resource_policy_attachment.go +++ b/google/resource_compute_disk_resource_policy_attachment.go @@ -169,7 +169,7 @@ func resourceComputeDiskResourcePolicyAttachmentRead(d *schema.ResourceData, met return fmt.Errorf("Error reading DiskResourcePolicyAttachment: %s", err) } - if err := d.Set("name", flattenComputeDiskResourcePolicyAttachmentName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeDiskResourcePolicyAttachmentName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading DiskResourcePolicyAttachment: %s", err) } @@ -254,7 +254,7 @@ func resourceComputeDiskResourcePolicyAttachmentImport(d *schema.ResourceData, m return []*schema.ResourceData{d}, nil } -func flattenComputeDiskResourcePolicyAttachmentName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskResourcePolicyAttachmentName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -338,7 +338,7 @@ func resourceComputeDiskResourcePolicyAttachmentFindNestedObjectInList(d *schema return -1, nil, err } - itemName := flattenComputeDiskResourcePolicyAttachmentName(item["name"], d) + itemName := flattenComputeDiskResourcePolicyAttachmentName(item["name"], d, meta.(*Config)) if !reflect.DeepEqual(itemName, expectedName) { log.Printf("[DEBUG] Skipping item with name= %#v, looking for %#v)", itemName, expectedName) continue diff --git a/google/resource_compute_firewall.go b/google/resource_compute_firewall.go index a7fc70ee66e..862fa14fdaa 100644 --- a/google/resource_compute_firewall.go +++ b/google/resource_compute_firewall.go @@ -489,30 +489,30 @@ func resourceComputeFirewallRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("allow", flattenComputeFirewallAllow(res["allowed"], d)); err != nil { + if err := d.Set("allow", flattenComputeFirewallAllow(res["allowed"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeFirewallCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeFirewallCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("deny", flattenComputeFirewallDeny(res["denied"], d)); err != nil { + if err := d.Set("deny", flattenComputeFirewallDeny(res["denied"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("description", flattenComputeFirewallDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeFirewallDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("destination_ranges", flattenComputeFirewallDestinationRanges(res["destinationRanges"], d)); err != nil { + if err := d.Set("destination_ranges", flattenComputeFirewallDestinationRanges(res["destinationRanges"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("direction", flattenComputeFirewallDirection(res["direction"], d)); err != nil { + if err := d.Set("direction", flattenComputeFirewallDirection(res["direction"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("disabled", flattenComputeFirewallDisabled(res["disabled"], d)); err != nil { + if err := d.Set("disabled", flattenComputeFirewallDisabled(res["disabled"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } // Terraform must set the top level schema field, but since this object contains collapsed properties // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. - if flattenedProp := flattenComputeFirewallLogConfig(res["logConfig"], d); flattenedProp != nil { + if flattenedProp := flattenComputeFirewallLogConfig(res["logConfig"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -520,28 +520,28 @@ func resourceComputeFirewallRead(d *schema.ResourceData, meta interface{}) error } } } - if err := d.Set("name", flattenComputeFirewallName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeFirewallName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("network", flattenComputeFirewallNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeFirewallNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("priority", flattenComputeFirewallPriority(res["priority"], d)); err != nil { + if err := d.Set("priority", flattenComputeFirewallPriority(res["priority"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("source_ranges", flattenComputeFirewallSourceRanges(res["sourceRanges"], d)); err != nil { + if err := d.Set("source_ranges", flattenComputeFirewallSourceRanges(res["sourceRanges"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("source_service_accounts", flattenComputeFirewallSourceServiceAccounts(res["sourceServiceAccounts"], d)); err != nil { + if err := d.Set("source_service_accounts", flattenComputeFirewallSourceServiceAccounts(res["sourceServiceAccounts"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("source_tags", flattenComputeFirewallSourceTags(res["sourceTags"], d)); err != nil { + if err := d.Set("source_tags", flattenComputeFirewallSourceTags(res["sourceTags"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("target_service_accounts", flattenComputeFirewallTargetServiceAccounts(res["targetServiceAccounts"], d)); err != nil { + if err := d.Set("target_service_accounts", flattenComputeFirewallTargetServiceAccounts(res["targetServiceAccounts"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } - if err := d.Set("target_tags", flattenComputeFirewallTargetTags(res["targetTags"], d)); err != nil { + if err := d.Set("target_tags", flattenComputeFirewallTargetTags(res["targetTags"], d, config)); err != nil { return fmt.Errorf("Error reading Firewall: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -715,7 +715,7 @@ func resourceComputeFirewallImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenComputeFirewallAllow(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallAllow(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -728,25 +728,25 @@ func flattenComputeFirewallAllow(v interface{}, d *schema.ResourceData) interfac continue } transformed.Add(map[string]interface{}{ - "protocol": flattenComputeFirewallAllowProtocol(original["IPProtocol"], d), - "ports": flattenComputeFirewallAllowPorts(original["ports"], d), + "protocol": flattenComputeFirewallAllowProtocol(original["IPProtocol"], d, config), + "ports": flattenComputeFirewallAllowPorts(original["ports"], d, config), }) } return transformed } -func flattenComputeFirewallAllowProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallAllowProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallAllowPorts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallAllowPorts(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallDeny(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDeny(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -759,40 +759,40 @@ func flattenComputeFirewallDeny(v interface{}, d *schema.ResourceData) interface continue } transformed.Add(map[string]interface{}{ - "protocol": flattenComputeFirewallDenyProtocol(original["IPProtocol"], d), - "ports": flattenComputeFirewallDenyPorts(original["ports"], d), + "protocol": flattenComputeFirewallDenyProtocol(original["IPProtocol"], d, config), + "ports": flattenComputeFirewallDenyPorts(original["ports"], d, config), }) } return transformed } -func flattenComputeFirewallDenyProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDenyProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallDenyPorts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDenyPorts(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallDestinationRanges(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDestinationRanges(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeFirewallDirection(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDirection(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallLogConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallLogConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -802,25 +802,25 @@ func flattenComputeFirewallLogConfig(v interface{}, d *schema.ResourceData) inte } transformed := make(map[string]interface{}) transformed["enable_logging"] = - flattenComputeFirewallLogConfigEnableLogging(original["enable"], d) + flattenComputeFirewallLogConfigEnableLogging(original["enable"], d, config) return []interface{}{transformed} } -func flattenComputeFirewallLogConfigEnableLogging(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallLogConfigEnableLogging(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeFirewallNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeFirewallPriority(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallPriority(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -830,35 +830,35 @@ func flattenComputeFirewallPriority(v interface{}, d *schema.ResourceData) inter return v } -func flattenComputeFirewallSourceRanges(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallSourceRanges(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeFirewallSourceServiceAccounts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallSourceServiceAccounts(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeFirewallSourceTags(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallSourceTags(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeFirewallTargetServiceAccounts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallTargetServiceAccounts(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeFirewallTargetTags(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeFirewallTargetTags(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_forwarding_rule.go b/google/resource_compute_forwarding_rule.go index 9b852f1f9cf..629dc043ff3 100644 --- a/google/resource_compute_forwarding_rule.go +++ b/google/resource_compute_forwarding_rule.go @@ -436,55 +436,55 @@ func resourceComputeForwardingRuleRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeForwardingRuleCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeForwardingRuleCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("description", flattenComputeForwardingRuleDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeForwardingRuleDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("ip_address", flattenComputeForwardingRuleIPAddress(res["IPAddress"], d)); err != nil { + if err := d.Set("ip_address", flattenComputeForwardingRuleIPAddress(res["IPAddress"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("ip_protocol", flattenComputeForwardingRuleIPProtocol(res["IPProtocol"], d)); err != nil { + if err := d.Set("ip_protocol", flattenComputeForwardingRuleIPProtocol(res["IPProtocol"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("backend_service", flattenComputeForwardingRuleBackendService(res["backendService"], d)); err != nil { + if err := d.Set("backend_service", flattenComputeForwardingRuleBackendService(res["backendService"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("load_balancing_scheme", flattenComputeForwardingRuleLoadBalancingScheme(res["loadBalancingScheme"], d)); err != nil { + if err := d.Set("load_balancing_scheme", flattenComputeForwardingRuleLoadBalancingScheme(res["loadBalancingScheme"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("name", flattenComputeForwardingRuleName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeForwardingRuleName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("network", flattenComputeForwardingRuleNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeForwardingRuleNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("port_range", flattenComputeForwardingRulePortRange(res["portRange"], d)); err != nil { + if err := d.Set("port_range", flattenComputeForwardingRulePortRange(res["portRange"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("ports", flattenComputeForwardingRulePorts(res["ports"], d)); err != nil { + if err := d.Set("ports", flattenComputeForwardingRulePorts(res["ports"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("subnetwork", flattenComputeForwardingRuleSubnetwork(res["subnetwork"], d)); err != nil { + if err := d.Set("subnetwork", flattenComputeForwardingRuleSubnetwork(res["subnetwork"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("target", flattenComputeForwardingRuleTarget(res["target"], d)); err != nil { + if err := d.Set("target", flattenComputeForwardingRuleTarget(res["target"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("all_ports", flattenComputeForwardingRuleAllPorts(res["allPorts"], d)); err != nil { + if err := d.Set("all_ports", flattenComputeForwardingRuleAllPorts(res["allPorts"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("network_tier", flattenComputeForwardingRuleNetworkTier(res["networkTier"], d)); err != nil { + if err := d.Set("network_tier", flattenComputeForwardingRuleNetworkTier(res["networkTier"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("service_label", flattenComputeForwardingRuleServiceLabel(res["serviceLabel"], d)); err != nil { + if err := d.Set("service_label", flattenComputeForwardingRuleServiceLabel(res["serviceLabel"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("service_name", flattenComputeForwardingRuleServiceName(res["serviceName"], d)); err != nil { + if err := d.Set("service_name", flattenComputeForwardingRuleServiceName(res["serviceName"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("region", flattenComputeForwardingRuleRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeForwardingRuleRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -592,83 +592,83 @@ func resourceComputeForwardingRuleImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeForwardingRuleCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleIPAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleIPAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeForwardingRulePortRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRulePortRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRulePorts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRulePorts(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeForwardingRuleSubnetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleSubnetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeForwardingRuleTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleAllPorts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleAllPorts(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleNetworkTier(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleNetworkTier(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleServiceLabel(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleServiceLabel(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleServiceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleServiceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_global_address.go b/google/resource_compute_global_address.go index 6ad2c9735ee..ac303ce560c 100644 --- a/google/resource_compute_global_address.go +++ b/google/resource_compute_global_address.go @@ -250,31 +250,31 @@ func resourceComputeGlobalAddressRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("address", flattenComputeGlobalAddressAddress(res["address"], d)); err != nil { + if err := d.Set("address", flattenComputeGlobalAddressAddress(res["address"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeGlobalAddressCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeGlobalAddressCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("description", flattenComputeGlobalAddressDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeGlobalAddressDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("name", flattenComputeGlobalAddressName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeGlobalAddressName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("ip_version", flattenComputeGlobalAddressIpVersion(res["ipVersion"], d)); err != nil { + if err := d.Set("ip_version", flattenComputeGlobalAddressIpVersion(res["ipVersion"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("prefix_length", flattenComputeGlobalAddressPrefixLength(res["prefixLength"], d)); err != nil { + if err := d.Set("prefix_length", flattenComputeGlobalAddressPrefixLength(res["prefixLength"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("address_type", flattenComputeGlobalAddressAddressType(res["addressType"], d)); err != nil { + if err := d.Set("address_type", flattenComputeGlobalAddressAddressType(res["addressType"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("purpose", flattenComputeGlobalAddressPurpose(res["purpose"], d)); err != nil { + if err := d.Set("purpose", flattenComputeGlobalAddressPurpose(res["purpose"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("network", flattenComputeGlobalAddressNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeGlobalAddressNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -337,27 +337,27 @@ func resourceComputeGlobalAddressImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenComputeGlobalAddressAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressIpVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressIpVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressPrefixLength(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressPrefixLength(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -367,15 +367,15 @@ func flattenComputeGlobalAddressPrefixLength(v interface{}, d *schema.ResourceDa return v } -func flattenComputeGlobalAddressAddressType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressAddressType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressPurpose(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressPurpose(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_global_forwarding_rule.go b/google/resource_compute_global_forwarding_rule.go index cdd080c7b2f..1ce15a85f79 100644 --- a/google/resource_compute_global_forwarding_rule.go +++ b/google/resource_compute_global_forwarding_rule.go @@ -359,31 +359,31 @@ func resourceComputeGlobalForwardingRuleRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("description", flattenComputeGlobalForwardingRuleDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeGlobalForwardingRuleDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("ip_address", flattenComputeGlobalForwardingRuleIPAddress(res["IPAddress"], d)); err != nil { + if err := d.Set("ip_address", flattenComputeGlobalForwardingRuleIPAddress(res["IPAddress"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("ip_protocol", flattenComputeGlobalForwardingRuleIPProtocol(res["IPProtocol"], d)); err != nil { + if err := d.Set("ip_protocol", flattenComputeGlobalForwardingRuleIPProtocol(res["IPProtocol"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("ip_version", flattenComputeGlobalForwardingRuleIpVersion(res["ipVersion"], d)); err != nil { + if err := d.Set("ip_version", flattenComputeGlobalForwardingRuleIpVersion(res["ipVersion"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("load_balancing_scheme", flattenComputeGlobalForwardingRuleLoadBalancingScheme(res["loadBalancingScheme"], d)); err != nil { + if err := d.Set("load_balancing_scheme", flattenComputeGlobalForwardingRuleLoadBalancingScheme(res["loadBalancingScheme"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("metadata_filters", flattenComputeGlobalForwardingRuleMetadataFilters(res["metadataFilters"], d)); err != nil { + if err := d.Set("metadata_filters", flattenComputeGlobalForwardingRuleMetadataFilters(res["metadataFilters"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("name", flattenComputeGlobalForwardingRuleName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeGlobalForwardingRuleName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("port_range", flattenComputeGlobalForwardingRulePortRange(res["portRange"], d)); err != nil { + if err := d.Set("port_range", flattenComputeGlobalForwardingRulePortRange(res["portRange"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("target", flattenComputeGlobalForwardingRuleTarget(res["target"], d)); err != nil { + if err := d.Set("target", flattenComputeGlobalForwardingRuleTarget(res["target"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -490,27 +490,27 @@ func resourceComputeGlobalForwardingRuleImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenComputeGlobalForwardingRuleDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleIPAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleIPAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleIpVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleIpVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleMetadataFilters(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleMetadataFilters(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -523,17 +523,17 @@ func flattenComputeGlobalForwardingRuleMetadataFilters(v interface{}, d *schema. continue } transformed = append(transformed, map[string]interface{}{ - "filter_match_criteria": flattenComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d), - "filter_labels": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(original["filterLabels"], d), + "filter_match_criteria": flattenComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d, config), + "filter_labels": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(original["filterLabels"], d, config), }) } return transformed } -func flattenComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -546,29 +546,29 @@ func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabels(v interface{} continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(original["name"], d), - "value": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(original["value"], d), + "name": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(original["name"], d, config), + "value": flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(original["value"], d, config), }) } return transformed } -func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRulePortRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRulePortRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_health_check.go b/google/resource_compute_health_check.go index a7e8d99e80d..f2b38c8a557 100644 --- a/google/resource_compute_health_check.go +++ b/google/resource_compute_health_check.go @@ -719,43 +719,43 @@ func resourceComputeHealthCheckRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("check_interval_sec", flattenComputeHealthCheckCheckIntervalSec(res["checkIntervalSec"], d)); err != nil { + if err := d.Set("check_interval_sec", flattenComputeHealthCheckCheckIntervalSec(res["checkIntervalSec"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeHealthCheckCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeHealthCheckCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("description", flattenComputeHealthCheckDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeHealthCheckDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("healthy_threshold", flattenComputeHealthCheckHealthyThreshold(res["healthyThreshold"], d)); err != nil { + if err := d.Set("healthy_threshold", flattenComputeHealthCheckHealthyThreshold(res["healthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("name", flattenComputeHealthCheckName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeHealthCheckName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("timeout_sec", flattenComputeHealthCheckTimeoutSec(res["timeoutSec"], d)); err != nil { + if err := d.Set("timeout_sec", flattenComputeHealthCheckTimeoutSec(res["timeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("unhealthy_threshold", flattenComputeHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d)); err != nil { + if err := d.Set("unhealthy_threshold", flattenComputeHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("type", flattenComputeHealthCheckType(res["type"], d)); err != nil { + if err := d.Set("type", flattenComputeHealthCheckType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("http_health_check", flattenComputeHealthCheckHttpHealthCheck(res["httpHealthCheck"], d)); err != nil { + if err := d.Set("http_health_check", flattenComputeHealthCheckHttpHealthCheck(res["httpHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("https_health_check", flattenComputeHealthCheckHttpsHealthCheck(res["httpsHealthCheck"], d)); err != nil { + if err := d.Set("https_health_check", flattenComputeHealthCheckHttpsHealthCheck(res["httpsHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("tcp_health_check", flattenComputeHealthCheckTcpHealthCheck(res["tcpHealthCheck"], d)); err != nil { + if err := d.Set("tcp_health_check", flattenComputeHealthCheckTcpHealthCheck(res["tcpHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("ssl_health_check", flattenComputeHealthCheckSslHealthCheck(res["sslHealthCheck"], d)); err != nil { + if err := d.Set("ssl_health_check", flattenComputeHealthCheckSslHealthCheck(res["sslHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } - if err := d.Set("http2_health_check", flattenComputeHealthCheckHttp2HealthCheck(res["http2HealthCheck"], d)); err != nil { + if err := d.Set("http2_health_check", flattenComputeHealthCheckHttp2HealthCheck(res["http2HealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading HealthCheck: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -922,7 +922,7 @@ func resourceComputeHealthCheckImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenComputeHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -932,15 +932,15 @@ func flattenComputeHealthCheckCheckIntervalSec(v interface{}, d *schema.Resource return v } -func flattenComputeHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -950,11 +950,11 @@ func flattenComputeHealthCheckHealthyThreshold(v interface{}, d *schema.Resource return v } -func flattenComputeHealthCheckName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -964,7 +964,7 @@ func flattenComputeHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData) return v } -func flattenComputeHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -974,11 +974,11 @@ func flattenComputeHealthCheckUnhealthyThreshold(v interface{}, d *schema.Resour return v } -func flattenComputeHealthCheckType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -988,34 +988,34 @@ func flattenComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceD } transformed := make(map[string]interface{}) transformed["host"] = - flattenComputeHealthCheckHttpHealthCheckHost(original["host"], d) + flattenComputeHealthCheckHttpHealthCheckHost(original["host"], d, config) transformed["request_path"] = - flattenComputeHealthCheckHttpHealthCheckRequestPath(original["requestPath"], d) + flattenComputeHealthCheckHttpHealthCheckRequestPath(original["requestPath"], d, config) transformed["response"] = - flattenComputeHealthCheckHttpHealthCheckResponse(original["response"], d) + flattenComputeHealthCheckHttpHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeHealthCheckHttpHealthCheckPort(original["port"], d) + flattenComputeHealthCheckHttpHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeHealthCheckHttpHealthCheckPortName(original["portName"], d) + flattenComputeHealthCheckHttpHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeHealthCheckHttpHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeHealthCheckHttpHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeHealthCheckHttpHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeHealthCheckHttpHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeHealthCheckHttpHealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1025,19 +1025,19 @@ func flattenComputeHealthCheckHttpHealthCheckPort(v interface{}, d *schema.Resou return v } -func flattenComputeHealthCheckHttpHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1047,34 +1047,34 @@ func flattenComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.Resource } transformed := make(map[string]interface{}) transformed["host"] = - flattenComputeHealthCheckHttpsHealthCheckHost(original["host"], d) + flattenComputeHealthCheckHttpsHealthCheckHost(original["host"], d, config) transformed["request_path"] = - flattenComputeHealthCheckHttpsHealthCheckRequestPath(original["requestPath"], d) + flattenComputeHealthCheckHttpsHealthCheckRequestPath(original["requestPath"], d, config) transformed["response"] = - flattenComputeHealthCheckHttpsHealthCheckResponse(original["response"], d) + flattenComputeHealthCheckHttpsHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeHealthCheckHttpsHealthCheckPort(original["port"], d) + flattenComputeHealthCheckHttpsHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeHealthCheckHttpsHealthCheckPortName(original["portName"], d) + flattenComputeHealthCheckHttpsHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeHealthCheckHttpsHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeHealthCheckHttpsHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeHealthCheckHttpsHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeHealthCheckHttpsHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeHealthCheckHttpsHealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1084,19 +1084,19 @@ func flattenComputeHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.Reso return v } -func flattenComputeHealthCheckHttpsHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttpsHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttpsHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1106,28 +1106,28 @@ func flattenComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceDa } transformed := make(map[string]interface{}) transformed["request"] = - flattenComputeHealthCheckTcpHealthCheckRequest(original["request"], d) + flattenComputeHealthCheckTcpHealthCheckRequest(original["request"], d, config) transformed["response"] = - flattenComputeHealthCheckTcpHealthCheckResponse(original["response"], d) + flattenComputeHealthCheckTcpHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeHealthCheckTcpHealthCheckPort(original["port"], d) + flattenComputeHealthCheckTcpHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeHealthCheckTcpHealthCheckPortName(original["portName"], d) + flattenComputeHealthCheckTcpHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeHealthCheckTcpHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeHealthCheckTcpHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeHealthCheckTcpHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeHealthCheckTcpHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeHealthCheckTcpHealthCheckRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheckRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckTcpHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckTcpHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1137,19 +1137,19 @@ func flattenComputeHealthCheckTcpHealthCheckPort(v interface{}, d *schema.Resour return v } -func flattenComputeHealthCheckTcpHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckTcpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckTcpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1159,28 +1159,28 @@ func flattenComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceDa } transformed := make(map[string]interface{}) transformed["request"] = - flattenComputeHealthCheckSslHealthCheckRequest(original["request"], d) + flattenComputeHealthCheckSslHealthCheckRequest(original["request"], d, config) transformed["response"] = - flattenComputeHealthCheckSslHealthCheckResponse(original["response"], d) + flattenComputeHealthCheckSslHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeHealthCheckSslHealthCheckPort(original["port"], d) + flattenComputeHealthCheckSslHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeHealthCheckSslHealthCheckPortName(original["portName"], d) + flattenComputeHealthCheckSslHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeHealthCheckSslHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeHealthCheckSslHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeHealthCheckSslHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeHealthCheckSslHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeHealthCheckSslHealthCheckRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheckRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckSslHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckSslHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1190,19 +1190,19 @@ func flattenComputeHealthCheckSslHealthCheckPort(v interface{}, d *schema.Resour return v } -func flattenComputeHealthCheckSslHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckSslHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckSslHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckSslHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttp2HealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1212,34 +1212,34 @@ func flattenComputeHealthCheckHttp2HealthCheck(v interface{}, d *schema.Resource } transformed := make(map[string]interface{}) transformed["host"] = - flattenComputeHealthCheckHttp2HealthCheckHost(original["host"], d) + flattenComputeHealthCheckHttp2HealthCheckHost(original["host"], d, config) transformed["request_path"] = - flattenComputeHealthCheckHttp2HealthCheckRequestPath(original["requestPath"], d) + flattenComputeHealthCheckHttp2HealthCheckRequestPath(original["requestPath"], d, config) transformed["response"] = - flattenComputeHealthCheckHttp2HealthCheckResponse(original["response"], d) + flattenComputeHealthCheckHttp2HealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeHealthCheckHttp2HealthCheckPort(original["port"], d) + flattenComputeHealthCheckHttp2HealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeHealthCheckHttp2HealthCheckPortName(original["portName"], d) + flattenComputeHealthCheckHttp2HealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeHealthCheckHttp2HealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeHealthCheckHttp2HealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeHealthCheckHttp2HealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeHealthCheckHttp2HealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeHealthCheckHttp2HealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttp2HealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttp2HealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttp2HealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1249,15 +1249,15 @@ func flattenComputeHealthCheckHttp2HealthCheckPort(v interface{}, d *schema.Reso return v } -func flattenComputeHealthCheckHttp2HealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttp2HealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHealthCheckHttp2HealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHealthCheckHttp2HealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_http_health_check.go b/google/resource_compute_http_health_check.go index 0f05ea9cda2..dfbaf0da5a7 100644 --- a/google/resource_compute_http_health_check.go +++ b/google/resource_compute_http_health_check.go @@ -246,34 +246,34 @@ func resourceComputeHttpHealthCheckRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("check_interval_sec", flattenComputeHttpHealthCheckCheckIntervalSec(res["checkIntervalSec"], d)); err != nil { + if err := d.Set("check_interval_sec", flattenComputeHttpHealthCheckCheckIntervalSec(res["checkIntervalSec"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeHttpHealthCheckCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeHttpHealthCheckCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("description", flattenComputeHttpHealthCheckDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeHttpHealthCheckDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("healthy_threshold", flattenComputeHttpHealthCheckHealthyThreshold(res["healthyThreshold"], d)); err != nil { + if err := d.Set("healthy_threshold", flattenComputeHttpHealthCheckHealthyThreshold(res["healthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("host", flattenComputeHttpHealthCheckHost(res["host"], d)); err != nil { + if err := d.Set("host", flattenComputeHttpHealthCheckHost(res["host"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("name", flattenComputeHttpHealthCheckName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeHttpHealthCheckName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("port", flattenComputeHttpHealthCheckPort(res["port"], d)); err != nil { + if err := d.Set("port", flattenComputeHttpHealthCheckPort(res["port"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("request_path", flattenComputeHttpHealthCheckRequestPath(res["requestPath"], d)); err != nil { + if err := d.Set("request_path", flattenComputeHttpHealthCheckRequestPath(res["requestPath"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("timeout_sec", flattenComputeHttpHealthCheckTimeoutSec(res["timeoutSec"], d)); err != nil { + if err := d.Set("timeout_sec", flattenComputeHttpHealthCheckTimeoutSec(res["timeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } - if err := d.Set("unhealthy_threshold", flattenComputeHttpHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d)); err != nil { + if err := d.Set("unhealthy_threshold", flattenComputeHttpHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading HttpHealthCheck: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -423,7 +423,7 @@ func resourceComputeHttpHealthCheckImport(d *schema.ResourceData, meta interface return []*schema.ResourceData{d}, nil } -func flattenComputeHttpHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -433,15 +433,15 @@ func flattenComputeHttpHealthCheckCheckIntervalSec(v interface{}, d *schema.Reso return v } -func flattenComputeHttpHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpHealthCheckDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -451,15 +451,15 @@ func flattenComputeHttpHealthCheckHealthyThreshold(v interface{}, d *schema.Reso return v } -func flattenComputeHttpHealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpHealthCheckName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -469,11 +469,11 @@ func flattenComputeHttpHealthCheckPort(v interface{}, d *schema.ResourceData) in return v } -func flattenComputeHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -483,7 +483,7 @@ func flattenComputeHttpHealthCheckTimeoutSec(v interface{}, d *schema.ResourceDa return v } -func flattenComputeHttpHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { diff --git a/google/resource_compute_https_health_check.go b/google/resource_compute_https_health_check.go index 7c2557a740e..682a9fba672 100644 --- a/google/resource_compute_https_health_check.go +++ b/google/resource_compute_https_health_check.go @@ -246,34 +246,34 @@ func resourceComputeHttpsHealthCheckRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("check_interval_sec", flattenComputeHttpsHealthCheckCheckIntervalSec(res["checkIntervalSec"], d)); err != nil { + if err := d.Set("check_interval_sec", flattenComputeHttpsHealthCheckCheckIntervalSec(res["checkIntervalSec"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeHttpsHealthCheckCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeHttpsHealthCheckCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("description", flattenComputeHttpsHealthCheckDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeHttpsHealthCheckDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("healthy_threshold", flattenComputeHttpsHealthCheckHealthyThreshold(res["healthyThreshold"], d)); err != nil { + if err := d.Set("healthy_threshold", flattenComputeHttpsHealthCheckHealthyThreshold(res["healthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("host", flattenComputeHttpsHealthCheckHost(res["host"], d)); err != nil { + if err := d.Set("host", flattenComputeHttpsHealthCheckHost(res["host"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("name", flattenComputeHttpsHealthCheckName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeHttpsHealthCheckName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("port", flattenComputeHttpsHealthCheckPort(res["port"], d)); err != nil { + if err := d.Set("port", flattenComputeHttpsHealthCheckPort(res["port"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("request_path", flattenComputeHttpsHealthCheckRequestPath(res["requestPath"], d)); err != nil { + if err := d.Set("request_path", flattenComputeHttpsHealthCheckRequestPath(res["requestPath"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("timeout_sec", flattenComputeHttpsHealthCheckTimeoutSec(res["timeoutSec"], d)); err != nil { + if err := d.Set("timeout_sec", flattenComputeHttpsHealthCheckTimeoutSec(res["timeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } - if err := d.Set("unhealthy_threshold", flattenComputeHttpsHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d)); err != nil { + if err := d.Set("unhealthy_threshold", flattenComputeHttpsHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading HttpsHealthCheck: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -423,7 +423,7 @@ func resourceComputeHttpsHealthCheckImport(d *schema.ResourceData, meta interfac return []*schema.ResourceData{d}, nil } -func flattenComputeHttpsHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -433,15 +433,15 @@ func flattenComputeHttpsHealthCheckCheckIntervalSec(v interface{}, d *schema.Res return v } -func flattenComputeHttpsHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpsHealthCheckDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpsHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -451,15 +451,15 @@ func flattenComputeHttpsHealthCheckHealthyThreshold(v interface{}, d *schema.Res return v } -func flattenComputeHttpsHealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpsHealthCheckName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpsHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -469,11 +469,11 @@ func flattenComputeHttpsHealthCheckPort(v interface{}, d *schema.ResourceData) i return v } -func flattenComputeHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHttpsHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -483,7 +483,7 @@ func flattenComputeHttpsHealthCheckTimeoutSec(v interface{}, d *schema.ResourceD return v } -func flattenComputeHttpsHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHttpsHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { diff --git a/google/resource_compute_image.go b/google/resource_compute_image.go index 18055f131f4..141643b47e7 100644 --- a/google/resource_compute_image.go +++ b/google/resource_compute_image.go @@ -320,37 +320,37 @@ func resourceComputeImageRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("archive_size_bytes", flattenComputeImageArchiveSizeBytes(res["archiveSizeBytes"], d)); err != nil { + if err := d.Set("archive_size_bytes", flattenComputeImageArchiveSizeBytes(res["archiveSizeBytes"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeImageCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeImageCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("description", flattenComputeImageDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeImageDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("disk_size_gb", flattenComputeImageDiskSizeGb(res["diskSizeGb"], d)); err != nil { + if err := d.Set("disk_size_gb", flattenComputeImageDiskSizeGb(res["diskSizeGb"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("family", flattenComputeImageFamily(res["family"], d)); err != nil { + if err := d.Set("family", flattenComputeImageFamily(res["family"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("guest_os_features", flattenComputeImageGuestOsFeatures(res["guestOsFeatures"], d)); err != nil { + if err := d.Set("guest_os_features", flattenComputeImageGuestOsFeatures(res["guestOsFeatures"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("labels", flattenComputeImageLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeImageLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeImageLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeImageLabelFingerprint(res["labelFingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("licenses", flattenComputeImageLicenses(res["licenses"], d)); err != nil { + if err := d.Set("licenses", flattenComputeImageLicenses(res["licenses"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("name", flattenComputeImageName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeImageName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } - if err := d.Set("source_disk", flattenComputeImageSourceDisk(res["sourceDisk"], d)); err != nil { + if err := d.Set("source_disk", flattenComputeImageSourceDisk(res["sourceDisk"], d, config)); err != nil { return fmt.Errorf("Error reading Image: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -464,7 +464,7 @@ func resourceComputeImageImport(d *schema.ResourceData, meta interface{}) ([]*sc return []*schema.ResourceData{d}, nil } -func flattenComputeImageArchiveSizeBytes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageArchiveSizeBytes(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -474,15 +474,15 @@ func flattenComputeImageArchiveSizeBytes(v interface{}, d *schema.ResourceData) return v } -func flattenComputeImageCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageDiskSizeGb(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageDiskSizeGb(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -492,11 +492,11 @@ func flattenComputeImageDiskSizeGb(v interface{}, d *schema.ResourceData) interf return v } -func flattenComputeImageFamily(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageFamily(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageGuestOsFeatures(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageGuestOsFeatures(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -509,35 +509,35 @@ func flattenComputeImageGuestOsFeatures(v interface{}, d *schema.ResourceData) i continue } transformed.Add(map[string]interface{}{ - "type": flattenComputeImageGuestOsFeaturesType(original["type"], d), + "type": flattenComputeImageGuestOsFeaturesType(original["type"], d, config), }) } return transformed } -func flattenComputeImageGuestOsFeaturesType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageGuestOsFeaturesType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageLicenses(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageLicenses(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeImageName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeImageSourceDisk(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeImageSourceDisk(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_interconnect_attachment.go b/google/resource_compute_interconnect_attachment.go index 10e05580755..1fe89f40927 100644 --- a/google/resource_compute_interconnect_attachment.go +++ b/google/resource_compute_interconnect_attachment.go @@ -374,61 +374,61 @@ func resourceComputeInterconnectAttachmentRead(d *schema.ResourceData, meta inte return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("admin_enabled", flattenComputeInterconnectAttachmentAdminEnabled(res["adminEnabled"], d)); err != nil { + if err := d.Set("admin_enabled", flattenComputeInterconnectAttachmentAdminEnabled(res["adminEnabled"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("cloud_router_ip_address", flattenComputeInterconnectAttachmentCloudRouterIpAddress(res["cloudRouterIpAddress"], d)); err != nil { + if err := d.Set("cloud_router_ip_address", flattenComputeInterconnectAttachmentCloudRouterIpAddress(res["cloudRouterIpAddress"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("customer_router_ip_address", flattenComputeInterconnectAttachmentCustomerRouterIpAddress(res["customerRouterIpAddress"], d)); err != nil { + if err := d.Set("customer_router_ip_address", flattenComputeInterconnectAttachmentCustomerRouterIpAddress(res["customerRouterIpAddress"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("interconnect", flattenComputeInterconnectAttachmentInterconnect(res["interconnect"], d)); err != nil { + if err := d.Set("interconnect", flattenComputeInterconnectAttachmentInterconnect(res["interconnect"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("description", flattenComputeInterconnectAttachmentDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeInterconnectAttachmentDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("bandwidth", flattenComputeInterconnectAttachmentBandwidth(res["bandwidth"], d)); err != nil { + if err := d.Set("bandwidth", flattenComputeInterconnectAttachmentBandwidth(res["bandwidth"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("edge_availability_domain", flattenComputeInterconnectAttachmentEdgeAvailabilityDomain(res["edgeAvailabilityDomain"], d)); err != nil { + if err := d.Set("edge_availability_domain", flattenComputeInterconnectAttachmentEdgeAvailabilityDomain(res["edgeAvailabilityDomain"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("pairing_key", flattenComputeInterconnectAttachmentPairingKey(res["pairingKey"], d)); err != nil { + if err := d.Set("pairing_key", flattenComputeInterconnectAttachmentPairingKey(res["pairingKey"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("partner_asn", flattenComputeInterconnectAttachmentPartnerAsn(res["partnerAsn"], d)); err != nil { + if err := d.Set("partner_asn", flattenComputeInterconnectAttachmentPartnerAsn(res["partnerAsn"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("private_interconnect_info", flattenComputeInterconnectAttachmentPrivateInterconnectInfo(res["privateInterconnectInfo"], d)); err != nil { + if err := d.Set("private_interconnect_info", flattenComputeInterconnectAttachmentPrivateInterconnectInfo(res["privateInterconnectInfo"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("type", flattenComputeInterconnectAttachmentType(res["type"], d)); err != nil { + if err := d.Set("type", flattenComputeInterconnectAttachmentType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("state", flattenComputeInterconnectAttachmentState(res["state"], d)); err != nil { + if err := d.Set("state", flattenComputeInterconnectAttachmentState(res["state"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("google_reference_id", flattenComputeInterconnectAttachmentGoogleReferenceId(res["googleReferenceId"], d)); err != nil { + if err := d.Set("google_reference_id", flattenComputeInterconnectAttachmentGoogleReferenceId(res["googleReferenceId"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("router", flattenComputeInterconnectAttachmentRouter(res["router"], d)); err != nil { + if err := d.Set("router", flattenComputeInterconnectAttachmentRouter(res["router"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeInterconnectAttachmentCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeInterconnectAttachmentCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("name", flattenComputeInterconnectAttachmentName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeInterconnectAttachmentName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("candidate_subnets", flattenComputeInterconnectAttachmentCandidateSubnets(res["candidateSubnets"], d)); err != nil { + if err := d.Set("candidate_subnets", flattenComputeInterconnectAttachmentCandidateSubnets(res["candidateSubnets"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("vlan_tag8021q", flattenComputeInterconnectAttachmentVlanTag8021q(res["vlanTag8021q"], d)); err != nil { + if err := d.Set("vlan_tag8021q", flattenComputeInterconnectAttachmentVlanTag8021q(res["vlanTag8021q"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } - if err := d.Set("region", flattenComputeInterconnectAttachmentRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeInterconnectAttachmentRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading InterconnectAttachment: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -495,43 +495,43 @@ func resourceComputeInterconnectAttachmentImport(d *schema.ResourceData, meta in return []*schema.ResourceData{d}, nil } -func flattenComputeInterconnectAttachmentAdminEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentAdminEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentCloudRouterIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentCloudRouterIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentCustomerRouterIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentCustomerRouterIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentInterconnect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentInterconnect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentBandwidth(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentBandwidth(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentEdgeAvailabilityDomain(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentEdgeAvailabilityDomain(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentPairingKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentPairingKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentPartnerAsn(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentPartnerAsn(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentPrivateInterconnectInfo(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentPrivateInterconnectInfo(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -541,10 +541,10 @@ func flattenComputeInterconnectAttachmentPrivateInterconnectInfo(v interface{}, } transformed := make(map[string]interface{}) transformed["tag8021q"] = - flattenComputeInterconnectAttachmentPrivateInterconnectInfoTag8021q(original["tag8021q"], d) + flattenComputeInterconnectAttachmentPrivateInterconnectInfoTag8021q(original["tag8021q"], d, config) return []interface{}{transformed} } -func flattenComputeInterconnectAttachmentPrivateInterconnectInfoTag8021q(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentPrivateInterconnectInfoTag8021q(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -554,38 +554,38 @@ func flattenComputeInterconnectAttachmentPrivateInterconnectInfoTag8021q(v inter return v } -func flattenComputeInterconnectAttachmentType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentState(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentGoogleReferenceId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentGoogleReferenceId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentRouter(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentRouter(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeInterconnectAttachmentCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentCandidateSubnets(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentCandidateSubnets(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeInterconnectAttachmentVlanTag8021q(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentVlanTag8021q(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -595,7 +595,7 @@ func flattenComputeInterconnectAttachmentVlanTag8021q(v interface{}, d *schema.R return v } -func flattenComputeInterconnectAttachmentRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeInterconnectAttachmentRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_network.go b/google/resource_compute_network.go index 1b3e91c036a..7b4e0cff8b8 100644 --- a/google/resource_compute_network.go +++ b/google/resource_compute_network.go @@ -236,21 +236,21 @@ func resourceComputeNetworkRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Network: %s", err) } - if err := d.Set("description", flattenComputeNetworkDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeNetworkDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Network: %s", err) } - if err := d.Set("gateway_ipv4", flattenComputeNetworkGatewayIpv4(res["gatewayIPv4"], d)); err != nil { + if err := d.Set("gateway_ipv4", flattenComputeNetworkGatewayIpv4(res["gatewayIPv4"], d, config)); err != nil { return fmt.Errorf("Error reading Network: %s", err) } - if err := d.Set("name", flattenComputeNetworkName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeNetworkName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Network: %s", err) } - if err := d.Set("auto_create_subnetworks", flattenComputeNetworkAutoCreateSubnetworks(res["autoCreateSubnetworks"], d)); err != nil { + if err := d.Set("auto_create_subnetworks", flattenComputeNetworkAutoCreateSubnetworks(res["autoCreateSubnetworks"], d, config)); err != nil { return fmt.Errorf("Error reading Network: %s", err) } // Terraform must set the top level schema field, but since this object contains collapsed properties // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. - if flattenedProp := flattenComputeNetworkRoutingConfig(res["routingConfig"], d); flattenedProp != nil { + if flattenedProp := flattenComputeNetworkRoutingConfig(res["routingConfig"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -365,23 +365,23 @@ func resourceComputeNetworkImport(d *schema.ResourceData, meta interface{}) ([]* return []*schema.ResourceData{d}, nil } -func flattenComputeNetworkDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkGatewayIpv4(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkGatewayIpv4(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkAutoCreateSubnetworks(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkAutoCreateSubnetworks(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkRoutingConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkRoutingConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -391,10 +391,10 @@ func flattenComputeNetworkRoutingConfig(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["routing_mode"] = - flattenComputeNetworkRoutingConfigRoutingMode(original["routingMode"], d) + flattenComputeNetworkRoutingConfigRoutingMode(original["routingMode"], d, config) return []interface{}{transformed} } -func flattenComputeNetworkRoutingConfigRoutingMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkRoutingConfigRoutingMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_network_endpoint.go b/google/resource_compute_network_endpoint.go index 501f648dc3d..843f1a86a8c 100644 --- a/google/resource_compute_network_endpoint.go +++ b/google/resource_compute_network_endpoint.go @@ -204,13 +204,13 @@ func resourceComputeNetworkEndpointRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Error reading NetworkEndpoint: %s", err) } - if err := d.Set("instance", flattenComputeNetworkEndpointInstance(res["instance"], d)); err != nil { + if err := d.Set("instance", flattenComputeNetworkEndpointInstance(res["instance"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpoint: %s", err) } - if err := d.Set("port", flattenComputeNetworkEndpointPort(res["port"], d)); err != nil { + if err := d.Set("port", flattenComputeNetworkEndpointPort(res["port"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpoint: %s", err) } - if err := d.Set("ip_address", flattenComputeNetworkEndpointIpAddress(res["ipAddress"], d)); err != nil { + if err := d.Set("ip_address", flattenComputeNetworkEndpointIpAddress(res["ipAddress"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpoint: %s", err) } @@ -300,14 +300,14 @@ func resourceComputeNetworkEndpointImport(d *schema.ResourceData, meta interface return []*schema.ResourceData{d}, nil } -func flattenComputeNetworkEndpointInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeNetworkEndpointPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles int given in float64 format if floatVal, ok := v.(float64); ok { return int(floatVal) @@ -315,7 +315,7 @@ func flattenComputeNetworkEndpointPort(v interface{}, d *schema.ResourceData) in return v } -func flattenComputeNetworkEndpointIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -391,17 +391,17 @@ func resourceComputeNetworkEndpointFindNestedObjectInList(d *schema.ResourceData return -1, nil, err } - itemInstance := flattenComputeNetworkEndpointInstance(item["instance"], d) + itemInstance := flattenComputeNetworkEndpointInstance(item["instance"], d, meta.(*Config)) if !reflect.DeepEqual(itemInstance, expectedInstance) { log.Printf("[DEBUG] Skipping item with instance= %#v, looking for %#v)", itemInstance, expectedInstance) continue } - itemIpAddress := flattenComputeNetworkEndpointIpAddress(item["ipAddress"], d) + itemIpAddress := flattenComputeNetworkEndpointIpAddress(item["ipAddress"], d, meta.(*Config)) if !reflect.DeepEqual(itemIpAddress, expectedIpAddress) { log.Printf("[DEBUG] Skipping item with ipAddress= %#v, looking for %#v)", itemIpAddress, expectedIpAddress) continue } - itemPort := flattenComputeNetworkEndpointPort(item["port"], d) + itemPort := flattenComputeNetworkEndpointPort(item["port"], d, meta.(*Config)) if !reflect.DeepEqual(itemPort, expectedPort) { log.Printf("[DEBUG] Skipping item with port= %#v, looking for %#v)", itemPort, expectedPort) continue diff --git a/google/resource_compute_network_endpoint_group.go b/google/resource_compute_network_endpoint_group.go index 5e4f4cf3b5b..3f578ea97fd 100644 --- a/google/resource_compute_network_endpoint_group.go +++ b/google/resource_compute_network_endpoint_group.go @@ -224,28 +224,28 @@ func resourceComputeNetworkEndpointGroupRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("name", flattenComputeNetworkEndpointGroupName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeNetworkEndpointGroupName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("description", flattenComputeNetworkEndpointGroupDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeNetworkEndpointGroupDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("network_endpoint_type", flattenComputeNetworkEndpointGroupNetworkEndpointType(res["networkEndpointType"], d)); err != nil { + if err := d.Set("network_endpoint_type", flattenComputeNetworkEndpointGroupNetworkEndpointType(res["networkEndpointType"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("size", flattenComputeNetworkEndpointGroupSize(res["size"], d)); err != nil { + if err := d.Set("size", flattenComputeNetworkEndpointGroupSize(res["size"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("network", flattenComputeNetworkEndpointGroupNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeNetworkEndpointGroupNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("subnetwork", flattenComputeNetworkEndpointGroupSubnetwork(res["subnetwork"], d)); err != nil { + if err := d.Set("subnetwork", flattenComputeNetworkEndpointGroupSubnetwork(res["subnetwork"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("default_port", flattenComputeNetworkEndpointGroupDefaultPort(res["defaultPort"], d)); err != nil { + if err := d.Set("default_port", flattenComputeNetworkEndpointGroupDefaultPort(res["defaultPort"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } - if err := d.Set("zone", flattenComputeNetworkEndpointGroupZone(res["zone"], d)); err != nil { + if err := d.Set("zone", flattenComputeNetworkEndpointGroupZone(res["zone"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkEndpointGroup: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -309,19 +309,19 @@ func resourceComputeNetworkEndpointGroupImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenComputeNetworkEndpointGroupName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkEndpointGroupDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkEndpointGroupNetworkEndpointType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupNetworkEndpointType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkEndpointGroupSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupSize(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -331,21 +331,21 @@ func flattenComputeNetworkEndpointGroupSize(v interface{}, d *schema.ResourceDat return v } -func flattenComputeNetworkEndpointGroupNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeNetworkEndpointGroupSubnetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupSubnetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeNetworkEndpointGroupDefaultPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupDefaultPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -355,7 +355,7 @@ func flattenComputeNetworkEndpointGroupDefaultPort(v interface{}, d *schema.Reso return v } -func flattenComputeNetworkEndpointGroupZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkEndpointGroupZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_network_peering_routes_config.go b/google/resource_compute_network_peering_routes_config.go index d0c5d89a4ab..8859dc173ac 100644 --- a/google/resource_compute_network_peering_routes_config.go +++ b/google/resource_compute_network_peering_routes_config.go @@ -177,13 +177,13 @@ func resourceComputeNetworkPeeringRoutesConfigRead(d *schema.ResourceData, meta return fmt.Errorf("Error reading NetworkPeeringRoutesConfig: %s", err) } - if err := d.Set("peering", flattenComputeNetworkPeeringRoutesConfigPeering(res["name"], d)); err != nil { + if err := d.Set("peering", flattenComputeNetworkPeeringRoutesConfigPeering(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkPeeringRoutesConfig: %s", err) } - if err := d.Set("export_custom_routes", flattenComputeNetworkPeeringRoutesConfigExportCustomRoutes(res["exportCustomRoutes"], d)); err != nil { + if err := d.Set("export_custom_routes", flattenComputeNetworkPeeringRoutesConfigExportCustomRoutes(res["exportCustomRoutes"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkPeeringRoutesConfig: %s", err) } - if err := d.Set("import_custom_routes", flattenComputeNetworkPeeringRoutesConfigImportCustomRoutes(res["importCustomRoutes"], d)); err != nil { + if err := d.Set("import_custom_routes", flattenComputeNetworkPeeringRoutesConfigImportCustomRoutes(res["importCustomRoutes"], d, config)); err != nil { return fmt.Errorf("Error reading NetworkPeeringRoutesConfig: %s", err) } @@ -282,15 +282,15 @@ func resourceComputeNetworkPeeringRoutesConfigImport(d *schema.ResourceData, met return []*schema.ResourceData{d}, nil } -func flattenComputeNetworkPeeringRoutesConfigPeering(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkPeeringRoutesConfigPeering(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkPeeringRoutesConfigExportCustomRoutes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkPeeringRoutesConfigExportCustomRoutes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNetworkPeeringRoutesConfigImportCustomRoutes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNetworkPeeringRoutesConfigImportCustomRoutes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -353,7 +353,7 @@ func resourceComputeNetworkPeeringRoutesConfigFindNestedObjectInList(d *schema.R } item := itemRaw.(map[string]interface{}) - itemPeering := flattenComputeNetworkPeeringRoutesConfigPeering(item["name"], d) + itemPeering := flattenComputeNetworkPeeringRoutesConfigPeering(item["name"], d, meta.(*Config)) if !reflect.DeepEqual(itemPeering, expectedPeering) { log.Printf("[DEBUG] Skipping item with name= %#v, looking for %#v)", itemPeering, expectedPeering) continue diff --git a/google/resource_compute_node_group.go b/google/resource_compute_node_group.go index bc7b2ead9da..69964e8d222 100644 --- a/google/resource_compute_node_group.go +++ b/google/resource_compute_node_group.go @@ -186,22 +186,22 @@ func resourceComputeNodeGroupRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error reading NodeGroup: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeNodeGroupCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeNodeGroupCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading NodeGroup: %s", err) } - if err := d.Set("description", flattenComputeNodeGroupDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeNodeGroupDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading NodeGroup: %s", err) } - if err := d.Set("name", flattenComputeNodeGroupName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeNodeGroupName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading NodeGroup: %s", err) } - if err := d.Set("node_template", flattenComputeNodeGroupNodeTemplate(res["nodeTemplate"], d)); err != nil { + if err := d.Set("node_template", flattenComputeNodeGroupNodeTemplate(res["nodeTemplate"], d, config)); err != nil { return fmt.Errorf("Error reading NodeGroup: %s", err) } - if err := d.Set("size", flattenComputeNodeGroupSize(res["size"], d)); err != nil { + if err := d.Set("size", flattenComputeNodeGroupSize(res["size"], d, config)); err != nil { return fmt.Errorf("Error reading NodeGroup: %s", err) } - if err := d.Set("zone", flattenComputeNodeGroupZone(res["zone"], d)); err != nil { + if err := d.Set("zone", flattenComputeNodeGroupZone(res["zone"], d, config)); err != nil { return fmt.Errorf("Error reading NodeGroup: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -309,26 +309,26 @@ func resourceComputeNodeGroupImport(d *schema.ResourceData, meta interface{}) ([ return []*schema.ResourceData{d}, nil } -func flattenComputeNodeGroupCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeGroupCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeGroupDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeGroupDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeGroupName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeGroupName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeGroupNodeTemplate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeGroupNodeTemplate(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeNodeGroupSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeGroupSize(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -338,7 +338,7 @@ func flattenComputeNodeGroupSize(v interface{}, d *schema.ResourceData) interfac return v } -func flattenComputeNodeGroupZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeGroupZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_node_template.go b/google/resource_compute_node_template.go index 4947771405a..3570a52048d 100644 --- a/google/resource_compute_node_template.go +++ b/google/resource_compute_node_template.go @@ -228,25 +228,25 @@ func resourceComputeNodeTemplateRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeNodeTemplateCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeNodeTemplateCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("description", flattenComputeNodeTemplateDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeNodeTemplateDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("name", flattenComputeNodeTemplateName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeNodeTemplateName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("node_affinity_labels", flattenComputeNodeTemplateNodeAffinityLabels(res["nodeAffinityLabels"], d)); err != nil { + if err := d.Set("node_affinity_labels", flattenComputeNodeTemplateNodeAffinityLabels(res["nodeAffinityLabels"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("node_type", flattenComputeNodeTemplateNodeType(res["nodeType"], d)); err != nil { + if err := d.Set("node_type", flattenComputeNodeTemplateNodeType(res["nodeType"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("node_type_flexibility", flattenComputeNodeTemplateNodeTypeFlexibility(res["nodeTypeFlexibility"], d)); err != nil { + if err := d.Set("node_type_flexibility", flattenComputeNodeTemplateNodeTypeFlexibility(res["nodeTypeFlexibility"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } - if err := d.Set("region", flattenComputeNodeTemplateRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeNodeTemplateRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading NodeTemplate: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -310,27 +310,27 @@ func resourceComputeNodeTemplateImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenComputeNodeTemplateCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateNodeAffinityLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateNodeAffinityLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateNodeType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateNodeType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateNodeTypeFlexibility(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateNodeTypeFlexibility(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -340,26 +340,26 @@ func flattenComputeNodeTemplateNodeTypeFlexibility(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["cpus"] = - flattenComputeNodeTemplateNodeTypeFlexibilityCpus(original["cpus"], d) + flattenComputeNodeTemplateNodeTypeFlexibilityCpus(original["cpus"], d, config) transformed["memory"] = - flattenComputeNodeTemplateNodeTypeFlexibilityMemory(original["memory"], d) + flattenComputeNodeTemplateNodeTypeFlexibilityMemory(original["memory"], d, config) transformed["local_ssd"] = - flattenComputeNodeTemplateNodeTypeFlexibilityLocalSsd(original["localSsd"], d) + flattenComputeNodeTemplateNodeTypeFlexibilityLocalSsd(original["localSsd"], d, config) return []interface{}{transformed} } -func flattenComputeNodeTemplateNodeTypeFlexibilityCpus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateNodeTypeFlexibilityCpus(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateNodeTypeFlexibilityMemory(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateNodeTypeFlexibilityMemory(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateNodeTypeFlexibilityLocalSsd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateNodeTypeFlexibilityLocalSsd(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeNodeTemplateRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_region_autoscaler.go b/google/resource_compute_region_autoscaler.go index 95151fab0f0..d4da9cb3ff3 100644 --- a/google/resource_compute_region_autoscaler.go +++ b/google/resource_compute_region_autoscaler.go @@ -318,22 +318,22 @@ func resourceComputeRegionAutoscalerRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionAutoscalerCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionAutoscalerCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } - if err := d.Set("name", flattenComputeRegionAutoscalerName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionAutoscalerName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } - if err := d.Set("description", flattenComputeRegionAutoscalerDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionAutoscalerDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } - if err := d.Set("autoscaling_policy", flattenComputeRegionAutoscalerAutoscalingPolicy(res["autoscalingPolicy"], d)); err != nil { + if err := d.Set("autoscaling_policy", flattenComputeRegionAutoscalerAutoscalingPolicy(res["autoscalingPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } - if err := d.Set("target", flattenComputeRegionAutoscalerTarget(res["target"], d)); err != nil { + if err := d.Set("target", flattenComputeRegionAutoscalerTarget(res["target"], d, config)); err != nil { return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } - if err := d.Set("region", flattenComputeRegionAutoscalerRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionAutoscalerRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionAutoscaler: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -460,19 +460,19 @@ func resourceComputeRegionAutoscalerImport(d *schema.ResourceData, meta interfac return []*schema.ResourceData{d}, nil } -func flattenComputeRegionAutoscalerCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -482,20 +482,20 @@ func flattenComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.Re } transformed := make(map[string]interface{}) transformed["min_replicas"] = - flattenComputeRegionAutoscalerAutoscalingPolicyMinReplicas(original["minNumReplicas"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyMinReplicas(original["minNumReplicas"], d, config) transformed["max_replicas"] = - flattenComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(original["maxNumReplicas"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(original["maxNumReplicas"], d, config) transformed["cooldown_period"] = - flattenComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(original["coolDownPeriodSec"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(original["coolDownPeriodSec"], d, config) transformed["cpu_utilization"] = - flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(original["cpuUtilization"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(original["cpuUtilization"], d, config) transformed["metric"] = - flattenComputeRegionAutoscalerAutoscalingPolicyMetric(original["customMetricUtilizations"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyMetric(original["customMetricUtilizations"], d, config) transformed["load_balancing_utilization"] = - flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(original["loadBalancingUtilization"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(original["loadBalancingUtilization"], d, config) return []interface{}{transformed} } -func flattenComputeRegionAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -505,7 +505,7 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -515,7 +515,7 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -525,7 +525,7 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{} return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -535,14 +535,14 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{} } transformed := make(map[string]interface{}) transformed["target"] = - flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilizationTarget(original["utilizationTarget"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilizationTarget(original["utilizationTarget"], d, config) return []interface{}{transformed} } -func flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -555,26 +555,26 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d *sch continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeRegionAutoscalerAutoscalingPolicyMetricName(original["metric"], d), - "target": flattenComputeRegionAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d), - "type": flattenComputeRegionAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d), + "name": flattenComputeRegionAutoscalerAutoscalingPolicyMetricName(original["metric"], d, config), + "target": flattenComputeRegionAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d, config), + "type": flattenComputeRegionAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d, config), }) } return transformed } -func flattenComputeRegionAutoscalerAutoscalingPolicyMetricName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMetricName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -584,18 +584,18 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v i } transformed := make(map[string]interface{}) transformed["target"] = - flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(original["utilizationTarget"], d) + flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(original["utilizationTarget"], d, config) return []interface{}{transformed} } -func flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerTarget(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerTarget(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionAutoscalerRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_region_backend_service.go b/google/resource_compute_region_backend_service.go index ca5f496aed9..d801eed48d0 100644 --- a/google/resource_compute_region_backend_service.go +++ b/google/resource_compute_region_backend_service.go @@ -512,12 +512,12 @@ func resourceComputeRegionBackendServiceRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("backend", flattenComputeRegionBackendServiceBackend(res["backends"], d)); err != nil { + if err := d.Set("backend", flattenComputeRegionBackendServiceBackend(res["backends"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } // Terraform must set the top level schema field, but since this object contains collapsed properties // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. - if flattenedProp := flattenComputeRegionBackendServiceConnectionDraining(res["connectionDraining"], d); flattenedProp != nil { + if flattenedProp := flattenComputeRegionBackendServiceConnectionDraining(res["connectionDraining"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -525,34 +525,34 @@ func resourceComputeRegionBackendServiceRead(d *schema.ResourceData, meta interf } } } - if err := d.Set("creation_timestamp", flattenComputeRegionBackendServiceCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionBackendServiceCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("description", flattenComputeRegionBackendServiceDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionBackendServiceDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("fingerprint", flattenComputeRegionBackendServiceFingerprint(res["fingerprint"], d)); err != nil { + if err := d.Set("fingerprint", flattenComputeRegionBackendServiceFingerprint(res["fingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("health_checks", flattenComputeRegionBackendServiceHealthChecks(res["healthChecks"], d)); err != nil { + if err := d.Set("health_checks", flattenComputeRegionBackendServiceHealthChecks(res["healthChecks"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("load_balancing_scheme", flattenComputeRegionBackendServiceLoadBalancingScheme(res["loadBalancingScheme"], d)); err != nil { + if err := d.Set("load_balancing_scheme", flattenComputeRegionBackendServiceLoadBalancingScheme(res["loadBalancingScheme"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("name", flattenComputeRegionBackendServiceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionBackendServiceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("protocol", flattenComputeRegionBackendServiceProtocol(res["protocol"], d)); err != nil { + if err := d.Set("protocol", flattenComputeRegionBackendServiceProtocol(res["protocol"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("session_affinity", flattenComputeRegionBackendServiceSessionAffinity(res["sessionAffinity"], d)); err != nil { + if err := d.Set("session_affinity", flattenComputeRegionBackendServiceSessionAffinity(res["sessionAffinity"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("timeout_sec", flattenComputeRegionBackendServiceTimeoutSec(res["timeoutSec"], d)); err != nil { + if err := d.Set("timeout_sec", flattenComputeRegionBackendServiceTimeoutSec(res["timeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("region", flattenComputeRegionBackendServiceRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionBackendServiceRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -720,7 +720,7 @@ func resourceComputeRegionBackendServiceImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenComputeRegionBackendServiceBackend(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackend(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -733,41 +733,41 @@ func flattenComputeRegionBackendServiceBackend(v interface{}, d *schema.Resource continue } transformed.Add(map[string]interface{}{ - "balancing_mode": flattenComputeRegionBackendServiceBackendBalancingMode(original["balancingMode"], d), - "capacity_scaler": flattenComputeRegionBackendServiceBackendCapacityScaler(original["capacityScaler"], d), - "description": flattenComputeRegionBackendServiceBackendDescription(original["description"], d), - "group": flattenComputeRegionBackendServiceBackendGroup(original["group"], d), - "max_connections": flattenComputeRegionBackendServiceBackendMaxConnections(original["maxConnections"], d), - "max_connections_per_instance": flattenComputeRegionBackendServiceBackendMaxConnectionsPerInstance(original["maxConnectionsPerInstance"], d), - "max_connections_per_endpoint": flattenComputeRegionBackendServiceBackendMaxConnectionsPerEndpoint(original["maxConnectionsPerEndpoint"], d), - "max_rate": flattenComputeRegionBackendServiceBackendMaxRate(original["maxRate"], d), - "max_rate_per_instance": flattenComputeRegionBackendServiceBackendMaxRatePerInstance(original["maxRatePerInstance"], d), - "max_rate_per_endpoint": flattenComputeRegionBackendServiceBackendMaxRatePerEndpoint(original["maxRatePerEndpoint"], d), - "max_utilization": flattenComputeRegionBackendServiceBackendMaxUtilization(original["maxUtilization"], d), + "balancing_mode": flattenComputeRegionBackendServiceBackendBalancingMode(original["balancingMode"], d, config), + "capacity_scaler": flattenComputeRegionBackendServiceBackendCapacityScaler(original["capacityScaler"], d, config), + "description": flattenComputeRegionBackendServiceBackendDescription(original["description"], d, config), + "group": flattenComputeRegionBackendServiceBackendGroup(original["group"], d, config), + "max_connections": flattenComputeRegionBackendServiceBackendMaxConnections(original["maxConnections"], d, config), + "max_connections_per_instance": flattenComputeRegionBackendServiceBackendMaxConnectionsPerInstance(original["maxConnectionsPerInstance"], d, config), + "max_connections_per_endpoint": flattenComputeRegionBackendServiceBackendMaxConnectionsPerEndpoint(original["maxConnectionsPerEndpoint"], d, config), + "max_rate": flattenComputeRegionBackendServiceBackendMaxRate(original["maxRate"], d, config), + "max_rate_per_instance": flattenComputeRegionBackendServiceBackendMaxRatePerInstance(original["maxRatePerInstance"], d, config), + "max_rate_per_endpoint": flattenComputeRegionBackendServiceBackendMaxRatePerEndpoint(original["maxRatePerEndpoint"], d, config), + "max_utilization": flattenComputeRegionBackendServiceBackendMaxUtilization(original["maxUtilization"], d, config), }) } return transformed } -func flattenComputeRegionBackendServiceBackendBalancingMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendBalancingMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceBackendCapacityScaler(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendCapacityScaler(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceBackendDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceBackendGroup(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendGroup(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionBackendServiceBackendMaxConnections(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxConnections(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -777,7 +777,7 @@ func flattenComputeRegionBackendServiceBackendMaxConnections(v interface{}, d *s return v } -func flattenComputeRegionBackendServiceBackendMaxConnectionsPerInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxConnectionsPerInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -787,7 +787,7 @@ func flattenComputeRegionBackendServiceBackendMaxConnectionsPerInstance(v interf return v } -func flattenComputeRegionBackendServiceBackendMaxConnectionsPerEndpoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxConnectionsPerEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -797,7 +797,7 @@ func flattenComputeRegionBackendServiceBackendMaxConnectionsPerEndpoint(v interf return v } -func flattenComputeRegionBackendServiceBackendMaxRate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxRate(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -807,19 +807,19 @@ func flattenComputeRegionBackendServiceBackendMaxRate(v interface{}, d *schema.R return v } -func flattenComputeRegionBackendServiceBackendMaxRatePerInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxRatePerInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceBackendMaxRatePerEndpoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxRatePerEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceBackendMaxUtilization(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendMaxUtilization(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceConnectionDraining(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConnectionDraining(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -829,10 +829,10 @@ func flattenComputeRegionBackendServiceConnectionDraining(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["connection_draining_timeout_sec"] = - flattenComputeRegionBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(original["drainingTimeoutSec"], d) + flattenComputeRegionBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(original["drainingTimeoutSec"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -842,42 +842,42 @@ func flattenComputeRegionBackendServiceConnectionDrainingConnectionDrainingTimeo return v } -func flattenComputeRegionBackendServiceCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceHealthChecks(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceHealthChecks(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeRegionBackendServiceLoadBalancingScheme(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceProtocol(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceProtocol(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceSessionAffinity(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceSessionAffinity(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -887,7 +887,7 @@ func flattenComputeRegionBackendServiceTimeoutSec(v interface{}, d *schema.Resou return v } -func flattenComputeRegionBackendServiceRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_region_disk.go b/google/resource_compute_region_disk.go index 2b8c5a67a2f..5d7644b505e 100644 --- a/google/resource_compute_region_disk.go +++ b/google/resource_compute_region_disk.go @@ -408,55 +408,55 @@ func resourceComputeRegionDiskRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeRegionDiskLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeRegionDiskLabelFingerprint(res["labelFingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionDiskCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionDiskCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("description", flattenComputeRegionDiskDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionDiskDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("last_attach_timestamp", flattenComputeRegionDiskLastAttachTimestamp(res["lastAttachTimestamp"], d)); err != nil { + if err := d.Set("last_attach_timestamp", flattenComputeRegionDiskLastAttachTimestamp(res["lastAttachTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("last_detach_timestamp", flattenComputeRegionDiskLastDetachTimestamp(res["lastDetachTimestamp"], d)); err != nil { + if err := d.Set("last_detach_timestamp", flattenComputeRegionDiskLastDetachTimestamp(res["lastDetachTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("labels", flattenComputeRegionDiskLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeRegionDiskLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("name", flattenComputeRegionDiskName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionDiskName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("size", flattenComputeRegionDiskSize(res["sizeGb"], d)); err != nil { + if err := d.Set("size", flattenComputeRegionDiskSize(res["sizeGb"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("users", flattenComputeRegionDiskUsers(res["users"], d)); err != nil { + if err := d.Set("users", flattenComputeRegionDiskUsers(res["users"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("physical_block_size_bytes", flattenComputeRegionDiskPhysicalBlockSizeBytes(res["physicalBlockSizeBytes"], d)); err != nil { + if err := d.Set("physical_block_size_bytes", flattenComputeRegionDiskPhysicalBlockSizeBytes(res["physicalBlockSizeBytes"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("replica_zones", flattenComputeRegionDiskReplicaZones(res["replicaZones"], d)); err != nil { + if err := d.Set("replica_zones", flattenComputeRegionDiskReplicaZones(res["replicaZones"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("type", flattenComputeRegionDiskType(res["type"], d)); err != nil { + if err := d.Set("type", flattenComputeRegionDiskType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("region", flattenComputeRegionDiskRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionDiskRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("disk_encryption_key", flattenComputeRegionDiskDiskEncryptionKey(res["diskEncryptionKey"], d)); err != nil { + if err := d.Set("disk_encryption_key", flattenComputeRegionDiskDiskEncryptionKey(res["diskEncryptionKey"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("snapshot", flattenComputeRegionDiskSnapshot(res["sourceSnapshot"], d)); err != nil { + if err := d.Set("snapshot", flattenComputeRegionDiskSnapshot(res["sourceSnapshot"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("source_snapshot_encryption_key", flattenComputeRegionDiskSourceSnapshotEncryptionKey(res["sourceSnapshotEncryptionKey"], d)); err != nil { + if err := d.Set("source_snapshot_encryption_key", flattenComputeRegionDiskSourceSnapshotEncryptionKey(res["sourceSnapshotEncryptionKey"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } - if err := d.Set("source_snapshot_id", flattenComputeRegionDiskSourceSnapshotId(res["sourceSnapshotId"], d)); err != nil { + if err := d.Set("source_snapshot_id", flattenComputeRegionDiskSourceSnapshotId(res["sourceSnapshotId"], d, config)); err != nil { return fmt.Errorf("Error reading RegionDisk: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -653,35 +653,35 @@ func resourceComputeRegionDiskImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenComputeRegionDiskLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskLastAttachTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskLastAttachTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskLastDetachTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskLastDetachTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSize(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -691,14 +691,14 @@ func flattenComputeRegionDiskSize(v interface{}, d *schema.ResourceData) interfa return v } -func flattenComputeRegionDiskUsers(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskUsers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeRegionDiskPhysicalBlockSizeBytes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskPhysicalBlockSizeBytes(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -708,28 +708,28 @@ func flattenComputeRegionDiskPhysicalBlockSizeBytes(v interface{}, d *schema.Res return v } -func flattenComputeRegionDiskReplicaZones(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskReplicaZones(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeRegionDiskType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskType(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenComputeRegionDiskRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -739,27 +739,27 @@ func flattenComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.Resource } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeRegionDiskDiskEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeRegionDiskDiskEncryptionKeyRawKey(original["rawKey"], d, config) transformed["sha256"] = - flattenComputeRegionDiskDiskEncryptionKeySha256(original["sha256"], d) + flattenComputeRegionDiskDiskEncryptionKeySha256(original["sha256"], d, config) return []interface{}{transformed} } -func flattenComputeRegionDiskDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskDiskEncryptionKeySha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskDiskEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskSnapshot(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSnapshot(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -769,20 +769,20 @@ func flattenComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(original["rawKey"], d, config) transformed["sha256"] = - flattenComputeRegionDiskSourceSnapshotEncryptionKeySha256(original["sha256"], d) + flattenComputeRegionDiskSourceSnapshotEncryptionKeySha256(original["sha256"], d, config) return []interface{}{transformed} } -func flattenComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskSourceSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSourceSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionDiskSourceSnapshotId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSourceSnapshotId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_region_health_check.go b/google/resource_compute_region_health_check.go index c38a8b0d06f..b77a874f69d 100644 --- a/google/resource_compute_region_health_check.go +++ b/google/resource_compute_region_health_check.go @@ -651,46 +651,46 @@ func resourceComputeRegionHealthCheckRead(d *schema.ResourceData, meta interface return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("check_interval_sec", flattenComputeRegionHealthCheckCheckIntervalSec(res["checkIntervalSec"], d)); err != nil { + if err := d.Set("check_interval_sec", flattenComputeRegionHealthCheckCheckIntervalSec(res["checkIntervalSec"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionHealthCheckCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionHealthCheckCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("description", flattenComputeRegionHealthCheckDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionHealthCheckDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("healthy_threshold", flattenComputeRegionHealthCheckHealthyThreshold(res["healthyThreshold"], d)); err != nil { + if err := d.Set("healthy_threshold", flattenComputeRegionHealthCheckHealthyThreshold(res["healthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("name", flattenComputeRegionHealthCheckName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionHealthCheckName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("unhealthy_threshold", flattenComputeRegionHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d)); err != nil { + if err := d.Set("unhealthy_threshold", flattenComputeRegionHealthCheckUnhealthyThreshold(res["unhealthyThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("timeout_sec", flattenComputeRegionHealthCheckTimeoutSec(res["timeoutSec"], d)); err != nil { + if err := d.Set("timeout_sec", flattenComputeRegionHealthCheckTimeoutSec(res["timeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("type", flattenComputeRegionHealthCheckType(res["type"], d)); err != nil { + if err := d.Set("type", flattenComputeRegionHealthCheckType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("http_health_check", flattenComputeRegionHealthCheckHttpHealthCheck(res["httpHealthCheck"], d)); err != nil { + if err := d.Set("http_health_check", flattenComputeRegionHealthCheckHttpHealthCheck(res["httpHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("https_health_check", flattenComputeRegionHealthCheckHttpsHealthCheck(res["httpsHealthCheck"], d)); err != nil { + if err := d.Set("https_health_check", flattenComputeRegionHealthCheckHttpsHealthCheck(res["httpsHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("tcp_health_check", flattenComputeRegionHealthCheckTcpHealthCheck(res["tcpHealthCheck"], d)); err != nil { + if err := d.Set("tcp_health_check", flattenComputeRegionHealthCheckTcpHealthCheck(res["tcpHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("ssl_health_check", flattenComputeRegionHealthCheckSslHealthCheck(res["sslHealthCheck"], d)); err != nil { + if err := d.Set("ssl_health_check", flattenComputeRegionHealthCheckSslHealthCheck(res["sslHealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("http2_health_check", flattenComputeRegionHealthCheckHttp2HealthCheck(res["http2HealthCheck"], d)); err != nil { + if err := d.Set("http2_health_check", flattenComputeRegionHealthCheckHttp2HealthCheck(res["http2HealthCheck"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } - if err := d.Set("region", flattenComputeRegionHealthCheckRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionHealthCheckRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionHealthCheck: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -864,7 +864,7 @@ func resourceComputeRegionHealthCheckImport(d *schema.ResourceData, meta interfa return []*schema.ResourceData{d}, nil } -func flattenComputeRegionHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -874,15 +874,15 @@ func flattenComputeRegionHealthCheckCheckIntervalSec(v interface{}, d *schema.Re return v } -func flattenComputeRegionHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -892,11 +892,11 @@ func flattenComputeRegionHealthCheckHealthyThreshold(v interface{}, d *schema.Re return v } -func flattenComputeRegionHealthCheckName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -906,7 +906,7 @@ func flattenComputeRegionHealthCheckUnhealthyThreshold(v interface{}, d *schema. return v } -func flattenComputeRegionHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -916,11 +916,11 @@ func flattenComputeRegionHealthCheckTimeoutSec(v interface{}, d *schema.Resource return v } -func flattenComputeRegionHealthCheckType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -930,34 +930,34 @@ func flattenComputeRegionHealthCheckHttpHealthCheck(v interface{}, d *schema.Res } transformed := make(map[string]interface{}) transformed["host"] = - flattenComputeRegionHealthCheckHttpHealthCheckHost(original["host"], d) + flattenComputeRegionHealthCheckHttpHealthCheckHost(original["host"], d, config) transformed["request_path"] = - flattenComputeRegionHealthCheckHttpHealthCheckRequestPath(original["requestPath"], d) + flattenComputeRegionHealthCheckHttpHealthCheckRequestPath(original["requestPath"], d, config) transformed["response"] = - flattenComputeRegionHealthCheckHttpHealthCheckResponse(original["response"], d) + flattenComputeRegionHealthCheckHttpHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeRegionHealthCheckHttpHealthCheckPort(original["port"], d) + flattenComputeRegionHealthCheckHttpHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeRegionHealthCheckHttpHealthCheckPortName(original["portName"], d) + flattenComputeRegionHealthCheckHttpHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeRegionHealthCheckHttpHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeRegionHealthCheckHttpHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeRegionHealthCheckHttpHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeRegionHealthCheckHttpHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeRegionHealthCheckHttpHealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -967,19 +967,19 @@ func flattenComputeRegionHealthCheckHttpHealthCheckPort(v interface{}, d *schema return v } -func flattenComputeRegionHealthCheckHttpHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -989,34 +989,34 @@ func flattenComputeRegionHealthCheckHttpsHealthCheck(v interface{}, d *schema.Re } transformed := make(map[string]interface{}) transformed["host"] = - flattenComputeRegionHealthCheckHttpsHealthCheckHost(original["host"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckHost(original["host"], d, config) transformed["request_path"] = - flattenComputeRegionHealthCheckHttpsHealthCheckRequestPath(original["requestPath"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckRequestPath(original["requestPath"], d, config) transformed["response"] = - flattenComputeRegionHealthCheckHttpsHealthCheckResponse(original["response"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeRegionHealthCheckHttpsHealthCheckPort(original["port"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeRegionHealthCheckHttpsHealthCheckPortName(original["portName"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeRegionHealthCheckHttpsHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeRegionHealthCheckHttpsHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeRegionHealthCheckHttpsHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeRegionHealthCheckHttpsHealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1026,19 +1026,19 @@ func flattenComputeRegionHealthCheckHttpsHealthCheckPort(v interface{}, d *schem return v } -func flattenComputeRegionHealthCheckHttpsHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttpsHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttpsHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1048,28 +1048,28 @@ func flattenComputeRegionHealthCheckTcpHealthCheck(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["request"] = - flattenComputeRegionHealthCheckTcpHealthCheckRequest(original["request"], d) + flattenComputeRegionHealthCheckTcpHealthCheckRequest(original["request"], d, config) transformed["response"] = - flattenComputeRegionHealthCheckTcpHealthCheckResponse(original["response"], d) + flattenComputeRegionHealthCheckTcpHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeRegionHealthCheckTcpHealthCheckPort(original["port"], d) + flattenComputeRegionHealthCheckTcpHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeRegionHealthCheckTcpHealthCheckPortName(original["portName"], d) + flattenComputeRegionHealthCheckTcpHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeRegionHealthCheckTcpHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeRegionHealthCheckTcpHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeRegionHealthCheckTcpHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeRegionHealthCheckTcpHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeRegionHealthCheckTcpHealthCheckRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheckRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckTcpHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckTcpHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1079,19 +1079,19 @@ func flattenComputeRegionHealthCheckTcpHealthCheckPort(v interface{}, d *schema. return v } -func flattenComputeRegionHealthCheckTcpHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckTcpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckTcpHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1101,28 +1101,28 @@ func flattenComputeRegionHealthCheckSslHealthCheck(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["request"] = - flattenComputeRegionHealthCheckSslHealthCheckRequest(original["request"], d) + flattenComputeRegionHealthCheckSslHealthCheckRequest(original["request"], d, config) transformed["response"] = - flattenComputeRegionHealthCheckSslHealthCheckResponse(original["response"], d) + flattenComputeRegionHealthCheckSslHealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeRegionHealthCheckSslHealthCheckPort(original["port"], d) + flattenComputeRegionHealthCheckSslHealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeRegionHealthCheckSslHealthCheckPortName(original["portName"], d) + flattenComputeRegionHealthCheckSslHealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeRegionHealthCheckSslHealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeRegionHealthCheckSslHealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeRegionHealthCheckSslHealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeRegionHealthCheckSslHealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeRegionHealthCheckSslHealthCheckRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheckRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckSslHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckSslHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1132,19 +1132,19 @@ func flattenComputeRegionHealthCheckSslHealthCheckPort(v interface{}, d *schema. return v } -func flattenComputeRegionHealthCheckSslHealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckSslHealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckSslHealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckSslHealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttp2HealthCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1154,34 +1154,34 @@ func flattenComputeRegionHealthCheckHttp2HealthCheck(v interface{}, d *schema.Re } transformed := make(map[string]interface{}) transformed["host"] = - flattenComputeRegionHealthCheckHttp2HealthCheckHost(original["host"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckHost(original["host"], d, config) transformed["request_path"] = - flattenComputeRegionHealthCheckHttp2HealthCheckRequestPath(original["requestPath"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckRequestPath(original["requestPath"], d, config) transformed["response"] = - flattenComputeRegionHealthCheckHttp2HealthCheckResponse(original["response"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckResponse(original["response"], d, config) transformed["port"] = - flattenComputeRegionHealthCheckHttp2HealthCheckPort(original["port"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckPort(original["port"], d, config) transformed["port_name"] = - flattenComputeRegionHealthCheckHttp2HealthCheckPortName(original["portName"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckPortName(original["portName"], d, config) transformed["proxy_header"] = - flattenComputeRegionHealthCheckHttp2HealthCheckProxyHeader(original["proxyHeader"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckProxyHeader(original["proxyHeader"], d, config) transformed["port_specification"] = - flattenComputeRegionHealthCheckHttp2HealthCheckPortSpecification(original["portSpecification"], d) + flattenComputeRegionHealthCheckHttp2HealthCheckPortSpecification(original["portSpecification"], d, config) return []interface{}{transformed} } -func flattenComputeRegionHealthCheckHttp2HealthCheckHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttp2HealthCheckRequestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttp2HealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttp2HealthCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1191,19 +1191,19 @@ func flattenComputeRegionHealthCheckHttp2HealthCheckPort(v interface{}, d *schem return v } -func flattenComputeRegionHealthCheckHttp2HealthCheckPortName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckPortName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttp2HealthCheckProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckHttp2HealthCheckPortSpecification(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckHttp2HealthCheckPortSpecification(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionHealthCheckRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionHealthCheckRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_reservation.go b/google/resource_compute_reservation.go index 52de368c828..b14b2dd680e 100644 --- a/google/resource_compute_reservation.go +++ b/google/resource_compute_reservation.go @@ -300,28 +300,28 @@ func resourceComputeReservationRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeReservationCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeReservationCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("description", flattenComputeReservationDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeReservationDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("name", flattenComputeReservationName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeReservationName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("commitment", flattenComputeReservationCommitment(res["commitment"], d)); err != nil { + if err := d.Set("commitment", flattenComputeReservationCommitment(res["commitment"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("specific_reservation_required", flattenComputeReservationSpecificReservationRequired(res["specificReservationRequired"], d)); err != nil { + if err := d.Set("specific_reservation_required", flattenComputeReservationSpecificReservationRequired(res["specificReservationRequired"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("status", flattenComputeReservationStatus(res["status"], d)); err != nil { + if err := d.Set("status", flattenComputeReservationStatus(res["status"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("specific_reservation", flattenComputeReservationSpecificReservation(res["specificReservation"], d)); err != nil { + if err := d.Set("specific_reservation", flattenComputeReservationSpecificReservation(res["specificReservation"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } - if err := d.Set("zone", flattenComputeReservationZone(res["zone"], d)); err != nil { + if err := d.Set("zone", flattenComputeReservationZone(res["zone"], d, config)); err != nil { return fmt.Errorf("Error reading Reservation: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -385,31 +385,31 @@ func resourceComputeReservationImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenComputeReservationCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationCommitment(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationCommitment(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationSpecificReservationRequired(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationRequired(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationSpecificReservation(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservation(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -419,14 +419,14 @@ func flattenComputeReservationSpecificReservation(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["count"] = - flattenComputeReservationSpecificReservationCount(original["count"], d) + flattenComputeReservationSpecificReservationCount(original["count"], d, config) transformed["in_use_count"] = - flattenComputeReservationSpecificReservationInUseCount(original["inUseCount"], d) + flattenComputeReservationSpecificReservationInUseCount(original["inUseCount"], d, config) transformed["instance_properties"] = - flattenComputeReservationSpecificReservationInstanceProperties(original["instanceProperties"], d) + flattenComputeReservationSpecificReservationInstanceProperties(original["instanceProperties"], d, config) return []interface{}{transformed} } -func flattenComputeReservationSpecificReservationCount(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationCount(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -436,7 +436,7 @@ func flattenComputeReservationSpecificReservationCount(v interface{}, d *schema. return v } -func flattenComputeReservationSpecificReservationInUseCount(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInUseCount(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -446,7 +446,7 @@ func flattenComputeReservationSpecificReservationInUseCount(v interface{}, d *sc return v } -func flattenComputeReservationSpecificReservationInstanceProperties(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstanceProperties(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -456,24 +456,24 @@ func flattenComputeReservationSpecificReservationInstanceProperties(v interface{ } transformed := make(map[string]interface{}) transformed["machine_type"] = - flattenComputeReservationSpecificReservationInstancePropertiesMachineType(original["machineType"], d) + flattenComputeReservationSpecificReservationInstancePropertiesMachineType(original["machineType"], d, config) transformed["min_cpu_platform"] = - flattenComputeReservationSpecificReservationInstancePropertiesMinCpuPlatform(original["minCpuPlatform"], d) + flattenComputeReservationSpecificReservationInstancePropertiesMinCpuPlatform(original["minCpuPlatform"], d, config) transformed["guest_accelerators"] = - flattenComputeReservationSpecificReservationInstancePropertiesGuestAccelerators(original["guestAccelerators"], d) + flattenComputeReservationSpecificReservationInstancePropertiesGuestAccelerators(original["guestAccelerators"], d, config) transformed["local_ssds"] = - flattenComputeReservationSpecificReservationInstancePropertiesLocalSsds(original["localSsds"], d) + flattenComputeReservationSpecificReservationInstancePropertiesLocalSsds(original["localSsds"], d, config) return []interface{}{transformed} } -func flattenComputeReservationSpecificReservationInstancePropertiesMachineType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesMachineType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationSpecificReservationInstancePropertiesMinCpuPlatform(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesMinCpuPlatform(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationSpecificReservationInstancePropertiesGuestAccelerators(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesGuestAccelerators(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -486,17 +486,17 @@ func flattenComputeReservationSpecificReservationInstancePropertiesGuestAccelera continue } transformed = append(transformed, map[string]interface{}{ - "accelerator_type": flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorType(original["acceleratorType"], d), - "accelerator_count": flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorCount(original["acceleratorCount"], d), + "accelerator_type": flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorType(original["acceleratorType"], d, config), + "accelerator_count": flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorCount(original["acceleratorCount"], d, config), }) } return transformed } -func flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorCount(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsAcceleratorCount(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -506,7 +506,7 @@ func flattenComputeReservationSpecificReservationInstancePropertiesGuestAccelera return v } -func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsds(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -519,17 +519,17 @@ func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsds(v i continue } transformed = append(transformed, map[string]interface{}{ - "interface": flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsInterface(original["interface"], d), - "disk_size_gb": flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsDiskSizeGb(original["diskSizeGb"], d), + "interface": flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsInterface(original["interface"], d, config), + "disk_size_gb": flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsDiskSizeGb(original["diskSizeGb"], d, config), }) } return transformed } -func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsInterface(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsInterface(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsDiskSizeGb(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsDiskSizeGb(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -539,7 +539,7 @@ func flattenComputeReservationSpecificReservationInstancePropertiesLocalSsdsDisk return v } -func flattenComputeReservationZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeReservationZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_resource_policy.go b/google/resource_compute_resource_policy.go index b8120727fea..de80df736cc 100644 --- a/google/resource_compute_resource_policy.go +++ b/google/resource_compute_resource_policy.go @@ -341,13 +341,13 @@ func resourceComputeResourcePolicyRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading ResourcePolicy: %s", err) } - if err := d.Set("name", flattenComputeResourcePolicyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeResourcePolicyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ResourcePolicy: %s", err) } - if err := d.Set("snapshot_schedule_policy", flattenComputeResourcePolicySnapshotSchedulePolicy(res["snapshotSchedulePolicy"], d)); err != nil { + if err := d.Set("snapshot_schedule_policy", flattenComputeResourcePolicySnapshotSchedulePolicy(res["snapshotSchedulePolicy"], d, config)); err != nil { return fmt.Errorf("Error reading ResourcePolicy: %s", err) } - if err := d.Set("region", flattenComputeResourcePolicyRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeResourcePolicyRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading ResourcePolicy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -411,11 +411,11 @@ func resourceComputeResourcePolicyImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeResourcePolicyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -425,14 +425,14 @@ func flattenComputeResourcePolicySnapshotSchedulePolicy(v interface{}, d *schema } transformed := make(map[string]interface{}) transformed["schedule"] = - flattenComputeResourcePolicySnapshotSchedulePolicySchedule(original["schedule"], d) + flattenComputeResourcePolicySnapshotSchedulePolicySchedule(original["schedule"], d, config) transformed["retention_policy"] = - flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicy(original["retentionPolicy"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicy(original["retentionPolicy"], d, config) transformed["snapshot_properties"] = - flattenComputeResourcePolicySnapshotSchedulePolicySnapshotProperties(original["snapshotProperties"], d) + flattenComputeResourcePolicySnapshotSchedulePolicySnapshotProperties(original["snapshotProperties"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicySchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicySchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -442,14 +442,14 @@ func flattenComputeResourcePolicySnapshotSchedulePolicySchedule(v interface{}, d } transformed := make(map[string]interface{}) transformed["hourly_schedule"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule(original["hourlySchedule"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule(original["hourlySchedule"], d, config) transformed["daily_schedule"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailySchedule(original["dailySchedule"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailySchedule(original["dailySchedule"], d, config) transformed["weekly_schedule"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule(original["weeklySchedule"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule(original["weeklySchedule"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -459,12 +459,12 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule(v } transformed := make(map[string]interface{}) transformed["hours_in_cycle"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleHoursInCycle(original["hoursInCycle"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleHoursInCycle(original["hoursInCycle"], d, config) transformed["start_time"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleStartTime(original["startTime"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleStartTime(original["startTime"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleHoursInCycle(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleHoursInCycle(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -474,11 +474,11 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleHou return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleStartTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleStartTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailySchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailySchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -488,12 +488,12 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailySchedule(v i } transformed := make(map[string]interface{}) transformed["days_in_cycle"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleDaysInCycle(original["daysInCycle"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleDaysInCycle(original["daysInCycle"], d, config) transformed["start_time"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleStartTime(original["startTime"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleStartTime(original["startTime"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleDaysInCycle(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleDaysInCycle(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -503,11 +503,11 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleDays return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleStartTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleStartTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -517,10 +517,10 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule(v } transformed := make(map[string]interface{}) transformed["day_of_weeks"] = - flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeks(original["dayOfWeeks"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeks(original["dayOfWeeks"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeks(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeks(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -533,21 +533,21 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDay continue } transformed.Add(map[string]interface{}{ - "start_time": flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksStartTime(original["startTime"], d), - "day": flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksDay(original["day"], d), + "start_time": flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksStartTime(original["startTime"], d, config), + "day": flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksDay(original["day"], d, config), }) } return transformed } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksStartTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksStartTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksDay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeeksDay(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -557,12 +557,12 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicy(v interfa } transformed := make(map[string]interface{}) transformed["max_retention_days"] = - flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyMaxRetentionDays(original["maxRetentionDays"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyMaxRetentionDays(original["maxRetentionDays"], d, config) transformed["on_source_disk_delete"] = - flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOnSourceDiskDelete(original["onSourceDiskDelete"], d) + flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOnSourceDiskDelete(original["onSourceDiskDelete"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyMaxRetentionDays(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyMaxRetentionDays(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -572,11 +572,11 @@ func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyMaxRetenti return v } -func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOnSourceDiskDelete(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicyRetentionPolicyOnSourceDiskDelete(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotProperties(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotProperties(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -586,29 +586,29 @@ func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotProperties(v inte } transformed := make(map[string]interface{}) transformed["labels"] = - flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesLabels(original["labels"], d) + flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesLabels(original["labels"], d, config) transformed["storage_locations"] = - flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesStorageLocations(original["storageLocations"], d) + flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesStorageLocations(original["storageLocations"], d, config) transformed["guest_flush"] = - flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesGuestFlush(original["guestFlush"], d) + flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesGuestFlush(original["guestFlush"], d, config) return []interface{}{transformed} } -func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesStorageLocations(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesStorageLocations(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesGuestFlush(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicySnapshotSchedulePolicySnapshotPropertiesGuestFlush(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeResourcePolicyRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeResourcePolicyRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_route.go b/google/resource_compute_route.go index 257f85acc8e..1a920f8b0c0 100644 --- a/google/resource_compute_route.go +++ b/google/resource_compute_route.go @@ -317,40 +317,40 @@ func resourceComputeRouteRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("dest_range", flattenComputeRouteDestRange(res["destRange"], d)); err != nil { + if err := d.Set("dest_range", flattenComputeRouteDestRange(res["destRange"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("description", flattenComputeRouteDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRouteDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("name", flattenComputeRouteName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRouteName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("network", flattenComputeRouteNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeRouteNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("priority", flattenComputeRoutePriority(res["priority"], d)); err != nil { + if err := d.Set("priority", flattenComputeRoutePriority(res["priority"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("tags", flattenComputeRouteTags(res["tags"], d)); err != nil { + if err := d.Set("tags", flattenComputeRouteTags(res["tags"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("next_hop_gateway", flattenComputeRouteNextHopGateway(res["nextHopGateway"], d)); err != nil { + if err := d.Set("next_hop_gateway", flattenComputeRouteNextHopGateway(res["nextHopGateway"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("next_hop_instance", flattenComputeRouteNextHopInstance(res["nextHopInstance"], d)); err != nil { + if err := d.Set("next_hop_instance", flattenComputeRouteNextHopInstance(res["nextHopInstance"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("next_hop_ip", flattenComputeRouteNextHopIp(res["nextHopIp"], d)); err != nil { + if err := d.Set("next_hop_ip", flattenComputeRouteNextHopIp(res["nextHopIp"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("next_hop_vpn_tunnel", flattenComputeRouteNextHopVpnTunnel(res["nextHopVpnTunnel"], d)); err != nil { + if err := d.Set("next_hop_vpn_tunnel", flattenComputeRouteNextHopVpnTunnel(res["nextHopVpnTunnel"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("next_hop_network", flattenComputeRouteNextHopNetwork(res["nextHopNetwork"], d)); err != nil { + if err := d.Set("next_hop_network", flattenComputeRouteNextHopNetwork(res["nextHopNetwork"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } - if err := d.Set("next_hop_ilb", flattenComputeRouteNextHopIlb(res["nextHopIlb"], d)); err != nil { + if err := d.Set("next_hop_ilb", flattenComputeRouteNextHopIlb(res["nextHopIlb"], d, config)); err != nil { return fmt.Errorf("Error reading Route: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -413,26 +413,26 @@ func resourceComputeRouteImport(d *schema.ResourceData, meta interface{}) ([]*sc return []*schema.ResourceData{d}, nil } -func flattenComputeRouteDestRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteDestRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouteDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouteName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouteNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRoutePriority(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRoutePriority(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -442,40 +442,40 @@ func flattenComputeRoutePriority(v interface{}, d *schema.ResourceData) interfac return v } -func flattenComputeRouteTags(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteTags(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeRouteNextHopGateway(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNextHopGateway(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouteNextHopInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNextHopInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRouteNextHopIp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNextHopIp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouteNextHopVpnTunnel(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNextHopVpnTunnel(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRouteNextHopNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNextHopNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouteNextHopIlb(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouteNextHopIlb(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_router.go b/google/resource_compute_router.go index 72a4f9e0c55..41159883cf9 100644 --- a/google/resource_compute_router.go +++ b/google/resource_compute_router.go @@ -260,22 +260,22 @@ func resourceComputeRouterRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Router: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRouterCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRouterCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Router: %s", err) } - if err := d.Set("name", flattenComputeRouterName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRouterName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Router: %s", err) } - if err := d.Set("description", flattenComputeRouterDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRouterDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Router: %s", err) } - if err := d.Set("network", flattenComputeRouterNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeRouterNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading Router: %s", err) } - if err := d.Set("bgp", flattenComputeRouterBgp(res["bgp"], d)); err != nil { + if err := d.Set("bgp", flattenComputeRouterBgp(res["bgp"], d, config)); err != nil { return fmt.Errorf("Error reading Router: %s", err) } - if err := d.Set("region", flattenComputeRouterRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRouterRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading Router: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -398,26 +398,26 @@ func resourceComputeRouterImport(d *schema.ResourceData, meta interface{}) ([]*s return []*schema.ResourceData{d}, nil } -func flattenComputeRouterCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRouterBgp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgp(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -427,16 +427,16 @@ func flattenComputeRouterBgp(v interface{}, d *schema.ResourceData) interface{} } transformed := make(map[string]interface{}) transformed["asn"] = - flattenComputeRouterBgpAsn(original["asn"], d) + flattenComputeRouterBgpAsn(original["asn"], d, config) transformed["advertise_mode"] = - flattenComputeRouterBgpAdvertiseMode(original["advertiseMode"], d) + flattenComputeRouterBgpAdvertiseMode(original["advertiseMode"], d, config) transformed["advertised_groups"] = - flattenComputeRouterBgpAdvertisedGroups(original["advertisedGroups"], d) + flattenComputeRouterBgpAdvertisedGroups(original["advertisedGroups"], d, config) transformed["advertised_ip_ranges"] = - flattenComputeRouterBgpAdvertisedIpRanges(original["advertisedIpRanges"], d) + flattenComputeRouterBgpAdvertisedIpRanges(original["advertisedIpRanges"], d, config) return []interface{}{transformed} } -func flattenComputeRouterBgpAsn(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpAsn(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -446,15 +446,15 @@ func flattenComputeRouterBgpAsn(v interface{}, d *schema.ResourceData) interface return v } -func flattenComputeRouterBgpAdvertiseMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpAdvertiseMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpAdvertisedGroups(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpAdvertisedGroups(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpAdvertisedIpRanges(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpAdvertisedIpRanges(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -467,21 +467,21 @@ func flattenComputeRouterBgpAdvertisedIpRanges(v interface{}, d *schema.Resource continue } transformed = append(transformed, map[string]interface{}{ - "range": flattenComputeRouterBgpAdvertisedIpRangesRange(original["range"], d), - "description": flattenComputeRouterBgpAdvertisedIpRangesDescription(original["description"], d), + "range": flattenComputeRouterBgpAdvertisedIpRangesRange(original["range"], d, config), + "description": flattenComputeRouterBgpAdvertisedIpRangesDescription(original["description"], d, config), }) } return transformed } -func flattenComputeRouterBgpAdvertisedIpRangesRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpAdvertisedIpRangesRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpAdvertisedIpRangesDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpAdvertisedIpRangesDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_router_bgp_peer.go b/google/resource_compute_router_bgp_peer.go index 95c0f224f37..829f7c1ae63 100644 --- a/google/resource_compute_router_bgp_peer.go +++ b/google/resource_compute_router_bgp_peer.go @@ -317,34 +317,34 @@ func resourceComputeRouterBgpPeerRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("name", flattenComputeRouterBgpPeerName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRouterBgpPeerName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("interface", flattenComputeRouterBgpPeerInterface(res["interfaceName"], d)); err != nil { + if err := d.Set("interface", flattenComputeRouterBgpPeerInterface(res["interfaceName"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("ip_address", flattenComputeRouterBgpPeerIpAddress(res["ipAddress"], d)); err != nil { + if err := d.Set("ip_address", flattenComputeRouterBgpPeerIpAddress(res["ipAddress"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("peer_ip_address", flattenComputeRouterBgpPeerPeerIpAddress(res["peerIpAddress"], d)); err != nil { + if err := d.Set("peer_ip_address", flattenComputeRouterBgpPeerPeerIpAddress(res["peerIpAddress"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("peer_asn", flattenComputeRouterBgpPeerPeerAsn(res["peerAsn"], d)); err != nil { + if err := d.Set("peer_asn", flattenComputeRouterBgpPeerPeerAsn(res["peerAsn"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("advertised_route_priority", flattenComputeRouterBgpPeerAdvertisedRoutePriority(res["advertisedRoutePriority"], d)); err != nil { + if err := d.Set("advertised_route_priority", flattenComputeRouterBgpPeerAdvertisedRoutePriority(res["advertisedRoutePriority"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("advertise_mode", flattenComputeRouterBgpPeerAdvertiseMode(res["advertiseMode"], d)); err != nil { + if err := d.Set("advertise_mode", flattenComputeRouterBgpPeerAdvertiseMode(res["advertiseMode"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("advertised_groups", flattenComputeRouterBgpPeerAdvertisedGroups(res["advertisedGroups"], d)); err != nil { + if err := d.Set("advertised_groups", flattenComputeRouterBgpPeerAdvertisedGroups(res["advertisedGroups"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("advertised_ip_ranges", flattenComputeRouterBgpPeerAdvertisedIpRanges(res["advertisedIpRanges"], d)); err != nil { + if err := d.Set("advertised_ip_ranges", flattenComputeRouterBgpPeerAdvertisedIpRanges(res["advertisedIpRanges"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } - if err := d.Set("management_type", flattenComputeRouterBgpPeerManagementType(res["managementType"], d)); err != nil { + if err := d.Set("management_type", flattenComputeRouterBgpPeerManagementType(res["managementType"], d, config)); err != nil { return fmt.Errorf("Error reading RouterBgpPeer: %s", err) } @@ -474,23 +474,23 @@ func resourceComputeRouterBgpPeerImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenComputeRouterBgpPeerName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerInterface(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerInterface(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerPeerIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerPeerIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerPeerAsn(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerPeerAsn(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -500,7 +500,7 @@ func flattenComputeRouterBgpPeerPeerAsn(v interface{}, d *schema.ResourceData) i return v } -func flattenComputeRouterBgpPeerAdvertisedRoutePriority(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerAdvertisedRoutePriority(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -510,15 +510,15 @@ func flattenComputeRouterBgpPeerAdvertisedRoutePriority(v interface{}, d *schema return v } -func flattenComputeRouterBgpPeerAdvertiseMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerAdvertiseMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerAdvertisedGroups(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerAdvertisedGroups(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerAdvertisedIpRanges(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerAdvertisedIpRanges(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -531,21 +531,21 @@ func flattenComputeRouterBgpPeerAdvertisedIpRanges(v interface{}, d *schema.Reso continue } transformed = append(transformed, map[string]interface{}{ - "range": flattenComputeRouterBgpPeerAdvertisedIpRangesRange(original["range"], d), - "description": flattenComputeRouterBgpPeerAdvertisedIpRangesDescription(original["description"], d), + "range": flattenComputeRouterBgpPeerAdvertisedIpRangesRange(original["range"], d, config), + "description": flattenComputeRouterBgpPeerAdvertisedIpRangesDescription(original["description"], d, config), }) } return transformed } -func flattenComputeRouterBgpPeerAdvertisedIpRangesRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerAdvertisedIpRangesRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerAdvertisedIpRangesDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerAdvertisedIpRangesDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterBgpPeerManagementType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterBgpPeerManagementType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -653,7 +653,7 @@ func resourceComputeRouterBgpPeerFindNestedObjectInList(d *schema.ResourceData, } item := itemRaw.(map[string]interface{}) - itemName := flattenComputeRouterBgpPeerName(item["name"], d) + itemName := flattenComputeRouterBgpPeerName(item["name"], d, meta.(*Config)) if !reflect.DeepEqual(itemName, expectedName) { log.Printf("[DEBUG] Skipping item with name= %#v, looking for %#v)", itemName, expectedName) continue diff --git a/google/resource_compute_router_nat.go b/google/resource_compute_router_nat.go index dd5c3d07275..5b79b793c33 100644 --- a/google/resource_compute_router_nat.go +++ b/google/resource_compute_router_nat.go @@ -442,37 +442,37 @@ func resourceComputeRouterNatRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("name", flattenComputeRouterNatName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRouterNatName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("nat_ip_allocate_option", flattenComputeRouterNatNatIpAllocateOption(res["natIpAllocateOption"], d)); err != nil { + if err := d.Set("nat_ip_allocate_option", flattenComputeRouterNatNatIpAllocateOption(res["natIpAllocateOption"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("nat_ips", flattenComputeRouterNatNatIps(res["natIps"], d)); err != nil { + if err := d.Set("nat_ips", flattenComputeRouterNatNatIps(res["natIps"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("source_subnetwork_ip_ranges_to_nat", flattenComputeRouterNatSourceSubnetworkIpRangesToNat(res["sourceSubnetworkIpRangesToNat"], d)); err != nil { + if err := d.Set("source_subnetwork_ip_ranges_to_nat", flattenComputeRouterNatSourceSubnetworkIpRangesToNat(res["sourceSubnetworkIpRangesToNat"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("subnetwork", flattenComputeRouterNatSubnetwork(res["subnetworks"], d)); err != nil { + if err := d.Set("subnetwork", flattenComputeRouterNatSubnetwork(res["subnetworks"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("min_ports_per_vm", flattenComputeRouterNatMinPortsPerVm(res["minPortsPerVm"], d)); err != nil { + if err := d.Set("min_ports_per_vm", flattenComputeRouterNatMinPortsPerVm(res["minPortsPerVm"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("udp_idle_timeout_sec", flattenComputeRouterNatUdpIdleTimeoutSec(res["udpIdleTimeoutSec"], d)); err != nil { + if err := d.Set("udp_idle_timeout_sec", flattenComputeRouterNatUdpIdleTimeoutSec(res["udpIdleTimeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("icmp_idle_timeout_sec", flattenComputeRouterNatIcmpIdleTimeoutSec(res["icmpIdleTimeoutSec"], d)); err != nil { + if err := d.Set("icmp_idle_timeout_sec", flattenComputeRouterNatIcmpIdleTimeoutSec(res["icmpIdleTimeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("tcp_established_idle_timeout_sec", flattenComputeRouterNatTcpEstablishedIdleTimeoutSec(res["tcpEstablishedIdleTimeoutSec"], d)); err != nil { + if err := d.Set("tcp_established_idle_timeout_sec", flattenComputeRouterNatTcpEstablishedIdleTimeoutSec(res["tcpEstablishedIdleTimeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("tcp_transitory_idle_timeout_sec", flattenComputeRouterNatTcpTransitoryIdleTimeoutSec(res["tcpTransitoryIdleTimeoutSec"], d)); err != nil { + if err := d.Set("tcp_transitory_idle_timeout_sec", flattenComputeRouterNatTcpTransitoryIdleTimeoutSec(res["tcpTransitoryIdleTimeoutSec"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } - if err := d.Set("log_config", flattenComputeRouterNatLogConfig(res["logConfig"], d)); err != nil { + if err := d.Set("log_config", flattenComputeRouterNatLogConfig(res["logConfig"], d, config)); err != nil { return fmt.Errorf("Error reading RouterNat: %s", err) } @@ -650,26 +650,26 @@ func resourceComputeRouterNatImport(d *schema.ResourceData, meta interface{}) ([ return []*schema.ResourceData{d}, nil } -func flattenComputeRouterNatName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterNatNatIpAllocateOption(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatNatIpAllocateOption(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterNatNatIps(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatNatIps(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeRouterNatSourceSubnetworkIpRangesToNat(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatSourceSubnetworkIpRangesToNat(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterNatSubnetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatSubnetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -682,35 +682,35 @@ func flattenComputeRouterNatSubnetwork(v interface{}, d *schema.ResourceData) in continue } transformed.Add(map[string]interface{}{ - "name": flattenComputeRouterNatSubnetworkName(original["name"], d), - "source_ip_ranges_to_nat": flattenComputeRouterNatSubnetworkSourceIpRangesToNat(original["sourceIpRangesToNat"], d), - "secondary_ip_range_names": flattenComputeRouterNatSubnetworkSecondaryIpRangeNames(original["secondaryIpRangeNames"], d), + "name": flattenComputeRouterNatSubnetworkName(original["name"], d, config), + "source_ip_ranges_to_nat": flattenComputeRouterNatSubnetworkSourceIpRangesToNat(original["sourceIpRangesToNat"], d, config), + "secondary_ip_range_names": flattenComputeRouterNatSubnetworkSecondaryIpRangeNames(original["secondaryIpRangeNames"], d, config), }) } return transformed } -func flattenComputeRouterNatSubnetworkName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatSubnetworkName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRouterNatSubnetworkSourceIpRangesToNat(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatSubnetworkSourceIpRangesToNat(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeRouterNatSubnetworkSecondaryIpRangeNames(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatSubnetworkSecondaryIpRangeNames(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeRouterNatMinPortsPerVm(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatMinPortsPerVm(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -720,7 +720,7 @@ func flattenComputeRouterNatMinPortsPerVm(v interface{}, d *schema.ResourceData) return v } -func flattenComputeRouterNatUdpIdleTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatUdpIdleTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return 30 } @@ -734,7 +734,7 @@ func flattenComputeRouterNatUdpIdleTimeoutSec(v interface{}, d *schema.ResourceD return v } -func flattenComputeRouterNatIcmpIdleTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatIcmpIdleTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return 30 } @@ -748,7 +748,7 @@ func flattenComputeRouterNatIcmpIdleTimeoutSec(v interface{}, d *schema.Resource return v } -func flattenComputeRouterNatTcpEstablishedIdleTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatTcpEstablishedIdleTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return 1200 } @@ -762,7 +762,7 @@ func flattenComputeRouterNatTcpEstablishedIdleTimeoutSec(v interface{}, d *schem return v } -func flattenComputeRouterNatTcpTransitoryIdleTimeoutSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatTcpTransitoryIdleTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return 30 } @@ -776,7 +776,7 @@ func flattenComputeRouterNatTcpTransitoryIdleTimeoutSec(v interface{}, d *schema return v } -func flattenComputeRouterNatLogConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatLogConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -786,16 +786,16 @@ func flattenComputeRouterNatLogConfig(v interface{}, d *schema.ResourceData) int } transformed := make(map[string]interface{}) transformed["enable"] = - flattenComputeRouterNatLogConfigEnable(original["enable"], d) + flattenComputeRouterNatLogConfigEnable(original["enable"], d, config) transformed["filter"] = - flattenComputeRouterNatLogConfigFilter(original["filter"], d) + flattenComputeRouterNatLogConfigFilter(original["filter"], d, config) return []interface{}{transformed} } -func flattenComputeRouterNatLogConfigEnable(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatLogConfigEnable(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRouterNatLogConfigFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatLogConfigFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -976,7 +976,7 @@ func resourceComputeRouterNatFindNestedObjectInList(d *schema.ResourceData, meta } item := itemRaw.(map[string]interface{}) - itemName := flattenComputeRouterNatName(item["name"], d) + itemName := flattenComputeRouterNatName(item["name"], d, meta.(*Config)) if !reflect.DeepEqual(itemName, expectedName) { log.Printf("[DEBUG] Skipping item with name= %#v, looking for %#v)", itemName, expectedName) continue diff --git a/google/resource_compute_snapshot.go b/google/resource_compute_snapshot.go index 88462a215c9..1add919ff14 100644 --- a/google/resource_compute_snapshot.go +++ b/google/resource_compute_snapshot.go @@ -309,37 +309,37 @@ func resourceComputeSnapshotRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeSnapshotCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeSnapshotCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("snapshot_id", flattenComputeSnapshotSnapshotId(res["id"], d)); err != nil { + if err := d.Set("snapshot_id", flattenComputeSnapshotSnapshotId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("disk_size_gb", flattenComputeSnapshotDiskSizeGb(res["diskSizeGb"], d)); err != nil { + if err := d.Set("disk_size_gb", flattenComputeSnapshotDiskSizeGb(res["diskSizeGb"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("name", flattenComputeSnapshotName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeSnapshotName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("description", flattenComputeSnapshotDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeSnapshotDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("storage_bytes", flattenComputeSnapshotStorageBytes(res["storageBytes"], d)); err != nil { + if err := d.Set("storage_bytes", flattenComputeSnapshotStorageBytes(res["storageBytes"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("licenses", flattenComputeSnapshotLicenses(res["licenses"], d)); err != nil { + if err := d.Set("licenses", flattenComputeSnapshotLicenses(res["licenses"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("labels", flattenComputeSnapshotLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeSnapshotLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeSnapshotLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeSnapshotLabelFingerprint(res["labelFingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("source_disk", flattenComputeSnapshotSourceDisk(res["sourceDisk"], d)); err != nil { + if err := d.Set("source_disk", flattenComputeSnapshotSourceDisk(res["sourceDisk"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } - if err := d.Set("snapshot_encryption_key", flattenComputeSnapshotSnapshotEncryptionKey(res["snapshotEncryptionKey"], d)); err != nil { + if err := d.Set("snapshot_encryption_key", flattenComputeSnapshotSnapshotEncryptionKey(res["snapshotEncryptionKey"], d, config)); err != nil { return fmt.Errorf("Error reading Snapshot: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -453,11 +453,11 @@ func resourceComputeSnapshotImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenComputeSnapshotCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSnapshotSnapshotId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotSnapshotId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -467,7 +467,7 @@ func flattenComputeSnapshotSnapshotId(v interface{}, d *schema.ResourceData) int return v } -func flattenComputeSnapshotDiskSizeGb(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotDiskSizeGb(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -477,15 +477,15 @@ func flattenComputeSnapshotDiskSizeGb(v interface{}, d *schema.ResourceData) int return v } -func flattenComputeSnapshotName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSnapshotDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSnapshotStorageBytes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotStorageBytes(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -495,29 +495,29 @@ func flattenComputeSnapshotStorageBytes(v interface{}, d *schema.ResourceData) i return v } -func flattenComputeSnapshotLicenses(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotLicenses(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeSnapshotLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSnapshotLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSnapshotSourceDisk(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotSourceDisk(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenComputeSnapshotSnapshotEncryptionKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -527,16 +527,16 @@ func flattenComputeSnapshotSnapshotEncryptionKey(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeSnapshotSnapshotEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeSnapshotSnapshotEncryptionKeyRawKey(original["rawKey"], d, config) transformed["sha256"] = - flattenComputeSnapshotSnapshotEncryptionKeySha256(original["sha256"], d) + flattenComputeSnapshotSnapshotEncryptionKeySha256(original["sha256"], d, config) return []interface{}{transformed} } -func flattenComputeSnapshotSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("snapshot_encryption_key.0.raw_key") } -func flattenComputeSnapshotSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSnapshotSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_ssl_certificate.go b/google/resource_compute_ssl_certificate.go index e213a0b5fb6..293d2215a46 100644 --- a/google/resource_compute_ssl_certificate.go +++ b/google/resource_compute_ssl_certificate.go @@ -209,19 +209,19 @@ func resourceComputeSslCertificateRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading SslCertificate: %s", err) } - if err := d.Set("certificate", flattenComputeSslCertificateCertificate(res["certificate"], d)); err != nil { + if err := d.Set("certificate", flattenComputeSslCertificateCertificate(res["certificate"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeSslCertificateCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeSslCertificateCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } - if err := d.Set("description", flattenComputeSslCertificateDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeSslCertificateDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } - if err := d.Set("certificate_id", flattenComputeSslCertificateCertificateId(res["id"], d)); err != nil { + if err := d.Set("certificate_id", flattenComputeSslCertificateCertificateId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } - if err := d.Set("name", flattenComputeSslCertificateName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeSslCertificateName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading SslCertificate: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -284,19 +284,19 @@ func resourceComputeSslCertificateImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeSslCertificateCertificate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslCertificateCertificate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslCertificateCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslCertificateCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslCertificateDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslCertificateDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslCertificateCertificateId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslCertificateCertificateId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -306,7 +306,7 @@ func flattenComputeSslCertificateCertificateId(v interface{}, d *schema.Resource return v } -func flattenComputeSslCertificateName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslCertificateName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_ssl_policy.go b/google/resource_compute_ssl_policy.go index 715010f9be2..504a59331c8 100644 --- a/google/resource_compute_ssl_policy.go +++ b/google/resource_compute_ssl_policy.go @@ -254,28 +254,28 @@ func resourceComputeSslPolicyRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeSslPolicyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeSslPolicyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("description", flattenComputeSslPolicyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeSslPolicyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("name", flattenComputeSslPolicyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeSslPolicyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("profile", flattenComputeSslPolicyProfile(res["profile"], d)); err != nil { + if err := d.Set("profile", flattenComputeSslPolicyProfile(res["profile"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("min_tls_version", flattenComputeSslPolicyMinTlsVersion(res["minTlsVersion"], d)); err != nil { + if err := d.Set("min_tls_version", flattenComputeSslPolicyMinTlsVersion(res["minTlsVersion"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("enabled_features", flattenComputeSslPolicyEnabledFeatures(res["enabledFeatures"], d)); err != nil { + if err := d.Set("enabled_features", flattenComputeSslPolicyEnabledFeatures(res["enabledFeatures"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("custom_features", flattenComputeSslPolicyCustomFeatures(res["customFeatures"], d)); err != nil { + if err := d.Set("custom_features", flattenComputeSslPolicyCustomFeatures(res["customFeatures"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } - if err := d.Set("fingerprint", flattenComputeSslPolicyFingerprint(res["fingerprint"], d)); err != nil { + if err := d.Set("fingerprint", flattenComputeSslPolicyFingerprint(res["fingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading SslPolicy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -394,41 +394,41 @@ func resourceComputeSslPolicyImport(d *schema.ResourceData, meta interface{}) ([ return []*schema.ResourceData{d}, nil } -func flattenComputeSslPolicyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslPolicyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslPolicyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslPolicyProfile(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyProfile(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslPolicyMinTlsVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyMinTlsVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSslPolicyEnabledFeatures(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyEnabledFeatures(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeSslPolicyCustomFeatures(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyCustomFeatures(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeSslPolicyFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSslPolicyFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_compute_subnetwork.go b/google/resource_compute_subnetwork.go index 88050fd9b8f..abd44578ad0 100644 --- a/google/resource_compute_subnetwork.go +++ b/google/resource_compute_subnetwork.go @@ -164,7 +164,6 @@ access Google APIs and services by using Private Google Access.`, Type: schema.TypeString, Computed: true, Optional: true, - ForceNew: true, DiffSuppressFunc: compareSelfLinkOrResourceName, Description: `URL of the GCP region for this subnetwork.`, }, @@ -393,34 +392,34 @@ func resourceComputeSubnetworkRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeSubnetworkCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeSubnetworkCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("description", flattenComputeSubnetworkDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeSubnetworkDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("gateway_address", flattenComputeSubnetworkGatewayAddress(res["gatewayAddress"], d)); err != nil { + if err := d.Set("gateway_address", flattenComputeSubnetworkGatewayAddress(res["gatewayAddress"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("ip_cidr_range", flattenComputeSubnetworkIpCidrRange(res["ipCidrRange"], d)); err != nil { + if err := d.Set("ip_cidr_range", flattenComputeSubnetworkIpCidrRange(res["ipCidrRange"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("name", flattenComputeSubnetworkName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeSubnetworkName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("network", flattenComputeSubnetworkNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeSubnetworkNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("secondary_ip_range", flattenComputeSubnetworkSecondaryIpRange(res["secondaryIpRanges"], d)); err != nil { + if err := d.Set("secondary_ip_range", flattenComputeSubnetworkSecondaryIpRange(res["secondaryIpRanges"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("private_ip_google_access", flattenComputeSubnetworkPrivateIpGoogleAccess(res["privateIpGoogleAccess"], d)); err != nil { + if err := d.Set("private_ip_google_access", flattenComputeSubnetworkPrivateIpGoogleAccess(res["privateIpGoogleAccess"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("region", flattenComputeSubnetworkRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeSubnetworkRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("log_config", flattenComputeSubnetworkLogConfig(res["logConfig"], d)); err != nil { + if err := d.Set("log_config", flattenComputeSubnetworkLogConfig(res["logConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -634,34 +633,34 @@ func resourceComputeSubnetworkImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenComputeSubnetworkCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkGatewayAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkGatewayAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkIpCidrRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkIpCidrRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -674,32 +673,32 @@ func flattenComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceD continue } transformed = append(transformed, map[string]interface{}{ - "range_name": flattenComputeSubnetworkSecondaryIpRangeRangeName(original["rangeName"], d), - "ip_cidr_range": flattenComputeSubnetworkSecondaryIpRangeIpCidrRange(original["ipCidrRange"], d), + "range_name": flattenComputeSubnetworkSecondaryIpRangeRangeName(original["rangeName"], d, config), + "ip_cidr_range": flattenComputeSubnetworkSecondaryIpRangeIpCidrRange(original["ipCidrRange"], d, config), }) } return transformed } -func flattenComputeSubnetworkSecondaryIpRangeRangeName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkSecondaryIpRangeRangeName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkSecondaryIpRangeIpCidrRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkSecondaryIpRangeIpCidrRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkPrivateIpGoogleAccess(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkPrivateIpGoogleAccess(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenComputeSubnetworkLogConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkLogConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } diff --git a/google/resource_compute_target_http_proxy.go b/google/resource_compute_target_http_proxy.go index 2706042f78c..a899eef6335 100644 --- a/google/resource_compute_target_http_proxy.go +++ b/google/resource_compute_target_http_proxy.go @@ -172,19 +172,19 @@ func resourceComputeTargetHttpProxyRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Error reading TargetHttpProxy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeTargetHttpProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeTargetHttpProxyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpProxy: %s", err) } - if err := d.Set("description", flattenComputeTargetHttpProxyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeTargetHttpProxyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpProxy: %s", err) } - if err := d.Set("proxy_id", flattenComputeTargetHttpProxyProxyId(res["id"], d)); err != nil { + if err := d.Set("proxy_id", flattenComputeTargetHttpProxyProxyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpProxy: %s", err) } - if err := d.Set("name", flattenComputeTargetHttpProxyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeTargetHttpProxyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpProxy: %s", err) } - if err := d.Set("url_map", flattenComputeTargetHttpProxyUrlMap(res["urlMap"], d)); err != nil { + if err := d.Set("url_map", flattenComputeTargetHttpProxyUrlMap(res["urlMap"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpProxy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -291,15 +291,15 @@ func resourceComputeTargetHttpProxyImport(d *schema.ResourceData, meta interface return []*schema.ResourceData{d}, nil } -func flattenComputeTargetHttpProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpProxyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetHttpProxyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpProxyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetHttpProxyProxyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpProxyProxyId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -309,11 +309,11 @@ func flattenComputeTargetHttpProxyProxyId(v interface{}, d *schema.ResourceData) return v } -func flattenComputeTargetHttpProxyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpProxyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetHttpProxyUrlMap(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpProxyUrlMap(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_target_https_proxy.go b/google/resource_compute_target_https_proxy.go index 3b7777f6b2e..a6117319dfe 100644 --- a/google/resource_compute_target_https_proxy.go +++ b/google/resource_compute_target_https_proxy.go @@ -222,28 +222,28 @@ func resourceComputeTargetHttpsProxyRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeTargetHttpsProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeTargetHttpsProxyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("description", flattenComputeTargetHttpsProxyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeTargetHttpsProxyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("proxy_id", flattenComputeTargetHttpsProxyProxyId(res["id"], d)); err != nil { + if err := d.Set("proxy_id", flattenComputeTargetHttpsProxyProxyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("name", flattenComputeTargetHttpsProxyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeTargetHttpsProxyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("quic_override", flattenComputeTargetHttpsProxyQuicOverride(res["quicOverride"], d)); err != nil { + if err := d.Set("quic_override", flattenComputeTargetHttpsProxyQuicOverride(res["quicOverride"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("ssl_certificates", flattenComputeTargetHttpsProxySslCertificates(res["sslCertificates"], d)); err != nil { + if err := d.Set("ssl_certificates", flattenComputeTargetHttpsProxySslCertificates(res["sslCertificates"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("ssl_policy", flattenComputeTargetHttpsProxySslPolicy(res["sslPolicy"], d)); err != nil { + if err := d.Set("ssl_policy", flattenComputeTargetHttpsProxySslPolicy(res["sslPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } - if err := d.Set("url_map", flattenComputeTargetHttpsProxyUrlMap(res["urlMap"], d)); err != nil { + if err := d.Set("url_map", flattenComputeTargetHttpsProxyUrlMap(res["urlMap"], d, config)); err != nil { return fmt.Errorf("Error reading TargetHttpsProxy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -434,15 +434,15 @@ func resourceComputeTargetHttpsProxyImport(d *schema.ResourceData, meta interfac return []*schema.ResourceData{d}, nil } -func flattenComputeTargetHttpsProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetHttpsProxyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetHttpsProxyProxyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxyProxyId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -452,11 +452,11 @@ func flattenComputeTargetHttpsProxyProxyId(v interface{}, d *schema.ResourceData return v } -func flattenComputeTargetHttpsProxyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetHttpsProxyQuicOverride(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxyQuicOverride(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return "NONE" } @@ -464,21 +464,21 @@ func flattenComputeTargetHttpsProxyQuicOverride(v interface{}, d *schema.Resourc return v } -func flattenComputeTargetHttpsProxySslCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxySslCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeTargetHttpsProxySslPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxySslPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeTargetHttpsProxyUrlMap(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetHttpsProxyUrlMap(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_target_instance.go b/google/resource_compute_target_instance.go index 953ec01ca43..43bffb01848 100644 --- a/google/resource_compute_target_instance.go +++ b/google/resource_compute_target_instance.go @@ -200,22 +200,22 @@ func resourceComputeTargetInstanceRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading TargetInstance: %s", err) } - if err := d.Set("name", flattenComputeTargetInstanceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeTargetInstanceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TargetInstance: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeTargetInstanceCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeTargetInstanceCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading TargetInstance: %s", err) } - if err := d.Set("description", flattenComputeTargetInstanceDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeTargetInstanceDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading TargetInstance: %s", err) } - if err := d.Set("instance", flattenComputeTargetInstanceInstance(res["instance"], d)); err != nil { + if err := d.Set("instance", flattenComputeTargetInstanceInstance(res["instance"], d, config)); err != nil { return fmt.Errorf("Error reading TargetInstance: %s", err) } - if err := d.Set("nat_policy", flattenComputeTargetInstanceNatPolicy(res["natPolicy"], d)); err != nil { + if err := d.Set("nat_policy", flattenComputeTargetInstanceNatPolicy(res["natPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading TargetInstance: %s", err) } - if err := d.Set("zone", flattenComputeTargetInstanceZone(res["zone"], d)); err != nil { + if err := d.Set("zone", flattenComputeTargetInstanceZone(res["zone"], d, config)); err != nil { return fmt.Errorf("Error reading TargetInstance: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -279,30 +279,30 @@ func resourceComputeTargetInstanceImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeTargetInstanceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetInstanceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetInstanceCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetInstanceCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetInstanceDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetInstanceDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetInstanceInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetInstanceInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeTargetInstanceNatPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetInstanceNatPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetInstanceZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetInstanceZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_target_ssl_proxy.go b/google/resource_compute_target_ssl_proxy.go index 5e120c95a32..965ff6702ed 100644 --- a/google/resource_compute_target_ssl_proxy.go +++ b/google/resource_compute_target_ssl_proxy.go @@ -218,28 +218,28 @@ func resourceComputeTargetSslProxyRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeTargetSslProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeTargetSslProxyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("description", flattenComputeTargetSslProxyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeTargetSslProxyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("proxy_id", flattenComputeTargetSslProxyProxyId(res["id"], d)); err != nil { + if err := d.Set("proxy_id", flattenComputeTargetSslProxyProxyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("name", flattenComputeTargetSslProxyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeTargetSslProxyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("proxy_header", flattenComputeTargetSslProxyProxyHeader(res["proxyHeader"], d)); err != nil { + if err := d.Set("proxy_header", flattenComputeTargetSslProxyProxyHeader(res["proxyHeader"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("backend_service", flattenComputeTargetSslProxyBackendService(res["service"], d)); err != nil { + if err := d.Set("backend_service", flattenComputeTargetSslProxyBackendService(res["service"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("ssl_certificates", flattenComputeTargetSslProxySslCertificates(res["sslCertificates"], d)); err != nil { + if err := d.Set("ssl_certificates", flattenComputeTargetSslProxySslCertificates(res["sslCertificates"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } - if err := d.Set("ssl_policy", flattenComputeTargetSslProxySslPolicy(res["sslPolicy"], d)); err != nil { + if err := d.Set("ssl_policy", flattenComputeTargetSslProxySslPolicy(res["sslPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading TargetSslProxy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -430,15 +430,15 @@ func resourceComputeTargetSslProxyImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeTargetSslProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetSslProxyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetSslProxyProxyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxyProxyId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -448,29 +448,29 @@ func flattenComputeTargetSslProxyProxyId(v interface{}, d *schema.ResourceData) return v } -func flattenComputeTargetSslProxyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetSslProxyProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxyProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetSslProxyBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxyBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeTargetSslProxySslCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxySslCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeTargetSslProxySslPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetSslProxySslPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_target_tcp_proxy.go b/google/resource_compute_target_tcp_proxy.go index 4839909174b..507ef6bfdf8 100644 --- a/google/resource_compute_target_tcp_proxy.go +++ b/google/resource_compute_target_tcp_proxy.go @@ -186,22 +186,22 @@ func resourceComputeTargetTcpProxyRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeTargetTcpProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeTargetTcpProxyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } - if err := d.Set("description", flattenComputeTargetTcpProxyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeTargetTcpProxyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } - if err := d.Set("proxy_id", flattenComputeTargetTcpProxyProxyId(res["id"], d)); err != nil { + if err := d.Set("proxy_id", flattenComputeTargetTcpProxyProxyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } - if err := d.Set("name", flattenComputeTargetTcpProxyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeTargetTcpProxyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } - if err := d.Set("proxy_header", flattenComputeTargetTcpProxyProxyHeader(res["proxyHeader"], d)); err != nil { + if err := d.Set("proxy_header", flattenComputeTargetTcpProxyProxyHeader(res["proxyHeader"], d, config)); err != nil { return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } - if err := d.Set("backend_service", flattenComputeTargetTcpProxyBackendService(res["service"], d)); err != nil { + if err := d.Set("backend_service", flattenComputeTargetTcpProxyBackendService(res["service"], d, config)); err != nil { return fmt.Errorf("Error reading TargetTcpProxy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -336,15 +336,15 @@ func resourceComputeTargetTcpProxyImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenComputeTargetTcpProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetTcpProxyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetTcpProxyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetTcpProxyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetTcpProxyProxyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetTcpProxyProxyId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -354,15 +354,15 @@ func flattenComputeTargetTcpProxyProxyId(v interface{}, d *schema.ResourceData) return v } -func flattenComputeTargetTcpProxyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetTcpProxyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetTcpProxyProxyHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetTcpProxyProxyHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeTargetTcpProxyBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeTargetTcpProxyBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_url_map.go b/google/resource_compute_url_map.go index 9cf8c9c703f..38ae7975ec3 100644 --- a/google/resource_compute_url_map.go +++ b/google/resource_compute_url_map.go @@ -1823,34 +1823,34 @@ func resourceComputeUrlMapRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeUrlMapCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeUrlMapCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("default_service", flattenComputeUrlMapDefaultService(res["defaultService"], d)); err != nil { + if err := d.Set("default_service", flattenComputeUrlMapDefaultService(res["defaultService"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("description", flattenComputeUrlMapDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeUrlMapDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("map_id", flattenComputeUrlMapMapId(res["id"], d)); err != nil { + if err := d.Set("map_id", flattenComputeUrlMapMapId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("fingerprint", flattenComputeUrlMapFingerprint(res["fingerprint"], d)); err != nil { + if err := d.Set("fingerprint", flattenComputeUrlMapFingerprint(res["fingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("header_action", flattenComputeUrlMapHeaderAction(res["headerAction"], d)); err != nil { + if err := d.Set("header_action", flattenComputeUrlMapHeaderAction(res["headerAction"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("host_rule", flattenComputeUrlMapHostRule(res["hostRules"], d)); err != nil { + if err := d.Set("host_rule", flattenComputeUrlMapHostRule(res["hostRules"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("name", flattenComputeUrlMapName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeUrlMapName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("path_matcher", flattenComputeUrlMapPathMatcher(res["pathMatchers"], d)); err != nil { + if err := d.Set("path_matcher", flattenComputeUrlMapPathMatcher(res["pathMatchers"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } - if err := d.Set("test", flattenComputeUrlMapTest(res["tests"], d)); err != nil { + if err := d.Set("test", flattenComputeUrlMapTest(res["tests"], d, config)); err != nil { return fmt.Errorf("Error reading UrlMap: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -1994,22 +1994,22 @@ func resourceComputeUrlMapImport(d *schema.ResourceData, meta interface{}) ([]*s return []*schema.ResourceData{d}, nil } -func flattenComputeUrlMapCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapDefaultService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapDefaultService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapMapId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapMapId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2019,11 +2019,11 @@ func flattenComputeUrlMapMapId(v interface{}, d *schema.ResourceData) interface{ return v } -func flattenComputeUrlMapFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2033,16 +2033,16 @@ func flattenComputeUrlMapHeaderAction(v interface{}, d *schema.ResourceData) int } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeUrlMapHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeUrlMapHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeUrlMapHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeUrlMapHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeUrlMapHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeUrlMapHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeUrlMapHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeUrlMapHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2055,30 +2055,30 @@ func flattenComputeUrlMapHeaderActionRequestHeadersToAdd(v interface{}, d *schem continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2091,30 +2091,30 @@ func flattenComputeUrlMapHeaderActionResponseHeadersToAdd(v interface{}, d *sche continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHostRule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHostRule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2127,33 +2127,33 @@ func flattenComputeUrlMapHostRule(v interface{}, d *schema.ResourceData) interfa continue } transformed.Add(map[string]interface{}{ - "description": flattenComputeUrlMapHostRuleDescription(original["description"], d), - "hosts": flattenComputeUrlMapHostRuleHosts(original["hosts"], d), - "path_matcher": flattenComputeUrlMapHostRulePathMatcher(original["pathMatcher"], d), + "description": flattenComputeUrlMapHostRuleDescription(original["description"], d, config), + "hosts": flattenComputeUrlMapHostRuleHosts(original["hosts"], d, config), + "path_matcher": flattenComputeUrlMapHostRulePathMatcher(original["pathMatcher"], d, config), }) } return transformed } -func flattenComputeUrlMapHostRuleDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHostRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapHostRuleHosts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHostRuleHosts(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeUrlMapHostRulePathMatcher(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapHostRulePathMatcher(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcher(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcher(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2166,28 +2166,28 @@ func flattenComputeUrlMapPathMatcher(v interface{}, d *schema.ResourceData) inte continue } transformed = append(transformed, map[string]interface{}{ - "default_service": flattenComputeUrlMapPathMatcherDefaultService(original["defaultService"], d), - "description": flattenComputeUrlMapPathMatcherDescription(original["description"], d), - "header_action": flattenComputeUrlMapPathMatcherHeaderAction(original["headerAction"], d), - "name": flattenComputeUrlMapPathMatcherName(original["name"], d), - "path_rule": flattenComputeUrlMapPathMatcherPathRule(original["pathRules"], d), - "route_rules": flattenComputeUrlMapPathMatcherRouteRules(original["routeRules"], d), + "default_service": flattenComputeUrlMapPathMatcherDefaultService(original["defaultService"], d, config), + "description": flattenComputeUrlMapPathMatcherDescription(original["description"], d, config), + "header_action": flattenComputeUrlMapPathMatcherHeaderAction(original["headerAction"], d, config), + "name": flattenComputeUrlMapPathMatcherName(original["name"], d, config), + "path_rule": flattenComputeUrlMapPathMatcherPathRule(original["pathRules"], d, config), + "route_rules": flattenComputeUrlMapPathMatcherRouteRules(original["routeRules"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherDefaultService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherDefaultService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2197,16 +2197,16 @@ func flattenComputeUrlMapPathMatcherHeaderAction(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2219,30 +2219,30 @@ func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAdd(v interface{ continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2255,34 +2255,34 @@ func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAdd(v interface continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2295,29 +2295,29 @@ func flattenComputeUrlMapPathMatcherPathRule(v interface{}, d *schema.ResourceDa continue } transformed = append(transformed, map[string]interface{}{ - "service": flattenComputeUrlMapPathMatcherPathRuleService(original["service"], d), - "paths": flattenComputeUrlMapPathMatcherPathRulePaths(original["paths"], d), - "route_action": flattenComputeUrlMapPathMatcherPathRuleRouteAction(original["routeAction"], d), - "url_redirect": flattenComputeUrlMapPathMatcherPathRuleUrlRedirect(original["urlRedirect"], d), + "service": flattenComputeUrlMapPathMatcherPathRuleService(original["service"], d, config), + "paths": flattenComputeUrlMapPathMatcherPathRulePaths(original["paths"], d, config), + "route_action": flattenComputeUrlMapPathMatcherPathRuleRouteAction(original["routeAction"], d, config), + "url_redirect": flattenComputeUrlMapPathMatcherPathRuleUrlRedirect(original["urlRedirect"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherPathRuleService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherPathRulePaths(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRulePaths(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeUrlMapPathMatcherPathRuleRouteAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2327,22 +2327,22 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteAction(v interface{}, d *schema } transformed := make(map[string]interface{}) transformed["cors_policy"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicy(original["corsPolicy"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicy(original["corsPolicy"], d, config) transformed["fault_injection_policy"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d, config) transformed["request_mirror_policy"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d, config) transformed["retry_policy"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicy(original["retryPolicy"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicy(original["retryPolicy"], d, config) transformed["timeout"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeout(original["timeout"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeout(original["timeout"], d, config) transformed["url_rewrite"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewrite(original["urlRewrite"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewrite(original["urlRewrite"], d, config) transformed["weighted_backend_services"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(original["weightedBackendServices"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(original["weightedBackendServices"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2352,52 +2352,52 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicy(v interface{}, } transformed := make(map[string]interface{}) transformed["allow_credentials"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d, config) transformed["allow_headers"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d, config) transformed["allow_methods"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(original["allowMethods"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(original["allowMethods"], d, config) transformed["allow_origin_regexes"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d, config) transformed["allow_origins"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d, config) transformed["disabled"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(original["disabled"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(original["disabled"], d, config) transformed["expose_headers"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d, config) transformed["max_age"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(original["maxAge"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(original["maxAge"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2407,7 +2407,7 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(v interf return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2417,12 +2417,12 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(v in } transformed := make(map[string]interface{}) transformed["abort"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(original["abort"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(original["abort"], d, config) transformed["delay"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(original["delay"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(original["delay"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2432,12 +2432,12 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort } transformed := make(map[string]interface{}) transformed["http_status"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d, config) transformed["percentage"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2447,11 +2447,11 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2461,12 +2461,12 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay } transformed := make(map[string]interface{}) transformed["fixed_delay"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d, config) transformed["percentage"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2476,12 +2476,12 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2491,15 +2491,15 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2509,17 +2509,17 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(v int } transformed := make(map[string]interface{}) transformed["backend_service"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(original["backendService"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(original["backendService"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2529,14 +2529,14 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicy(v interface{} } transformed := make(map[string]interface{}) transformed["num_retries"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(original["numRetries"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(original["numRetries"], d, config) transformed["per_try_timeout"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d, config) transformed["retry_conditions"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(original["retryConditions"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(original["retryConditions"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2546,7 +2546,7 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(v i return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2556,12 +2556,12 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout( } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2571,15 +2571,15 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutN return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2589,12 +2589,12 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeout(v interface{}, d } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(original["nanos"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(original["seconds"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2604,11 +2604,11 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(v interface{ return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2618,20 +2618,20 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewrite(v interface{}, } transformed := make(map[string]interface{}) transformed["host_rewrite"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d, config) transformed["path_prefix_rewrite"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2644,21 +2644,21 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(v continue } transformed = append(transformed, map[string]interface{}{ - "backend_service": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(original["backendService"], d), - "header_action": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d), - "weight": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(original["weight"], d), + "backend_service": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(original["backendService"], d, config), + "header_action": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d, config), + "weight": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(original["weight"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2668,16 +2668,16 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHe } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2690,30 +2690,30 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHe continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2726,30 +2726,30 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHe continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2759,7 +2759,7 @@ func flattenComputeUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWe return v } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2769,44 +2769,44 @@ func flattenComputeUrlMapPathMatcherPathRuleUrlRedirect(v interface{}, d *schema } transformed := make(map[string]interface{}) transformed["host_redirect"] = - flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(original["hostRedirect"], d) + flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(original["hostRedirect"], d, config) transformed["https_redirect"] = - flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(original["httpsRedirect"], d) + flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(original["httpsRedirect"], d, config) transformed["path_redirect"] = - flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(original["pathRedirect"], d) + flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(original["pathRedirect"], d, config) transformed["prefix_redirect"] = - flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(original["prefixRedirect"], d) + flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(original["prefixRedirect"], d, config) transformed["redirect_response_code"] = - flattenComputeUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d) + flattenComputeUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d, config) transformed["strip_query"] = - flattenComputeUrlMapPathMatcherPathRuleUrlRedirectStripQuery(original["stripQuery"], d) + flattenComputeUrlMapPathMatcherPathRuleUrlRedirectStripQuery(original["stripQuery"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectStripQuery(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherPathRuleUrlRedirectStripQuery(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2819,17 +2819,17 @@ func flattenComputeUrlMapPathMatcherRouteRules(v interface{}, d *schema.Resource continue } transformed = append(transformed, map[string]interface{}{ - "priority": flattenComputeUrlMapPathMatcherRouteRulesPriority(original["priority"], d), - "service": flattenComputeUrlMapPathMatcherRouteRulesService(original["service"], d), - "header_action": flattenComputeUrlMapPathMatcherRouteRulesHeaderAction(original["headerAction"], d), - "match_rules": flattenComputeUrlMapPathMatcherRouteRulesMatchRules(original["matchRules"], d), - "route_action": flattenComputeUrlMapPathMatcherRouteRulesRouteAction(original["routeAction"], d), - "url_redirect": flattenComputeUrlMapPathMatcherRouteRulesUrlRedirect(original["urlRedirect"], d), + "priority": flattenComputeUrlMapPathMatcherRouteRulesPriority(original["priority"], d, config), + "service": flattenComputeUrlMapPathMatcherRouteRulesService(original["service"], d, config), + "header_action": flattenComputeUrlMapPathMatcherRouteRulesHeaderAction(original["headerAction"], d, config), + "match_rules": flattenComputeUrlMapPathMatcherRouteRulesMatchRules(original["matchRules"], d, config), + "route_action": flattenComputeUrlMapPathMatcherRouteRulesRouteAction(original["routeAction"], d, config), + "url_redirect": flattenComputeUrlMapPathMatcherRouteRulesUrlRedirect(original["urlRedirect"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesPriority(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesPriority(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -2839,14 +2839,14 @@ func flattenComputeUrlMapPathMatcherRouteRulesPriority(v interface{}, d *schema. return v } -func flattenComputeUrlMapPathMatcherRouteRulesService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2856,16 +2856,16 @@ func flattenComputeUrlMapPathMatcherRouteRulesHeaderAction(v interface{}, d *sch } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2878,30 +2878,30 @@ func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(v continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2914,30 +2914,30 @@ func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(v continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2950,22 +2950,22 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRules(v interface{}, d *schem continue } transformed = append(transformed, map[string]interface{}{ - "full_path_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(original["fullPathMatch"], d), - "header_matches": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(original["headerMatches"], d), - "ignore_case": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(original["ignoreCase"], d), - "metadata_filters": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(original["metadataFilters"], d), - "prefix_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(original["prefixMatch"], d), - "query_parameter_matches": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(original["queryParameterMatches"], d), - "regex_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(original["regexMatch"], d), + "full_path_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(original["fullPathMatch"], d, config), + "header_matches": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(original["headerMatches"], d, config), + "ignore_case": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(original["ignoreCase"], d, config), + "metadata_filters": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(original["metadataFilters"], d, config), + "prefix_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(original["prefixMatch"], d, config), + "query_parameter_matches": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(original["queryParameterMatches"], d, config), + "regex_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(original["regexMatch"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2978,39 +2978,39 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(v interfac continue } transformed = append(transformed, map[string]interface{}{ - "exact_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(original["exactMatch"], d), - "header_name": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(original["headerName"], d), - "invert_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(original["invertMatch"], d), - "prefix_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(original["prefixMatch"], d), - "present_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(original["presentMatch"], d), - "range_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(original["rangeMatch"], d), - "regex_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(original["regexMatch"], d), - "suffix_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(original["suffixMatch"], d), + "exact_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(original["exactMatch"], d, config), + "header_name": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(original["headerName"], d, config), + "invert_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(original["invertMatch"], d, config), + "prefix_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(original["prefixMatch"], d, config), + "present_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(original["presentMatch"], d, config), + "range_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(original["rangeMatch"], d, config), + "regex_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(original["regexMatch"], d, config), + "suffix_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(original["suffixMatch"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3020,12 +3020,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch( } transformed := make(map[string]interface{}) transformed["range_end"] = - flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(original["rangeEnd"], d) + flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(original["rangeEnd"], d, config) transformed["range_start"] = - flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(original["rangeStart"], d) + flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(original["rangeStart"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3035,7 +3035,7 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchR return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3045,19 +3045,19 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchR return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3070,13 +3070,13 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(v interf continue } transformed = append(transformed, map[string]interface{}{ - "filter_labels": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(original["filterLabels"], d), - "filter_match_criteria": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d), + "filter_labels": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(original["filterLabels"], d, config), + "filter_match_criteria": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3089,29 +3089,29 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLab continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(original["name"], d), - "value": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(original["value"], d), + "name": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(original["name"], d, config), + "value": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(original["value"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3124,35 +3124,35 @@ func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(v continue } transformed = append(transformed, map[string]interface{}{ - "exact_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(original["exactMatch"], d), - "name": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(original["name"], d), - "present_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(original["presentMatch"], d), - "regex_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(original["regexMatch"], d), + "exact_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(original["exactMatch"], d, config), + "name": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(original["name"], d, config), + "present_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(original["presentMatch"], d, config), + "regex_match": flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(original["regexMatch"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3162,22 +3162,22 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteAction(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["cors_policy"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(original["corsPolicy"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(original["corsPolicy"], d, config) transformed["fault_injection_policy"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d, config) transformed["request_mirror_policy"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d, config) transformed["retry_policy"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(original["retryPolicy"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(original["retryPolicy"], d, config) transformed["timeout"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeout(original["timeout"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeout(original["timeout"], d, config) transformed["url_rewrite"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(original["urlRewrite"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(original["urlRewrite"], d, config) transformed["weighted_backend_services"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(original["weightedBackendServices"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(original["weightedBackendServices"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3187,52 +3187,52 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(v interface{ } transformed := make(map[string]interface{}) transformed["allow_credentials"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d, config) transformed["allow_headers"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d, config) transformed["allow_methods"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(original["allowMethods"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(original["allowMethods"], d, config) transformed["allow_origin_regexes"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d, config) transformed["allow_origins"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d, config) transformed["disabled"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(original["disabled"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(original["disabled"], d, config) transformed["expose_headers"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d, config) transformed["max_age"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(original["maxAge"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(original["maxAge"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3242,7 +3242,7 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(v inte return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3252,12 +3252,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(v } transformed := make(map[string]interface{}) transformed["abort"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(original["abort"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(original["abort"], d, config) transformed["delay"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(original["delay"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(original["delay"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3267,12 +3267,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbo } transformed := make(map[string]interface{}) transformed["http_status"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d, config) transformed["percentage"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3282,11 +3282,11 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbo return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3296,12 +3296,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDel } transformed := make(map[string]interface{}) transformed["fixed_delay"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d, config) transformed["percentage"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3311,12 +3311,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDel } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3326,15 +3326,15 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDel return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3344,17 +3344,17 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(v i } transformed := make(map[string]interface{}) transformed["backend_service"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(original["backendService"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(original["backendService"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3364,14 +3364,14 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(v interface } transformed := make(map[string]interface{}) transformed["num_retries"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(original["numRetries"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(original["numRetries"], d, config) transformed["per_try_timeout"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d, config) transformed["retry_conditions"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(original["retryConditions"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(original["retryConditions"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3381,7 +3381,7 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(v return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3391,12 +3391,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeou } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3406,15 +3406,15 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeou return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3424,12 +3424,12 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeout(v interface{}, } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(original["nanos"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(original["seconds"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3439,11 +3439,11 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(v interfac return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3453,20 +3453,20 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(v interface{ } transformed := make(map[string]interface{}) transformed["host_rewrite"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d, config) transformed["path_prefix_rewrite"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3479,21 +3479,21 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices continue } transformed = append(transformed, map[string]interface{}{ - "backend_service": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(original["backendService"], d), - "header_action": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d), - "weight": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(original["weight"], d), + "backend_service": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(original["backendService"], d, config), + "header_action": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d, config), + "weight": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(original["weight"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3503,16 +3503,16 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3525,30 +3525,30 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3561,30 +3561,30 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -3594,7 +3594,7 @@ func flattenComputeUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices return v } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3604,44 +3604,44 @@ func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirect(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["host_redirect"] = - flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(original["hostRedirect"], d) + flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(original["hostRedirect"], d, config) transformed["https_redirect"] = - flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(original["httpsRedirect"], d) + flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(original["httpsRedirect"], d, config) transformed["path_redirect"] = - flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(original["pathRedirect"], d) + flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(original["pathRedirect"], d, config) transformed["prefix_redirect"] = - flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(original["prefixRedirect"], d) + flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(original["prefixRedirect"], d, config) transformed["redirect_response_code"] = - flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d) + flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d, config) transformed["strip_query"] = - flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(original["stripQuery"], d) + flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(original["stripQuery"], d, config) return []interface{}{transformed} } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapTest(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapTest(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3654,27 +3654,27 @@ func flattenComputeUrlMapTest(v interface{}, d *schema.ResourceData) interface{} continue } transformed = append(transformed, map[string]interface{}{ - "description": flattenComputeUrlMapTestDescription(original["description"], d), - "host": flattenComputeUrlMapTestHost(original["host"], d), - "path": flattenComputeUrlMapTestPath(original["path"], d), - "service": flattenComputeUrlMapTestService(original["service"], d), + "description": flattenComputeUrlMapTestDescription(original["description"], d, config), + "host": flattenComputeUrlMapTestHost(original["host"], d, config), + "path": flattenComputeUrlMapTestPath(original["path"], d, config), + "service": flattenComputeUrlMapTestService(original["service"], d, config), }) } return transformed } -func flattenComputeUrlMapTestDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapTestDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapTestHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapTestHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapTestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapTestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeUrlMapTestService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeUrlMapTestService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_vpn_gateway.go b/google/resource_compute_vpn_gateway.go index e3dff6217b2..1e752368d95 100644 --- a/google/resource_compute_vpn_gateway.go +++ b/google/resource_compute_vpn_gateway.go @@ -184,22 +184,22 @@ func resourceComputeVpnGatewayRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading VpnGateway: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeVpnGatewayCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeVpnGatewayCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading VpnGateway: %s", err) } - if err := d.Set("description", flattenComputeVpnGatewayDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeVpnGatewayDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading VpnGateway: %s", err) } - if err := d.Set("name", flattenComputeVpnGatewayName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeVpnGatewayName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading VpnGateway: %s", err) } - if err := d.Set("gateway_id", flattenComputeVpnGatewayGatewayId(res["id"], d)); err != nil { + if err := d.Set("gateway_id", flattenComputeVpnGatewayGatewayId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading VpnGateway: %s", err) } - if err := d.Set("network", flattenComputeVpnGatewayNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeVpnGatewayNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading VpnGateway: %s", err) } - if err := d.Set("region", flattenComputeVpnGatewayRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeVpnGatewayRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading VpnGateway: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -263,19 +263,19 @@ func resourceComputeVpnGatewayImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenComputeVpnGatewayCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnGatewayCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnGatewayDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnGatewayDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnGatewayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnGatewayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnGatewayGatewayId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnGatewayGatewayId(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -285,14 +285,14 @@ func flattenComputeVpnGatewayGatewayId(v interface{}, d *schema.ResourceData) in return v } -func flattenComputeVpnGatewayNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnGatewayNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeVpnGatewayRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnGatewayRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_compute_vpn_tunnel.go b/google/resource_compute_vpn_tunnel.go index 999919c5f26..e26b0feb387 100644 --- a/google/resource_compute_vpn_tunnel.go +++ b/google/resource_compute_vpn_tunnel.go @@ -400,43 +400,43 @@ func resourceComputeVpnTunnelRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("tunnel_id", flattenComputeVpnTunnelTunnelId(res["id"], d)); err != nil { + if err := d.Set("tunnel_id", flattenComputeVpnTunnelTunnelId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeVpnTunnelCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeVpnTunnelCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("name", flattenComputeVpnTunnelName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeVpnTunnelName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("description", flattenComputeVpnTunnelDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeVpnTunnelDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("target_vpn_gateway", flattenComputeVpnTunnelTargetVpnGateway(res["targetVpnGateway"], d)); err != nil { + if err := d.Set("target_vpn_gateway", flattenComputeVpnTunnelTargetVpnGateway(res["targetVpnGateway"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("router", flattenComputeVpnTunnelRouter(res["router"], d)); err != nil { + if err := d.Set("router", flattenComputeVpnTunnelRouter(res["router"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("peer_ip", flattenComputeVpnTunnelPeerIp(res["peerIp"], d)); err != nil { + if err := d.Set("peer_ip", flattenComputeVpnTunnelPeerIp(res["peerIp"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("shared_secret_hash", flattenComputeVpnTunnelSharedSecretHash(res["sharedSecretHash"], d)); err != nil { + if err := d.Set("shared_secret_hash", flattenComputeVpnTunnelSharedSecretHash(res["sharedSecretHash"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("ike_version", flattenComputeVpnTunnelIkeVersion(res["ikeVersion"], d)); err != nil { + if err := d.Set("ike_version", flattenComputeVpnTunnelIkeVersion(res["ikeVersion"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("local_traffic_selector", flattenComputeVpnTunnelLocalTrafficSelector(res["localTrafficSelector"], d)); err != nil { + if err := d.Set("local_traffic_selector", flattenComputeVpnTunnelLocalTrafficSelector(res["localTrafficSelector"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("remote_traffic_selector", flattenComputeVpnTunnelRemoteTrafficSelector(res["remoteTrafficSelector"], d)); err != nil { + if err := d.Set("remote_traffic_selector", flattenComputeVpnTunnelRemoteTrafficSelector(res["remoteTrafficSelector"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("detailed_status", flattenComputeVpnTunnelDetailedStatus(res["detailedStatus"], d)); err != nil { + if err := d.Set("detailed_status", flattenComputeVpnTunnelDetailedStatus(res["detailedStatus"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("region", flattenComputeVpnTunnelRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeVpnTunnelRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -500,45 +500,45 @@ func resourceComputeVpnTunnelImport(d *schema.ResourceData, meta interface{}) ([ return []*schema.ResourceData{d}, nil } -func flattenComputeVpnTunnelTunnelId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelTunnelId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelTargetVpnGateway(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelTargetVpnGateway(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeVpnTunnelRouter(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelRouter(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeVpnTunnelPeerIp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelPeerIp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelSharedSecretHash(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelSharedSecretHash(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelIkeVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelIkeVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -548,25 +548,25 @@ func flattenComputeVpnTunnelIkeVersion(v interface{}, d *schema.ResourceData) in return v } -func flattenComputeVpnTunnelLocalTrafficSelector(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelLocalTrafficSelector(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeVpnTunnelRemoteTrafficSelector(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelRemoteTrafficSelector(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeVpnTunnelDetailedStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelDetailedStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_container_analysis_note.go b/google/resource_container_analysis_note.go index 58275e96ed1..bf3c6dcaf0d 100644 --- a/google/resource_container_analysis_note.go +++ b/google/resource_container_analysis_note.go @@ -181,10 +181,10 @@ func resourceContainerAnalysisNoteRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading Note: %s", err) } - if err := d.Set("name", flattenContainerAnalysisNoteName(res["name"], d)); err != nil { + if err := d.Set("name", flattenContainerAnalysisNoteName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Note: %s", err) } - if err := d.Set("attestation_authority", flattenContainerAnalysisNoteAttestationAuthority(res["attestationAuthority"], d)); err != nil { + if err := d.Set("attestation_authority", flattenContainerAnalysisNoteAttestationAuthority(res["attestationAuthority"], d, config)); err != nil { return fmt.Errorf("Error reading Note: %s", err) } @@ -282,14 +282,14 @@ func resourceContainerAnalysisNoteImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenContainerAnalysisNoteName(v interface{}, d *schema.ResourceData) interface{} { +func flattenContainerAnalysisNoteName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.ResourceData) interface{} { +func flattenContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -299,10 +299,10 @@ func flattenContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.R } transformed := make(map[string]interface{}) transformed["hint"] = - flattenContainerAnalysisNoteAttestationAuthorityHint(original["hint"], d) + flattenContainerAnalysisNoteAttestationAuthorityHint(original["hint"], d, config) return []interface{}{transformed} } -func flattenContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *schema.ResourceData) interface{} { +func flattenContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -312,10 +312,10 @@ func flattenContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["human_readable_name"] = - flattenContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(original["humanReadableName"], d) + flattenContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(original["humanReadableName"], d, config) return []interface{}{transformed} } -func flattenContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(v interface{}, d *schema.ResourceData) interface{} { +func flattenContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_dataproc_autoscaling_policy.go b/google/resource_dataproc_autoscaling_policy.go index e159d4b7223..e507d9a2d43 100644 --- a/google/resource_dataproc_autoscaling_policy.go +++ b/google/resource_dataproc_autoscaling_policy.go @@ -317,19 +317,19 @@ func resourceDataprocAutoscalingPolicyRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error reading AutoscalingPolicy: %s", err) } - if err := d.Set("policy_id", flattenDataprocAutoscalingPolicyPolicyId(res["id"], d)); err != nil { + if err := d.Set("policy_id", flattenDataprocAutoscalingPolicyPolicyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading AutoscalingPolicy: %s", err) } - if err := d.Set("name", flattenDataprocAutoscalingPolicyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenDataprocAutoscalingPolicyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading AutoscalingPolicy: %s", err) } - if err := d.Set("worker_config", flattenDataprocAutoscalingPolicyWorkerConfig(res["workerConfig"], d)); err != nil { + if err := d.Set("worker_config", flattenDataprocAutoscalingPolicyWorkerConfig(res["workerConfig"], d, config)); err != nil { return fmt.Errorf("Error reading AutoscalingPolicy: %s", err) } - if err := d.Set("secondary_worker_config", flattenDataprocAutoscalingPolicySecondaryWorkerConfig(res["secondaryWorkerConfig"], d)); err != nil { + if err := d.Set("secondary_worker_config", flattenDataprocAutoscalingPolicySecondaryWorkerConfig(res["secondaryWorkerConfig"], d, config)); err != nil { return fmt.Errorf("Error reading AutoscalingPolicy: %s", err) } - if err := d.Set("basic_algorithm", flattenDataprocAutoscalingPolicyBasicAlgorithm(res["basicAlgorithm"], d)); err != nil { + if err := d.Set("basic_algorithm", flattenDataprocAutoscalingPolicyBasicAlgorithm(res["basicAlgorithm"], d, config)); err != nil { return fmt.Errorf("Error reading AutoscalingPolicy: %s", err) } @@ -430,15 +430,15 @@ func resourceDataprocAutoscalingPolicyImport(d *schema.ResourceData, meta interf return []*schema.ResourceData{d}, nil } -func flattenDataprocAutoscalingPolicyPolicyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyPolicyId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyWorkerConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyWorkerConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -448,14 +448,14 @@ func flattenDataprocAutoscalingPolicyWorkerConfig(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["min_instances"] = - flattenDataprocAutoscalingPolicyWorkerConfigMinInstances(original["minInstances"], d) + flattenDataprocAutoscalingPolicyWorkerConfigMinInstances(original["minInstances"], d, config) transformed["max_instances"] = - flattenDataprocAutoscalingPolicyWorkerConfigMaxInstances(original["maxInstances"], d) + flattenDataprocAutoscalingPolicyWorkerConfigMaxInstances(original["maxInstances"], d, config) transformed["weight"] = - flattenDataprocAutoscalingPolicyWorkerConfigWeight(original["weight"], d) + flattenDataprocAutoscalingPolicyWorkerConfigWeight(original["weight"], d, config) return []interface{}{transformed} } -func flattenDataprocAutoscalingPolicyWorkerConfigMinInstances(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyWorkerConfigMinInstances(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -465,7 +465,7 @@ func flattenDataprocAutoscalingPolicyWorkerConfigMinInstances(v interface{}, d * return v } -func flattenDataprocAutoscalingPolicyWorkerConfigMaxInstances(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyWorkerConfigMaxInstances(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -475,7 +475,7 @@ func flattenDataprocAutoscalingPolicyWorkerConfigMaxInstances(v interface{}, d * return v } -func flattenDataprocAutoscalingPolicyWorkerConfigWeight(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyWorkerConfigWeight(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -485,7 +485,7 @@ func flattenDataprocAutoscalingPolicyWorkerConfigWeight(v interface{}, d *schema return v } -func flattenDataprocAutoscalingPolicySecondaryWorkerConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicySecondaryWorkerConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -495,14 +495,14 @@ func flattenDataprocAutoscalingPolicySecondaryWorkerConfig(v interface{}, d *sch } transformed := make(map[string]interface{}) transformed["min_instances"] = - flattenDataprocAutoscalingPolicySecondaryWorkerConfigMinInstances(original["minInstances"], d) + flattenDataprocAutoscalingPolicySecondaryWorkerConfigMinInstances(original["minInstances"], d, config) transformed["max_instances"] = - flattenDataprocAutoscalingPolicySecondaryWorkerConfigMaxInstances(original["maxInstances"], d) + flattenDataprocAutoscalingPolicySecondaryWorkerConfigMaxInstances(original["maxInstances"], d, config) transformed["weight"] = - flattenDataprocAutoscalingPolicySecondaryWorkerConfigWeight(original["weight"], d) + flattenDataprocAutoscalingPolicySecondaryWorkerConfigWeight(original["weight"], d, config) return []interface{}{transformed} } -func flattenDataprocAutoscalingPolicySecondaryWorkerConfigMinInstances(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicySecondaryWorkerConfigMinInstances(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -512,7 +512,7 @@ func flattenDataprocAutoscalingPolicySecondaryWorkerConfigMinInstances(v interfa return v } -func flattenDataprocAutoscalingPolicySecondaryWorkerConfigMaxInstances(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicySecondaryWorkerConfigMaxInstances(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -522,7 +522,7 @@ func flattenDataprocAutoscalingPolicySecondaryWorkerConfigMaxInstances(v interfa return v } -func flattenDataprocAutoscalingPolicySecondaryWorkerConfigWeight(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicySecondaryWorkerConfigWeight(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -532,7 +532,7 @@ func flattenDataprocAutoscalingPolicySecondaryWorkerConfigWeight(v interface{}, return v } -func flattenDataprocAutoscalingPolicyBasicAlgorithm(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithm(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -542,16 +542,16 @@ func flattenDataprocAutoscalingPolicyBasicAlgorithm(v interface{}, d *schema.Res } transformed := make(map[string]interface{}) transformed["cooldown_period"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmCooldownPeriod(original["cooldownPeriod"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmCooldownPeriod(original["cooldownPeriod"], d, config) transformed["yarn_config"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfig(original["yarnConfig"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfig(original["yarnConfig"], d, config) return []interface{}{transformed} } -func flattenDataprocAutoscalingPolicyBasicAlgorithmCooldownPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmCooldownPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -561,34 +561,34 @@ func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfig(v interface{}, d * } transformed := make(map[string]interface{}) transformed["graceful_decommission_timeout"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigGracefulDecommissionTimeout(original["gracefulDecommissionTimeout"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigGracefulDecommissionTimeout(original["gracefulDecommissionTimeout"], d, config) transformed["scale_up_factor"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpFactor(original["scaleUpFactor"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpFactor(original["scaleUpFactor"], d, config) transformed["scale_down_factor"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownFactor(original["scaleDownFactor"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownFactor(original["scaleDownFactor"], d, config) transformed["scale_up_min_worker_fraction"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpMinWorkerFraction(original["scaleUpMinWorkerFraction"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpMinWorkerFraction(original["scaleUpMinWorkerFraction"], d, config) transformed["scale_down_min_worker_fraction"] = - flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownMinWorkerFraction(original["scaleDownMinWorkerFraction"], d) + flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownMinWorkerFraction(original["scaleDownMinWorkerFraction"], d, config) return []interface{}{transformed} } -func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigGracefulDecommissionTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigGracefulDecommissionTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpFactor(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpFactor(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownFactor(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownFactor(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpMinWorkerFraction(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleUpMinWorkerFraction(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownMinWorkerFraction(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataprocAutoscalingPolicyBasicAlgorithmYarnConfigScaleDownMinWorkerFraction(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_deployment_manager_deployment.go b/google/resource_deployment_manager_deployment.go index fd039975c03..eae3dea48dc 100644 --- a/google/resource_deployment_manager_deployment.go +++ b/google/resource_deployment_manager_deployment.go @@ -298,22 +298,22 @@ func resourceDeploymentManagerDeploymentRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading Deployment: %s", err) } - if err := d.Set("name", flattenDeploymentManagerDeploymentName(res["name"], d)); err != nil { + if err := d.Set("name", flattenDeploymentManagerDeploymentName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Deployment: %s", err) } - if err := d.Set("description", flattenDeploymentManagerDeploymentDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenDeploymentManagerDeploymentDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Deployment: %s", err) } - if err := d.Set("labels", flattenDeploymentManagerDeploymentLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenDeploymentManagerDeploymentLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Deployment: %s", err) } - if err := d.Set("deployment_id", flattenDeploymentManagerDeploymentDeploymentId(res["id"], d)); err != nil { + if err := d.Set("deployment_id", flattenDeploymentManagerDeploymentDeploymentId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading Deployment: %s", err) } - if err := d.Set("manifest", flattenDeploymentManagerDeploymentManifest(res["manifest"], d)); err != nil { + if err := d.Set("manifest", flattenDeploymentManagerDeploymentManifest(res["manifest"], d, config)); err != nil { return fmt.Errorf("Error reading Deployment: %s", err) } - if err := d.Set("self_link", flattenDeploymentManagerDeploymentSelfLink(res["selfLink"], d)); err != nil { + if err := d.Set("self_link", flattenDeploymentManagerDeploymentSelfLink(res["selfLink"], d, config)); err != nil { return fmt.Errorf("Error reading Deployment: %s", err) } @@ -474,15 +474,15 @@ func resourceDeploymentManagerDeploymentImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenDeploymentManagerDeploymentName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDeploymentManagerDeploymentDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDeploymentManagerDeploymentLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -495,29 +495,29 @@ func flattenDeploymentManagerDeploymentLabels(v interface{}, d *schema.ResourceD continue } transformed.Add(map[string]interface{}{ - "key": flattenDeploymentManagerDeploymentLabelsKey(original["key"], d), - "value": flattenDeploymentManagerDeploymentLabelsValue(original["value"], d), + "key": flattenDeploymentManagerDeploymentLabelsKey(original["key"], d, config), + "value": flattenDeploymentManagerDeploymentLabelsValue(original["value"], d, config), }) } return transformed } -func flattenDeploymentManagerDeploymentLabelsKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentLabelsKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDeploymentManagerDeploymentLabelsValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentLabelsValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDeploymentManagerDeploymentDeploymentId(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentDeploymentId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDeploymentManagerDeploymentManifest(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentManifest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDeploymentManagerDeploymentSelfLink(v interface{}, d *schema.ResourceData) interface{} { +func flattenDeploymentManagerDeploymentSelfLink(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_dialogflow_agent.go b/google/resource_dialogflow_agent.go index 0702b05323d..ac30d05776f 100644 --- a/google/resource_dialogflow_agent.go +++ b/google/resource_dialogflow_agent.go @@ -292,37 +292,37 @@ func resourceDialogflowAgentRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("display_name", flattenDialogflowAgentDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenDialogflowAgentDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("default_language_code", flattenDialogflowAgentDefaultLanguageCode(res["defaultLanguageCode"], d)); err != nil { + if err := d.Set("default_language_code", flattenDialogflowAgentDefaultLanguageCode(res["defaultLanguageCode"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("supported_language_codes", flattenDialogflowAgentSupportedLanguageCodes(res["supportedLanguageCodes"], d)); err != nil { + if err := d.Set("supported_language_codes", flattenDialogflowAgentSupportedLanguageCodes(res["supportedLanguageCodes"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("time_zone", flattenDialogflowAgentTimeZone(res["timeZone"], d)); err != nil { + if err := d.Set("time_zone", flattenDialogflowAgentTimeZone(res["timeZone"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("description", flattenDialogflowAgentDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenDialogflowAgentDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("avatar_uri_backend", flattenDialogflowAgentAvatarUriBackend(res["avatarUri"], d)); err != nil { + if err := d.Set("avatar_uri_backend", flattenDialogflowAgentAvatarUriBackend(res["avatarUri"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("enable_logging", flattenDialogflowAgentEnableLogging(res["enableLogging"], d)); err != nil { + if err := d.Set("enable_logging", flattenDialogflowAgentEnableLogging(res["enableLogging"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("match_mode", flattenDialogflowAgentMatchMode(res["matchMode"], d)); err != nil { + if err := d.Set("match_mode", flattenDialogflowAgentMatchMode(res["matchMode"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("classification_threshold", flattenDialogflowAgentClassificationThreshold(res["classificationThreshold"], d)); err != nil { + if err := d.Set("classification_threshold", flattenDialogflowAgentClassificationThreshold(res["classificationThreshold"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("api_version", flattenDialogflowAgentApiVersion(res["apiVersion"], d)); err != nil { + if err := d.Set("api_version", flattenDialogflowAgentApiVersion(res["apiVersion"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } - if err := d.Set("tier", flattenDialogflowAgentTier(res["tier"], d)); err != nil { + if err := d.Set("tier", flattenDialogflowAgentTier(res["tier"], d, config)); err != nil { return fmt.Errorf("Error reading Agent: %s", err) } @@ -487,47 +487,47 @@ func resourceDialogflowAgentImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenDialogflowAgentDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentDefaultLanguageCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentDefaultLanguageCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentSupportedLanguageCodes(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentSupportedLanguageCodes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentTimeZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentTimeZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentAvatarUriBackend(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentAvatarUriBackend(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentEnableLogging(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentEnableLogging(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentMatchMode(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentMatchMode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentClassificationThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentClassificationThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentApiVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentApiVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDialogflowAgentTier(v interface{}, d *schema.ResourceData) interface{} { +func flattenDialogflowAgentTier(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_dns_managed_zone.go b/google/resource_dns_managed_zone.go index 0a937382f63..a505a6a3aaf 100644 --- a/google/resource_dns_managed_zone.go +++ b/google/resource_dns_managed_zone.go @@ -325,28 +325,28 @@ func resourceDNSManagedZoneRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("description", flattenDNSManagedZoneDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenDNSManagedZoneDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("dns_name", flattenDNSManagedZoneDnsName(res["dnsName"], d)); err != nil { + if err := d.Set("dns_name", flattenDNSManagedZoneDnsName(res["dnsName"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("dnssec_config", flattenDNSManagedZoneDnssecConfig(res["dnssecConfig"], d)); err != nil { + if err := d.Set("dnssec_config", flattenDNSManagedZoneDnssecConfig(res["dnssecConfig"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("name", flattenDNSManagedZoneName(res["name"], d)); err != nil { + if err := d.Set("name", flattenDNSManagedZoneName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("name_servers", flattenDNSManagedZoneNameServers(res["nameServers"], d)); err != nil { + if err := d.Set("name_servers", flattenDNSManagedZoneNameServers(res["nameServers"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("labels", flattenDNSManagedZoneLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenDNSManagedZoneLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("visibility", flattenDNSManagedZoneVisibility(res["visibility"], d)); err != nil { + if err := d.Set("visibility", flattenDNSManagedZoneVisibility(res["visibility"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("private_visibility_config", flattenDNSManagedZonePrivateVisibilityConfig(res["privateVisibilityConfig"], d)); err != nil { + if err := d.Set("private_visibility_config", flattenDNSManagedZonePrivateVisibilityConfig(res["privateVisibilityConfig"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } @@ -449,15 +449,15 @@ func resourceDNSManagedZoneImport(d *schema.ResourceData, meta interface{}) ([]* return []*schema.ResourceData{d}, nil } -func flattenDNSManagedZoneDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnssecConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -467,28 +467,28 @@ func flattenDNSManagedZoneDnssecConfig(v interface{}, d *schema.ResourceData) in } transformed := make(map[string]interface{}) transformed["kind"] = - flattenDNSManagedZoneDnssecConfigKind(original["kind"], d) + flattenDNSManagedZoneDnssecConfigKind(original["kind"], d, config) transformed["non_existence"] = - flattenDNSManagedZoneDnssecConfigNonExistence(original["nonExistence"], d) + flattenDNSManagedZoneDnssecConfigNonExistence(original["nonExistence"], d, config) transformed["state"] = - flattenDNSManagedZoneDnssecConfigState(original["state"], d) + flattenDNSManagedZoneDnssecConfigState(original["state"], d, config) transformed["default_key_specs"] = - flattenDNSManagedZoneDnssecConfigDefaultKeySpecs(original["defaultKeySpecs"], d) + flattenDNSManagedZoneDnssecConfigDefaultKeySpecs(original["defaultKeySpecs"], d, config) return []interface{}{transformed} } -func flattenDNSManagedZoneDnssecConfigKind(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigKind(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnssecConfigNonExistence(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigNonExistence(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnssecConfigState(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnssecConfigDefaultKeySpecs(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigDefaultKeySpecs(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -501,19 +501,19 @@ func flattenDNSManagedZoneDnssecConfigDefaultKeySpecs(v interface{}, d *schema.R continue } transformed = append(transformed, map[string]interface{}{ - "algorithm": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsAlgorithm(original["algorithm"], d), - "key_length": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyLength(original["keyLength"], d), - "key_type": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyType(original["keyType"], d), - "kind": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKind(original["kind"], d), + "algorithm": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsAlgorithm(original["algorithm"], d, config), + "key_length": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyLength(original["keyLength"], d, config), + "key_type": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyType(original["keyType"], d, config), + "kind": flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKind(original["kind"], d, config), }) } return transformed } -func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsAlgorithm(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsAlgorithm(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyLength(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyLength(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -523,27 +523,27 @@ func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyLength(v interface{}, d return v } -func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyType(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKeyType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKind(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneDnssecConfigDefaultKeySpecsKind(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneNameServers(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneNameServers(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneVisibility(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneVisibility(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return "public" } @@ -551,7 +551,7 @@ func flattenDNSManagedZoneVisibility(v interface{}, d *schema.ResourceData) inte return v } -func flattenDNSManagedZonePrivateVisibilityConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZonePrivateVisibilityConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -561,10 +561,10 @@ func flattenDNSManagedZonePrivateVisibilityConfig(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["networks"] = - flattenDNSManagedZonePrivateVisibilityConfigNetworks(original["networks"], d) + flattenDNSManagedZonePrivateVisibilityConfigNetworks(original["networks"], d, config) return []interface{}{transformed} } -func flattenDNSManagedZonePrivateVisibilityConfigNetworks(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZonePrivateVisibilityConfigNetworks(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -588,12 +588,12 @@ func flattenDNSManagedZonePrivateVisibilityConfigNetworks(v interface{}, d *sche continue } transformed.Add(map[string]interface{}{ - "network_url": flattenDNSManagedZonePrivateVisibilityConfigNetworksNetworkUrl(original["networkUrl"], d), + "network_url": flattenDNSManagedZonePrivateVisibilityConfigNetworksNetworkUrl(original["networkUrl"], d, config), }) } return transformed } -func flattenDNSManagedZonePrivateVisibilityConfigNetworksNetworkUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZonePrivateVisibilityConfigNetworksNetworkUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_filestore_instance.go b/google/resource_filestore_instance.go index 7b110a067c5..e398762be49 100644 --- a/google/resource_filestore_instance.go +++ b/google/resource_filestore_instance.go @@ -254,25 +254,25 @@ func resourceFilestoreInstanceRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("description", flattenFilestoreInstanceDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenFilestoreInstanceDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("create_time", flattenFilestoreInstanceCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenFilestoreInstanceCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("tier", flattenFilestoreInstanceTier(res["tier"], d)); err != nil { + if err := d.Set("tier", flattenFilestoreInstanceTier(res["tier"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("labels", flattenFilestoreInstanceLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenFilestoreInstanceLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("file_shares", flattenFilestoreInstanceFileShares(res["fileShares"], d)); err != nil { + if err := d.Set("file_shares", flattenFilestoreInstanceFileShares(res["fileShares"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("networks", flattenFilestoreInstanceNetworks(res["networks"], d)); err != nil { + if err := d.Set("networks", flattenFilestoreInstanceNetworks(res["networks"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("etag", flattenFilestoreInstanceEtag(res["etag"], d)); err != nil { + if err := d.Set("etag", flattenFilestoreInstanceEtag(res["etag"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } @@ -403,23 +403,23 @@ func resourceFilestoreInstanceImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenFilestoreInstanceDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceTier(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceTier(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceFileShares(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceFileShares(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -432,17 +432,17 @@ func flattenFilestoreInstanceFileShares(v interface{}, d *schema.ResourceData) i continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenFilestoreInstanceFileSharesName(original["name"], d), - "capacity_gb": flattenFilestoreInstanceFileSharesCapacityGb(original["capacityGb"], d), + "name": flattenFilestoreInstanceFileSharesName(original["name"], d, config), + "capacity_gb": flattenFilestoreInstanceFileSharesCapacityGb(original["capacityGb"], d, config), }) } return transformed } -func flattenFilestoreInstanceFileSharesName(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceFileSharesName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceFileSharesCapacityGb(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceFileSharesCapacityGb(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -452,7 +452,7 @@ func flattenFilestoreInstanceFileSharesCapacityGb(v interface{}, d *schema.Resou return v } -func flattenFilestoreInstanceNetworks(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceNetworks(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -465,31 +465,31 @@ func flattenFilestoreInstanceNetworks(v interface{}, d *schema.ResourceData) int continue } transformed = append(transformed, map[string]interface{}{ - "network": flattenFilestoreInstanceNetworksNetwork(original["network"], d), - "modes": flattenFilestoreInstanceNetworksModes(original["modes"], d), - "reserved_ip_range": flattenFilestoreInstanceNetworksReservedIpRange(original["reservedIpRange"], d), - "ip_addresses": flattenFilestoreInstanceNetworksIpAddresses(original["ipAddresses"], d), + "network": flattenFilestoreInstanceNetworksNetwork(original["network"], d, config), + "modes": flattenFilestoreInstanceNetworksModes(original["modes"], d, config), + "reserved_ip_range": flattenFilestoreInstanceNetworksReservedIpRange(original["reservedIpRange"], d, config), + "ip_addresses": flattenFilestoreInstanceNetworksIpAddresses(original["ipAddresses"], d, config), }) } return transformed } -func flattenFilestoreInstanceNetworksNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceNetworksNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceNetworksModes(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceNetworksModes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceNetworksReservedIpRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceNetworksReservedIpRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceNetworksIpAddresses(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceNetworksIpAddresses(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFilestoreInstanceEtag(v interface{}, d *schema.ResourceData) interface{} { +func flattenFilestoreInstanceEtag(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_firestore_index.go b/google/resource_firestore_index.go index f720a3ccd4e..377a27e2749 100644 --- a/google/resource_firestore_index.go +++ b/google/resource_firestore_index.go @@ -217,13 +217,13 @@ func resourceFirestoreIndexRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Index: %s", err) } - if err := d.Set("name", flattenFirestoreIndexName(res["name"], d)); err != nil { + if err := d.Set("name", flattenFirestoreIndexName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Index: %s", err) } - if err := d.Set("query_scope", flattenFirestoreIndexQueryScope(res["queryScope"], d)); err != nil { + if err := d.Set("query_scope", flattenFirestoreIndexQueryScope(res["queryScope"], d, config)); err != nil { return fmt.Errorf("Error reading Index: %s", err) } - if err := d.Set("fields", flattenFirestoreIndexFields(res["fields"], d)); err != nil { + if err := d.Set("fields", flattenFirestoreIndexFields(res["fields"], d, config)); err != nil { return fmt.Errorf("Error reading Index: %s", err) } @@ -285,15 +285,15 @@ func resourceFirestoreIndexImport(d *schema.ResourceData, meta interface{}) ([]* return []*schema.ResourceData{d}, nil } -func flattenFirestoreIndexName(v interface{}, d *schema.ResourceData) interface{} { +func flattenFirestoreIndexName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFirestoreIndexQueryScope(v interface{}, d *schema.ResourceData) interface{} { +func flattenFirestoreIndexQueryScope(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFirestoreIndexFields(v interface{}, d *schema.ResourceData) interface{} { +func flattenFirestoreIndexFields(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -306,22 +306,22 @@ func flattenFirestoreIndexFields(v interface{}, d *schema.ResourceData) interfac continue } transformed = append(transformed, map[string]interface{}{ - "field_path": flattenFirestoreIndexFieldsFieldPath(original["fieldPath"], d), - "order": flattenFirestoreIndexFieldsOrder(original["order"], d), - "array_config": flattenFirestoreIndexFieldsArrayConfig(original["arrayConfig"], d), + "field_path": flattenFirestoreIndexFieldsFieldPath(original["fieldPath"], d, config), + "order": flattenFirestoreIndexFieldsOrder(original["order"], d, config), + "array_config": flattenFirestoreIndexFieldsArrayConfig(original["arrayConfig"], d, config), }) } return transformed } -func flattenFirestoreIndexFieldsFieldPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenFirestoreIndexFieldsFieldPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFirestoreIndexFieldsOrder(v interface{}, d *schema.ResourceData) interface{} { +func flattenFirestoreIndexFieldsOrder(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenFirestoreIndexFieldsArrayConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenFirestoreIndexFieldsArrayConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_default_supported_idp_config.go b/google/resource_identity_platform_default_supported_idp_config.go index dab4808f769..850730902a9 100644 --- a/google/resource_identity_platform_default_supported_idp_config.go +++ b/google/resource_identity_platform_default_supported_idp_config.go @@ -169,16 +169,16 @@ func resourceIdentityPlatformDefaultSupportedIdpConfigRead(d *schema.ResourceDat return fmt.Errorf("Error reading DefaultSupportedIdpConfig: %s", err) } - if err := d.Set("name", flattenIdentityPlatformDefaultSupportedIdpConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformDefaultSupportedIdpConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultSupportedIdpConfig: %s", err) } - if err := d.Set("client_id", flattenIdentityPlatformDefaultSupportedIdpConfigClientId(res["clientId"], d)); err != nil { + if err := d.Set("client_id", flattenIdentityPlatformDefaultSupportedIdpConfigClientId(res["clientId"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultSupportedIdpConfig: %s", err) } - if err := d.Set("client_secret", flattenIdentityPlatformDefaultSupportedIdpConfigClientSecret(res["clientSecret"], d)); err != nil { + if err := d.Set("client_secret", flattenIdentityPlatformDefaultSupportedIdpConfigClientSecret(res["clientSecret"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultSupportedIdpConfig: %s", err) } - if err := d.Set("enabled", flattenIdentityPlatformDefaultSupportedIdpConfigEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenIdentityPlatformDefaultSupportedIdpConfigEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultSupportedIdpConfig: %s", err) } @@ -292,19 +292,19 @@ func resourceIdentityPlatformDefaultSupportedIdpConfigImport(d *schema.ResourceD return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformDefaultSupportedIdpConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformDefaultSupportedIdpConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformDefaultSupportedIdpConfigClientId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformDefaultSupportedIdpConfigClientId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformDefaultSupportedIdpConfigClientSecret(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformDefaultSupportedIdpConfigClientSecret(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformDefaultSupportedIdpConfigEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformDefaultSupportedIdpConfigEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_inbound_saml_config.go b/google/resource_identity_platform_inbound_saml_config.go index fd9dd03c2cd..5630a060bb9 100644 --- a/google/resource_identity_platform_inbound_saml_config.go +++ b/google/resource_identity_platform_inbound_saml_config.go @@ -227,19 +227,19 @@ func resourceIdentityPlatformInboundSamlConfigRead(d *schema.ResourceData, meta return fmt.Errorf("Error reading InboundSamlConfig: %s", err) } - if err := d.Set("name", flattenIdentityPlatformInboundSamlConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformInboundSamlConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading InboundSamlConfig: %s", err) } - if err := d.Set("display_name", flattenIdentityPlatformInboundSamlConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenIdentityPlatformInboundSamlConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading InboundSamlConfig: %s", err) } - if err := d.Set("enabled", flattenIdentityPlatformInboundSamlConfigEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenIdentityPlatformInboundSamlConfigEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading InboundSamlConfig: %s", err) } - if err := d.Set("idp_config", flattenIdentityPlatformInboundSamlConfigIdpConfig(res["idpConfig"], d)); err != nil { + if err := d.Set("idp_config", flattenIdentityPlatformInboundSamlConfigIdpConfig(res["idpConfig"], d, config)); err != nil { return fmt.Errorf("Error reading InboundSamlConfig: %s", err) } - if err := d.Set("sp_config", flattenIdentityPlatformInboundSamlConfigSpConfig(res["spConfig"], d)); err != nil { + if err := d.Set("sp_config", flattenIdentityPlatformInboundSamlConfigSpConfig(res["spConfig"], d, config)); err != nil { return fmt.Errorf("Error reading InboundSamlConfig: %s", err) } @@ -363,22 +363,22 @@ func resourceIdentityPlatformInboundSamlConfigImport(d *schema.ResourceData, met return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformInboundSamlConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenIdentityPlatformInboundSamlConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigIdpConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigIdpConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -388,28 +388,28 @@ func flattenIdentityPlatformInboundSamlConfigIdpConfig(v interface{}, d *schema. } transformed := make(map[string]interface{}) transformed["idp_entity_id"] = - flattenIdentityPlatformInboundSamlConfigIdpConfigIdpEntityId(original["idpEntityId"], d) + flattenIdentityPlatformInboundSamlConfigIdpConfigIdpEntityId(original["idpEntityId"], d, config) transformed["sso_url"] = - flattenIdentityPlatformInboundSamlConfigIdpConfigSsoUrl(original["ssoUrl"], d) + flattenIdentityPlatformInboundSamlConfigIdpConfigSsoUrl(original["ssoUrl"], d, config) transformed["sign_request"] = - flattenIdentityPlatformInboundSamlConfigIdpConfigSignRequest(original["signRequest"], d) + flattenIdentityPlatformInboundSamlConfigIdpConfigSignRequest(original["signRequest"], d, config) transformed["idp_certificates"] = - flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificates(original["idpCertificates"], d) + flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificates(original["idpCertificates"], d, config) return []interface{}{transformed} } -func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpEntityId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpEntityId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigIdpConfigSsoUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigIdpConfigSsoUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigIdpConfigSignRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigIdpConfigSignRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -422,16 +422,16 @@ func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificates(v interfac continue } transformed = append(transformed, map[string]interface{}{ - "x509_certificate": flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(original["x509Certificate"], d), + "x509_certificate": flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(original["x509Certificate"], d, config), }) } return transformed } -func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigSpConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigSpConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -441,22 +441,22 @@ func flattenIdentityPlatformInboundSamlConfigSpConfig(v interface{}, d *schema.R } transformed := make(map[string]interface{}) transformed["sp_entity_id"] = - flattenIdentityPlatformInboundSamlConfigSpConfigSpEntityId(original["spEntityId"], d) + flattenIdentityPlatformInboundSamlConfigSpConfigSpEntityId(original["spEntityId"], d, config) transformed["callback_uri"] = - flattenIdentityPlatformInboundSamlConfigSpConfigCallbackUri(original["callbackUri"], d) + flattenIdentityPlatformInboundSamlConfigSpConfigCallbackUri(original["callbackUri"], d, config) transformed["sp_certificates"] = - flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificates(original["spCertificates"], d) + flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificates(original["spCertificates"], d, config) return []interface{}{transformed} } -func flattenIdentityPlatformInboundSamlConfigSpConfigSpEntityId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigSpConfigSpEntityId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigSpConfigCallbackUri(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigSpConfigCallbackUri(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -469,12 +469,12 @@ func flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificates(v interface{ continue } transformed = append(transformed, map[string]interface{}{ - "x509_certificate": flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificatesX509Certificate(original["x509Certificate"], d), + "x509_certificate": flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificatesX509Certificate(original["x509Certificate"], d, config), }) } return transformed } -func flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificatesX509Certificate(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformInboundSamlConfigSpConfigSpCertificatesX509Certificate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_oauth_idp_config.go b/google/resource_identity_platform_oauth_idp_config.go index 60e5e095abd..64916ea5b1e 100644 --- a/google/resource_identity_platform_oauth_idp_config.go +++ b/google/resource_identity_platform_oauth_idp_config.go @@ -172,22 +172,22 @@ func resourceIdentityPlatformOauthIdpConfigRead(d *schema.ResourceData, meta int return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } - if err := d.Set("name", flattenIdentityPlatformOauthIdpConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformOauthIdpConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } - if err := d.Set("display_name", flattenIdentityPlatformOauthIdpConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenIdentityPlatformOauthIdpConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } - if err := d.Set("enabled", flattenIdentityPlatformOauthIdpConfigEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenIdentityPlatformOauthIdpConfigEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } - if err := d.Set("issuer", flattenIdentityPlatformOauthIdpConfigIssuer(res["issuer"], d)); err != nil { + if err := d.Set("issuer", flattenIdentityPlatformOauthIdpConfigIssuer(res["issuer"], d, config)); err != nil { return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } - if err := d.Set("client_id", flattenIdentityPlatformOauthIdpConfigClientId(res["clientId"], d)); err != nil { + if err := d.Set("client_id", flattenIdentityPlatformOauthIdpConfigClientId(res["clientId"], d, config)); err != nil { return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } - if err := d.Set("client_secret", flattenIdentityPlatformOauthIdpConfigClientSecret(res["clientSecret"], d)); err != nil { + if err := d.Set("client_secret", flattenIdentityPlatformOauthIdpConfigClientSecret(res["clientSecret"], d, config)); err != nil { return fmt.Errorf("Error reading OauthIdpConfig: %s", err) } @@ -321,30 +321,30 @@ func resourceIdentityPlatformOauthIdpConfigImport(d *schema.ResourceData, meta i return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformOauthIdpConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformOauthIdpConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenIdentityPlatformOauthIdpConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformOauthIdpConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformOauthIdpConfigEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformOauthIdpConfigEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformOauthIdpConfigIssuer(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformOauthIdpConfigIssuer(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformOauthIdpConfigClientId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformOauthIdpConfigClientId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformOauthIdpConfigClientSecret(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformOauthIdpConfigClientSecret(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_tenant.go b/google/resource_identity_platform_tenant.go index 087f29eec91..c901394b5f5 100644 --- a/google/resource_identity_platform_tenant.go +++ b/google/resource_identity_platform_tenant.go @@ -169,19 +169,19 @@ func resourceIdentityPlatformTenantRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Error reading Tenant: %s", err) } - if err := d.Set("name", flattenIdentityPlatformTenantName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformTenantName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Tenant: %s", err) } - if err := d.Set("display_name", flattenIdentityPlatformTenantDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenIdentityPlatformTenantDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Tenant: %s", err) } - if err := d.Set("allow_password_signup", flattenIdentityPlatformTenantAllowPasswordSignup(res["allowPasswordSignup"], d)); err != nil { + if err := d.Set("allow_password_signup", flattenIdentityPlatformTenantAllowPasswordSignup(res["allowPasswordSignup"], d, config)); err != nil { return fmt.Errorf("Error reading Tenant: %s", err) } - if err := d.Set("enable_email_link_signin", flattenIdentityPlatformTenantEnableEmailLinkSignin(res["enableEmailLinkSignin"], d)); err != nil { + if err := d.Set("enable_email_link_signin", flattenIdentityPlatformTenantEnableEmailLinkSignin(res["enableEmailLinkSignin"], d, config)); err != nil { return fmt.Errorf("Error reading Tenant: %s", err) } - if err := d.Set("disable_auth", flattenIdentityPlatformTenantDisableAuth(res["disableAuth"], d)); err != nil { + if err := d.Set("disable_auth", flattenIdentityPlatformTenantDisableAuth(res["disableAuth"], d, config)); err != nil { return fmt.Errorf("Error reading Tenant: %s", err) } @@ -305,26 +305,26 @@ func resourceIdentityPlatformTenantImport(d *schema.ResourceData, meta interface return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformTenantName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenIdentityPlatformTenantDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantAllowPasswordSignup(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantAllowPasswordSignup(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantEnableEmailLinkSignin(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantEnableEmailLinkSignin(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantDisableAuth(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantDisableAuth(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_tenant_default_supported_idp_config.go b/google/resource_identity_platform_tenant_default_supported_idp_config.go index d41da9fb588..da0e3f12208 100644 --- a/google/resource_identity_platform_tenant_default_supported_idp_config.go +++ b/google/resource_identity_platform_tenant_default_supported_idp_config.go @@ -175,16 +175,16 @@ func resourceIdentityPlatformTenantDefaultSupportedIdpConfigRead(d *schema.Resou return fmt.Errorf("Error reading TenantDefaultSupportedIdpConfig: %s", err) } - if err := d.Set("name", flattenIdentityPlatformTenantDefaultSupportedIdpConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformTenantDefaultSupportedIdpConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TenantDefaultSupportedIdpConfig: %s", err) } - if err := d.Set("client_id", flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientId(res["clientId"], d)); err != nil { + if err := d.Set("client_id", flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientId(res["clientId"], d, config)); err != nil { return fmt.Errorf("Error reading TenantDefaultSupportedIdpConfig: %s", err) } - if err := d.Set("client_secret", flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientSecret(res["clientSecret"], d)); err != nil { + if err := d.Set("client_secret", flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientSecret(res["clientSecret"], d, config)); err != nil { return fmt.Errorf("Error reading TenantDefaultSupportedIdpConfig: %s", err) } - if err := d.Set("enabled", flattenIdentityPlatformTenantDefaultSupportedIdpConfigEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenIdentityPlatformTenantDefaultSupportedIdpConfigEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading TenantDefaultSupportedIdpConfig: %s", err) } @@ -298,19 +298,19 @@ func resourceIdentityPlatformTenantDefaultSupportedIdpConfigImport(d *schema.Res return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformTenantDefaultSupportedIdpConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantDefaultSupportedIdpConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientSecret(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantDefaultSupportedIdpConfigClientSecret(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantDefaultSupportedIdpConfigEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantDefaultSupportedIdpConfigEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_tenant_inbound_saml_config.go b/google/resource_identity_platform_tenant_inbound_saml_config.go index 846fca37c33..a58c9547224 100644 --- a/google/resource_identity_platform_tenant_inbound_saml_config.go +++ b/google/resource_identity_platform_tenant_inbound_saml_config.go @@ -233,19 +233,19 @@ func resourceIdentityPlatformTenantInboundSamlConfigRead(d *schema.ResourceData, return fmt.Errorf("Error reading TenantInboundSamlConfig: %s", err) } - if err := d.Set("name", flattenIdentityPlatformTenantInboundSamlConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformTenantInboundSamlConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TenantInboundSamlConfig: %s", err) } - if err := d.Set("display_name", flattenIdentityPlatformTenantInboundSamlConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenIdentityPlatformTenantInboundSamlConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading TenantInboundSamlConfig: %s", err) } - if err := d.Set("enabled", flattenIdentityPlatformTenantInboundSamlConfigEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenIdentityPlatformTenantInboundSamlConfigEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading TenantInboundSamlConfig: %s", err) } - if err := d.Set("idp_config", flattenIdentityPlatformTenantInboundSamlConfigIdpConfig(res["idpConfig"], d)); err != nil { + if err := d.Set("idp_config", flattenIdentityPlatformTenantInboundSamlConfigIdpConfig(res["idpConfig"], d, config)); err != nil { return fmt.Errorf("Error reading TenantInboundSamlConfig: %s", err) } - if err := d.Set("sp_config", flattenIdentityPlatformTenantInboundSamlConfigSpConfig(res["spConfig"], d)); err != nil { + if err := d.Set("sp_config", flattenIdentityPlatformTenantInboundSamlConfigSpConfig(res["spConfig"], d, config)); err != nil { return fmt.Errorf("Error reading TenantInboundSamlConfig: %s", err) } @@ -369,22 +369,22 @@ func resourceIdentityPlatformTenantInboundSamlConfigImport(d *schema.ResourceDat return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformTenantInboundSamlConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenIdentityPlatformTenantInboundSamlConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigIdpConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigIdpConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -394,28 +394,28 @@ func flattenIdentityPlatformTenantInboundSamlConfigIdpConfig(v interface{}, d *s } transformed := make(map[string]interface{}) transformed["idp_entity_id"] = - flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpEntityId(original["idpEntityId"], d) + flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpEntityId(original["idpEntityId"], d, config) transformed["sso_url"] = - flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSsoUrl(original["ssoUrl"], d) + flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSsoUrl(original["ssoUrl"], d, config) transformed["sign_request"] = - flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSignRequest(original["signRequest"], d) + flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSignRequest(original["signRequest"], d, config) transformed["idp_certificates"] = - flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificates(original["idpCertificates"], d) + flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificates(original["idpCertificates"], d, config) return []interface{}{transformed} } -func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpEntityId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpEntityId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSsoUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSsoUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSignRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigSignRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -428,16 +428,16 @@ func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificates(v in continue } transformed = append(transformed, map[string]interface{}{ - "x509_certificate": flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(original["x509Certificate"], d), + "x509_certificate": flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(original["x509Certificate"], d, config), }) } return transformed } -func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigIdpConfigIdpCertificatesX509Certificate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigSpConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigSpConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -447,22 +447,22 @@ func flattenIdentityPlatformTenantInboundSamlConfigSpConfig(v interface{}, d *sc } transformed := make(map[string]interface{}) transformed["sp_entity_id"] = - flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpEntityId(original["spEntityId"], d) + flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpEntityId(original["spEntityId"], d, config) transformed["callback_uri"] = - flattenIdentityPlatformTenantInboundSamlConfigSpConfigCallbackUri(original["callbackUri"], d) + flattenIdentityPlatformTenantInboundSamlConfigSpConfigCallbackUri(original["callbackUri"], d, config) transformed["sp_certificates"] = - flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificates(original["spCertificates"], d) + flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificates(original["spCertificates"], d, config) return []interface{}{transformed} } -func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpEntityId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpEntityId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigSpConfigCallbackUri(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigSpConfigCallbackUri(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -475,12 +475,12 @@ func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificates(v inte continue } transformed = append(transformed, map[string]interface{}{ - "x509_certificate": flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificatesX509Certificate(original["x509Certificate"], d), + "x509_certificate": flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificatesX509Certificate(original["x509Certificate"], d, config), }) } return transformed } -func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificatesX509Certificate(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantInboundSamlConfigSpConfigSpCertificatesX509Certificate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_identity_platform_tenant_oauth_idp_config.go b/google/resource_identity_platform_tenant_oauth_idp_config.go index dd1274ac25e..2cc46ffa7c4 100644 --- a/google/resource_identity_platform_tenant_oauth_idp_config.go +++ b/google/resource_identity_platform_tenant_oauth_idp_config.go @@ -178,22 +178,22 @@ func resourceIdentityPlatformTenantOauthIdpConfigRead(d *schema.ResourceData, me return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } - if err := d.Set("name", flattenIdentityPlatformTenantOauthIdpConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenIdentityPlatformTenantOauthIdpConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } - if err := d.Set("display_name", flattenIdentityPlatformTenantOauthIdpConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenIdentityPlatformTenantOauthIdpConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } - if err := d.Set("enabled", flattenIdentityPlatformTenantOauthIdpConfigEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenIdentityPlatformTenantOauthIdpConfigEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } - if err := d.Set("issuer", flattenIdentityPlatformTenantOauthIdpConfigIssuer(res["issuer"], d)); err != nil { + if err := d.Set("issuer", flattenIdentityPlatformTenantOauthIdpConfigIssuer(res["issuer"], d, config)); err != nil { return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } - if err := d.Set("client_id", flattenIdentityPlatformTenantOauthIdpConfigClientId(res["clientId"], d)); err != nil { + if err := d.Set("client_id", flattenIdentityPlatformTenantOauthIdpConfigClientId(res["clientId"], d, config)); err != nil { return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } - if err := d.Set("client_secret", flattenIdentityPlatformTenantOauthIdpConfigClientSecret(res["clientSecret"], d)); err != nil { + if err := d.Set("client_secret", flattenIdentityPlatformTenantOauthIdpConfigClientSecret(res["clientSecret"], d, config)); err != nil { return fmt.Errorf("Error reading TenantOauthIdpConfig: %s", err) } @@ -327,30 +327,30 @@ func resourceIdentityPlatformTenantOauthIdpConfigImport(d *schema.ResourceData, return []*schema.ResourceData{d}, nil } -func flattenIdentityPlatformTenantOauthIdpConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantOauthIdpConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenIdentityPlatformTenantOauthIdpConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantOauthIdpConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantOauthIdpConfigEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantOauthIdpConfigEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantOauthIdpConfigIssuer(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantOauthIdpConfigIssuer(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantOauthIdpConfigClientId(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantOauthIdpConfigClientId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenIdentityPlatformTenantOauthIdpConfigClientSecret(v interface{}, d *schema.ResourceData) interface{} { +func flattenIdentityPlatformTenantOauthIdpConfigClientSecret(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_kms_crypto_key.go b/google/resource_kms_crypto_key.go index f8d6684ab2a..c948d5ab6c0 100644 --- a/google/resource_kms_crypto_key.go +++ b/google/resource_kms_crypto_key.go @@ -215,16 +215,16 @@ func resourceKMSCryptoKeyRead(d *schema.ResourceData, meta interface{}) error { return nil } - if err := d.Set("labels", flattenKMSCryptoKeyLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenKMSCryptoKeyLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading CryptoKey: %s", err) } - if err := d.Set("purpose", flattenKMSCryptoKeyPurpose(res["purpose"], d)); err != nil { + if err := d.Set("purpose", flattenKMSCryptoKeyPurpose(res["purpose"], d, config)); err != nil { return fmt.Errorf("Error reading CryptoKey: %s", err) } - if err := d.Set("rotation_period", flattenKMSCryptoKeyRotationPeriod(res["rotationPeriod"], d)); err != nil { + if err := d.Set("rotation_period", flattenKMSCryptoKeyRotationPeriod(res["rotationPeriod"], d, config)); err != nil { return fmt.Errorf("Error reading CryptoKey: %s", err) } - if err := d.Set("version_template", flattenKMSCryptoKeyVersionTemplate(res["versionTemplate"], d)); err != nil { + if err := d.Set("version_template", flattenKMSCryptoKeyVersionTemplate(res["versionTemplate"], d, config)); err != nil { return fmt.Errorf("Error reading CryptoKey: %s", err) } @@ -342,19 +342,19 @@ func resourceKMSCryptoKeyImport(d *schema.ResourceData, meta interface{}) ([]*sc return []*schema.ResourceData{d}, nil } -func flattenKMSCryptoKeyLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSCryptoKeyLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenKMSCryptoKeyPurpose(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSCryptoKeyPurpose(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenKMSCryptoKeyRotationPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSCryptoKeyRotationPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenKMSCryptoKeyVersionTemplate(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSCryptoKeyVersionTemplate(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -364,16 +364,16 @@ func flattenKMSCryptoKeyVersionTemplate(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["algorithm"] = - flattenKMSCryptoKeyVersionTemplateAlgorithm(original["algorithm"], d) + flattenKMSCryptoKeyVersionTemplateAlgorithm(original["algorithm"], d, config) transformed["protection_level"] = - flattenKMSCryptoKeyVersionTemplateProtectionLevel(original["protectionLevel"], d) + flattenKMSCryptoKeyVersionTemplateProtectionLevel(original["protectionLevel"], d, config) return []interface{}{transformed} } -func flattenKMSCryptoKeyVersionTemplateAlgorithm(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSCryptoKeyVersionTemplateAlgorithm(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenKMSCryptoKeyVersionTemplateProtectionLevel(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSCryptoKeyVersionTemplateProtectionLevel(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_kms_key_ring.go b/google/resource_kms_key_ring.go index 843491a545f..35ce9478667 100644 --- a/google/resource_kms_key_ring.go +++ b/google/resource_kms_key_ring.go @@ -148,7 +148,7 @@ func resourceKMSKeyRingRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading KeyRing: %s", err) } - if err := d.Set("name", flattenKMSKeyRingName(res["name"], d)); err != nil { + if err := d.Set("name", flattenKMSKeyRingName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading KeyRing: %s", err) } @@ -184,7 +184,7 @@ func resourceKMSKeyRingImport(d *schema.ResourceData, meta interface{}) ([]*sche return []*schema.ResourceData{d}, nil } -func flattenKMSKeyRingName(v interface{}, d *schema.ResourceData) interface{} { +func flattenKMSKeyRingName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_logging_metric.go b/google/resource_logging_metric.go index e69bff67fd8..b45c0386b5e 100644 --- a/google/resource_logging_metric.go +++ b/google/resource_logging_metric.go @@ -369,25 +369,25 @@ func resourceLoggingMetricRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("name", flattenLoggingMetricName(res["name"], d)); err != nil { + if err := d.Set("name", flattenLoggingMetricName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("description", flattenLoggingMetricDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenLoggingMetricDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("filter", flattenLoggingMetricFilter(res["filter"], d)); err != nil { + if err := d.Set("filter", flattenLoggingMetricFilter(res["filter"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("metric_descriptor", flattenLoggingMetricMetricDescriptor(res["metricDescriptor"], d)); err != nil { + if err := d.Set("metric_descriptor", flattenLoggingMetricMetricDescriptor(res["metricDescriptor"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("label_extractors", flattenLoggingMetricLabelExtractors(res["labelExtractors"], d)); err != nil { + if err := d.Set("label_extractors", flattenLoggingMetricLabelExtractors(res["labelExtractors"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("value_extractor", flattenLoggingMetricValueExtractor(res["valueExtractor"], d)); err != nil { + if err := d.Set("value_extractor", flattenLoggingMetricValueExtractor(res["valueExtractor"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } - if err := d.Set("bucket_options", flattenLoggingMetricBucketOptions(res["bucketOptions"], d)); err != nil { + if err := d.Set("bucket_options", flattenLoggingMetricBucketOptions(res["bucketOptions"], d, config)); err != nil { return fmt.Errorf("Error reading Metric: %s", err) } @@ -512,19 +512,19 @@ func resourceLoggingMetricImport(d *schema.ResourceData, meta interface{}) ([]*s return []*schema.ResourceData{d}, nil } -func flattenLoggingMetricName(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricMetricDescriptor(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptor(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -534,30 +534,30 @@ func flattenLoggingMetricMetricDescriptor(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["unit"] = - flattenLoggingMetricMetricDescriptorUnit(original["unit"], d) + flattenLoggingMetricMetricDescriptorUnit(original["unit"], d, config) transformed["value_type"] = - flattenLoggingMetricMetricDescriptorValueType(original["valueType"], d) + flattenLoggingMetricMetricDescriptorValueType(original["valueType"], d, config) transformed["metric_kind"] = - flattenLoggingMetricMetricDescriptorMetricKind(original["metricKind"], d) + flattenLoggingMetricMetricDescriptorMetricKind(original["metricKind"], d, config) transformed["labels"] = - flattenLoggingMetricMetricDescriptorLabels(original["labels"], d) + flattenLoggingMetricMetricDescriptorLabels(original["labels"], d, config) transformed["display_name"] = - flattenLoggingMetricMetricDescriptorDisplayName(original["displayName"], d) + flattenLoggingMetricMetricDescriptorDisplayName(original["displayName"], d, config) return []interface{}{transformed} } -func flattenLoggingMetricMetricDescriptorUnit(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorUnit(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricMetricDescriptorValueType(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorValueType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricMetricDescriptorMetricKind(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorMetricKind(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricMetricDescriptorLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -570,22 +570,22 @@ func flattenLoggingMetricMetricDescriptorLabels(v interface{}, d *schema.Resourc continue } transformed.Add(map[string]interface{}{ - "key": flattenLoggingMetricMetricDescriptorLabelsKey(original["key"], d), - "description": flattenLoggingMetricMetricDescriptorLabelsDescription(original["description"], d), - "value_type": flattenLoggingMetricMetricDescriptorLabelsValueType(original["valueType"], d), + "key": flattenLoggingMetricMetricDescriptorLabelsKey(original["key"], d, config), + "description": flattenLoggingMetricMetricDescriptorLabelsDescription(original["description"], d, config), + "value_type": flattenLoggingMetricMetricDescriptorLabelsValueType(original["valueType"], d, config), }) } return transformed } -func flattenLoggingMetricMetricDescriptorLabelsKey(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorLabelsKey(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricMetricDescriptorLabelsDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorLabelsDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricMetricDescriptorLabelsValueType(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorLabelsValueType(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil || isEmptyValue(reflect.ValueOf(v)) { return "STRING" } @@ -593,19 +593,19 @@ func flattenLoggingMetricMetricDescriptorLabelsValueType(v interface{}, d *schem return v } -func flattenLoggingMetricMetricDescriptorDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricMetricDescriptorDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricLabelExtractors(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricLabelExtractors(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricValueExtractor(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricValueExtractor(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricBucketOptions(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptions(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -615,14 +615,14 @@ func flattenLoggingMetricBucketOptions(v interface{}, d *schema.ResourceData) in } transformed := make(map[string]interface{}) transformed["linear_buckets"] = - flattenLoggingMetricBucketOptionsLinearBuckets(original["linearBuckets"], d) + flattenLoggingMetricBucketOptionsLinearBuckets(original["linearBuckets"], d, config) transformed["exponential_buckets"] = - flattenLoggingMetricBucketOptionsExponentialBuckets(original["exponentialBuckets"], d) + flattenLoggingMetricBucketOptionsExponentialBuckets(original["exponentialBuckets"], d, config) transformed["explicit_buckets"] = - flattenLoggingMetricBucketOptionsExplicitBuckets(original["explicitBuckets"], d) + flattenLoggingMetricBucketOptionsExplicitBuckets(original["explicitBuckets"], d, config) return []interface{}{transformed} } -func flattenLoggingMetricBucketOptionsLinearBuckets(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsLinearBuckets(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -632,14 +632,14 @@ func flattenLoggingMetricBucketOptionsLinearBuckets(v interface{}, d *schema.Res } transformed := make(map[string]interface{}) transformed["num_finite_buckets"] = - flattenLoggingMetricBucketOptionsLinearBucketsNumFiniteBuckets(original["numFiniteBuckets"], d) + flattenLoggingMetricBucketOptionsLinearBucketsNumFiniteBuckets(original["numFiniteBuckets"], d, config) transformed["width"] = - flattenLoggingMetricBucketOptionsLinearBucketsWidth(original["width"], d) + flattenLoggingMetricBucketOptionsLinearBucketsWidth(original["width"], d, config) transformed["offset"] = - flattenLoggingMetricBucketOptionsLinearBucketsOffset(original["offset"], d) + flattenLoggingMetricBucketOptionsLinearBucketsOffset(original["offset"], d, config) return []interface{}{transformed} } -func flattenLoggingMetricBucketOptionsLinearBucketsNumFiniteBuckets(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsLinearBucketsNumFiniteBuckets(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -649,7 +649,7 @@ func flattenLoggingMetricBucketOptionsLinearBucketsNumFiniteBuckets(v interface{ return v } -func flattenLoggingMetricBucketOptionsLinearBucketsWidth(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsLinearBucketsWidth(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -659,11 +659,11 @@ func flattenLoggingMetricBucketOptionsLinearBucketsWidth(v interface{}, d *schem return v } -func flattenLoggingMetricBucketOptionsLinearBucketsOffset(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsLinearBucketsOffset(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricBucketOptionsExponentialBuckets(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsExponentialBuckets(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -673,14 +673,14 @@ func flattenLoggingMetricBucketOptionsExponentialBuckets(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["num_finite_buckets"] = - flattenLoggingMetricBucketOptionsExponentialBucketsNumFiniteBuckets(original["numFiniteBuckets"], d) + flattenLoggingMetricBucketOptionsExponentialBucketsNumFiniteBuckets(original["numFiniteBuckets"], d, config) transformed["growth_factor"] = - flattenLoggingMetricBucketOptionsExponentialBucketsGrowthFactor(original["growthFactor"], d) + flattenLoggingMetricBucketOptionsExponentialBucketsGrowthFactor(original["growthFactor"], d, config) transformed["scale"] = - flattenLoggingMetricBucketOptionsExponentialBucketsScale(original["scale"], d) + flattenLoggingMetricBucketOptionsExponentialBucketsScale(original["scale"], d, config) return []interface{}{transformed} } -func flattenLoggingMetricBucketOptionsExponentialBucketsNumFiniteBuckets(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsExponentialBucketsNumFiniteBuckets(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -690,15 +690,15 @@ func flattenLoggingMetricBucketOptionsExponentialBucketsNumFiniteBuckets(v inter return v } -func flattenLoggingMetricBucketOptionsExponentialBucketsGrowthFactor(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsExponentialBucketsGrowthFactor(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricBucketOptionsExponentialBucketsScale(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsExponentialBucketsScale(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenLoggingMetricBucketOptionsExplicitBuckets(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsExplicitBuckets(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -708,10 +708,10 @@ func flattenLoggingMetricBucketOptionsExplicitBuckets(v interface{}, d *schema.R } transformed := make(map[string]interface{}) transformed["bounds"] = - flattenLoggingMetricBucketOptionsExplicitBucketsBounds(original["bounds"], d) + flattenLoggingMetricBucketOptionsExplicitBucketsBounds(original["bounds"], d, config) return []interface{}{transformed} } -func flattenLoggingMetricBucketOptionsExplicitBucketsBounds(v interface{}, d *schema.ResourceData) interface{} { +func flattenLoggingMetricBucketOptionsExplicitBucketsBounds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_ml_engine_model.go b/google/resource_ml_engine_model.go index a746e61df34..3544b7f63a6 100644 --- a/google/resource_ml_engine_model.go +++ b/google/resource_ml_engine_model.go @@ -204,25 +204,25 @@ func resourceMLEngineModelRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("name", flattenMLEngineModelName(res["name"], d)); err != nil { + if err := d.Set("name", flattenMLEngineModelName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("description", flattenMLEngineModelDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenMLEngineModelDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("default_version", flattenMLEngineModelDefaultVersion(res["defaultVersion"], d)); err != nil { + if err := d.Set("default_version", flattenMLEngineModelDefaultVersion(res["defaultVersion"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("regions", flattenMLEngineModelRegions(res["regions"], d)); err != nil { + if err := d.Set("regions", flattenMLEngineModelRegions(res["regions"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("online_prediction_logging", flattenMLEngineModelOnlinePredictionLogging(res["onlinePredictionLogging"], d)); err != nil { + if err := d.Set("online_prediction_logging", flattenMLEngineModelOnlinePredictionLogging(res["onlinePredictionLogging"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("online_prediction_console_logging", flattenMLEngineModelOnlinePredictionConsoleLogging(res["onlinePredictionConsoleLogging"], d)); err != nil { + if err := d.Set("online_prediction_console_logging", flattenMLEngineModelOnlinePredictionConsoleLogging(res["onlinePredictionConsoleLogging"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } - if err := d.Set("labels", flattenMLEngineModelLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenMLEngineModelLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Model: %s", err) } @@ -282,18 +282,18 @@ func resourceMLEngineModelImport(d *schema.ResourceData, meta interface{}) ([]*s return []*schema.ResourceData{d}, nil } -func flattenMLEngineModelName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenMLEngineModelDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMLEngineModelDefaultVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelDefaultVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -303,26 +303,26 @@ func flattenMLEngineModelDefaultVersion(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["name"] = - flattenMLEngineModelDefaultVersionName(original["name"], d) + flattenMLEngineModelDefaultVersionName(original["name"], d, config) return []interface{}{transformed} } -func flattenMLEngineModelDefaultVersionName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelDefaultVersionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMLEngineModelRegions(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelRegions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMLEngineModelOnlinePredictionLogging(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelOnlinePredictionLogging(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMLEngineModelOnlinePredictionConsoleLogging(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelOnlinePredictionConsoleLogging(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMLEngineModelLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenMLEngineModelLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_monitoring_alert_policy.go b/google/resource_monitoring_alert_policy.go index 173fd14ff78..7de77ffebce 100644 --- a/google/resource_monitoring_alert_policy.go +++ b/google/resource_monitoring_alert_policy.go @@ -843,31 +843,31 @@ func resourceMonitoringAlertPolicyRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("name", flattenMonitoringAlertPolicyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenMonitoringAlertPolicyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("display_name", flattenMonitoringAlertPolicyDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenMonitoringAlertPolicyDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("combiner", flattenMonitoringAlertPolicyCombiner(res["combiner"], d)); err != nil { + if err := d.Set("combiner", flattenMonitoringAlertPolicyCombiner(res["combiner"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("creation_record", flattenMonitoringAlertPolicyCreationRecord(res["creationRecord"], d)); err != nil { + if err := d.Set("creation_record", flattenMonitoringAlertPolicyCreationRecord(res["creationRecord"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("enabled", flattenMonitoringAlertPolicyEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenMonitoringAlertPolicyEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("conditions", flattenMonitoringAlertPolicyConditions(res["conditions"], d)); err != nil { + if err := d.Set("conditions", flattenMonitoringAlertPolicyConditions(res["conditions"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("notification_channels", flattenMonitoringAlertPolicyNotificationChannels(res["notificationChannels"], d)); err != nil { + if err := d.Set("notification_channels", flattenMonitoringAlertPolicyNotificationChannels(res["notificationChannels"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("user_labels", flattenMonitoringAlertPolicyUserLabels(res["userLabels"], d)); err != nil { + if err := d.Set("user_labels", flattenMonitoringAlertPolicyUserLabels(res["userLabels"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } - if err := d.Set("documentation", flattenMonitoringAlertPolicyDocumentation(res["documentation"], d)); err != nil { + if err := d.Set("documentation", flattenMonitoringAlertPolicyDocumentation(res["documentation"], d, config)); err != nil { return fmt.Errorf("Error reading AlertPolicy: %s", err) } @@ -1027,19 +1027,19 @@ func resourceMonitoringAlertPolicyImport(d *schema.ResourceData, meta interface{ return []*schema.ResourceData{d}, nil } -func flattenMonitoringAlertPolicyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyCombiner(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyCombiner(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyCreationRecord(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyCreationRecord(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1049,24 +1049,24 @@ func flattenMonitoringAlertPolicyCreationRecord(v interface{}, d *schema.Resourc } transformed := make(map[string]interface{}) transformed["mutate_time"] = - flattenMonitoringAlertPolicyCreationRecordMutateTime(original["mutateTime"], d) + flattenMonitoringAlertPolicyCreationRecordMutateTime(original["mutateTime"], d, config) transformed["mutated_by"] = - flattenMonitoringAlertPolicyCreationRecordMutatedBy(original["mutatedBy"], d) + flattenMonitoringAlertPolicyCreationRecordMutatedBy(original["mutatedBy"], d, config) return []interface{}{transformed} } -func flattenMonitoringAlertPolicyCreationRecordMutateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyCreationRecordMutateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyCreationRecordMutatedBy(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyCreationRecordMutatedBy(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1079,15 +1079,15 @@ func flattenMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceDat continue } transformed = append(transformed, map[string]interface{}{ - "condition_absent": flattenMonitoringAlertPolicyConditionsConditionAbsent(original["conditionAbsent"], d), - "name": flattenMonitoringAlertPolicyConditionsName(original["name"], d), - "condition_threshold": flattenMonitoringAlertPolicyConditionsConditionThreshold(original["conditionThreshold"], d), - "display_name": flattenMonitoringAlertPolicyConditionsDisplayName(original["displayName"], d), + "condition_absent": flattenMonitoringAlertPolicyConditionsConditionAbsent(original["conditionAbsent"], d, config), + "name": flattenMonitoringAlertPolicyConditionsName(original["name"], d, config), + "condition_threshold": flattenMonitoringAlertPolicyConditionsConditionThreshold(original["conditionThreshold"], d, config), + "display_name": flattenMonitoringAlertPolicyConditionsDisplayName(original["displayName"], d, config), }) } return transformed } -func flattenMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1097,16 +1097,16 @@ func flattenMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *sch } transformed := make(map[string]interface{}) transformed["aggregations"] = - flattenMonitoringAlertPolicyConditionsConditionAbsentAggregations(original["aggregations"], d) + flattenMonitoringAlertPolicyConditionsConditionAbsentAggregations(original["aggregations"], d, config) transformed["trigger"] = - flattenMonitoringAlertPolicyConditionsConditionAbsentTrigger(original["trigger"], d) + flattenMonitoringAlertPolicyConditionsConditionAbsentTrigger(original["trigger"], d, config) transformed["duration"] = - flattenMonitoringAlertPolicyConditionsConditionAbsentDuration(original["duration"], d) + flattenMonitoringAlertPolicyConditionsConditionAbsentDuration(original["duration"], d, config) transformed["filter"] = - flattenMonitoringAlertPolicyConditionsConditionAbsentFilter(original["filter"], d) + flattenMonitoringAlertPolicyConditionsConditionAbsentFilter(original["filter"], d, config) return []interface{}{transformed} } -func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregations(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregations(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1119,31 +1119,31 @@ func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregations(v interfa continue } transformed = append(transformed, map[string]interface{}{ - "per_series_aligner": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsPerSeriesAligner(original["perSeriesAligner"], d), - "group_by_fields": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsGroupByFields(original["groupByFields"], d), - "alignment_period": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsAlignmentPeriod(original["alignmentPeriod"], d), - "cross_series_reducer": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeriesReducer(original["crossSeriesReducer"], d), + "per_series_aligner": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsPerSeriesAligner(original["perSeriesAligner"], d, config), + "group_by_fields": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsGroupByFields(original["groupByFields"], d, config), + "alignment_period": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsAlignmentPeriod(original["alignmentPeriod"], d, config), + "cross_series_reducer": flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeriesReducer(original["crossSeriesReducer"], d, config), }) } return transformed } -func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsGroupByFields(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsGroupByFields(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1153,16 +1153,16 @@ func flattenMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, } transformed := make(map[string]interface{}) transformed["percent"] = - flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerPercent(original["percent"], d) + flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerPercent(original["percent"], d, config) transformed["count"] = - flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(original["count"], d) + flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(original["count"], d, config) return []interface{}{transformed} } -func flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerPercent(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerPercent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1172,19 +1172,19 @@ func flattenMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(v interfa return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionAbsentFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionAbsentFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1194,32 +1194,32 @@ func flattenMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d * } transformed := make(map[string]interface{}) transformed["threshold_value"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdThresholdValue(original["thresholdValue"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdThresholdValue(original["thresholdValue"], d, config) transformed["denominator_filter"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorFilter(original["denominatorFilter"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorFilter(original["denominatorFilter"], d, config) transformed["denominator_aggregations"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregations(original["denominatorAggregations"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregations(original["denominatorAggregations"], d, config) transformed["duration"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdDuration(original["duration"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdDuration(original["duration"], d, config) transformed["comparison"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdComparison(original["comparison"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdComparison(original["comparison"], d, config) transformed["trigger"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdTrigger(original["trigger"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdTrigger(original["trigger"], d, config) transformed["aggregations"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdAggregations(original["aggregations"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdAggregations(original["aggregations"], d, config) transformed["filter"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdFilter(original["filter"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdFilter(original["filter"], d, config) return []interface{}{transformed} } -func flattenMonitoringAlertPolicyConditionsConditionThresholdThresholdValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdThresholdValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregations(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregations(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1232,39 +1232,39 @@ func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregat continue } transformed = append(transformed, map[string]interface{}{ - "per_series_aligner": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsPerSeriesAligner(original["perSeriesAligner"], d), - "group_by_fields": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsGroupByFields(original["groupByFields"], d), - "alignment_period": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsAlignmentPeriod(original["alignmentPeriod"], d), - "cross_series_reducer": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsCrossSeriesReducer(original["crossSeriesReducer"], d), + "per_series_aligner": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsPerSeriesAligner(original["perSeriesAligner"], d, config), + "group_by_fields": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsGroupByFields(original["groupByFields"], d, config), + "alignment_period": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsAlignmentPeriod(original["alignmentPeriod"], d, config), + "cross_series_reducer": flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsCrossSeriesReducer(original["crossSeriesReducer"], d, config), }) } return transformed } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsGroupByFields(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsGroupByFields(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdComparison(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdComparison(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1274,16 +1274,16 @@ func flattenMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface } transformed := make(map[string]interface{}) transformed["percent"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerPercent(original["percent"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerPercent(original["percent"], d, config) transformed["count"] = - flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(original["count"], d) + flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(original["count"], d, config) return []interface{}{transformed} } -func flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerPercent(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerPercent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -1293,7 +1293,7 @@ func flattenMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(v inte return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregations(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregations(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1306,47 +1306,47 @@ func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregations(v inte continue } transformed = append(transformed, map[string]interface{}{ - "per_series_aligner": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsPerSeriesAligner(original["perSeriesAligner"], d), - "group_by_fields": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsGroupByFields(original["groupByFields"], d), - "alignment_period": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsAlignmentPeriod(original["alignmentPeriod"], d), - "cross_series_reducer": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsCrossSeriesReducer(original["crossSeriesReducer"], d), + "per_series_aligner": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsPerSeriesAligner(original["perSeriesAligner"], d, config), + "group_by_fields": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsGroupByFields(original["groupByFields"], d, config), + "alignment_period": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsAlignmentPeriod(original["alignmentPeriod"], d, config), + "cross_series_reducer": flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsCrossSeriesReducer(original["crossSeriesReducer"], d, config), }) } return transformed } -func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsGroupByFields(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsGroupByFields(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsConditionThresholdFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsConditionThresholdFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyConditionsDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyConditionsDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyNotificationChannels(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyNotificationChannels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyUserLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyUserLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyDocumentation(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyDocumentation(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1356,16 +1356,16 @@ func flattenMonitoringAlertPolicyDocumentation(v interface{}, d *schema.Resource } transformed := make(map[string]interface{}) transformed["content"] = - flattenMonitoringAlertPolicyDocumentationContent(original["content"], d) + flattenMonitoringAlertPolicyDocumentationContent(original["content"], d, config) transformed["mime_type"] = - flattenMonitoringAlertPolicyDocumentationMimeType(original["mimeType"], d) + flattenMonitoringAlertPolicyDocumentationMimeType(original["mimeType"], d, config) return []interface{}{transformed} } -func flattenMonitoringAlertPolicyDocumentationContent(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyDocumentationContent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringAlertPolicyDocumentationMimeType(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringAlertPolicyDocumentationMimeType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_monitoring_group.go b/google/resource_monitoring_group.go index b7481b6cd4d..7ca2fb46ada 100644 --- a/google/resource_monitoring_group.go +++ b/google/resource_monitoring_group.go @@ -176,19 +176,19 @@ func resourceMonitoringGroupRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Group: %s", err) } - if err := d.Set("parent_name", flattenMonitoringGroupParentName(res["parentName"], d)); err != nil { + if err := d.Set("parent_name", flattenMonitoringGroupParentName(res["parentName"], d, config)); err != nil { return fmt.Errorf("Error reading Group: %s", err) } - if err := d.Set("name", flattenMonitoringGroupName(res["name"], d)); err != nil { + if err := d.Set("name", flattenMonitoringGroupName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Group: %s", err) } - if err := d.Set("is_cluster", flattenMonitoringGroupIsCluster(res["isCluster"], d)); err != nil { + if err := d.Set("is_cluster", flattenMonitoringGroupIsCluster(res["isCluster"], d, config)); err != nil { return fmt.Errorf("Error reading Group: %s", err) } - if err := d.Set("display_name", flattenMonitoringGroupDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenMonitoringGroupDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Group: %s", err) } - if err := d.Set("filter", flattenMonitoringGroupFilter(res["filter"], d)); err != nil { + if err := d.Set("filter", flattenMonitoringGroupFilter(res["filter"], d, config)); err != nil { return fmt.Errorf("Error reading Group: %s", err) } @@ -295,23 +295,23 @@ func resourceMonitoringGroupImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenMonitoringGroupParentName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringGroupParentName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringGroupName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringGroupName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringGroupIsCluster(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringGroupIsCluster(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringGroupDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringGroupDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringGroupFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringGroupFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_monitoring_notification_channel.go b/google/resource_monitoring_notification_channel.go index 7f6aedafd53..3aa408b1758 100644 --- a/google/resource_monitoring_notification_channel.go +++ b/google/resource_monitoring_notification_channel.go @@ -212,28 +212,28 @@ func resourceMonitoringNotificationChannelRead(d *schema.ResourceData, meta inte return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("labels", flattenMonitoringNotificationChannelLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenMonitoringNotificationChannelLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("name", flattenMonitoringNotificationChannelName(res["name"], d)); err != nil { + if err := d.Set("name", flattenMonitoringNotificationChannelName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("verification_status", flattenMonitoringNotificationChannelVerificationStatus(res["verificationStatus"], d)); err != nil { + if err := d.Set("verification_status", flattenMonitoringNotificationChannelVerificationStatus(res["verificationStatus"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("type", flattenMonitoringNotificationChannelType(res["type"], d)); err != nil { + if err := d.Set("type", flattenMonitoringNotificationChannelType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("user_labels", flattenMonitoringNotificationChannelUserLabels(res["userLabels"], d)); err != nil { + if err := d.Set("user_labels", flattenMonitoringNotificationChannelUserLabels(res["userLabels"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("description", flattenMonitoringNotificationChannelDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenMonitoringNotificationChannelDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("display_name", flattenMonitoringNotificationChannelDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenMonitoringNotificationChannelDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } - if err := d.Set("enabled", flattenMonitoringNotificationChannelEnabled(res["enabled"], d)); err != nil { + if err := d.Set("enabled", flattenMonitoringNotificationChannelEnabled(res["enabled"], d, config)); err != nil { return fmt.Errorf("Error reading NotificationChannel: %s", err) } @@ -357,7 +357,7 @@ func resourceMonitoringNotificationChannelImport(d *schema.ResourceData, meta in // This method checks to see if the value read from the server looks like // the obfuscated version of the state value. If so, it will just use the state // value to avoid permadiff. -func flattenMonitoringNotificationChannelLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -401,31 +401,31 @@ func isMonitoringNotificationChannelLabelsObfuscated(serverLabel, stateLabel str return true } -func flattenMonitoringNotificationChannelName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringNotificationChannelVerificationStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelVerificationStatus(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringNotificationChannelType(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringNotificationChannelUserLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelUserLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringNotificationChannelDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringNotificationChannelDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringNotificationChannelEnabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringNotificationChannelEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_monitoring_uptime_check_config.go b/google/resource_monitoring_uptime_check_config.go index 2075f484a0e..7ef58b18353 100644 --- a/google/resource_monitoring_uptime_check_config.go +++ b/google/resource_monitoring_uptime_check_config.go @@ -404,37 +404,37 @@ func resourceMonitoringUptimeCheckConfigRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("name", flattenMonitoringUptimeCheckConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenMonitoringUptimeCheckConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("uptime_check_id", flattenMonitoringUptimeCheckConfigUptimeCheckId(res["id"], d)); err != nil { + if err := d.Set("uptime_check_id", flattenMonitoringUptimeCheckConfigUptimeCheckId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("display_name", flattenMonitoringUptimeCheckConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenMonitoringUptimeCheckConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("period", flattenMonitoringUptimeCheckConfigPeriod(res["period"], d)); err != nil { + if err := d.Set("period", flattenMonitoringUptimeCheckConfigPeriod(res["period"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("timeout", flattenMonitoringUptimeCheckConfigTimeout(res["timeout"], d)); err != nil { + if err := d.Set("timeout", flattenMonitoringUptimeCheckConfigTimeout(res["timeout"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("content_matchers", flattenMonitoringUptimeCheckConfigContentMatchers(res["contentMatchers"], d)); err != nil { + if err := d.Set("content_matchers", flattenMonitoringUptimeCheckConfigContentMatchers(res["contentMatchers"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("selected_regions", flattenMonitoringUptimeCheckConfigSelectedRegions(res["selectedRegions"], d)); err != nil { + if err := d.Set("selected_regions", flattenMonitoringUptimeCheckConfigSelectedRegions(res["selectedRegions"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("http_check", flattenMonitoringUptimeCheckConfigHttpCheck(res["httpCheck"], d)); err != nil { + if err := d.Set("http_check", flattenMonitoringUptimeCheckConfigHttpCheck(res["httpCheck"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("tcp_check", flattenMonitoringUptimeCheckConfigTcpCheck(res["tcpCheck"], d)); err != nil { + if err := d.Set("tcp_check", flattenMonitoringUptimeCheckConfigTcpCheck(res["tcpCheck"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("resource_group", flattenMonitoringUptimeCheckConfigResourceGroup(res["resourceGroup"], d)); err != nil { + if err := d.Set("resource_group", flattenMonitoringUptimeCheckConfigResourceGroup(res["resourceGroup"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } - if err := d.Set("monitored_resource", flattenMonitoringUptimeCheckConfigMonitoredResource(res["monitoredResource"], d)); err != nil { + if err := d.Set("monitored_resource", flattenMonitoringUptimeCheckConfigMonitoredResource(res["monitoredResource"], d, config)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } @@ -570,28 +570,28 @@ func resourceMonitoringUptimeCheckConfigImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenMonitoringUptimeCheckConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigUptimeCheckId(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigUptimeCheckId(v interface{}, d *schema.ResourceData, config *Config) interface{} { parts := strings.Split(d.Get("name").(string), "/") return parts[len(parts)-1] } -func flattenMonitoringUptimeCheckConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigPeriod(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigPeriod(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigContentMatchers(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigContentMatchers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -604,20 +604,20 @@ func flattenMonitoringUptimeCheckConfigContentMatchers(v interface{}, d *schema. continue } transformed = append(transformed, map[string]interface{}{ - "content": flattenMonitoringUptimeCheckConfigContentMatchersContent(original["content"], d), + "content": flattenMonitoringUptimeCheckConfigContentMatchersContent(original["content"], d, config), }) } return transformed } -func flattenMonitoringUptimeCheckConfigContentMatchersContent(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigContentMatchersContent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigSelectedRegions(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigSelectedRegions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigHttpCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -627,22 +627,22 @@ func flattenMonitoringUptimeCheckConfigHttpCheck(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["auth_info"] = - flattenMonitoringUptimeCheckConfigHttpCheckAuthInfo(original["authInfo"], d) + flattenMonitoringUptimeCheckConfigHttpCheckAuthInfo(original["authInfo"], d, config) transformed["port"] = - flattenMonitoringUptimeCheckConfigHttpCheckPort(original["port"], d) + flattenMonitoringUptimeCheckConfigHttpCheckPort(original["port"], d, config) transformed["headers"] = - flattenMonitoringUptimeCheckConfigHttpCheckHeaders(original["headers"], d) + flattenMonitoringUptimeCheckConfigHttpCheckHeaders(original["headers"], d, config) transformed["path"] = - flattenMonitoringUptimeCheckConfigHttpCheckPath(original["path"], d) + flattenMonitoringUptimeCheckConfigHttpCheckPath(original["path"], d, config) transformed["use_ssl"] = - flattenMonitoringUptimeCheckConfigHttpCheckUseSsl(original["useSsl"], d) + flattenMonitoringUptimeCheckConfigHttpCheckUseSsl(original["useSsl"], d, config) transformed["validate_ssl"] = - flattenMonitoringUptimeCheckConfigHttpCheckValidateSsl(original["validateSsl"], d) + flattenMonitoringUptimeCheckConfigHttpCheckValidateSsl(original["validateSsl"], d, config) transformed["mask_headers"] = - flattenMonitoringUptimeCheckConfigHttpCheckMaskHeaders(original["maskHeaders"], d) + flattenMonitoringUptimeCheckConfigHttpCheckMaskHeaders(original["maskHeaders"], d, config) return []interface{}{transformed} } -func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -652,20 +652,20 @@ func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["password"] = - flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(original["password"], d) + flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(original["password"], d, config) transformed["username"] = - flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(original["username"], d) + flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(original["username"], d, config) return []interface{}{transformed} } -func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("http_check.0.auth_info.0.password") } -func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigHttpCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -675,27 +675,27 @@ func flattenMonitoringUptimeCheckConfigHttpCheckPort(v interface{}, d *schema.Re return v } -func flattenMonitoringUptimeCheckConfigHttpCheckHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigHttpCheckPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigHttpCheckUseSsl(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckUseSsl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigHttpCheckValidateSsl(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckValidateSsl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigHttpCheckMaskHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigHttpCheckMaskHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigTcpCheck(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigTcpCheck(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -705,10 +705,10 @@ func flattenMonitoringUptimeCheckConfigTcpCheck(v interface{}, d *schema.Resourc } transformed := make(map[string]interface{}) transformed["port"] = - flattenMonitoringUptimeCheckConfigTcpCheckPort(original["port"], d) + flattenMonitoringUptimeCheckConfigTcpCheckPort(original["port"], d, config) return []interface{}{transformed} } -func flattenMonitoringUptimeCheckConfigTcpCheckPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigTcpCheckPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -718,7 +718,7 @@ func flattenMonitoringUptimeCheckConfigTcpCheckPort(v interface{}, d *schema.Res return v } -func flattenMonitoringUptimeCheckConfigResourceGroup(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigResourceGroup(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -728,21 +728,21 @@ func flattenMonitoringUptimeCheckConfigResourceGroup(v interface{}, d *schema.Re } transformed := make(map[string]interface{}) transformed["resource_type"] = - flattenMonitoringUptimeCheckConfigResourceGroupResourceType(original["resourceType"], d) + flattenMonitoringUptimeCheckConfigResourceGroupResourceType(original["resourceType"], d, config) transformed["group_id"] = - flattenMonitoringUptimeCheckConfigResourceGroupGroupId(original["groupId"], d) + flattenMonitoringUptimeCheckConfigResourceGroupGroupId(original["groupId"], d, config) return []interface{}{transformed} } -func flattenMonitoringUptimeCheckConfigResourceGroupResourceType(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigResourceGroupResourceType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigResourceGroupGroupId(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigResourceGroupGroupId(v interface{}, d *schema.ResourceData, config *Config) interface{} { project := d.Get("project").(string) return fmt.Sprintf("projects/%s/groups/%s", project, v) } -func flattenMonitoringUptimeCheckConfigMonitoredResource(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigMonitoredResource(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -752,16 +752,16 @@ func flattenMonitoringUptimeCheckConfigMonitoredResource(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["type"] = - flattenMonitoringUptimeCheckConfigMonitoredResourceType(original["type"], d) + flattenMonitoringUptimeCheckConfigMonitoredResourceType(original["type"], d, config) transformed["labels"] = - flattenMonitoringUptimeCheckConfigMonitoredResourceLabels(original["labels"], d) + flattenMonitoringUptimeCheckConfigMonitoredResourceLabels(original["labels"], d, config) return []interface{}{transformed} } -func flattenMonitoringUptimeCheckConfigMonitoredResourceType(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigMonitoredResourceType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenMonitoringUptimeCheckConfigMonitoredResourceLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenMonitoringUptimeCheckConfigMonitoredResourceLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_pubsub_subscription.go b/google/resource_pubsub_subscription.go index d93fbe720ba..260b88e0962 100644 --- a/google/resource_pubsub_subscription.go +++ b/google/resource_pubsub_subscription.go @@ -355,28 +355,28 @@ func resourcePubsubSubscriptionRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("name", flattenPubsubSubscriptionName(res["name"], d)); err != nil { + if err := d.Set("name", flattenPubsubSubscriptionName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("topic", flattenPubsubSubscriptionTopic(res["topic"], d)); err != nil { + if err := d.Set("topic", flattenPubsubSubscriptionTopic(res["topic"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("labels", flattenPubsubSubscriptionLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenPubsubSubscriptionLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("push_config", flattenPubsubSubscriptionPushConfig(res["pushConfig"], d)); err != nil { + if err := d.Set("push_config", flattenPubsubSubscriptionPushConfig(res["pushConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("ack_deadline_seconds", flattenPubsubSubscriptionAckDeadlineSeconds(res["ackDeadlineSeconds"], d)); err != nil { + if err := d.Set("ack_deadline_seconds", flattenPubsubSubscriptionAckDeadlineSeconds(res["ackDeadlineSeconds"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("message_retention_duration", flattenPubsubSubscriptionMessageRetentionDuration(res["messageRetentionDuration"], d)); err != nil { + if err := d.Set("message_retention_duration", flattenPubsubSubscriptionMessageRetentionDuration(res["messageRetentionDuration"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("retain_acked_messages", flattenPubsubSubscriptionRetainAckedMessages(res["retainAckedMessages"], d)); err != nil { + if err := d.Set("retain_acked_messages", flattenPubsubSubscriptionRetainAckedMessages(res["retainAckedMessages"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } - if err := d.Set("expiration_policy", flattenPubsubSubscriptionExpirationPolicy(res["expirationPolicy"], d)); err != nil { + if err := d.Set("expiration_policy", flattenPubsubSubscriptionExpirationPolicy(res["expirationPolicy"], d, config)); err != nil { return fmt.Errorf("Error reading Subscription: %s", err) } @@ -525,25 +525,25 @@ func resourcePubsubSubscriptionImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenPubsubSubscriptionName(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenPubsubSubscriptionTopic(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionTopic(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenPubsubSubscriptionLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionPushConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionPushConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -553,14 +553,14 @@ func flattenPubsubSubscriptionPushConfig(v interface{}, d *schema.ResourceData) } transformed := make(map[string]interface{}) transformed["oidc_token"] = - flattenPubsubSubscriptionPushConfigOidcToken(original["oidcToken"], d) + flattenPubsubSubscriptionPushConfigOidcToken(original["oidcToken"], d, config) transformed["push_endpoint"] = - flattenPubsubSubscriptionPushConfigPushEndpoint(original["pushEndpoint"], d) + flattenPubsubSubscriptionPushConfigPushEndpoint(original["pushEndpoint"], d, config) transformed["attributes"] = - flattenPubsubSubscriptionPushConfigAttributes(original["attributes"], d) + flattenPubsubSubscriptionPushConfigAttributes(original["attributes"], d, config) return []interface{}{transformed} } -func flattenPubsubSubscriptionPushConfigOidcToken(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionPushConfigOidcToken(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -570,28 +570,28 @@ func flattenPubsubSubscriptionPushConfigOidcToken(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["service_account_email"] = - flattenPubsubSubscriptionPushConfigOidcTokenServiceAccountEmail(original["serviceAccountEmail"], d) + flattenPubsubSubscriptionPushConfigOidcTokenServiceAccountEmail(original["serviceAccountEmail"], d, config) transformed["audience"] = - flattenPubsubSubscriptionPushConfigOidcTokenAudience(original["audience"], d) + flattenPubsubSubscriptionPushConfigOidcTokenAudience(original["audience"], d, config) return []interface{}{transformed} } -func flattenPubsubSubscriptionPushConfigOidcTokenServiceAccountEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionPushConfigOidcTokenServiceAccountEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionPushConfigOidcTokenAudience(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionPushConfigOidcTokenAudience(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionPushConfigPushEndpoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionPushConfigPushEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionPushConfigAttributes(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionPushConfigAttributes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionAckDeadlineSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionAckDeadlineSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -601,25 +601,25 @@ func flattenPubsubSubscriptionAckDeadlineSeconds(v interface{}, d *schema.Resour return v } -func flattenPubsubSubscriptionMessageRetentionDuration(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionMessageRetentionDuration(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionRetainAckedMessages(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionRetainAckedMessages(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubSubscriptionExpirationPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionExpirationPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } original := v.(map[string]interface{}) transformed := make(map[string]interface{}) transformed["ttl"] = - flattenPubsubSubscriptionExpirationPolicyTtl(original["ttl"], d) + flattenPubsubSubscriptionExpirationPolicyTtl(original["ttl"], d, config) return []interface{}{transformed} } -func flattenPubsubSubscriptionExpirationPolicyTtl(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubSubscriptionExpirationPolicyTtl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_pubsub_topic.go b/google/resource_pubsub_topic.go index 1808e1ff02e..0150d3c2b3a 100644 --- a/google/resource_pubsub_topic.go +++ b/google/resource_pubsub_topic.go @@ -184,16 +184,16 @@ func resourcePubsubTopicRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Topic: %s", err) } - if err := d.Set("name", flattenPubsubTopicName(res["name"], d)); err != nil { + if err := d.Set("name", flattenPubsubTopicName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Topic: %s", err) } - if err := d.Set("kms_key_name", flattenPubsubTopicKmsKeyName(res["kmsKeyName"], d)); err != nil { + if err := d.Set("kms_key_name", flattenPubsubTopicKmsKeyName(res["kmsKeyName"], d, config)); err != nil { return fmt.Errorf("Error reading Topic: %s", err) } - if err := d.Set("labels", flattenPubsubTopicLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenPubsubTopicLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Topic: %s", err) } - if err := d.Set("message_storage_policy", flattenPubsubTopicMessageStoragePolicy(res["messageStoragePolicy"], d)); err != nil { + if err := d.Set("message_storage_policy", flattenPubsubTopicMessageStoragePolicy(res["messageStoragePolicy"], d, config)); err != nil { return fmt.Errorf("Error reading Topic: %s", err) } @@ -302,22 +302,22 @@ func resourcePubsubTopicImport(d *schema.ResourceData, meta interface{}) ([]*sch return []*schema.ResourceData{d}, nil } -func flattenPubsubTopicName(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubTopicName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenPubsubTopicKmsKeyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubTopicKmsKeyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubTopicLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubTopicLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenPubsubTopicMessageStoragePolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubTopicMessageStoragePolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -327,10 +327,10 @@ func flattenPubsubTopicMessageStoragePolicy(v interface{}, d *schema.ResourceDat } transformed := make(map[string]interface{}) transformed["allowed_persistence_regions"] = - flattenPubsubTopicMessageStoragePolicyAllowedPersistenceRegions(original["allowedPersistenceRegions"], d) + flattenPubsubTopicMessageStoragePolicyAllowedPersistenceRegions(original["allowedPersistenceRegions"], d, config) return []interface{}{transformed} } -func flattenPubsubTopicMessageStoragePolicyAllowedPersistenceRegions(v interface{}, d *schema.ResourceData) interface{} { +func flattenPubsubTopicMessageStoragePolicyAllowedPersistenceRegions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_redis_instance.go b/google/resource_redis_instance.go index 96da124defb..09f9dcbb7bc 100644 --- a/google/resource_redis_instance.go +++ b/google/resource_redis_instance.go @@ -323,49 +323,49 @@ func resourceRedisInstanceRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("alternative_location_id", flattenRedisInstanceAlternativeLocationId(res["alternativeLocationId"], d)); err != nil { + if err := d.Set("alternative_location_id", flattenRedisInstanceAlternativeLocationId(res["alternativeLocationId"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("authorized_network", flattenRedisInstanceAuthorizedNetwork(res["authorizedNetwork"], d)); err != nil { + if err := d.Set("authorized_network", flattenRedisInstanceAuthorizedNetwork(res["authorizedNetwork"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("create_time", flattenRedisInstanceCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenRedisInstanceCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("current_location_id", flattenRedisInstanceCurrentLocationId(res["currentLocationId"], d)); err != nil { + if err := d.Set("current_location_id", flattenRedisInstanceCurrentLocationId(res["currentLocationId"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("display_name", flattenRedisInstanceDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenRedisInstanceDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("host", flattenRedisInstanceHost(res["host"], d)); err != nil { + if err := d.Set("host", flattenRedisInstanceHost(res["host"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("labels", flattenRedisInstanceLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenRedisInstanceLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("redis_configs", flattenRedisInstanceRedisConfigs(res["redisConfigs"], d)); err != nil { + if err := d.Set("redis_configs", flattenRedisInstanceRedisConfigs(res["redisConfigs"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("location_id", flattenRedisInstanceLocationId(res["locationId"], d)); err != nil { + if err := d.Set("location_id", flattenRedisInstanceLocationId(res["locationId"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("name", flattenRedisInstanceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenRedisInstanceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("memory_size_gb", flattenRedisInstanceMemorySizeGb(res["memorySizeGb"], d)); err != nil { + if err := d.Set("memory_size_gb", flattenRedisInstanceMemorySizeGb(res["memorySizeGb"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("port", flattenRedisInstancePort(res["port"], d)); err != nil { + if err := d.Set("port", flattenRedisInstancePort(res["port"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("redis_version", flattenRedisInstanceRedisVersion(res["redisVersion"], d)); err != nil { + if err := d.Set("redis_version", flattenRedisInstanceRedisVersion(res["redisVersion"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("reserved_ip_range", flattenRedisInstanceReservedIpRange(res["reservedIpRange"], d)); err != nil { + if err := d.Set("reserved_ip_range", flattenRedisInstanceReservedIpRange(res["reservedIpRange"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("tier", flattenRedisInstanceTier(res["tier"], d)); err != nil { + if err := d.Set("tier", flattenRedisInstanceTier(res["tier"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } @@ -511,50 +511,50 @@ func resourceRedisInstanceImport(d *schema.ResourceData, meta interface{}) ([]*s return []*schema.ResourceData{d}, nil } -func flattenRedisInstanceAlternativeLocationId(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceAlternativeLocationId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceAuthorizedNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceAuthorizedNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceCurrentLocationId(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceCurrentLocationId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceRedisConfigs(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceRedisConfigs(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceLocationId(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceLocationId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenRedisInstanceMemorySizeGb(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceMemorySizeGb(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -564,7 +564,7 @@ func flattenRedisInstanceMemorySizeGb(v interface{}, d *schema.ResourceData) int return v } -func flattenRedisInstancePort(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstancePort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -574,15 +574,15 @@ func flattenRedisInstancePort(v interface{}, d *schema.ResourceData) interface{} return v } -func flattenRedisInstanceRedisVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceRedisVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceReservedIpRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceReservedIpRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenRedisInstanceTier(v interface{}, d *schema.ResourceData) interface{} { +func flattenRedisInstanceTier(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_resource_manager_lien.go b/google/resource_resource_manager_lien.go index c5707440706..b745b043173 100644 --- a/google/resource_resource_manager_lien.go +++ b/google/resource_resource_manager_lien.go @@ -148,8 +148,8 @@ func resourceResourceManagerLienCreate(d *schema.ResourceData, meta interface{}) // us to know the server-side generated name of the object we're // trying to fetch, and the only way to know that is to capture // it here. The following two lines do that. - d.SetId(flattenResourceManagerLienName(res["name"], d).(string)) - d.Set("name", flattenResourceManagerLienName(res["name"], d)) + d.SetId(flattenResourceManagerLienName(res["name"], d, config).(string)) + d.Set("name", flattenResourceManagerLienName(res["name"], d, config)) return resourceResourceManagerLienRead(d, meta) } @@ -191,22 +191,22 @@ func resourceResourceManagerLienRead(d *schema.ResourceData, meta interface{}) e return nil } - if err := d.Set("name", flattenResourceManagerLienName(res["name"], d)); err != nil { + if err := d.Set("name", flattenResourceManagerLienName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Lien: %s", err) } - if err := d.Set("reason", flattenResourceManagerLienReason(res["reason"], d)); err != nil { + if err := d.Set("reason", flattenResourceManagerLienReason(res["reason"], d, config)); err != nil { return fmt.Errorf("Error reading Lien: %s", err) } - if err := d.Set("origin", flattenResourceManagerLienOrigin(res["origin"], d)); err != nil { + if err := d.Set("origin", flattenResourceManagerLienOrigin(res["origin"], d, config)); err != nil { return fmt.Errorf("Error reading Lien: %s", err) } - if err := d.Set("create_time", flattenResourceManagerLienCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenResourceManagerLienCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading Lien: %s", err) } - if err := d.Set("parent", flattenResourceManagerLienParent(res["parent"], d)); err != nil { + if err := d.Set("parent", flattenResourceManagerLienParent(res["parent"], d, config)); err != nil { return fmt.Errorf("Error reading Lien: %s", err) } - if err := d.Set("restrictions", flattenResourceManagerLienRestrictions(res["restrictions"], d)); err != nil { + if err := d.Set("restrictions", flattenResourceManagerLienRestrictions(res["restrictions"], d, config)); err != nil { return fmt.Errorf("Error reading Lien: %s", err) } @@ -265,30 +265,30 @@ func resourceResourceManagerLienImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenResourceManagerLienName(v interface{}, d *schema.ResourceData) interface{} { +func flattenResourceManagerLienName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenResourceManagerLienReason(v interface{}, d *schema.ResourceData) interface{} { +func flattenResourceManagerLienReason(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenResourceManagerLienOrigin(v interface{}, d *schema.ResourceData) interface{} { +func flattenResourceManagerLienOrigin(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenResourceManagerLienCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenResourceManagerLienCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenResourceManagerLienParent(v interface{}, d *schema.ResourceData) interface{} { +func flattenResourceManagerLienParent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenResourceManagerLienRestrictions(v interface{}, d *schema.ResourceData) interface{} { +func flattenResourceManagerLienRestrictions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } @@ -350,7 +350,7 @@ func resourceResourceManagerLienFindNestedObjectInList(d *schema.ResourceData, m return -1, nil, err } - itemName := flattenResourceManagerLienName(item["name"], d) + itemName := flattenResourceManagerLienName(item["name"], d, meta.(*Config)) if !reflect.DeepEqual(itemName, expectedName) { log.Printf("[DEBUG] Skipping item with name= %#v, looking for %#v)", itemName, expectedName) continue diff --git a/google/resource_secret_manager_secret_test.go b/google/resource_secret_manager_secret_test.go new file mode 100644 index 00000000000..71664db3c87 --- /dev/null +++ b/google/resource_secret_manager_secret_test.go @@ -0,0 +1 @@ +package google diff --git a/google/resource_secret_manager_secret_version_test.go b/google/resource_secret_manager_secret_version_test.go new file mode 100644 index 00000000000..71664db3c87 --- /dev/null +++ b/google/resource_secret_manager_secret_version_test.go @@ -0,0 +1 @@ +package google diff --git a/google/resource_security_center_source.go b/google/resource_security_center_source.go index c01d9acc86a..4c2dd495c5b 100644 --- a/google/resource_security_center_source.go +++ b/google/resource_security_center_source.go @@ -137,13 +137,13 @@ func resourceSecurityCenterSourceRead(d *schema.ResourceData, meta interface{}) return handleNotFoundError(err, d, fmt.Sprintf("SecurityCenterSource %q", d.Id())) } - if err := d.Set("name", flattenSecurityCenterSourceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenSecurityCenterSourceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Source: %s", err) } - if err := d.Set("description", flattenSecurityCenterSourceDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenSecurityCenterSourceDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Source: %s", err) } - if err := d.Set("display_name", flattenSecurityCenterSourceDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenSecurityCenterSourceDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Source: %s", err) } @@ -227,15 +227,15 @@ func resourceSecurityCenterSourceImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenSecurityCenterSourceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityCenterSourceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityCenterSourceDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityCenterSourceDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityCenterSourceDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityCenterSourceDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_source_repo_repository.go b/google/resource_source_repo_repository.go index 32921f5549c..9525a5794bd 100644 --- a/google/resource_source_repo_repository.go +++ b/google/resource_source_repo_repository.go @@ -173,16 +173,16 @@ func resourceSourceRepoRepositoryRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading Repository: %s", err) } - if err := d.Set("name", flattenSourceRepoRepositoryName(res["name"], d)); err != nil { + if err := d.Set("name", flattenSourceRepoRepositoryName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Repository: %s", err) } - if err := d.Set("url", flattenSourceRepoRepositoryUrl(res["url"], d)); err != nil { + if err := d.Set("url", flattenSourceRepoRepositoryUrl(res["url"], d, config)); err != nil { return fmt.Errorf("Error reading Repository: %s", err) } - if err := d.Set("size", flattenSourceRepoRepositorySize(res["size"], d)); err != nil { + if err := d.Set("size", flattenSourceRepoRepositorySize(res["size"], d, config)); err != nil { return fmt.Errorf("Error reading Repository: %s", err) } - if err := d.Set("pubsub_configs", flattenSourceRepoRepositoryPubsubConfigs(res["pubsubConfigs"], d)); err != nil { + if err := d.Set("pubsub_configs", flattenSourceRepoRepositoryPubsubConfigs(res["pubsubConfigs"], d, config)); err != nil { return fmt.Errorf("Error reading Repository: %s", err) } @@ -280,7 +280,7 @@ func resourceSourceRepoRepositoryImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenSourceRepoRepositoryName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSourceRepoRepositoryName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -290,11 +290,11 @@ func flattenSourceRepoRepositoryName(v interface{}, d *schema.ResourceData) inte return parts[3] } -func flattenSourceRepoRepositoryUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenSourceRepoRepositoryUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSourceRepoRepositorySize(v interface{}, d *schema.ResourceData) interface{} { +func flattenSourceRepoRepositorySize(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -304,7 +304,7 @@ func flattenSourceRepoRepositorySize(v interface{}, d *schema.ResourceData) inte return v } -func flattenSourceRepoRepositoryPubsubConfigs(v interface{}, d *schema.ResourceData) interface{} { +func flattenSourceRepoRepositoryPubsubConfigs(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -314,17 +314,17 @@ func flattenSourceRepoRepositoryPubsubConfigs(v interface{}, d *schema.ResourceD original := raw.(map[string]interface{}) transformed = append(transformed, map[string]interface{}{ "topic": k, - "message_format": flattenSourceRepoRepositoryPubsubConfigsMessageFormat(original["messageFormat"], d), - "service_account_email": flattenSourceRepoRepositoryPubsubConfigsServiceAccountEmail(original["serviceAccountEmail"], d), + "message_format": flattenSourceRepoRepositoryPubsubConfigsMessageFormat(original["messageFormat"], d, config), + "service_account_email": flattenSourceRepoRepositoryPubsubConfigsServiceAccountEmail(original["serviceAccountEmail"], d, config), }) } return transformed } -func flattenSourceRepoRepositoryPubsubConfigsMessageFormat(v interface{}, d *schema.ResourceData) interface{} { +func flattenSourceRepoRepositoryPubsubConfigsMessageFormat(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSourceRepoRepositoryPubsubConfigsServiceAccountEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenSourceRepoRepositoryPubsubConfigsServiceAccountEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_spanner_database.go b/google/resource_spanner_database.go index d7ac87be4a9..15518a29c3f 100644 --- a/google/resource_spanner_database.go +++ b/google/resource_spanner_database.go @@ -179,13 +179,13 @@ func resourceSpannerDatabaseRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("name", flattenSpannerDatabaseName(res["name"], d)); err != nil { + if err := d.Set("name", flattenSpannerDatabaseName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("state", flattenSpannerDatabaseState(res["state"], d)); err != nil { + if err := d.Set("state", flattenSpannerDatabaseState(res["state"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("instance", flattenSpannerDatabaseInstance(res["instance"], d)); err != nil { + if err := d.Set("instance", flattenSpannerDatabaseInstance(res["instance"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } @@ -238,15 +238,15 @@ func resourceSpannerDatabaseImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenSpannerDatabaseName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerDatabaseName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSpannerDatabaseState(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerDatabaseState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSpannerDatabaseInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerDatabaseInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google/resource_spanner_instance.go b/google/resource_spanner_instance.go index 2cbcba78463..af8ed5b101d 100644 --- a/google/resource_spanner_instance.go +++ b/google/resource_spanner_instance.go @@ -218,22 +218,22 @@ func resourceSpannerInstanceRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("name", flattenSpannerInstanceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenSpannerInstanceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("config", flattenSpannerInstanceConfig(res["config"], d)); err != nil { + if err := d.Set("config", flattenSpannerInstanceConfig(res["config"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("display_name", flattenSpannerInstanceDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenSpannerInstanceDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("num_nodes", flattenSpannerInstanceNumNodes(res["nodeCount"], d)); err != nil { + if err := d.Set("num_nodes", flattenSpannerInstanceNumNodes(res["nodeCount"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("labels", flattenSpannerInstanceLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenSpannerInstanceLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("state", flattenSpannerInstanceState(res["state"], d)); err != nil { + if err := d.Set("state", flattenSpannerInstanceState(res["state"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } @@ -347,22 +347,22 @@ func resourceSpannerInstanceImport(d *schema.ResourceData, meta interface{}) ([] return []*schema.ResourceData{d}, nil } -func flattenSpannerInstanceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerInstanceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSpannerInstanceConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerInstanceConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenSpannerInstanceDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerInstanceDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSpannerInstanceNumNodes(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerInstanceNumNodes(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -372,11 +372,11 @@ func flattenSpannerInstanceNumNodes(v interface{}, d *schema.ResourceData) inter return v } -func flattenSpannerInstanceLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSpannerInstanceState(v interface{}, d *schema.ResourceData) interface{} { +func flattenSpannerInstanceState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_sql_database.go b/google/resource_sql_database.go index 5d81d520997..70623c2dba7 100644 --- a/google/resource_sql_database.go +++ b/google/resource_sql_database.go @@ -183,16 +183,16 @@ func resourceSQLDatabaseRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("charset", flattenSQLDatabaseCharset(res["charset"], d)); err != nil { + if err := d.Set("charset", flattenSQLDatabaseCharset(res["charset"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("collation", flattenSQLDatabaseCollation(res["collation"], d)); err != nil { + if err := d.Set("collation", flattenSQLDatabaseCollation(res["collation"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("name", flattenSQLDatabaseName(res["name"], d)); err != nil { + if err := d.Set("name", flattenSQLDatabaseName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } - if err := d.Set("instance", flattenSQLDatabaseInstance(res["instance"], d)); err != nil { + if err := d.Set("instance", flattenSQLDatabaseInstance(res["instance"], d, config)); err != nil { return fmt.Errorf("Error reading Database: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -328,19 +328,19 @@ func resourceSQLDatabaseImport(d *schema.ResourceData, meta interface{}) ([]*sch return []*schema.ResourceData{d}, nil } -func flattenSQLDatabaseCharset(v interface{}, d *schema.ResourceData) interface{} { +func flattenSQLDatabaseCharset(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSQLDatabaseCollation(v interface{}, d *schema.ResourceData) interface{} { +func flattenSQLDatabaseCollation(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSQLDatabaseName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSQLDatabaseName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSQLDatabaseInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenSQLDatabaseInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_storage_bucket_access_control.go b/google/resource_storage_bucket_access_control.go index 55d2c59ac0f..e88569ae0e5 100644 --- a/google/resource_storage_bucket_access_control.go +++ b/google/resource_storage_bucket_access_control.go @@ -148,19 +148,19 @@ func resourceStorageBucketAccessControlRead(d *schema.ResourceData, meta interfa return handleNotFoundError(err, d, fmt.Sprintf("StorageBucketAccessControl %q", d.Id())) } - if err := d.Set("bucket", flattenStorageBucketAccessControlBucket(res["bucket"], d)); err != nil { + if err := d.Set("bucket", flattenStorageBucketAccessControlBucket(res["bucket"], d, config)); err != nil { return fmt.Errorf("Error reading BucketAccessControl: %s", err) } - if err := d.Set("domain", flattenStorageBucketAccessControlDomain(res["domain"], d)); err != nil { + if err := d.Set("domain", flattenStorageBucketAccessControlDomain(res["domain"], d, config)); err != nil { return fmt.Errorf("Error reading BucketAccessControl: %s", err) } - if err := d.Set("email", flattenStorageBucketAccessControlEmail(res["email"], d)); err != nil { + if err := d.Set("email", flattenStorageBucketAccessControlEmail(res["email"], d, config)); err != nil { return fmt.Errorf("Error reading BucketAccessControl: %s", err) } - if err := d.Set("entity", flattenStorageBucketAccessControlEntity(res["entity"], d)); err != nil { + if err := d.Set("entity", flattenStorageBucketAccessControlEntity(res["entity"], d, config)); err != nil { return fmt.Errorf("Error reading BucketAccessControl: %s", err) } - if err := d.Set("role", flattenStorageBucketAccessControlRole(res["role"], d)); err != nil { + if err := d.Set("role", flattenStorageBucketAccessControlRole(res["role"], d, config)); err != nil { return fmt.Errorf("Error reading BucketAccessControl: %s", err) } @@ -243,26 +243,26 @@ func resourceStorageBucketAccessControlImport(d *schema.ResourceData, meta inter return []*schema.ResourceData{d}, nil } -func flattenStorageBucketAccessControlBucket(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageBucketAccessControlBucket(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenStorageBucketAccessControlDomain(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageBucketAccessControlDomain(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageBucketAccessControlEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageBucketAccessControlEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageBucketAccessControlEntity(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageBucketAccessControlEntity(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageBucketAccessControlRole(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageBucketAccessControlRole(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_storage_default_object_access_control.go b/google/resource_storage_default_object_access_control.go index 75812b24411..241285fda06 100644 --- a/google/resource_storage_default_object_access_control.go +++ b/google/resource_storage_default_object_access_control.go @@ -183,28 +183,28 @@ func resourceStorageDefaultObjectAccessControlRead(d *schema.ResourceData, meta return handleNotFoundError(err, d, fmt.Sprintf("StorageDefaultObjectAccessControl %q", d.Id())) } - if err := d.Set("domain", flattenStorageDefaultObjectAccessControlDomain(res["domain"], d)); err != nil { + if err := d.Set("domain", flattenStorageDefaultObjectAccessControlDomain(res["domain"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("email", flattenStorageDefaultObjectAccessControlEmail(res["email"], d)); err != nil { + if err := d.Set("email", flattenStorageDefaultObjectAccessControlEmail(res["email"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("entity", flattenStorageDefaultObjectAccessControlEntity(res["entity"], d)); err != nil { + if err := d.Set("entity", flattenStorageDefaultObjectAccessControlEntity(res["entity"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("entity_id", flattenStorageDefaultObjectAccessControlEntityId(res["entityId"], d)); err != nil { + if err := d.Set("entity_id", flattenStorageDefaultObjectAccessControlEntityId(res["entityId"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("generation", flattenStorageDefaultObjectAccessControlGeneration(res["generation"], d)); err != nil { + if err := d.Set("generation", flattenStorageDefaultObjectAccessControlGeneration(res["generation"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("object", flattenStorageDefaultObjectAccessControlObject(res["object"], d)); err != nil { + if err := d.Set("object", flattenStorageDefaultObjectAccessControlObject(res["object"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("project_team", flattenStorageDefaultObjectAccessControlProjectTeam(res["projectTeam"], d)); err != nil { + if err := d.Set("project_team", flattenStorageDefaultObjectAccessControlProjectTeam(res["projectTeam"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } - if err := d.Set("role", flattenStorageDefaultObjectAccessControlRole(res["role"], d)); err != nil { + if err := d.Set("role", flattenStorageDefaultObjectAccessControlRole(res["role"], d, config)); err != nil { return fmt.Errorf("Error reading DefaultObjectAccessControl: %s", err) } @@ -293,23 +293,23 @@ func resourceStorageDefaultObjectAccessControlImport(d *schema.ResourceData, met return []*schema.ResourceData{d}, nil } -func flattenStorageDefaultObjectAccessControlDomain(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlDomain(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlEntity(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlEntity(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlEntityId(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlEntityId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -319,11 +319,11 @@ func flattenStorageDefaultObjectAccessControlGeneration(v interface{}, d *schema return v } -func flattenStorageDefaultObjectAccessControlObject(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlObject(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlProjectTeam(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlProjectTeam(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -333,20 +333,20 @@ func flattenStorageDefaultObjectAccessControlProjectTeam(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["project_number"] = - flattenStorageDefaultObjectAccessControlProjectTeamProjectNumber(original["projectNumber"], d) + flattenStorageDefaultObjectAccessControlProjectTeamProjectNumber(original["projectNumber"], d, config) transformed["team"] = - flattenStorageDefaultObjectAccessControlProjectTeamTeam(original["team"], d) + flattenStorageDefaultObjectAccessControlProjectTeamTeam(original["team"], d, config) return []interface{}{transformed} } -func flattenStorageDefaultObjectAccessControlProjectTeamProjectNumber(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlProjectTeamProjectNumber(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlProjectTeamTeam(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlProjectTeamTeam(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageDefaultObjectAccessControlRole(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageDefaultObjectAccessControlRole(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_storage_object_access_control.go b/google/resource_storage_object_access_control.go index 5045ffae97a..30b5662fb37 100644 --- a/google/resource_storage_object_access_control.go +++ b/google/resource_storage_object_access_control.go @@ -183,31 +183,31 @@ func resourceStorageObjectAccessControlRead(d *schema.ResourceData, meta interfa return handleNotFoundError(err, d, fmt.Sprintf("StorageObjectAccessControl %q", d.Id())) } - if err := d.Set("bucket", flattenStorageObjectAccessControlBucket(res["bucket"], d)); err != nil { + if err := d.Set("bucket", flattenStorageObjectAccessControlBucket(res["bucket"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("domain", flattenStorageObjectAccessControlDomain(res["domain"], d)); err != nil { + if err := d.Set("domain", flattenStorageObjectAccessControlDomain(res["domain"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("email", flattenStorageObjectAccessControlEmail(res["email"], d)); err != nil { + if err := d.Set("email", flattenStorageObjectAccessControlEmail(res["email"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("entity", flattenStorageObjectAccessControlEntity(res["entity"], d)); err != nil { + if err := d.Set("entity", flattenStorageObjectAccessControlEntity(res["entity"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("entity_id", flattenStorageObjectAccessControlEntityId(res["entityId"], d)); err != nil { + if err := d.Set("entity_id", flattenStorageObjectAccessControlEntityId(res["entityId"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("generation", flattenStorageObjectAccessControlGeneration(res["generation"], d)); err != nil { + if err := d.Set("generation", flattenStorageObjectAccessControlGeneration(res["generation"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("object", flattenStorageObjectAccessControlObject(res["object"], d)); err != nil { + if err := d.Set("object", flattenStorageObjectAccessControlObject(res["object"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("project_team", flattenStorageObjectAccessControlProjectTeam(res["projectTeam"], d)); err != nil { + if err := d.Set("project_team", flattenStorageObjectAccessControlProjectTeam(res["projectTeam"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } - if err := d.Set("role", flattenStorageObjectAccessControlRole(res["role"], d)); err != nil { + if err := d.Set("role", flattenStorageObjectAccessControlRole(res["role"], d, config)); err != nil { return fmt.Errorf("Error reading ObjectAccessControl: %s", err) } @@ -296,30 +296,30 @@ func resourceStorageObjectAccessControlImport(d *schema.ResourceData, meta inter return []*schema.ResourceData{d}, nil } -func flattenStorageObjectAccessControlBucket(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlBucket(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenStorageObjectAccessControlDomain(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlDomain(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlEmail(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlEmail(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlEntity(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlEntity(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlEntityId(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlEntityId(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlGeneration(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlGeneration(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -329,11 +329,11 @@ func flattenStorageObjectAccessControlGeneration(v interface{}, d *schema.Resour return v } -func flattenStorageObjectAccessControlObject(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlObject(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlProjectTeam(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlProjectTeam(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -343,20 +343,20 @@ func flattenStorageObjectAccessControlProjectTeam(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["project_number"] = - flattenStorageObjectAccessControlProjectTeamProjectNumber(original["projectNumber"], d) + flattenStorageObjectAccessControlProjectTeamProjectNumber(original["projectNumber"], d, config) transformed["team"] = - flattenStorageObjectAccessControlProjectTeamTeam(original["team"], d) + flattenStorageObjectAccessControlProjectTeamTeam(original["team"], d, config) return []interface{}{transformed} } -func flattenStorageObjectAccessControlProjectTeamProjectNumber(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlProjectTeamProjectNumber(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlProjectTeamTeam(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlProjectTeamTeam(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenStorageObjectAccessControlRole(v interface{}, d *schema.ResourceData) interface{} { +func flattenStorageObjectAccessControlRole(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google/resource_tpu_node.go b/google/resource_tpu_node.go index 69dc8247ba9..824a22c4845 100644 --- a/google/resource_tpu_node.go +++ b/google/resource_tpu_node.go @@ -306,34 +306,34 @@ func resourceTPUNodeRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("name", flattenTPUNodeName(res["name"], d)); err != nil { + if err := d.Set("name", flattenTPUNodeName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("description", flattenTPUNodeDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenTPUNodeDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("accelerator_type", flattenTPUNodeAcceleratorType(res["acceleratorType"], d)); err != nil { + if err := d.Set("accelerator_type", flattenTPUNodeAcceleratorType(res["acceleratorType"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("tensorflow_version", flattenTPUNodeTensorflowVersion(res["tensorflowVersion"], d)); err != nil { + if err := d.Set("tensorflow_version", flattenTPUNodeTensorflowVersion(res["tensorflowVersion"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("network", flattenTPUNodeNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenTPUNodeNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("cidr_block", flattenTPUNodeCidrBlock(res["cidrBlock"], d)); err != nil { + if err := d.Set("cidr_block", flattenTPUNodeCidrBlock(res["cidrBlock"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("service_account", flattenTPUNodeServiceAccount(res["serviceAccount"], d)); err != nil { + if err := d.Set("service_account", flattenTPUNodeServiceAccount(res["serviceAccount"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("scheduling_config", flattenTPUNodeSchedulingConfig(res["schedulingConfig"], d)); err != nil { + if err := d.Set("scheduling_config", flattenTPUNodeSchedulingConfig(res["schedulingConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("network_endpoints", flattenTPUNodeNetworkEndpoints(res["networkEndpoints"], d)); err != nil { + if err := d.Set("network_endpoints", flattenTPUNodeNetworkEndpoints(res["networkEndpoints"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } - if err := d.Set("labels", flattenTPUNodeLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenTPUNodeLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Node: %s", err) } @@ -438,38 +438,38 @@ func resourceTPUNodeImport(d *schema.ResourceData, meta interface{}) ([]*schema. return []*schema.ResourceData{d}, nil } -func flattenTPUNodeName(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenTPUNodeDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeAcceleratorType(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeAcceleratorType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeTensorflowVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeTensorflowVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeCidrBlock(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeCidrBlock(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeServiceAccount(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeServiceAccount(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeSchedulingConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeSchedulingConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -479,14 +479,14 @@ func flattenTPUNodeSchedulingConfig(v interface{}, d *schema.ResourceData) inter } transformed := make(map[string]interface{}) transformed["preemptible"] = - flattenTPUNodeSchedulingConfigPreemptible(original["preemptible"], d) + flattenTPUNodeSchedulingConfigPreemptible(original["preemptible"], d, config) return []interface{}{transformed} } -func flattenTPUNodeSchedulingConfigPreemptible(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeSchedulingConfigPreemptible(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeNetworkEndpoints(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeNetworkEndpoints(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -499,17 +499,17 @@ func flattenTPUNodeNetworkEndpoints(v interface{}, d *schema.ResourceData) inter continue } transformed = append(transformed, map[string]interface{}{ - "ip_address": flattenTPUNodeNetworkEndpointsIpAddress(original["ipAddress"], d), - "port": flattenTPUNodeNetworkEndpointsPort(original["port"], d), + "ip_address": flattenTPUNodeNetworkEndpointsIpAddress(original["ipAddress"], d, config), + "port": flattenTPUNodeNetworkEndpointsPort(original["port"], d, config), }) } return transformed } -func flattenTPUNodeNetworkEndpointsIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeNetworkEndpointsIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenTPUNodeNetworkEndpointsPort(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeNetworkEndpointsPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { // Handles the string fixed64 format if strVal, ok := v.(string); ok { if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { @@ -519,7 +519,7 @@ func flattenTPUNodeNetworkEndpointsPort(v interface{}, d *schema.ResourceData) i return v } -func flattenTPUNodeLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenTPUNodeLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/website/docs/d/datasource_google_secret_manager_secret_version.html.markdown b/website/docs/d/datasource_google_secret_manager_secret_version.html.markdown new file mode 100644 index 00000000000..ca58f2453bb --- /dev/null +++ b/website/docs/d/datasource_google_secret_manager_secret_version.html.markdown @@ -0,0 +1,49 @@ +--- +subcategory: "Cloud Platform" +layout: "google" +page_title: "Google: google_secret_manager_secret_version" +sidebar_current: "docs-google-datasource-secret-manager-secret-version" +description: |- + Get a Secret Manager secret's version. +--- + +# google\_secret\_manager\_secret\_version + +Get a Secret Manager secret's version. For more information see the [official documentation](https://cloud.google.com/secret-manager/docs/) and [API](https://cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets.versions). + +## Example Usage + +```hcl +data "google_secret_manager_secret_version" "basic" { + provider = google-beta + secret = "my-secret" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `project` - (Optional) The project to get the secret version for. If it + is not provided, the provider project is used. + +* `secret` - (Required) The secret to get the secret version for. + +* `version` - (Optional) The version of the secret to get. If it + is not provided, the latest version is retrieved. + + +## Attributes Reference + +The following attributes are exported: + +* `secret_data` - The secret data. No larger than 64KiB. A base64-encoded string. + +* `name` - The resource name of the SecretVersion. Format: + `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}` + +* `create_time` - The time at which the Secret was created. + +* `destroy_time` - The time at which the Secret was destroyed. Only present if state is DESTROYED. + +* `enabled` - True if the current state of the SecretVersion is enabled. \ No newline at end of file diff --git a/website/docs/r/binary_authorization_attestor_iam.html.markdown b/website/docs/r/binary_authorization_attestor_iam.html.markdown index db207a34baa..fb81aa4f2c1 100644 --- a/website/docs/r/binary_authorization_attestor_iam.html.markdown +++ b/website/docs/r/binary_authorization_attestor_iam.html.markdown @@ -46,9 +46,9 @@ data "google_iam_policy" "admin" { } resource "google_binary_authorization_attestor_iam_policy" "editor" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -56,8 +56,8 @@ resource "google_binary_authorization_attestor_iam_policy" "editor" { ```hcl resource "google_binary_authorization_attestor_iam_binding" "editor" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name role = "roles/viewer" members = [ "user:jane@example.com", @@ -69,8 +69,8 @@ resource "google_binary_authorization_attestor_iam_binding" "editor" { ```hcl resource "google_binary_authorization_attestor_iam_member" "editor" { - project = "${google_binary_authorization_attestor.attestor.project}" - attestor = "${google_binary_authorization_attestor.attestor.name}" + project = google_binary_authorization_attestor.attestor.project + attestor = google_binary_authorization_attestor.attestor.name role = "roles/viewer" member = "user:jane@example.com" } diff --git a/website/docs/r/cloud_run_service_iam.html.markdown b/website/docs/r/cloud_run_service_iam.html.markdown index 02283820875..651e7d611ca 100644 --- a/website/docs/r/cloud_run_service_iam.html.markdown +++ b/website/docs/r/cloud_run_service_iam.html.markdown @@ -46,10 +46,10 @@ data "google_iam_policy" "admin" { } resource "google_cloud_run_service_iam_policy" "editor" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -57,9 +57,9 @@ resource "google_cloud_run_service_iam_policy" "editor" { ```hcl resource "google_cloud_run_service_iam_binding" "editor" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name role = "roles/viewer" members = [ "user:jane@example.com", @@ -71,9 +71,9 @@ resource "google_cloud_run_service_iam_binding" "editor" { ```hcl resource "google_cloud_run_service_iam_member" "editor" { - location = "${google_cloud_run_service.default.location}" - project = "${google_cloud_run_service.default.project}" - service = "${google_cloud_run_service.default.name}" + location = google_cloud_run_service.default.location + project = google_cloud_run_service.default.project + service = google_cloud_run_service.default.name role = "roles/viewer" member = "user:jane@example.com" } diff --git a/website/docs/r/cloudfunctions_cloud_function_iam.html.markdown b/website/docs/r/cloudfunctions_cloud_function_iam.html.markdown index 782c7fa544a..5b614db60e0 100644 --- a/website/docs/r/cloudfunctions_cloud_function_iam.html.markdown +++ b/website/docs/r/cloudfunctions_cloud_function_iam.html.markdown @@ -46,10 +46,10 @@ data "google_iam_policy" "admin" { } resource "google_cloudfunctions_function_iam_policy" "editor" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -57,9 +57,9 @@ resource "google_cloudfunctions_function_iam_policy" "editor" { ```hcl resource "google_cloudfunctions_function_iam_binding" "editor" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name role = "roles/viewer" members = [ "user:jane@example.com", @@ -71,9 +71,9 @@ resource "google_cloudfunctions_function_iam_binding" "editor" { ```hcl resource "google_cloudfunctions_function_iam_member" "editor" { - project = "${google_cloudfunctions_function.function.project}" - region = "${google_cloudfunctions_function.function.region}" - cloud_function = "${google_cloudfunctions_function.function.name}" + project = google_cloudfunctions_function.function.project + region = google_cloudfunctions_function.function.region + cloud_function = google_cloudfunctions_function.function.name role = "roles/viewer" member = "user:jane@example.com" } diff --git a/website/docs/r/compute_instance_iam.html.markdown b/website/docs/r/compute_instance_iam.html.markdown index dec0c356b50..cfd84414867 100644 --- a/website/docs/r/compute_instance_iam.html.markdown +++ b/website/docs/r/compute_instance_iam.html.markdown @@ -46,10 +46,10 @@ data "google_iam_policy" "admin" { } resource "google_compute_instance_iam_policy" "editor" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -57,9 +57,9 @@ resource "google_compute_instance_iam_policy" "editor" { ```hcl resource "google_compute_instance_iam_binding" "editor" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name role = "roles/compute.osLogin" members = [ "user:jane@example.com", @@ -71,9 +71,9 @@ resource "google_compute_instance_iam_binding" "editor" { ```hcl resource "google_compute_instance_iam_member" "editor" { - project = "${google_compute_instance.default.project}" - zone = "${google_compute_instance.default.zone}" - instance_name = "${google_compute_instance.default.name}" + project = google_compute_instance.default.project + zone = google_compute_instance.default.zone + instance_name = google_compute_instance.default.name role = "roles/compute.osLogin" member = "user:jane@example.com" } diff --git a/website/docs/r/compute_subnetwork_iam.html.markdown b/website/docs/r/compute_subnetwork_iam.html.markdown index 83de671c212..9f6f3ae5393 100644 --- a/website/docs/r/compute_subnetwork_iam.html.markdown +++ b/website/docs/r/compute_subnetwork_iam.html.markdown @@ -46,10 +46,10 @@ data "google_iam_policy" "admin" { } resource "google_compute_subnetwork_iam_policy" "editor" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -57,9 +57,9 @@ resource "google_compute_subnetwork_iam_policy" "editor" { ```hcl resource "google_compute_subnetwork_iam_binding" "editor" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name role = "roles/compute.networkUser" members = [ "user:jane@example.com", @@ -71,9 +71,9 @@ resource "google_compute_subnetwork_iam_binding" "editor" { ```hcl resource "google_compute_subnetwork_iam_member" "editor" { - project = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.project}" - region = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.region}" - subnetwork = "${google_compute_subnetwork.network-with-private-secondary-ip-ranges.name}" + project = google_compute_subnetwork.network-with-private-secondary-ip-ranges.project + region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region + subnetwork = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name role = "roles/compute.networkUser" member = "user:jane@example.com" } diff --git a/website/docs/r/iap_app_engine_service_iam.html.markdown b/website/docs/r/iap_app_engine_service_iam.html.markdown index 1c398313447..811b95d697f 100644 --- a/website/docs/r/iap_app_engine_service_iam.html.markdown +++ b/website/docs/r/iap_app_engine_service_iam.html.markdown @@ -49,7 +49,7 @@ resource "google_iap_app_engine_service_iam_policy" "editor" { project = "${google_app_engine_standard_app_version.version.project}" app_id = "${google_app_engine_standard_app_version.version.project}" service = "${google_app_engine_standard_app_version.version.service}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + policy_data = data.google_iam_policy.admin.policy_data } ``` diff --git a/website/docs/r/iap_app_engine_version_iam.html.markdown b/website/docs/r/iap_app_engine_version_iam.html.markdown index eb6f1d4f4be..9a6ceb68dbe 100644 --- a/website/docs/r/iap_app_engine_version_iam.html.markdown +++ b/website/docs/r/iap_app_engine_version_iam.html.markdown @@ -50,7 +50,7 @@ resource "google_iap_app_engine_version_iam_policy" "editor" { app_id = "${google_app_engine_standard_app_version.version.project}" service = "${google_app_engine_standard_app_version.version.service}" version_id = "${google_app_engine_standard_app_version.version.version_id}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + policy_data = data.google_iam_policy.admin.policy_data } ``` diff --git a/website/docs/r/iap_tunnel_instance_iam.html.markdown b/website/docs/r/iap_tunnel_instance_iam.html.markdown index 9fda481644a..289d062a70b 100644 --- a/website/docs/r/iap_tunnel_instance_iam.html.markdown +++ b/website/docs/r/iap_tunnel_instance_iam.html.markdown @@ -46,10 +46,10 @@ data "google_iam_policy" "admin" { } resource "google_iap_tunnel_instance_iam_policy" "editor" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -57,9 +57,9 @@ resource "google_iap_tunnel_instance_iam_policy" "editor" { ```hcl resource "google_iap_tunnel_instance_iam_binding" "editor" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name role = "roles/iap.tunnelResourceAccessor" members = [ "user:jane@example.com", @@ -71,9 +71,9 @@ resource "google_iap_tunnel_instance_iam_binding" "editor" { ```hcl resource "google_iap_tunnel_instance_iam_member" "editor" { - project = "${google_compute_instance.tunnelvm.project}" - zone = "${google_compute_instance.tunnelvm.zone}" - instance = "${google_compute_instance.tunnelvm.name}" + project = google_compute_instance.tunnelvm.project + zone = google_compute_instance.tunnelvm.zone + instance = google_compute_instance.tunnelvm.name role = "roles/iap.tunnelResourceAccessor" member = "user:jane@example.com" } diff --git a/website/docs/r/iap_web_backend_service_iam.html.markdown b/website/docs/r/iap_web_backend_service_iam.html.markdown index e9552538036..4c0134d1e64 100644 --- a/website/docs/r/iap_web_backend_service_iam.html.markdown +++ b/website/docs/r/iap_web_backend_service_iam.html.markdown @@ -46,9 +46,9 @@ data "google_iam_policy" "admin" { } resource "google_iap_web_backend_service_iam_policy" "editor" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -56,8 +56,8 @@ resource "google_iap_web_backend_service_iam_policy" "editor" { ```hcl resource "google_iap_web_backend_service_iam_binding" "editor" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name role = "roles/iap.httpsResourceAccessor" members = [ "user:jane@example.com", @@ -69,8 +69,8 @@ resource "google_iap_web_backend_service_iam_binding" "editor" { ```hcl resource "google_iap_web_backend_service_iam_member" "editor" { - project = "${google_compute_backend_service.default.project}" - web_backend_service = "${google_compute_backend_service.default.name}" + project = google_compute_backend_service.default.project + web_backend_service = google_compute_backend_service.default.name role = "roles/iap.httpsResourceAccessor" member = "user:jane@example.com" } diff --git a/website/docs/r/iap_web_iam.html.markdown b/website/docs/r/iap_web_iam.html.markdown index 9ccf5c7711c..a10ae50c1e2 100644 --- a/website/docs/r/iap_web_iam.html.markdown +++ b/website/docs/r/iap_web_iam.html.markdown @@ -46,8 +46,8 @@ data "google_iam_policy" "admin" { } resource "google_iap_web_iam_policy" "editor" { - project = "${google_project_service.project_service.project}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_project_service.project_service.project + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -55,7 +55,7 @@ resource "google_iap_web_iam_policy" "editor" { ```hcl resource "google_iap_web_iam_binding" "editor" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "roles/iap.httpsResourceAccessor" members = [ "user:jane@example.com", @@ -67,7 +67,7 @@ resource "google_iap_web_iam_binding" "editor" { ```hcl resource "google_iap_web_iam_member" "editor" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "roles/iap.httpsResourceAccessor" member = "user:jane@example.com" } diff --git a/website/docs/r/iap_web_type_app_engine_iam.html.markdown b/website/docs/r/iap_web_type_app_engine_iam.html.markdown index 80fec55d830..3d9f3c242dc 100644 --- a/website/docs/r/iap_web_type_app_engine_iam.html.markdown +++ b/website/docs/r/iap_web_type_app_engine_iam.html.markdown @@ -46,9 +46,9 @@ data "google_iam_policy" "admin" { } resource "google_iap_web_type_app_engine_iam_policy" "editor" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -56,8 +56,8 @@ resource "google_iap_web_type_app_engine_iam_policy" "editor" { ```hcl resource "google_iap_web_type_app_engine_iam_binding" "editor" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id role = "roles/iap.httpsResourceAccessor" members = [ "user:jane@example.com", @@ -69,8 +69,8 @@ resource "google_iap_web_type_app_engine_iam_binding" "editor" { ```hcl resource "google_iap_web_type_app_engine_iam_member" "editor" { - project = "${google_app_engine_application.app.project}" - app_id = "${google_app_engine_application.app.app_id}" + project = google_app_engine_application.app.project + app_id = google_app_engine_application.app.app_id role = "roles/iap.httpsResourceAccessor" member = "user:jane@example.com" } diff --git a/website/docs/r/iap_web_type_compute_iam.html.markdown b/website/docs/r/iap_web_type_compute_iam.html.markdown index eb1ea3135b4..16b804722a9 100644 --- a/website/docs/r/iap_web_type_compute_iam.html.markdown +++ b/website/docs/r/iap_web_type_compute_iam.html.markdown @@ -46,8 +46,8 @@ data "google_iam_policy" "admin" { } resource "google_iap_web_type_compute_iam_policy" "editor" { - project = "${google_project_service.project_service.project}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_project_service.project_service.project + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -55,7 +55,7 @@ resource "google_iap_web_type_compute_iam_policy" "editor" { ```hcl resource "google_iap_web_type_compute_iam_binding" "editor" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "roles/iap.httpsResourceAccessor" members = [ "user:jane@example.com", @@ -67,7 +67,7 @@ resource "google_iap_web_type_compute_iam_binding" "editor" { ```hcl resource "google_iap_web_type_compute_iam_member" "editor" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "roles/iap.httpsResourceAccessor" member = "user:jane@example.com" } diff --git a/website/docs/r/pubsub_topic_iam.html.markdown b/website/docs/r/pubsub_topic_iam.html.markdown index 4f01964ccfe..3567ae38bb5 100644 --- a/website/docs/r/pubsub_topic_iam.html.markdown +++ b/website/docs/r/pubsub_topic_iam.html.markdown @@ -46,9 +46,9 @@ data "google_iam_policy" "admin" { } resource "google_pubsub_topic_iam_policy" "editor" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -56,8 +56,8 @@ resource "google_pubsub_topic_iam_policy" "editor" { ```hcl resource "google_pubsub_topic_iam_binding" "editor" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name role = "roles/viewer" members = [ "user:jane@example.com", @@ -69,8 +69,8 @@ resource "google_pubsub_topic_iam_binding" "editor" { ```hcl resource "google_pubsub_topic_iam_member" "editor" { - project = "${google_pubsub_topic.example.project}" - topic = "${google_pubsub_topic.example.name}" + project = google_pubsub_topic.example.project + topic = google_pubsub_topic.example.name role = "roles/viewer" member = "user:jane@example.com" } diff --git a/website/docs/r/runtimeconfig_config_iam.html.markdown b/website/docs/r/runtimeconfig_config_iam.html.markdown index 09d82f8a808..5a2ebe69c07 100644 --- a/website/docs/r/runtimeconfig_config_iam.html.markdown +++ b/website/docs/r/runtimeconfig_config_iam.html.markdown @@ -46,9 +46,9 @@ data "google_iam_policy" "admin" { } resource "google_runtimeconfig_config_iam_policy" "editor" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -56,8 +56,8 @@ resource "google_runtimeconfig_config_iam_policy" "editor" { ```hcl resource "google_runtimeconfig_config_iam_binding" "editor" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name role = "roles/viewer" members = [ "user:jane@example.com", @@ -69,8 +69,8 @@ resource "google_runtimeconfig_config_iam_binding" "editor" { ```hcl resource "google_runtimeconfig_config_iam_member" "editor" { - project = "${google_runtimeconfig_config.config.project}" - config = "${google_runtimeconfig_config.config.name}" + project = google_runtimeconfig_config.config.project + config = google_runtimeconfig_config.config.name role = "roles/viewer" member = "user:jane@example.com" } diff --git a/website/docs/r/sourcerepo_repository_iam.html.markdown b/website/docs/r/sourcerepo_repository_iam.html.markdown index daf8d2d35f9..41a2a42df3b 100644 --- a/website/docs/r/sourcerepo_repository_iam.html.markdown +++ b/website/docs/r/sourcerepo_repository_iam.html.markdown @@ -46,9 +46,9 @@ data "google_iam_policy" "admin" { } resource "google_sourcerepo_repository_iam_policy" "editor" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -56,8 +56,8 @@ resource "google_sourcerepo_repository_iam_policy" "editor" { ```hcl resource "google_sourcerepo_repository_iam_binding" "editor" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name role = "roles/viewer" members = [ "user:jane@example.com", @@ -69,8 +69,8 @@ resource "google_sourcerepo_repository_iam_binding" "editor" { ```hcl resource "google_sourcerepo_repository_iam_member" "editor" { - project = "${google_sourcerepo_repository.my-repo.project}" - repository = "${google_sourcerepo_repository.my-repo.name}" + project = google_sourcerepo_repository.my-repo.project + repository = google_sourcerepo_repository.my-repo.name role = "roles/viewer" member = "user:jane@example.com" } diff --git a/website/docs/r/storage_bucket_iam.html.markdown b/website/docs/r/storage_bucket_iam.html.markdown index 9a108c3ac54..1a171b33ba6 100644 --- a/website/docs/r/storage_bucket_iam.html.markdown +++ b/website/docs/r/storage_bucket_iam.html.markdown @@ -46,8 +46,8 @@ data "google_iam_policy" "admin" { } resource "google_storage_bucket_iam_policy" "editor" { - bucket = "${google_storage_bucket.default.name}" - policy_data = "${data.google_iam_policy.admin.policy_data}" + bucket = google_storage_bucket.default.name + policy_data = data.google_iam_policy.admin.policy_data } ``` @@ -55,7 +55,7 @@ resource "google_storage_bucket_iam_policy" "editor" { ```hcl resource "google_storage_bucket_iam_binding" "editor" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "roles/storage.admin" members = [ "user:jane@example.com", @@ -67,7 +67,7 @@ resource "google_storage_bucket_iam_binding" "editor" { ```hcl resource "google_storage_bucket_iam_member" "editor" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "roles/storage.admin" member = "user:jane@example.com" }