From db8f75af08a2a9d6c61d5753f0b5a9d6a390a749 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 31 Jan 2020 22:49:41 +0000 Subject: [PATCH] add `secret_manager` resources and `secret_version` data source (#3007) Signed-off-by: Modular Magician --- .changelog/3007.txt | 3 + google-beta/config.go | 3 + ..._source_monitoring_notification_channel.go | 2 +- ...ta_source_secret_manager_secret_version.go | 121 +++ ...urce_secret_manager_secret_version_test.go | 135 +++ ...y_authorization_attestor_generated_test.go | 24 +- ...functions_cloud_function_generated_test.go | 34 +- .../iam_cloud_run_service_generated_test.go | 34 +- .../iam_compute_instance_generated_test.go | 78 +- .../iam_compute_subnetwork_generated_test.go | 34 +- ...m_iap_app_engine_service_generated_test.go | 6 +- ...m_iap_app_engine_version_generated_test.go | 6 +- .../iam_iap_tunnel_instance_generated_test.go | 78 +- ..._iap_web_backend_service_generated_test.go | 54 +- google-beta/iam_iap_web_generated_test.go | 30 +- ..._iap_web_type_app_engine_generated_test.go | 54 +- ...iam_iap_web_type_compute_generated_test.go | 30 +- .../iam_pubsub_topic_generated_test.go | 24 +- ...am_runtime_config_config_generated_test.go | 24 +- google-beta/iam_secret_manager_secret.go | 181 +++++ ...am_secret_manager_secret_generated_test.go | 263 ++++++ ...m_source_repo_repository_generated_test.go | 24 +- .../iam_storage_bucket_generated_test.go | 30 +- google-beta/provider.go | 21 +- ...rce_access_context_manager_access_level.go | 76 +- ...ce_access_context_manager_access_policy.go | 20 +- ...ccess_context_manager_service_perimeter.go | 40 +- ...p_engine_application_url_dispatch_rules.go | 16 +- .../resource_app_engine_domain_mapping.go | 40 +- .../resource_app_engine_firewall_rule.go | 16 +- ...esource_app_engine_standard_app_version.go | 92 +-- google-beta/resource_big_query_dataset.go | 92 +-- .../resource_bigquery_data_transfer_config.go | 32 +- google-beta/resource_bigtable_app_profile.go | 24 +- google-beta/resource_billing_budget.go | 72 +- .../resource_binary_authorization_attestor.go | 48 +- .../resource_binary_authorization_policy.go | 48 +- google-beta/resource_cloud_build_trigger.go | 172 ++-- .../resource_cloud_run_domain_mapping.go | 96 +-- google-beta/resource_cloud_run_service.go | 232 +++--- google-beta/resource_cloud_scheduler_job.go | 128 +-- google-beta/resource_cloud_tasks_queue.go | 48 +- .../resource_cloudscheduler_job_test.go | 2 +- google-beta/resource_compute_address.go | 48 +- google-beta/resource_compute_autoscaler.go | 76 +- .../resource_compute_backend_bucket.go | 28 +- ...e_compute_backend_bucket_signed_url_key.go | 6 +- .../resource_compute_backend_service.go | 312 +++---- ..._compute_backend_service_signed_url_key.go | 6 +- google-beta/resource_compute_disk.go | 116 +-- ...compute_disk_resource_policy_attachment.go | 6 +- .../resource_compute_external_vpn_gateway.go | 24 +- google-beta/resource_compute_firewall.go | 84 +- .../resource_compute_forwarding_rule.go | 80 +- .../resource_compute_global_address.go | 44 +- ...resource_compute_global_forwarding_rule.go | 64 +- .../resource_compute_ha_vpn_gateway.go | 28 +- google-beta/resource_compute_health_check.go | 184 ++--- .../resource_compute_http_health_check.go | 40 +- .../resource_compute_https_health_check.go | 40 +- google-beta/resource_compute_image.go | 48 +- ...esource_compute_interconnect_attachment.go | 80 +- ...esource_compute_managed_ssl_certificate.go | 36 +- google-beta/resource_compute_network.go | 24 +- .../resource_compute_network_endpoint.go | 18 +- ...resource_compute_network_endpoint_group.go | 32 +- ...e_compute_network_peering_routes_config.go | 14 +- google-beta/resource_compute_node_group.go | 24 +- google-beta/resource_compute_node_template.go | 48 +- .../resource_compute_region_autoscaler.go | 76 +- ...resource_compute_region_backend_service.go | 276 +++---- google-beta/resource_compute_region_disk.go | 92 +-- .../resource_compute_region_health_check.go | 188 ++--- ...resource_compute_region_ssl_certificate.go | 24 +- ...source_compute_region_target_http_proxy.go | 24 +- ...ource_compute_region_target_https_proxy.go | 28 +- .../resource_compute_region_url_map.go | 684 ++++++++-------- google-beta/resource_compute_reservation.go | 76 +- .../resource_compute_resource_policy.go | 84 +- google-beta/resource_compute_route.go | 48 +- google-beta/resource_compute_router.go | 48 +- .../resource_compute_router_bgp_peer.go | 50 +- google-beta/resource_compute_router_nat.go | 70 +- google-beta/resource_compute_snapshot.go | 52 +- .../resource_compute_ssl_certificate.go | 20 +- google-beta/resource_compute_ssl_policy.go | 32 +- google-beta/resource_compute_subnetwork.go | 57 +- .../resource_compute_target_http_proxy.go | 20 +- .../resource_compute_target_https_proxy.go | 32 +- .../resource_compute_target_instance.go | 24 +- .../resource_compute_target_ssl_proxy.go | 32 +- .../resource_compute_target_tcp_proxy.go | 24 +- google-beta/resource_compute_url_map.go | 768 +++++++++--------- google-beta/resource_compute_vpn_gateway.go | 24 +- google-beta/resource_compute_vpn_tunnel.go | 80 +- .../resource_container_analysis_note.go | 16 +- google-beta/resource_data_fusion_instance.go | 72 +- .../resource_dataproc_autoscaling_policy.go | 72 +- .../resource_deployment_manager_deployment.go | 32 +- google-beta/resource_dialogflow_agent.go | 44 +- google-beta/resource_dns_managed_zone.go | 104 +-- google-beta/resource_dns_policy.go | 36 +- google-beta/resource_filestore_instance.go | 52 +- google-beta/resource_firestore_index.go | 24 +- google-beta/resource_healthcare_dataset.go | 8 +- .../resource_healthcare_dicom_store.go | 16 +- google-beta/resource_healthcare_fhir_store.go | 32 +- .../resource_healthcare_hl7_v2_store.go | 28 +- ...y_platform_default_supported_idp_config.go | 16 +- ...e_identity_platform_inbound_saml_config.go | 56 +- ...urce_identity_platform_oauth_idp_config.go | 24 +- .../resource_identity_platform_tenant.go | 20 +- ...orm_tenant_default_supported_idp_config.go | 16 +- ...ity_platform_tenant_inbound_saml_config.go | 56 +- ...entity_platform_tenant_oauth_idp_config.go | 24 +- google-beta/resource_kms_crypto_key.go | 24 +- google-beta/resource_kms_key_ring.go | 4 +- google-beta/resource_logging_metric.go | 100 +-- google-beta/resource_ml_engine_model.go | 32 +- .../resource_monitoring_alert_policy.go | 180 ++-- google-beta/resource_monitoring_group.go | 20 +- ...esource_monitoring_notification_channel.go | 32 +- ...resource_monitoring_uptime_check_config.go | 104 +-- google-beta/resource_pubsub_subscription.go | 56 +- google-beta/resource_pubsub_topic.go | 20 +- google-beta/resource_redis_instance.go | 60 +- google-beta/resource_resource_manager_lien.go | 30 +- google-beta/resource_secret_manager_secret.go | 455 +++++++++++ ...ce_secret_manager_secret_generated_test.go | 94 +++ ...urce_secret_manager_secret_sweeper_test.go | 119 +++ .../resource_secret_manager_secret_test.go | 55 ++ .../resource_secret_manager_secret_version.go | 328 ++++++++ ...t_manager_secret_version_generated_test.go | 96 +++ ...ret_manager_secret_version_sweeper_test.go | 119 +++ ...urce_secret_manager_secret_version_test.go | 97 +++ .../resource_security_center_source.go | 12 +- .../resource_security_scanner_scan_config.go | 76 +- .../resource_source_repo_repository.go | 24 +- google-beta/resource_spanner_database.go | 12 +- google-beta/resource_spanner_instance.go | 24 +- google-beta/resource_sql_database.go | 16 +- .../resource_sql_database_instance_test.go | 1 + .../resource_storage_bucket_access_control.go | 20 +- ...e_storage_default_object_access_control.go | 40 +- .../resource_storage_object_access_control.go | 44 +- google-beta/resource_tpu_node.go | 52 +- google-beta/resource_vpc_access_connector.go | 24 +- ...ecret_manager_secret_version.html.markdown | 49 ++ ...y_authorization_attestor_iam.html.markdown | 14 +- .../r/cloud_run_service_iam.html.markdown | 20 +- ...functions_cloud_function_iam.html.markdown | 20 +- .../docs/r/compute_instance_iam.html.markdown | 40 +- .../r/compute_subnetwork_iam.html.markdown | 20 +- .../iap_app_engine_service_iam.html.markdown | 4 +- .../iap_app_engine_version_iam.html.markdown | 4 +- .../r/iap_tunnel_instance_iam.html.markdown | 40 +- .../iap_web_backend_service_iam.html.markdown | 28 +- website/docs/r/iap_web_iam.html.markdown | 16 +- .../iap_web_type_app_engine_iam.html.markdown | 28 +- .../r/iap_web_type_compute_iam.html.markdown | 16 +- website/docs/r/pubsub_topic_iam.html.markdown | 14 +- .../r/runtimeconfig_config_iam.html.markdown | 14 +- .../r/secret_manager_secret.html.markdown | 160 ++++ .../r/secret_manager_secret_iam.html.markdown | 147 ++++ ...ecret_manager_secret_version.html.markdown | 120 +++ .../r/sourcerepo_repository_iam.html.markdown | 14 +- .../docs/r/storage_bucket_iam.html.markdown | 16 +- 167 files changed, 6746 insertions(+), 4186 deletions(-) create mode 100644 .changelog/3007.txt create mode 100644 google-beta/data_source_secret_manager_secret_version.go create mode 100644 google-beta/data_source_secret_manager_secret_version_test.go create mode 100644 google-beta/iam_secret_manager_secret.go create mode 100644 google-beta/iam_secret_manager_secret_generated_test.go create mode 100644 google-beta/resource_secret_manager_secret.go create mode 100644 google-beta/resource_secret_manager_secret_generated_test.go create mode 100644 google-beta/resource_secret_manager_secret_sweeper_test.go create mode 100644 google-beta/resource_secret_manager_secret_test.go create mode 100644 google-beta/resource_secret_manager_secret_version.go create mode 100644 google-beta/resource_secret_manager_secret_version_generated_test.go create mode 100644 google-beta/resource_secret_manager_secret_version_sweeper_test.go create mode 100644 google-beta/resource_secret_manager_secret_version_test.go create mode 100644 website/docs/d/datasource_google_secret_manager_secret_version.html.markdown create mode 100644 website/docs/r/secret_manager_secret.html.markdown create mode 100644 website/docs/r/secret_manager_secret_iam.html.markdown create mode 100644 website/docs/r/secret_manager_secret_version.html.markdown diff --git a/.changelog/3007.txt b/.changelog/3007.txt new file mode 100644 index 0000000000..a7b352630a --- /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-beta/config.go b/google-beta/config.go index 8ebed131cb..79486e2e82 100644 --- a/google-beta/config.go +++ b/google-beta/config.go @@ -106,6 +106,7 @@ type Config struct { RedisBasePath string ResourceManagerBasePath string RuntimeConfigBasePath string + SecretManagerBasePath string SecurityCenterBasePath string SecurityScannerBasePath string SourceRepoBasePath string @@ -248,6 +249,7 @@ var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/" var RedisDefaultBasePath = "https://redis.googleapis.com/v1beta1/" var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/" var RuntimeConfigDefaultBasePath = "https://runtimeconfig.googleapis.com/v1beta1/" +var SecretManagerDefaultBasePath = "https://secretmanager.googleapis.com/v1beta1/" var SecurityCenterDefaultBasePath = "https://securitycenter.googleapis.com/v1/" var SecurityScannerDefaultBasePath = "https://websecurityscanner.googleapis.com/v1beta/" var SourceRepoDefaultBasePath = "https://sourcerepo.googleapis.com/v1/" @@ -748,6 +750,7 @@ func ConfigureBasePaths(c *Config) { c.RedisBasePath = RedisDefaultBasePath c.ResourceManagerBasePath = ResourceManagerDefaultBasePath c.RuntimeConfigBasePath = RuntimeConfigDefaultBasePath + c.SecretManagerBasePath = SecretManagerDefaultBasePath c.SecurityCenterBasePath = SecurityCenterDefaultBasePath c.SecurityScannerBasePath = SecurityScannerDefaultBasePath c.SourceRepoBasePath = SourceRepoDefaultBasePath diff --git a/google-beta/data_source_monitoring_notification_channel.go b/google-beta/data_source_monitoring_notification_channel.go index 645f108105..fe550c8103 100644 --- a/google-beta/data_source_monitoring_notification_channel.go +++ b/google-beta/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-beta/data_source_secret_manager_secret_version.go b/google-beta/data_source_secret_manager_secret_version.go new file mode 100644 index 0000000000..9b27a33866 --- /dev/null +++ b/google-beta/data_source_secret_manager_secret_version.go @@ -0,0 +1,121 @@ +package google + +import ( + "fmt" + "log" + "regexp" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceSecretManagerSecretVersion() *schema.Resource { + return &schema.Resource{ + Read: dataSourceSecretManagerSecretVersionRead, + Schema: map[string]*schema.Schema{ + "project": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "secret": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: compareSelfLinkOrResourceName, + }, + "version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + }, + "destroy_time": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "enabled": { + Type: schema.TypeBool, + Computed: true, + }, + "secret_data": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + }, + }, + } +} + +func dataSourceSecretManagerSecretVersionRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + fv, err := parseProjectFieldValue("secrets", d.Get("secret").(string), "project", d, config, false) + if err != nil { + return err + } + if d.Get("project").(string) != "" && d.Get("project").(string) != fv.Project { + return fmt.Errorf("The project set on this secret version (%s) is not equal to the project where this secret exists (%s).", d.Get("project").(string), fv.Project) + } + project := fv.Project + d.Set("project", project) + d.Set("secret", fv.Name) + + var url string + versionNum := d.Get("version") + + if versionNum != "" { + url, err = replaceVars(d, config, "{{SecretManagerBasePath}}projects/{{project}}/secrets/{{secret}}/versions/{{version}}") + if err != nil { + return err + } + } else { + url, err = replaceVars(d, config, "{{SecretManagerBasePath}}projects/{{project}}/secrets/{{secret}}/versions/latest") + if err != nil { + return err + } + } + + var version map[string]interface{} + version, err = sendRequest(config, "GET", project, url, nil) + if err != nil { + return fmt.Errorf("Error retrieving available secret manager secret versions: %s", err.Error()) + } + + secretVersionRegex := regexp.MustCompile("projects/(.+)/secrets/(.+)/versions/(.+)$") + + parts := secretVersionRegex.FindStringSubmatch(version["name"].(string)) + // should return [full string, project number, secret name, version number] + if len(parts) != 4 { + panic(fmt.Sprintf("secret name, %s, does not match format, projects/{{project}}/secrets/{{secret}}/versions/{{version}}", version["name"].(string))) + } + + log.Printf("[DEBUG] Received Google SecretManager Version: %q", version) + + d.Set("version", parts[3]) + + url = fmt.Sprintf("%s:access", url) + resp, err := sendRequest(config, "GET", project, url, nil) + if err != nil { + return fmt.Errorf("Error retrieving available secret manager secret version access: %s", err.Error()) + } + + d.Set("create_time", version["createTime"].(string)) + if version["destroyTime"] != nil { + d.Set("destroy_time", version["destroyTime"].(string)) + } + d.Set("name", version["name"].(string)) + d.Set("enabled", true) + + data := resp["payload"].(map[string]interface{}) + d.Set("secret_data", data["data"].(string)) + + d.SetId(time.Now().UTC().String()) + return nil +} diff --git a/google-beta/data_source_secret_manager_secret_version_test.go b/google-beta/data_source_secret_manager_secret_version_test.go new file mode 100644 index 0000000000..1c10e6c884 --- /dev/null +++ b/google-beta/data_source_secret_manager_secret_version_test.go @@ -0,0 +1,135 @@ +package google + +import ( + "errors" + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccDatasourceSecretManagerSecretVersion_basic(t *testing.T) { + t.Parallel() + + randomString := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + CheckDestroy: testAccCheckSecretManagerSecretVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDatasourceSecretManagerSecretVersion_basic(randomString), + Check: resource.ComposeTestCheckFunc( + testAccCheckDatasourceSecretManagerSecretVersion("data.google_secret_manager_secret_version.basic", "1"), + ), + }, + }, + }) +} + +func TestAccDatasourceSecretManagerSecretVersion_latest(t *testing.T) { + t.Parallel() + + randomString := acctest.RandString(10) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + CheckDestroy: testAccCheckSecretManagerSecretVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDatasourceSecretManagerSecretVersion_latest(randomString), + Check: resource.ComposeTestCheckFunc( + testAccCheckDatasourceSecretManagerSecretVersion("data.google_secret_manager_secret_version.latest", "2"), + ), + }, + }, + }) +} + +func testAccCheckDatasourceSecretManagerSecretVersion(n, expected string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Can't find Secret Version data source: %s", n) + } + + if rs.Primary.ID == "" { + return errors.New("data source ID not set.") + } + + version, ok := rs.Primary.Attributes["version"] + if !ok { + return errors.New("can't find 'version' attribute") + } + + if version != expected { + return fmt.Errorf("expected %s, got %s, version not found", expected, version) + } + return nil + } +} + +func testAccDatasourceSecretManagerSecretVersion_latest(randomString string) string { + return fmt.Sprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + secret_id = "tf-test-secret-version-%s" + labels = { + label = "my-label" + } + replication { + automatic = true + } +} + +resource "google_secret_manager_secret_version" "secret-version-basic-1" { + provider = google-beta + secret = google_secret_manager_secret.secret-basic.name + secret_data = "my-tf-test-secret-first" +} + +resource "google_secret_manager_secret_version" "secret-version-basic-2" { + provider = google-beta + secret = google_secret_manager_secret.secret-basic.name + secret_data = "my-tf-test-secret-second" + + depends_on = [google_secret_manager_secret_version.secret-version-basic-1] +} + +data "google_secret_manager_secret_version" "latest" { + provider = google-beta + secret = google_secret_manager_secret_version.secret-version-basic-2.secret +} +`, randomString) +} + +func testAccDatasourceSecretManagerSecretVersion_basic(randomString string) string { + return fmt.Sprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + secret_id = "tf-test-secret-version-%s" + labels = { + label = "my-label" + } + replication { + automatic = true + } +} + +resource "google_secret_manager_secret_version" "secret-version-basic" { + provider = google-beta + secret = google_secret_manager_secret.secret-basic.name + secret_data = "my-tf-test-secret-%s" +} + +data "google_secret_manager_secret_version" "basic" { + provider = google-beta + secret = google_secret_manager_secret_version.secret-version-basic.secret + version = 1 +} +`, randomString, randomString) +} diff --git a/google-beta/iam_binary_authorization_attestor_generated_test.go b/google-beta/iam_binary_authorization_attestor_generated_test.go index 77f2590e64..3a5f98ad6d 100644 --- a/google-beta/iam_binary_authorization_attestor_generated_test.go +++ b/google-beta/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-beta/iam_cloud_functions_cloud_function_generated_test.go b/google-beta/iam_cloud_functions_cloud_function_generated_test.go index 4856c35af0..c675410ca4 100644 --- a/google-beta/iam_cloud_functions_cloud_function_generated_test.go +++ b/google-beta/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-beta/iam_cloud_run_service_generated_test.go b/google-beta/iam_cloud_run_service_generated_test.go index a7ee9bcbd1..d78f66340d 100644 --- a/google-beta/iam_cloud_run_service_generated_test.go +++ b/google-beta/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-beta/iam_compute_instance_generated_test.go b/google-beta/iam_compute_instance_generated_test.go index a360ec24bf..a421b518c1 100644 --- a/google-beta/iam_compute_instance_generated_test.go +++ b/google-beta/iam_compute_instance_generated_test.go @@ -289,9 +289,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" } @@ -324,10 +324,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) } @@ -354,10 +354,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) } @@ -381,9 +381,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"] } @@ -409,9 +409,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"] } @@ -437,9 +437,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"] condition { @@ -470,17 +470,17 @@ 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"] } resource "google_compute_instance_iam_binding" "foo2" { - 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"] condition { @@ -511,9 +511,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" condition { @@ -544,17 +544,17 @@ 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" } resource "google_compute_instance_iam_member" "foo2" { - 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" condition { @@ -597,10 +597,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) } diff --git a/google-beta/iam_compute_subnetwork_generated_test.go b/google-beta/iam_compute_subnetwork_generated_test.go index fa4f9c8ead..6d2554bada 100644 --- a/google-beta/iam_compute_subnetwork_generated_test.go +++ b/google-beta/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-beta/iam_iap_app_engine_service_generated_test.go b/google-beta/iam_iap_app_engine_service_generated_test.go index 46a639e1b2..32b568eaff 100644 --- a/google-beta/iam_iap_app_engine_service_generated_test.go +++ b/google-beta/iam_iap_app_engine_service_generated_test.go @@ -431,7 +431,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) } @@ -497,7 +497,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) } @@ -992,7 +992,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-beta/iam_iap_app_engine_version_generated_test.go b/google-beta/iam_iap_app_engine_version_generated_test.go index df6cbc53dc..bd0cd8fdc8 100644 --- a/google-beta/iam_iap_app_engine_version_generated_test.go +++ b/google-beta/iam_iap_app_engine_version_generated_test.go @@ -353,7 +353,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) } @@ -396,7 +396,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) } @@ -732,7 +732,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-beta/iam_iap_tunnel_instance_generated_test.go b/google-beta/iam_iap_tunnel_instance_generated_test.go index af8f8340fe..bf4bb704ab 100644 --- a/google-beta/iam_iap_tunnel_instance_generated_test.go +++ b/google-beta/iam_iap_tunnel_instance_generated_test.go @@ -289,9 +289,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" } @@ -324,10 +324,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) } @@ -354,10 +354,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) } @@ -381,9 +381,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"] } @@ -409,9 +409,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"] } @@ -437,9 +437,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"] condition { @@ -470,17 +470,17 @@ 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"] } resource "google_iap_tunnel_instance_iam_binding" "foo2" { - 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"] condition { @@ -511,9 +511,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" condition { @@ -544,17 +544,17 @@ 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" } resource "google_iap_tunnel_instance_iam_member" "foo2" { - 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" condition { @@ -597,10 +597,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) } diff --git a/google-beta/iam_iap_web_backend_service_generated_test.go b/google-beta/iam_iap_web_backend_service_generated_test.go index 85d4001809..75b5e4e417 100644 --- a/google-beta/iam_iap_web_backend_service_generated_test.go +++ b/google-beta/iam_iap_web_backend_service_generated_test.go @@ -285,8 +285,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" } @@ -315,9 +315,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) } @@ -340,9 +340,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) } @@ -362,8 +362,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"] } @@ -385,8 +385,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"] } @@ -408,8 +408,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"] condition { @@ -436,15 +436,15 @@ 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"] } resource "google_iap_web_backend_service_iam_binding" "foo2" { - 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"] condition { @@ -471,8 +471,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" condition { @@ -499,15 +499,15 @@ 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" } resource "google_iap_web_backend_service_iam_member" "foo2" { - 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" condition { @@ -546,9 +546,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) } diff --git a/google-beta/iam_iap_web_generated_test.go b/google-beta/iam_iap_web_generated_test.go index edac590332..b09320d93a 100644 --- a/google-beta/iam_iap_web_generated_test.go +++ b/google-beta/iam_iap_web_generated_test.go @@ -300,7 +300,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" } @@ -328,8 +328,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) } @@ -351,8 +351,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) } @@ -371,7 +371,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"] } @@ -392,7 +392,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"] } @@ -413,7 +413,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"] condition { @@ -439,13 +439,13 @@ 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"] } resource "google_iap_web_iam_binding" "foo2" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" members = ["user:admin@hashicorptest.com"] condition { @@ -471,7 +471,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" condition { @@ -497,13 +497,13 @@ 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" } resource "google_iap_web_iam_member" "foo2" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" member = "user:admin@hashicorptest.com" condition { @@ -541,8 +541,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) } diff --git a/google-beta/iam_iap_web_type_app_engine_generated_test.go b/google-beta/iam_iap_web_type_app_engine_generated_test.go index 56f300d8d6..1b07f9fbe7 100644 --- a/google-beta/iam_iap_web_type_app_engine_generated_test.go +++ b/google-beta/iam_iap_web_type_app_engine_generated_test.go @@ -313,8 +313,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" } @@ -347,9 +347,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) } @@ -376,9 +376,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) } @@ -402,8 +402,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"] } @@ -429,8 +429,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"] } @@ -456,8 +456,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"] condition { @@ -488,15 +488,15 @@ 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"] } resource "google_iap_web_type_app_engine_iam_binding" "foo2" { - 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"] condition { @@ -527,8 +527,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" condition { @@ -559,15 +559,15 @@ 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" } resource "google_iap_web_type_app_engine_iam_member" "foo2" { - 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" condition { @@ -610,9 +610,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) } diff --git a/google-beta/iam_iap_web_type_compute_generated_test.go b/google-beta/iam_iap_web_type_compute_generated_test.go index 503f4e36e5..e7b27cf29a 100644 --- a/google-beta/iam_iap_web_type_compute_generated_test.go +++ b/google-beta/iam_iap_web_type_compute_generated_test.go @@ -300,7 +300,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" } @@ -328,8 +328,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) } @@ -351,8 +351,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) } @@ -371,7 +371,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"] } @@ -392,7 +392,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"] } @@ -413,7 +413,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"] condition { @@ -439,13 +439,13 @@ 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"] } resource "google_iap_web_type_compute_iam_binding" "foo2" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" members = ["user:admin@hashicorptest.com"] condition { @@ -471,7 +471,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" condition { @@ -497,13 +497,13 @@ 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" } resource "google_iap_web_type_compute_iam_member" "foo2" { - project = "${google_project_service.project_service.project}" + project = google_project_service.project_service.project role = "%{role}" member = "user:admin@hashicorptest.com" condition { @@ -541,8 +541,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) } diff --git a/google-beta/iam_pubsub_topic_generated_test.go b/google-beta/iam_pubsub_topic_generated_test.go index 767791d62c..41236d8e18 100644 --- a/google-beta/iam_pubsub_topic_generated_test.go +++ b/google-beta/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-beta/iam_runtime_config_config_generated_test.go b/google-beta/iam_runtime_config_config_generated_test.go index 74aee9f95c..591d892bda 100644 --- a/google-beta/iam_runtime_config_config_generated_test.go +++ b/google-beta/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-beta/iam_secret_manager_secret.go b/google-beta/iam_secret_manager_secret.go new file mode 100644 index 0000000000..1795da0728 --- /dev/null +++ b/google-beta/iam_secret_manager_secret.go @@ -0,0 +1,181 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- +package google + +import ( + "fmt" + + "github.com/hashicorp/errwrap" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "google.golang.org/api/cloudresourcemanager/v1" +) + +var SecretManagerSecretIamSchema = map[string]*schema.Schema{ + "project": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ForceNew: true, + }, + "secret_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: compareSelfLinkOrResourceName, + }, +} + +type SecretManagerSecretIamUpdater struct { + project string + secretId string + d *schema.ResourceData + Config *Config +} + +func SecretManagerSecretIamUpdaterProducer(d *schema.ResourceData, config *Config) (ResourceIamUpdater, error) { + values := make(map[string]string) + + project, err := getProject(d, config) + if err != nil { + return nil, err + } + values["project"] = project + if v, ok := d.GetOk("secret_id"); ok { + values["secret_id"] = v.(string) + } + + // We may have gotten either a long or short name, so attempt to parse long name if possible + m, err := getImportIdQualifiers([]string{"projects/(?P[^/]+)/secrets/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)"}, d, config, d.Get("secret_id").(string)) + if err != nil { + return nil, err + } + + for k, v := range m { + values[k] = v + } + + u := &SecretManagerSecretIamUpdater{ + project: values["project"], + secretId: values["secret_id"], + d: d, + Config: config, + } + + d.Set("project", u.project) + d.Set("secret_id", u.GetResourceId()) + + return u, nil +} + +func SecretManagerSecretIdParseFunc(d *schema.ResourceData, config *Config) error { + values := make(map[string]string) + + project, err := getProject(d, config) + if err != nil { + return err + } + values["project"] = project + + m, err := getImportIdQualifiers([]string{"projects/(?P[^/]+)/secrets/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)"}, d, config, d.Id()) + if err != nil { + return err + } + + for k, v := range m { + values[k] = v + } + + u := &SecretManagerSecretIamUpdater{ + project: values["project"], + secretId: values["secret_id"], + d: d, + Config: config, + } + d.Set("secret_id", u.GetResourceId()) + d.SetId(u.GetResourceId()) + return nil +} + +func (u *SecretManagerSecretIamUpdater) GetResourceIamPolicy() (*cloudresourcemanager.Policy, error) { + url, err := u.qualifySecretUrl("getIamPolicy") + if err != nil { + return nil, err + } + + project, err := getProject(u.d, u.Config) + if err != nil { + return nil, err + } + var obj map[string]interface{} + + policy, err := sendRequest(u.Config, "GET", project, url, obj) + if err != nil { + return nil, errwrap.Wrapf(fmt.Sprintf("Error retrieving IAM policy for %s: {{err}}", u.DescribeResource()), err) + } + + out := &cloudresourcemanager.Policy{} + err = Convert(policy, out) + if err != nil { + return nil, errwrap.Wrapf("Cannot convert a policy to a resource manager policy: {{err}}", err) + } + + return out, nil +} + +func (u *SecretManagerSecretIamUpdater) SetResourceIamPolicy(policy *cloudresourcemanager.Policy) error { + json, err := ConvertToMap(policy) + if err != nil { + return err + } + + obj := make(map[string]interface{}) + obj["policy"] = json + + url, err := u.qualifySecretUrl("setIamPolicy") + if err != nil { + return err + } + project, err := getProject(u.d, u.Config) + if err != nil { + return err + } + + _, err = sendRequestWithTimeout(u.Config, "POST", project, url, obj, u.d.Timeout(schema.TimeoutCreate)) + if err != nil { + return errwrap.Wrapf(fmt.Sprintf("Error setting IAM policy for %s: {{err}}", u.DescribeResource()), err) + } + + return nil +} + +func (u *SecretManagerSecretIamUpdater) qualifySecretUrl(methodIdentifier string) (string, error) { + urlTemplate := fmt.Sprintf("{{SecretManagerBasePath}}%s:%s", fmt.Sprintf("projects/%s/secrets/%s", u.project, u.secretId), methodIdentifier) + url, err := replaceVars(u.d, u.Config, urlTemplate) + if err != nil { + return "", err + } + return url, nil +} + +func (u *SecretManagerSecretIamUpdater) GetResourceId() string { + return fmt.Sprintf("projects/%s/secrets/%s", u.project, u.secretId) +} + +func (u *SecretManagerSecretIamUpdater) GetMutexKey() string { + return fmt.Sprintf("iam-secretmanager-secret-%s", u.GetResourceId()) +} + +func (u *SecretManagerSecretIamUpdater) DescribeResource() string { + return fmt.Sprintf("secretmanager secret %q", u.GetResourceId()) +} diff --git a/google-beta/iam_secret_manager_secret_generated_test.go b/google-beta/iam_secret_manager_secret_generated_test.go new file mode 100644 index 0000000000..e70c28de4d --- /dev/null +++ b/google-beta/iam_secret_manager_secret_generated_test.go @@ -0,0 +1,263 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccSecretManagerSecretIamBindingGenerated(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + "role": "roles/viewer", + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + Steps: []resource.TestStep{ + { + Config: testAccSecretManagerSecretIamBinding_basicGenerated(context), + }, + { + // Test Iam Binding update + Config: testAccSecretManagerSecretIamBinding_updateGenerated(context), + }, + }, + }) +} + +func TestAccSecretManagerSecretIamMemberGenerated(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + "role": "roles/viewer", + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + Steps: []resource.TestStep{ + { + // Test Iam Member creation (no update for member, no need to test) + Config: testAccSecretManagerSecretIamMember_basicGenerated(context), + }, + }, + }) +} + +func TestAccSecretManagerSecretIamPolicyGenerated(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + "role": "roles/viewer", + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + Steps: []resource.TestStep{ + { + Config: testAccSecretManagerSecretIamPolicy_basicGenerated(context), + }, + { + Config: testAccSecretManagerSecretIamPolicy_emptyBinding(context), + }, + }, + }) +} + +func testAccSecretManagerSecretIamMember_basicGenerated(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} + +resource "google_secret_manager_secret_iam_member" "foo" { + provider = google-beta + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + role = "%{role}" + member = "user:admin@hashicorptest.com" +} +`, context) +} + +func testAccSecretManagerSecretIamPolicy_basicGenerated(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} + +data "google_iam_policy" "foo" { + provider = google-beta + binding { + role = "%{role}" + members = ["user:admin@hashicorptest.com"] + } +} + +resource "google_secret_manager_secret_iam_policy" "foo" { + provider = google-beta + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + policy_data = data.google_iam_policy.foo.policy_data +} +`, context) +} + +func testAccSecretManagerSecretIamPolicy_emptyBinding(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} + +data "google_iam_policy" "foo" { + provider = google-beta +} + +resource "google_secret_manager_secret_iam_policy" "foo" { + provider = google-beta + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + policy_data = data.google_iam_policy.foo.policy_data +} +`, context) +} + +func testAccSecretManagerSecretIamBinding_basicGenerated(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} + +resource "google_secret_manager_secret_iam_binding" "foo" { + + provider = google-beta + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + role = "%{role}" + members = ["user:admin@hashicorptest.com"] +} +`, context) +} + +func testAccSecretManagerSecretIamBinding_updateGenerated(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} + +resource "google_secret_manager_secret_iam_binding" "foo" { + provider = google-beta + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + role = "%{role}" + members = ["user:admin@hashicorptest.com", "user:paddy@hashicorp.com"] +} +`, context) +} diff --git a/google-beta/iam_source_repo_repository_generated_test.go b/google-beta/iam_source_repo_repository_generated_test.go index 535fe0a4dc..4036ef4d46 100644 --- a/google-beta/iam_source_repo_repository_generated_test.go +++ b/google-beta/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-beta/iam_storage_bucket_generated_test.go b/google-beta/iam_storage_bucket_generated_test.go index 8f365d5741..02c2880e23 100644 --- a/google-beta/iam_storage_bucket_generated_test.go +++ b/google-beta/iam_storage_bucket_generated_test.go @@ -288,7 +288,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" } @@ -314,8 +314,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) } @@ -331,8 +331,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) } @@ -345,7 +345,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"] } @@ -360,7 +360,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"] } @@ -375,7 +375,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"] condition { @@ -395,13 +395,13 @@ 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"] } resource "google_storage_bucket_iam_binding" "foo2" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "%{role}" members = ["user:admin@hashicorptest.com"] condition { @@ -421,7 +421,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" condition { @@ -441,13 +441,13 @@ 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" } resource "google_storage_bucket_iam_member" "foo2" { - bucket = "${google_storage_bucket.default.name}" + bucket = google_storage_bucket.default.name role = "%{role}" member = "user:admin@hashicorptest.com" condition { @@ -483,8 +483,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) } diff --git a/google-beta/provider.go b/google-beta/provider.go index 7ec02d45d1..c895d6a0dd 100644 --- a/google-beta/provider.go +++ b/google-beta/provider.go @@ -365,6 +365,14 @@ func Provider() terraform.ResourceProvider { "GOOGLE_RUNTIME_CONFIG_CUSTOM_ENDPOINT", }, RuntimeConfigDefaultBasePath), }, + "secret_manager_custom_endpoint": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateCustomEndpoint, + DefaultFunc: schema.MultiEnvDefaultFunc([]string{ + "GOOGLE_SECRET_MANAGER_CUSTOM_ENDPOINT", + }, SecretManagerDefaultBasePath), + }, "security_center_custom_endpoint": { Type: schema.TypeString, Optional: true, @@ -503,6 +511,7 @@ func Provider() terraform.ResourceProvider { "google_project": dataSourceGoogleProject(), "google_projects": dataSourceGoogleProjects(), "google_project_organization_policy": dataSourceGoogleProjectOrganizationPolicy(), + "google_secret_manager_secret_version": dataSourceSecretManagerSecretVersion(), "google_service_account": dataSourceGoogleServiceAccount(), "google_service_account_access_token": dataSourceGoogleServiceAccountAccessToken(), "google_service_account_key": dataSourceGoogleServiceAccountKey(), @@ -530,9 +539,9 @@ func Provider() terraform.ResourceProvider { return provider } -// Generated resources: 114 -// Generated IAM resources: 48 -// Total generated resources: 162 +// Generated resources: 116 +// Generated IAM resources: 51 +// Total generated resources: 167 func ResourceMap() map[string]*schema.Resource { resourceMap, _ := ResourceMapWithErrors() return resourceMap @@ -686,6 +695,11 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) { "google_runtimeconfig_config_iam_binding": ResourceIamBinding(RuntimeConfigConfigIamSchema, RuntimeConfigConfigIamUpdaterProducer, RuntimeConfigConfigIdParseFunc), "google_runtimeconfig_config_iam_member": ResourceIamMember(RuntimeConfigConfigIamSchema, RuntimeConfigConfigIamUpdaterProducer, RuntimeConfigConfigIdParseFunc), "google_runtimeconfig_config_iam_policy": ResourceIamPolicy(RuntimeConfigConfigIamSchema, RuntimeConfigConfigIamUpdaterProducer, RuntimeConfigConfigIdParseFunc), + "google_secret_manager_secret": resourceSecretManagerSecret(), + "google_secret_manager_secret_iam_binding": ResourceIamBinding(SecretManagerSecretIamSchema, SecretManagerSecretIamUpdaterProducer, SecretManagerSecretIdParseFunc), + "google_secret_manager_secret_iam_member": ResourceIamMember(SecretManagerSecretIamSchema, SecretManagerSecretIamUpdaterProducer, SecretManagerSecretIdParseFunc), + "google_secret_manager_secret_iam_policy": ResourceIamPolicy(SecretManagerSecretIamSchema, SecretManagerSecretIamUpdaterProducer, SecretManagerSecretIdParseFunc), + "google_secret_manager_secret_version": resourceSecretManagerSecretVersion(), "google_scc_source": resourceSecurityCenterSource(), "google_security_scanner_scan_config": resourceSecurityScannerScanConfig(), "google_sourcerepo_repository": resourceSourceRepoRepository(), @@ -895,6 +909,7 @@ func providerConfigure(d *schema.ResourceData, p *schema.Provider, terraformVers config.RedisBasePath = d.Get("redis_custom_endpoint").(string) config.ResourceManagerBasePath = d.Get("resource_manager_custom_endpoint").(string) config.RuntimeConfigBasePath = d.Get("runtime_config_custom_endpoint").(string) + config.SecretManagerBasePath = d.Get("secret_manager_custom_endpoint").(string) config.SecurityCenterBasePath = d.Get("security_center_custom_endpoint").(string) config.SecurityScannerBasePath = d.Get("security_scanner_custom_endpoint").(string) config.SourceRepoBasePath = d.Get("source_repo_custom_endpoint").(string) diff --git a/google-beta/resource_access_context_manager_access_level.go b/google-beta/resource_access_context_manager_access_level.go index dfc2496102..5777be23b4 100644 --- a/google-beta/resource_access_context_manager_access_level.go +++ b/google-beta/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-beta/resource_access_context_manager_access_policy.go b/google-beta/resource_access_context_manager_access_policy.go index fb3fbe3af1..67230319de 100644 --- a/google-beta/resource_access_context_manager_access_policy.go +++ b/google-beta/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-beta/resource_access_context_manager_service_perimeter.go b/google-beta/resource_access_context_manager_service_perimeter.go index 990630d4e0..dd2580be8b 100644 --- a/google-beta/resource_access_context_manager_service_perimeter.go +++ b/google-beta/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-beta/resource_app_engine_application_url_dispatch_rules.go b/google-beta/resource_app_engine_application_url_dispatch_rules.go index e28b2a4c73..8897c9bfc5 100644 --- a/google-beta/resource_app_engine_application_url_dispatch_rules.go +++ b/google-beta/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-beta/resource_app_engine_domain_mapping.go b/google-beta/resource_app_engine_domain_mapping.go index a555c3b9cb..62cc1bae09 100644 --- a/google-beta/resource_app_engine_domain_mapping.go +++ b/google-beta/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-beta/resource_app_engine_firewall_rule.go b/google-beta/resource_app_engine_firewall_rule.go index 1a0dc61f59..b4e98db215 100644 --- a/google-beta/resource_app_engine_firewall_rule.go +++ b/google-beta/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-beta/resource_app_engine_standard_app_version.go b/google-beta/resource_app_engine_standard_app_version.go index 479a04cf7a..ddd23a3516 100644 --- a/google-beta/resource_app_engine_standard_app_version.go +++ b/google-beta/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-beta/resource_big_query_dataset.go b/google-beta/resource_big_query_dataset.go index d4759a4889..c2afaff2be 100644 --- a/google-beta/resource_big_query_dataset.go +++ b/google-beta/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-beta/resource_bigquery_data_transfer_config.go b/google-beta/resource_bigquery_data_transfer_config.go index e8f2969d97..e161c12598 100644 --- a/google-beta/resource_bigquery_data_transfer_config.go +++ b/google-beta/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-beta/resource_bigtable_app_profile.go b/google-beta/resource_bigtable_app_profile.go index bb8bae19fd..f70c838561 100644 --- a/google-beta/resource_bigtable_app_profile.go +++ b/google-beta/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-beta/resource_billing_budget.go b/google-beta/resource_billing_budget.go index 021527badb..e9d6a35938 100644 --- a/google-beta/resource_billing_budget.go +++ b/google-beta/resource_billing_budget.go @@ -264,12 +264,12 @@ func resourceBillingBudgetRead(d *schema.ResourceData, meta interface{}) error { return handleNotFoundError(err, d, fmt.Sprintf("BillingBudget %q", d.Id())) } - if err := d.Set("name", flattenBillingBudgetName(res["name"], d)); err != nil { + if err := d.Set("name", flattenBillingBudgetName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Budget: %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 := flattenBillingBudgetBudget(res["budget"], d); flattenedProp != nil { + if flattenedProp := flattenBillingBudgetBudget(res["budget"], d, config); flattenedProp != nil { casted := flattenedProp.([]interface{})[0] if casted != nil { for k, v := range casted.(map[string]interface{}) { @@ -339,11 +339,11 @@ func resourceBillingBudgetImport(d *schema.ResourceData, meta interface{}) ([]*s return []*schema.ResourceData{d}, nil } -func flattenBillingBudgetName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudget(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudget(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -353,22 +353,22 @@ func flattenBillingBudgetBudget(v interface{}, d *schema.ResourceData) interface } transformed := make(map[string]interface{}) transformed["display_name"] = - flattenBillingBudgetBudgetDisplayName(original["displayName"], d) + flattenBillingBudgetBudgetDisplayName(original["displayName"], d, config) transformed["budget_filter"] = - flattenBillingBudgetBudgetBudgetFilter(original["budgetFilter"], d) + flattenBillingBudgetBudgetBudgetFilter(original["budgetFilter"], d, config) transformed["amount"] = - flattenBillingBudgetBudgetAmount(original["amount"], d) + flattenBillingBudgetBudgetAmount(original["amount"], d, config) transformed["threshold_rules"] = - flattenBillingBudgetBudgetThresholdRules(original["thresholdRules"], d) + flattenBillingBudgetBudgetThresholdRules(original["thresholdRules"], d, config) transformed["all_updates_rule"] = - flattenBillingBudgetBudgetAllUpdatesRule(original["allUpdatesRule"], d) + flattenBillingBudgetBudgetAllUpdatesRule(original["allUpdatesRule"], d, config) return []interface{}{transformed} } -func flattenBillingBudgetBudgetDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetBudgetFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetBudgetFilter(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -378,26 +378,26 @@ func flattenBillingBudgetBudgetBudgetFilter(v interface{}, d *schema.ResourceDat } transformed := make(map[string]interface{}) transformed["projects"] = - flattenBillingBudgetBudgetBudgetFilterProjects(original["projects"], d) + flattenBillingBudgetBudgetBudgetFilterProjects(original["projects"], d, config) transformed["credit_types_treatment"] = - flattenBillingBudgetBudgetBudgetFilterCreditTypesTreatment(original["creditTypesTreatment"], d) + flattenBillingBudgetBudgetBudgetFilterCreditTypesTreatment(original["creditTypesTreatment"], d, config) transformed["services"] = - flattenBillingBudgetBudgetBudgetFilterServices(original["services"], d) + flattenBillingBudgetBudgetBudgetFilterServices(original["services"], d, config) return []interface{}{transformed} } -func flattenBillingBudgetBudgetBudgetFilterProjects(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetBudgetFilterProjects(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetBudgetFilterCreditTypesTreatment(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetBudgetFilterCreditTypesTreatment(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetBudgetFilterServices(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetBudgetFilterServices(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetAmount(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAmount(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -407,10 +407,10 @@ func flattenBillingBudgetBudgetAmount(v interface{}, d *schema.ResourceData) int } transformed := make(map[string]interface{}) transformed["specified_amount"] = - flattenBillingBudgetBudgetAmountSpecifiedAmount(original["specifiedAmount"], d) + flattenBillingBudgetBudgetAmountSpecifiedAmount(original["specifiedAmount"], d, config) return []interface{}{transformed} } -func flattenBillingBudgetBudgetAmountSpecifiedAmount(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAmountSpecifiedAmount(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -420,22 +420,22 @@ func flattenBillingBudgetBudgetAmountSpecifiedAmount(v interface{}, d *schema.Re } transformed := make(map[string]interface{}) transformed["currency_code"] = - flattenBillingBudgetBudgetAmountSpecifiedAmountCurrencyCode(original["currencyCode"], d) + flattenBillingBudgetBudgetAmountSpecifiedAmountCurrencyCode(original["currencyCode"], d, config) transformed["units"] = - flattenBillingBudgetBudgetAmountSpecifiedAmountUnits(original["units"], d) + flattenBillingBudgetBudgetAmountSpecifiedAmountUnits(original["units"], d, config) transformed["nanos"] = - flattenBillingBudgetBudgetAmountSpecifiedAmountNanos(original["nanos"], d) + flattenBillingBudgetBudgetAmountSpecifiedAmountNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenBillingBudgetBudgetAmountSpecifiedAmountCurrencyCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAmountSpecifiedAmountCurrencyCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetAmountSpecifiedAmountUnits(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAmountSpecifiedAmountUnits(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetAmountSpecifiedAmountNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAmountSpecifiedAmountNanos(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 { @@ -445,7 +445,7 @@ func flattenBillingBudgetBudgetAmountSpecifiedAmountNanos(v interface{}, d *sche return v } -func flattenBillingBudgetBudgetThresholdRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetThresholdRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -458,21 +458,21 @@ func flattenBillingBudgetBudgetThresholdRules(v interface{}, d *schema.ResourceD continue } transformed = append(transformed, map[string]interface{}{ - "threshold_percent": flattenBillingBudgetBudgetThresholdRulesThresholdPercent(original["thresholdPercent"], d), - "spend_basis": flattenBillingBudgetBudgetThresholdRulesSpendBasis(original["spendBasis"], d), + "threshold_percent": flattenBillingBudgetBudgetThresholdRulesThresholdPercent(original["thresholdPercent"], d, config), + "spend_basis": flattenBillingBudgetBudgetThresholdRulesSpendBasis(original["spendBasis"], d, config), }) } return transformed } -func flattenBillingBudgetBudgetThresholdRulesThresholdPercent(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetThresholdRulesThresholdPercent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetThresholdRulesSpendBasis(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetThresholdRulesSpendBasis(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetAllUpdatesRule(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAllUpdatesRule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -482,16 +482,16 @@ func flattenBillingBudgetBudgetAllUpdatesRule(v interface{}, d *schema.ResourceD } transformed := make(map[string]interface{}) transformed["pubsub_topic"] = - flattenBillingBudgetBudgetAllUpdatesRulePubsubTopic(original["pubsubTopic"], d) + flattenBillingBudgetBudgetAllUpdatesRulePubsubTopic(original["pubsubTopic"], d, config) transformed["schema_version"] = - flattenBillingBudgetBudgetAllUpdatesRuleSchemaVersion(original["schemaVersion"], d) + flattenBillingBudgetBudgetAllUpdatesRuleSchemaVersion(original["schemaVersion"], d, config) return []interface{}{transformed} } -func flattenBillingBudgetBudgetAllUpdatesRulePubsubTopic(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAllUpdatesRulePubsubTopic(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenBillingBudgetBudgetAllUpdatesRuleSchemaVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenBillingBudgetBudgetAllUpdatesRuleSchemaVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_binary_authorization_attestor.go b/google-beta/resource_binary_authorization_attestor.go index 50b19ed611..47967370b5 100644 --- a/google-beta/resource_binary_authorization_attestor.go +++ b/google-beta/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-beta/resource_binary_authorization_policy.go b/google-beta/resource_binary_authorization_policy.go index e7580bd14a..70612407e9 100644 --- a/google-beta/resource_binary_authorization_policy.go +++ b/google-beta/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-beta/resource_cloud_build_trigger.go b/google-beta/resource_cloud_build_trigger.go index 13754fa870..ba08f6fb1c 100644 --- a/google-beta/resource_cloud_build_trigger.go +++ b/google-beta/resource_cloud_build_trigger.go @@ -611,40 +611,40 @@ 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("github", flattenCloudBuildTriggerGithub(res["github"], d)); err != nil { + if err := d.Set("github", flattenCloudBuildTriggerGithub(res["github"], 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) } @@ -782,43 +782,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 } @@ -828,44 +828,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 flattenCloudBuildTriggerGithub(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithub(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -875,24 +875,24 @@ func flattenCloudBuildTriggerGithub(v interface{}, d *schema.ResourceData) inter } transformed := make(map[string]interface{}) transformed["owner"] = - flattenCloudBuildTriggerGithubOwner(original["owner"], d) + flattenCloudBuildTriggerGithubOwner(original["owner"], d, config) transformed["name"] = - flattenCloudBuildTriggerGithubName(original["name"], d) + flattenCloudBuildTriggerGithubName(original["name"], d, config) transformed["pull_request"] = - flattenCloudBuildTriggerGithubPullRequest(original["pullRequest"], d) + flattenCloudBuildTriggerGithubPullRequest(original["pullRequest"], d, config) transformed["push"] = - flattenCloudBuildTriggerGithubPush(original["push"], d) + flattenCloudBuildTriggerGithubPush(original["push"], d, config) return []interface{}{transformed} } -func flattenCloudBuildTriggerGithubOwner(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubOwner(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerGithubName(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerGithubPullRequest(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubPullRequest(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -902,20 +902,20 @@ func flattenCloudBuildTriggerGithubPullRequest(v interface{}, d *schema.Resource } transformed := make(map[string]interface{}) transformed["branch"] = - flattenCloudBuildTriggerGithubPullRequestBranch(original["branch"], d) + flattenCloudBuildTriggerGithubPullRequestBranch(original["branch"], d, config) transformed["comment_control"] = - flattenCloudBuildTriggerGithubPullRequestCommentControl(original["commentControl"], d) + flattenCloudBuildTriggerGithubPullRequestCommentControl(original["commentControl"], d, config) return []interface{}{transformed} } -func flattenCloudBuildTriggerGithubPullRequestBranch(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubPullRequestBranch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerGithubPullRequestCommentControl(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubPullRequestCommentControl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerGithubPush(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubPush(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -925,20 +925,20 @@ func flattenCloudBuildTriggerGithubPush(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["branch"] = - flattenCloudBuildTriggerGithubPushBranch(original["branch"], d) + flattenCloudBuildTriggerGithubPushBranch(original["branch"], d, config) transformed["tag"] = - flattenCloudBuildTriggerGithubPushTag(original["tag"], d) + flattenCloudBuildTriggerGithubPushTag(original["tag"], d, config) return []interface{}{transformed} } -func flattenCloudBuildTriggerGithubPushBranch(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubPushBranch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenCloudBuildTriggerGithubPushTag(v interface{}, d *schema.ResourceData) interface{} { +func flattenCloudBuildTriggerGithubPushTag(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 } @@ -948,28 +948,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 } @@ -982,58 +982,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 } @@ -1046,21 +1046,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-beta/resource_cloud_run_domain_mapping.go b/google-beta/resource_cloud_run_domain_mapping.go index 129731e94e..a803cdff72 100644 --- a/google-beta/resource_cloud_run_domain_mapping.go +++ b/google-beta/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-beta/resource_cloud_run_service.go b/google-beta/resource_cloud_run_service.go index b70c17bd2d..27d82e05bd 100644 --- a/google-beta/resource_cloud_run_service.go +++ b/google-beta/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-beta/resource_cloud_scheduler_job.go b/google-beta/resource_cloud_scheduler_job.go index 7373108869..92703db91b 100644 --- a/google-beta/resource_cloud_scheduler_job.go +++ b/google-beta/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-beta/resource_cloud_tasks_queue.go b/google-beta/resource_cloud_tasks_queue.go index 938f73a093..8d6f1ed0db 100644 --- a/google-beta/resource_cloud_tasks_queue.go +++ b/google-beta/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-beta/resource_cloudscheduler_job_test.go b/google-beta/resource_cloudscheduler_job_test.go index 4767dc5093..1b03acacf0 100644 --- a/google-beta/resource_cloudscheduler_job_test.go +++ b/google-beta/resource_cloudscheduler_job_test.go @@ -87,7 +87,7 @@ func TestCloudScheduler_FlattenHttpHeaders(t *testing.T) { for _, c := range cases { d := &schema.ResourceData{} - output := flattenCloudSchedulerJobAppEngineHttpTargetHeaders(c.Input, d) + output := flattenCloudSchedulerJobAppEngineHttpTargetHeaders(c.Input, d, &Config{}) if !reflect.DeepEqual(output, c.Output) { t.Fatalf("Error matching output and expected: %#v vs %#v", output, c.Output) } diff --git a/google-beta/resource_compute_address.go b/google-beta/resource_compute_address.go index 55fc46b5b8..4554992cc0 100644 --- a/google-beta/resource_compute_address.go +++ b/google-beta/resource_compute_address.go @@ -319,40 +319,40 @@ 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("labels", flattenComputeAddressLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeAddressLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Address: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeAddressLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeAddressLabelFingerprint(res["labelFingerprint"], 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 { @@ -467,11 +467,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" } @@ -479,46 +479,46 @@ 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 flattenComputeAddressLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeAddressLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAddressLabelFingerprint(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-beta/resource_compute_autoscaler.go b/google-beta/resource_compute_autoscaler.go index 4bc79c9b91..fea1958793 100644 --- a/google-beta/resource_compute_autoscaler.go +++ b/google-beta/resource_compute_autoscaler.go @@ -374,22 +374,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 { @@ -516,19 +516,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 } @@ -538,20 +538,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 { @@ -561,7 +561,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 { @@ -571,7 +571,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 { @@ -581,7 +581,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 } @@ -591,14 +591,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 } @@ -611,36 +611,36 @@ func flattenComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.Re continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeAutoscalerAutoscalingPolicyMetricName(original["metric"], d), - "single_instance_assignment": flattenComputeAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(original["singleInstanceAssignment"], d), - "target": flattenComputeAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d), - "type": flattenComputeAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d), - "filter": flattenComputeAutoscalerAutoscalingPolicyMetricFilter(original["filter"], d), + "name": flattenComputeAutoscalerAutoscalingPolicyMetricName(original["metric"], d, config), + "single_instance_assignment": flattenComputeAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(original["singleInstanceAssignment"], d, config), + "target": flattenComputeAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d, config), + "type": flattenComputeAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d, config), + "filter": flattenComputeAutoscalerAutoscalingPolicyMetricFilter(original["filter"], 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 flattenComputeAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(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 flattenComputeAutoscalerAutoscalingPolicyMetricFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeAutoscalerAutoscalingPolicyMetricFilter(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 } @@ -650,21 +650,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-beta/resource_compute_backend_bucket.go b/google-beta/resource_compute_backend_bucket.go index 451b166723..45956f6913 100644 --- a/google-beta/resource_compute_backend_bucket.go +++ b/google-beta/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-beta/resource_compute_backend_bucket_signed_url_key.go b/google-beta/resource_compute_backend_bucket_signed_url_key.go index 53b77e84e3..411422ba45 100644 --- a/google-beta/resource_compute_backend_bucket_signed_url_key.go +++ b/google-beta/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-beta/resource_compute_backend_service.go b/google-beta/resource_compute_backend_service.go index 6eacadd56f..17466d126a 100644 --- a/google-beta/resource_compute_backend_service.go +++ b/google-beta/resource_compute_backend_service.go @@ -1158,24 +1158,24 @@ 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("circuit_breakers", flattenComputeBackendServiceCircuitBreakers(res["circuitBreakers"], d)); err != nil { + if err := d.Set("circuit_breakers", flattenComputeBackendServiceCircuitBreakers(res["circuitBreakers"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } - if err := d.Set("consistent_hash", flattenComputeBackendServiceConsistentHash(res["consistentHash"], d)); err != nil { + if err := d.Set("consistent_hash", flattenComputeBackendServiceConsistentHash(res["consistentHash"], 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{}) { @@ -1183,55 +1183,55 @@ 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("custom_request_headers", flattenComputeBackendServiceCustomRequestHeaders(res["customRequestHeaders"], d)); err != nil { + if err := d.Set("custom_request_headers", flattenComputeBackendServiceCustomRequestHeaders(res["customRequestHeaders"], 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("locality_lb_policy", flattenComputeBackendServiceLocalityLbPolicy(res["localityLbPolicy"], d)); err != nil { + if err := d.Set("locality_lb_policy", flattenComputeBackendServiceLocalityLbPolicy(res["localityLbPolicy"], 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("outlier_detection", flattenComputeBackendServiceOutlierDetection(res["outlierDetection"], d)); err != nil { + if err := d.Set("outlier_detection", flattenComputeBackendServiceOutlierDetection(res["outlierDetection"], 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("log_config", flattenComputeBackendServiceLogConfig(res["logConfig"], d)); err != nil { + if err := d.Set("log_config", flattenComputeBackendServiceLogConfig(res["logConfig"], d, config)); err != nil { return fmt.Errorf("Error reading BackendService: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -1482,7 +1482,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 { @@ -1492,7 +1492,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 } @@ -1505,41 +1505,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 { @@ -1549,7 +1549,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 { @@ -1559,7 +1559,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 { @@ -1569,7 +1569,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 { @@ -1579,19 +1579,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 flattenComputeBackendServiceCircuitBreakers(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1601,20 +1601,20 @@ func flattenComputeBackendServiceCircuitBreakers(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["connect_timeout"] = - flattenComputeBackendServiceCircuitBreakersConnectTimeout(original["connectTimeout"], d) + flattenComputeBackendServiceCircuitBreakersConnectTimeout(original["connectTimeout"], d, config) transformed["max_requests_per_connection"] = - flattenComputeBackendServiceCircuitBreakersMaxRequestsPerConnection(original["maxRequestsPerConnection"], d) + flattenComputeBackendServiceCircuitBreakersMaxRequestsPerConnection(original["maxRequestsPerConnection"], d, config) transformed["max_connections"] = - flattenComputeBackendServiceCircuitBreakersMaxConnections(original["maxConnections"], d) + flattenComputeBackendServiceCircuitBreakersMaxConnections(original["maxConnections"], d, config) transformed["max_pending_requests"] = - flattenComputeBackendServiceCircuitBreakersMaxPendingRequests(original["maxPendingRequests"], d) + flattenComputeBackendServiceCircuitBreakersMaxPendingRequests(original["maxPendingRequests"], d, config) transformed["max_requests"] = - flattenComputeBackendServiceCircuitBreakersMaxRequests(original["maxRequests"], d) + flattenComputeBackendServiceCircuitBreakersMaxRequests(original["maxRequests"], d, config) transformed["max_retries"] = - flattenComputeBackendServiceCircuitBreakersMaxRetries(original["maxRetries"], d) + flattenComputeBackendServiceCircuitBreakersMaxRetries(original["maxRetries"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceCircuitBreakersConnectTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersConnectTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1624,12 +1624,12 @@ func flattenComputeBackendServiceCircuitBreakersConnectTimeout(v interface{}, d } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeBackendServiceCircuitBreakersConnectTimeoutSeconds(original["seconds"], d) + flattenComputeBackendServiceCircuitBreakersConnectTimeoutSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeBackendServiceCircuitBreakersConnectTimeoutNanos(original["nanos"], d) + flattenComputeBackendServiceCircuitBreakersConnectTimeoutNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceCircuitBreakersConnectTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersConnectTimeoutSeconds(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 { @@ -1639,7 +1639,7 @@ func flattenComputeBackendServiceCircuitBreakersConnectTimeoutSeconds(v interfac return v } -func flattenComputeBackendServiceCircuitBreakersConnectTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersConnectTimeoutNanos(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 { @@ -1649,7 +1649,7 @@ func flattenComputeBackendServiceCircuitBreakersConnectTimeoutNanos(v interface{ return v } -func flattenComputeBackendServiceCircuitBreakersMaxRequestsPerConnection(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersMaxRequestsPerConnection(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 { @@ -1659,7 +1659,7 @@ func flattenComputeBackendServiceCircuitBreakersMaxRequestsPerConnection(v inter return v } -func flattenComputeBackendServiceCircuitBreakersMaxConnections(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersMaxConnections(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 { @@ -1669,7 +1669,7 @@ func flattenComputeBackendServiceCircuitBreakersMaxConnections(v interface{}, d return v } -func flattenComputeBackendServiceCircuitBreakersMaxPendingRequests(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersMaxPendingRequests(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 { @@ -1679,7 +1679,7 @@ func flattenComputeBackendServiceCircuitBreakersMaxPendingRequests(v interface{} return v } -func flattenComputeBackendServiceCircuitBreakersMaxRequests(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersMaxRequests(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 { @@ -1689,7 +1689,7 @@ func flattenComputeBackendServiceCircuitBreakersMaxRequests(v interface{}, d *sc return v } -func flattenComputeBackendServiceCircuitBreakersMaxRetries(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCircuitBreakersMaxRetries(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 { @@ -1699,7 +1699,7 @@ func flattenComputeBackendServiceCircuitBreakersMaxRetries(v interface{}, d *sch return v } -func flattenComputeBackendServiceConsistentHash(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHash(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1709,14 +1709,14 @@ func flattenComputeBackendServiceConsistentHash(v interface{}, d *schema.Resourc } transformed := make(map[string]interface{}) transformed["http_cookie"] = - flattenComputeBackendServiceConsistentHashHttpCookie(original["httpCookie"], d) + flattenComputeBackendServiceConsistentHashHttpCookie(original["httpCookie"], d, config) transformed["http_header_name"] = - flattenComputeBackendServiceConsistentHashHttpHeaderName(original["httpHeaderName"], d) + flattenComputeBackendServiceConsistentHashHttpHeaderName(original["httpHeaderName"], d, config) transformed["minimum_ring_size"] = - flattenComputeBackendServiceConsistentHashMinimumRingSize(original["minimumRingSize"], d) + flattenComputeBackendServiceConsistentHashMinimumRingSize(original["minimumRingSize"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceConsistentHashHttpCookie(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpCookie(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1726,14 +1726,14 @@ func flattenComputeBackendServiceConsistentHashHttpCookie(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["ttl"] = - flattenComputeBackendServiceConsistentHashHttpCookieTtl(original["ttl"], d) + flattenComputeBackendServiceConsistentHashHttpCookieTtl(original["ttl"], d, config) transformed["name"] = - flattenComputeBackendServiceConsistentHashHttpCookieName(original["name"], d) + flattenComputeBackendServiceConsistentHashHttpCookieName(original["name"], d, config) transformed["path"] = - flattenComputeBackendServiceConsistentHashHttpCookiePath(original["path"], d) + flattenComputeBackendServiceConsistentHashHttpCookiePath(original["path"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceConsistentHashHttpCookieTtl(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpCookieTtl(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1743,12 +1743,12 @@ func flattenComputeBackendServiceConsistentHashHttpCookieTtl(v interface{}, d *s } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeBackendServiceConsistentHashHttpCookieTtlSeconds(original["seconds"], d) + flattenComputeBackendServiceConsistentHashHttpCookieTtlSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeBackendServiceConsistentHashHttpCookieTtlNanos(original["nanos"], d) + flattenComputeBackendServiceConsistentHashHttpCookieTtlNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceConsistentHashHttpCookieTtlSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpCookieTtlSeconds(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 { @@ -1758,7 +1758,7 @@ func flattenComputeBackendServiceConsistentHashHttpCookieTtlSeconds(v interface{ return v } -func flattenComputeBackendServiceConsistentHashHttpCookieTtlNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpCookieTtlNanos(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 { @@ -1768,19 +1768,19 @@ func flattenComputeBackendServiceConsistentHashHttpCookieTtlNanos(v interface{}, return v } -func flattenComputeBackendServiceConsistentHashHttpCookieName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpCookieName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceConsistentHashHttpCookiePath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpCookiePath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceConsistentHashHttpHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashHttpHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceConsistentHashMinimumRingSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceConsistentHashMinimumRingSize(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 { @@ -1790,7 +1790,7 @@ func flattenComputeBackendServiceConsistentHashMinimumRingSize(v interface{}, d 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 } @@ -1800,12 +1800,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 } @@ -1815,44 +1815,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 { @@ -1862,7 +1862,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 } @@ -1872,10 +1872,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 { @@ -1885,37 +1885,37 @@ 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 flattenComputeBackendServiceCustomRequestHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceCustomRequestHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -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 } @@ -1925,38 +1925,38 @@ 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 flattenComputeBackendServiceLocalityLbPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceLocalityLbPolicy(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 flattenComputeBackendServiceOutlierDetection(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetection(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1966,30 +1966,30 @@ func flattenComputeBackendServiceOutlierDetection(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["base_ejection_time"] = - flattenComputeBackendServiceOutlierDetectionBaseEjectionTime(original["baseEjectionTime"], d) + flattenComputeBackendServiceOutlierDetectionBaseEjectionTime(original["baseEjectionTime"], d, config) transformed["consecutive_errors"] = - flattenComputeBackendServiceOutlierDetectionConsecutiveErrors(original["consecutiveErrors"], d) + flattenComputeBackendServiceOutlierDetectionConsecutiveErrors(original["consecutiveErrors"], d, config) transformed["consecutive_gateway_failure"] = - flattenComputeBackendServiceOutlierDetectionConsecutiveGatewayFailure(original["consecutiveGatewayFailure"], d) + flattenComputeBackendServiceOutlierDetectionConsecutiveGatewayFailure(original["consecutiveGatewayFailure"], d, config) transformed["enforcing_consecutive_errors"] = - flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveErrors(original["enforcingConsecutiveErrors"], d) + flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveErrors(original["enforcingConsecutiveErrors"], d, config) transformed["enforcing_consecutive_gateway_failure"] = - flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(original["enforcingConsecutiveGatewayFailure"], d) + flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(original["enforcingConsecutiveGatewayFailure"], d, config) transformed["enforcing_success_rate"] = - flattenComputeBackendServiceOutlierDetectionEnforcingSuccessRate(original["enforcingSuccessRate"], d) + flattenComputeBackendServiceOutlierDetectionEnforcingSuccessRate(original["enforcingSuccessRate"], d, config) transformed["interval"] = - flattenComputeBackendServiceOutlierDetectionInterval(original["interval"], d) + flattenComputeBackendServiceOutlierDetectionInterval(original["interval"], d, config) transformed["max_ejection_percent"] = - flattenComputeBackendServiceOutlierDetectionMaxEjectionPercent(original["maxEjectionPercent"], d) + flattenComputeBackendServiceOutlierDetectionMaxEjectionPercent(original["maxEjectionPercent"], d, config) transformed["success_rate_minimum_hosts"] = - flattenComputeBackendServiceOutlierDetectionSuccessRateMinimumHosts(original["successRateMinimumHosts"], d) + flattenComputeBackendServiceOutlierDetectionSuccessRateMinimumHosts(original["successRateMinimumHosts"], d, config) transformed["success_rate_request_volume"] = - flattenComputeBackendServiceOutlierDetectionSuccessRateRequestVolume(original["successRateRequestVolume"], d) + flattenComputeBackendServiceOutlierDetectionSuccessRateRequestVolume(original["successRateRequestVolume"], d, config) transformed["success_rate_stdev_factor"] = - flattenComputeBackendServiceOutlierDetectionSuccessRateStdevFactor(original["successRateStdevFactor"], d) + flattenComputeBackendServiceOutlierDetectionSuccessRateStdevFactor(original["successRateStdevFactor"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceOutlierDetectionBaseEjectionTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionBaseEjectionTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1999,12 +1999,12 @@ func flattenComputeBackendServiceOutlierDetectionBaseEjectionTime(v interface{}, } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeSeconds(original["seconds"], d) + flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeNanos(original["nanos"], d) + flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeSeconds(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 { @@ -2014,7 +2014,7 @@ func flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeSeconds(v inter return v } -func flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeNanos(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 { @@ -2024,7 +2024,7 @@ func flattenComputeBackendServiceOutlierDetectionBaseEjectionTimeNanos(v interfa return v } -func flattenComputeBackendServiceOutlierDetectionConsecutiveErrors(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionConsecutiveErrors(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 { @@ -2034,7 +2034,7 @@ func flattenComputeBackendServiceOutlierDetectionConsecutiveErrors(v interface{} return v } -func flattenComputeBackendServiceOutlierDetectionConsecutiveGatewayFailure(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionConsecutiveGatewayFailure(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 { @@ -2044,7 +2044,7 @@ func flattenComputeBackendServiceOutlierDetectionConsecutiveGatewayFailure(v int return v } -func flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveErrors(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveErrors(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 { @@ -2054,7 +2054,7 @@ func flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveErrors(v in return v } -func flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(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 { @@ -2064,7 +2064,7 @@ func flattenComputeBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFail return v } -func flattenComputeBackendServiceOutlierDetectionEnforcingSuccessRate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionEnforcingSuccessRate(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 { @@ -2074,7 +2074,7 @@ func flattenComputeBackendServiceOutlierDetectionEnforcingSuccessRate(v interfac return v } -func flattenComputeBackendServiceOutlierDetectionInterval(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionInterval(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2084,12 +2084,12 @@ func flattenComputeBackendServiceOutlierDetectionInterval(v interface{}, d *sche } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeBackendServiceOutlierDetectionIntervalSeconds(original["seconds"], d) + flattenComputeBackendServiceOutlierDetectionIntervalSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeBackendServiceOutlierDetectionIntervalNanos(original["nanos"], d) + flattenComputeBackendServiceOutlierDetectionIntervalNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceOutlierDetectionIntervalSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionIntervalSeconds(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 { @@ -2099,7 +2099,7 @@ func flattenComputeBackendServiceOutlierDetectionIntervalSeconds(v interface{}, return v } -func flattenComputeBackendServiceOutlierDetectionIntervalNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionIntervalNanos(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 { @@ -2109,7 +2109,7 @@ func flattenComputeBackendServiceOutlierDetectionIntervalNanos(v interface{}, d return v } -func flattenComputeBackendServiceOutlierDetectionMaxEjectionPercent(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionMaxEjectionPercent(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 { @@ -2119,7 +2119,7 @@ func flattenComputeBackendServiceOutlierDetectionMaxEjectionPercent(v interface{ return v } -func flattenComputeBackendServiceOutlierDetectionSuccessRateMinimumHosts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionSuccessRateMinimumHosts(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 { @@ -2129,7 +2129,7 @@ func flattenComputeBackendServiceOutlierDetectionSuccessRateMinimumHosts(v inter return v } -func flattenComputeBackendServiceOutlierDetectionSuccessRateRequestVolume(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionSuccessRateRequestVolume(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 { @@ -2139,7 +2139,7 @@ func flattenComputeBackendServiceOutlierDetectionSuccessRateRequestVolume(v inte return v } -func flattenComputeBackendServiceOutlierDetectionSuccessRateStdevFactor(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceOutlierDetectionSuccessRateStdevFactor(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 { @@ -2149,23 +2149,23 @@ func flattenComputeBackendServiceOutlierDetectionSuccessRateStdevFactor(v interf 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 { @@ -2175,7 +2175,7 @@ func flattenComputeBackendServiceTimeoutSec(v interface{}, d *schema.ResourceDat return v } -func flattenComputeBackendServiceLogConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceLogConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2185,16 +2185,16 @@ func flattenComputeBackendServiceLogConfig(v interface{}, d *schema.ResourceData } transformed := make(map[string]interface{}) transformed["enable"] = - flattenComputeBackendServiceLogConfigEnable(original["enable"], d) + flattenComputeBackendServiceLogConfigEnable(original["enable"], d, config) transformed["sample_rate"] = - flattenComputeBackendServiceLogConfigSampleRate(original["sampleRate"], d) + flattenComputeBackendServiceLogConfigSampleRate(original["sampleRate"], d, config) return []interface{}{transformed} } -func flattenComputeBackendServiceLogConfigEnable(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceLogConfigEnable(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeBackendServiceLogConfigSampleRate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeBackendServiceLogConfigSampleRate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_compute_backend_service_signed_url_key.go b/google-beta/resource_compute_backend_service_signed_url_key.go index e421aeb0b0..e0c88dff0e 100644 --- a/google-beta/resource_compute_backend_service_signed_url_key.go +++ b/google-beta/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-beta/resource_compute_disk.go b/google-beta/resource_compute_disk.go index 50218761f9..6a52c99699 100644 --- a/google-beta/resource_compute_disk.go +++ b/google-beta/resource_compute_disk.go @@ -694,64 +694,64 @@ 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("resource_policies", flattenComputeDiskResourcePolicies(res["resourcePolicies"], d)); err != nil { + if err := d.Set("resource_policies", flattenComputeDiskResourcePolicies(res["resourcePolicies"], 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 { @@ -948,35 +948,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 { @@ -986,14 +986,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 { @@ -1003,32 +1003,32 @@ 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 flattenComputeDiskResourcePolicies(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeDiskResourcePolicies(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -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 } @@ -1038,30 +1038,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 } @@ -1071,33 +1071,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 } @@ -1107,26 +1107,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-beta/resource_compute_disk_resource_policy_attachment.go b/google-beta/resource_compute_disk_resource_policy_attachment.go index e3a13f5a92..49a871d1b3 100644 --- a/google-beta/resource_compute_disk_resource_policy_attachment.go +++ b/google-beta/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-beta/resource_compute_external_vpn_gateway.go b/google-beta/resource_compute_external_vpn_gateway.go index cd0e0515ce..18c21abf5f 100644 --- a/google-beta/resource_compute_external_vpn_gateway.go +++ b/google-beta/resource_compute_external_vpn_gateway.go @@ -196,16 +196,16 @@ func resourceComputeExternalVpnGatewayRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error reading ExternalVpnGateway: %s", err) } - if err := d.Set("description", flattenComputeExternalVpnGatewayDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeExternalVpnGatewayDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading ExternalVpnGateway: %s", err) } - if err := d.Set("name", flattenComputeExternalVpnGatewayName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeExternalVpnGatewayName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ExternalVpnGateway: %s", err) } - if err := d.Set("redundancy_type", flattenComputeExternalVpnGatewayRedundancyType(res["redundancyType"], d)); err != nil { + if err := d.Set("redundancy_type", flattenComputeExternalVpnGatewayRedundancyType(res["redundancyType"], d, config)); err != nil { return fmt.Errorf("Error reading ExternalVpnGateway: %s", err) } - if err := d.Set("interface", flattenComputeExternalVpnGatewayInterface(res["interfaces"], d)); err != nil { + if err := d.Set("interface", flattenComputeExternalVpnGatewayInterface(res["interfaces"], d, config)); err != nil { return fmt.Errorf("Error reading ExternalVpnGateway: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -268,19 +268,19 @@ func resourceComputeExternalVpnGatewayImport(d *schema.ResourceData, meta interf return []*schema.ResourceData{d}, nil } -func flattenComputeExternalVpnGatewayDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeExternalVpnGatewayDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeExternalVpnGatewayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeExternalVpnGatewayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeExternalVpnGatewayRedundancyType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeExternalVpnGatewayRedundancyType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeExternalVpnGatewayInterface(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeExternalVpnGatewayInterface(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -293,13 +293,13 @@ func flattenComputeExternalVpnGatewayInterface(v interface{}, d *schema.Resource continue } transformed = append(transformed, map[string]interface{}{ - "id": flattenComputeExternalVpnGatewayInterfaceId(original["id"], d), - "ip_address": flattenComputeExternalVpnGatewayInterfaceIpAddress(original["ipAddress"], d), + "id": flattenComputeExternalVpnGatewayInterfaceId(original["id"], d, config), + "ip_address": flattenComputeExternalVpnGatewayInterfaceIpAddress(original["ipAddress"], d, config), }) } return transformed } -func flattenComputeExternalVpnGatewayInterfaceId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeExternalVpnGatewayInterfaceId(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,7 +309,7 @@ func flattenComputeExternalVpnGatewayInterfaceId(v interface{}, d *schema.Resour return v } -func flattenComputeExternalVpnGatewayInterfaceIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeExternalVpnGatewayInterfaceIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_compute_firewall.go b/google-beta/resource_compute_firewall.go index a7fc70ee66..862fa14fda 100644 --- a/google-beta/resource_compute_firewall.go +++ b/google-beta/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-beta/resource_compute_forwarding_rule.go b/google-beta/resource_compute_forwarding_rule.go index 23bbb14cab..2470f1f214 100644 --- a/google-beta/resource_compute_forwarding_rule.go +++ b/google-beta/resource_compute_forwarding_rule.go @@ -508,64 +508,64 @@ 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("allow_global_access", flattenComputeForwardingRuleAllowGlobalAccess(res["allowGlobalAccess"], d)); err != nil { + if err := d.Set("allow_global_access", flattenComputeForwardingRuleAllowGlobalAccess(res["allowGlobalAccess"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("labels", flattenComputeForwardingRuleLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeForwardingRuleLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading ForwardingRule: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeForwardingRuleLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeForwardingRuleLabelFingerprint(res["labelFingerprint"], 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 { @@ -736,95 +736,95 @@ 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 flattenComputeForwardingRuleAllowGlobalAccess(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleAllowGlobalAccess(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeForwardingRuleLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeForwardingRuleLabelFingerprint(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-beta/resource_compute_global_address.go b/google-beta/resource_compute_global_address.go index fdb24dcb26..546f2e0f6f 100644 --- a/google-beta/resource_compute_global_address.go +++ b/google-beta/resource_compute_global_address.go @@ -312,37 +312,37 @@ 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("labels", flattenComputeGlobalAddressLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeGlobalAddressLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalAddress: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeGlobalAddressLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeGlobalAddressLabelFingerprint(res["labelFingerprint"], 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 { @@ -456,35 +456,35 @@ 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 flattenComputeGlobalAddressLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalAddressLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalAddressLabelFingerprint(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 { @@ -494,15 +494,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-beta/resource_compute_global_forwarding_rule.go b/google-beta/resource_compute_global_forwarding_rule.go index af9edbb9e5..08f1cd12ca 100644 --- a/google-beta/resource_compute_global_forwarding_rule.go +++ b/google-beta/resource_compute_global_forwarding_rule.go @@ -437,40 +437,40 @@ 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("labels", flattenComputeGlobalForwardingRuleLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeGlobalForwardingRuleLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading GlobalForwardingRule: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeGlobalForwardingRuleLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeGlobalForwardingRuleLabelFingerprint(res["labelFingerprint"], 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("network", flattenComputeGlobalForwardingRuleNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeGlobalForwardingRuleNetwork(res["network"], 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 { @@ -612,35 +612,35 @@ 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 flattenComputeGlobalForwardingRuleLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeGlobalForwardingRuleLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleLabelFingerprint(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 } @@ -653,17 +653,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 } @@ -676,36 +676,36 @@ 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 flattenComputeGlobalForwardingRuleNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeGlobalForwardingRuleNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -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-beta/resource_compute_ha_vpn_gateway.go b/google-beta/resource_compute_ha_vpn_gateway.go index de0e87955e..e2c6ffed18 100644 --- a/google-beta/resource_compute_ha_vpn_gateway.go +++ b/google-beta/resource_compute_ha_vpn_gateway.go @@ -194,19 +194,19 @@ func resourceComputeHaVpnGatewayRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error reading HaVpnGateway: %s", err) } - if err := d.Set("description", flattenComputeHaVpnGatewayDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeHaVpnGatewayDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading HaVpnGateway: %s", err) } - if err := d.Set("name", flattenComputeHaVpnGatewayName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeHaVpnGatewayName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading HaVpnGateway: %s", err) } - if err := d.Set("network", flattenComputeHaVpnGatewayNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeHaVpnGatewayNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading HaVpnGateway: %s", err) } - if err := d.Set("vpn_interfaces", flattenComputeHaVpnGatewayVpnInterfaces(res["vpnInterfaces"], d)); err != nil { + if err := d.Set("vpn_interfaces", flattenComputeHaVpnGatewayVpnInterfaces(res["vpnInterfaces"], d, config)); err != nil { return fmt.Errorf("Error reading HaVpnGateway: %s", err) } - if err := d.Set("region", flattenComputeHaVpnGatewayRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeHaVpnGatewayRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading HaVpnGateway: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -270,22 +270,22 @@ func resourceComputeHaVpnGatewayImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenComputeHaVpnGatewayDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHaVpnGatewayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHaVpnGatewayNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeHaVpnGatewayVpnInterfaces(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayVpnInterfaces(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -298,13 +298,13 @@ func flattenComputeHaVpnGatewayVpnInterfaces(v interface{}, d *schema.ResourceDa continue } transformed = append(transformed, map[string]interface{}{ - "id": flattenComputeHaVpnGatewayVpnInterfacesId(original["id"], d), - "ip_address": flattenComputeHaVpnGatewayVpnInterfacesIpAddress(original["ipAddress"], d), + "id": flattenComputeHaVpnGatewayVpnInterfacesId(original["id"], d, config), + "ip_address": flattenComputeHaVpnGatewayVpnInterfacesIpAddress(original["ipAddress"], d, config), }) } return transformed } -func flattenComputeHaVpnGatewayVpnInterfacesId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayVpnInterfacesId(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 { @@ -314,11 +314,11 @@ func flattenComputeHaVpnGatewayVpnInterfacesId(v interface{}, d *schema.Resource return v } -func flattenComputeHaVpnGatewayVpnInterfacesIpAddress(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayVpnInterfacesIpAddress(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeHaVpnGatewayRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeHaVpnGatewayRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google-beta/resource_compute_health_check.go b/google-beta/resource_compute_health_check.go index a7e8d99e80..f2b38c8a55 100644 --- a/google-beta/resource_compute_health_check.go +++ b/google-beta/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-beta/resource_compute_http_health_check.go b/google-beta/resource_compute_http_health_check.go index 0f05ea9cda..dfbaf0da5a 100644 --- a/google-beta/resource_compute_http_health_check.go +++ b/google-beta/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-beta/resource_compute_https_health_check.go b/google-beta/resource_compute_https_health_check.go index 7c2557a740..682a9fba67 100644 --- a/google-beta/resource_compute_https_health_check.go +++ b/google-beta/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-beta/resource_compute_image.go b/google-beta/resource_compute_image.go index 18055f131f..141643b47e 100644 --- a/google-beta/resource_compute_image.go +++ b/google-beta/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-beta/resource_compute_interconnect_attachment.go b/google-beta/resource_compute_interconnect_attachment.go index 10e0558075..1fe89f4092 100644 --- a/google-beta/resource_compute_interconnect_attachment.go +++ b/google-beta/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-beta/resource_compute_managed_ssl_certificate.go b/google-beta/resource_compute_managed_ssl_certificate.go index f37d62bc3d..5c1f6c4aea 100644 --- a/google-beta/resource_compute_managed_ssl_certificate.go +++ b/google-beta/resource_compute_managed_ssl_certificate.go @@ -220,28 +220,28 @@ func resourceComputeManagedSslCertificateRead(d *schema.ResourceData, meta inter return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeManagedSslCertificateCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeManagedSslCertificateCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("description", flattenComputeManagedSslCertificateDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeManagedSslCertificateDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("certificate_id", flattenComputeManagedSslCertificateCertificateId(res["id"], d)); err != nil { + if err := d.Set("certificate_id", flattenComputeManagedSslCertificateCertificateId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("name", flattenComputeManagedSslCertificateName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeManagedSslCertificateName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("managed", flattenComputeManagedSslCertificateManaged(res["managed"], d)); err != nil { + if err := d.Set("managed", flattenComputeManagedSslCertificateManaged(res["managed"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("type", flattenComputeManagedSslCertificateType(res["type"], d)); err != nil { + if err := d.Set("type", flattenComputeManagedSslCertificateType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("subject_alternative_names", flattenComputeManagedSslCertificateSubjectAlternativeNames(res["subjectAlternativeNames"], d)); err != nil { + if err := d.Set("subject_alternative_names", flattenComputeManagedSslCertificateSubjectAlternativeNames(res["subjectAlternativeNames"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } - if err := d.Set("expire_time", flattenComputeManagedSslCertificateExpireTime(res["expireTime"], d)); err != nil { + if err := d.Set("expire_time", flattenComputeManagedSslCertificateExpireTime(res["expireTime"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedSslCertificate: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -304,15 +304,15 @@ func resourceComputeManagedSslCertificateImport(d *schema.ResourceData, meta int return []*schema.ResourceData{d}, nil } -func flattenComputeManagedSslCertificateCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeManagedSslCertificateDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeManagedSslCertificateCertificateId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateCertificateId(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 { @@ -322,11 +322,11 @@ func flattenComputeManagedSslCertificateCertificateId(v interface{}, d *schema.R return v } -func flattenComputeManagedSslCertificateName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeManagedSslCertificateManaged(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateManaged(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -336,22 +336,22 @@ func flattenComputeManagedSslCertificateManaged(v interface{}, d *schema.Resourc } transformed := make(map[string]interface{}) transformed["domains"] = - flattenComputeManagedSslCertificateManagedDomains(original["domains"], d) + flattenComputeManagedSslCertificateManagedDomains(original["domains"], d, config) return []interface{}{transformed} } -func flattenComputeManagedSslCertificateManagedDomains(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateManagedDomains(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeManagedSslCertificateType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeManagedSslCertificateSubjectAlternativeNames(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateSubjectAlternativeNames(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeManagedSslCertificateExpireTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeManagedSslCertificateExpireTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_compute_network.go b/google-beta/resource_compute_network.go index 1b3e91c036..7b4e0cff8b 100644 --- a/google-beta/resource_compute_network.go +++ b/google-beta/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-beta/resource_compute_network_endpoint.go b/google-beta/resource_compute_network_endpoint.go index 501f648dc3..843f1a86a8 100644 --- a/google-beta/resource_compute_network_endpoint.go +++ b/google-beta/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-beta/resource_compute_network_endpoint_group.go b/google-beta/resource_compute_network_endpoint_group.go index 5e4f4cf3b5..3f578ea97f 100644 --- a/google-beta/resource_compute_network_endpoint_group.go +++ b/google-beta/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-beta/resource_compute_network_peering_routes_config.go b/google-beta/resource_compute_network_peering_routes_config.go index d0c5d89a4a..8859dc173a 100644 --- a/google-beta/resource_compute_network_peering_routes_config.go +++ b/google-beta/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-beta/resource_compute_node_group.go b/google-beta/resource_compute_node_group.go index bc7b2ead9d..69964e8d22 100644 --- a/google-beta/resource_compute_node_group.go +++ b/google-beta/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-beta/resource_compute_node_template.go b/google-beta/resource_compute_node_template.go index 9617e493b8..29286e5564 100644 --- a/google-beta/resource_compute_node_template.go +++ b/google-beta/resource_compute_node_template.go @@ -266,28 +266,28 @@ 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("server_binding", flattenComputeNodeTemplateServerBinding(res["serverBinding"], d)); err != nil { + if err := d.Set("server_binding", flattenComputeNodeTemplateServerBinding(res["serverBinding"], 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 { @@ -351,27 +351,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 } @@ -381,26 +381,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 flattenComputeNodeTemplateServerBinding(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateServerBinding(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -410,14 +410,14 @@ func flattenComputeNodeTemplateServerBinding(v interface{}, d *schema.ResourceDa } transformed := make(map[string]interface{}) transformed["type"] = - flattenComputeNodeTemplateServerBindingType(original["type"], d) + flattenComputeNodeTemplateServerBindingType(original["type"], d, config) return []interface{}{transformed} } -func flattenComputeNodeTemplateServerBindingType(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeNodeTemplateServerBindingType(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-beta/resource_compute_region_autoscaler.go b/google-beta/resource_compute_region_autoscaler.go index 4e33ff0d0c..e33eebe4b0 100644 --- a/google-beta/resource_compute_region_autoscaler.go +++ b/google-beta/resource_compute_region_autoscaler.go @@ -374,22 +374,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 { @@ -516,19 +516,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 } @@ -538,20 +538,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 { @@ -561,7 +561,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 { @@ -571,7 +571,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 { @@ -581,7 +581,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 } @@ -591,14 +591,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 } @@ -611,36 +611,36 @@ func flattenComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d *sch continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeRegionAutoscalerAutoscalingPolicyMetricName(original["metric"], d), - "single_instance_assignment": flattenComputeRegionAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(original["singleInstanceAssignment"], d), - "target": flattenComputeRegionAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d), - "type": flattenComputeRegionAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d), - "filter": flattenComputeRegionAutoscalerAutoscalingPolicyMetricFilter(original["filter"], d), + "name": flattenComputeRegionAutoscalerAutoscalingPolicyMetricName(original["metric"], d, config), + "single_instance_assignment": flattenComputeRegionAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(original["singleInstanceAssignment"], d, config), + "target": flattenComputeRegionAutoscalerAutoscalingPolicyMetricTarget(original["utilizationTarget"], d, config), + "type": flattenComputeRegionAutoscalerAutoscalingPolicyMetricType(original["utilizationTargetType"], d, config), + "filter": flattenComputeRegionAutoscalerAutoscalingPolicyMetricFilter(original["filter"], 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 flattenComputeRegionAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMetricSingleInstanceAssignment(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 flattenComputeRegionAutoscalerAutoscalingPolicyMetricFilter(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionAutoscalerAutoscalingPolicyMetricFilter(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 } @@ -650,18 +650,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-beta/resource_compute_region_backend_service.go b/google-beta/resource_compute_region_backend_service.go index 7a11084d0a..9818f15010 100644 --- a/google-beta/resource_compute_region_backend_service.go +++ b/google-beta/resource_compute_region_backend_service.go @@ -1006,21 +1006,21 @@ func resourceComputeRegionBackendServiceRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("affinity_cookie_ttl_sec", flattenComputeRegionBackendServiceAffinityCookieTtlSec(res["affinityCookieTtlSec"], d)); err != nil { + if err := d.Set("affinity_cookie_ttl_sec", flattenComputeRegionBackendServiceAffinityCookieTtlSec(res["affinityCookieTtlSec"], d, config)); err != nil { 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) } - if err := d.Set("circuit_breakers", flattenComputeRegionBackendServiceCircuitBreakers(res["circuitBreakers"], d)); err != nil { + if err := d.Set("circuit_breakers", flattenComputeRegionBackendServiceCircuitBreakers(res["circuitBreakers"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("consistent_hash", flattenComputeRegionBackendServiceConsistentHash(res["consistentHash"], d)); err != nil { + if err := d.Set("consistent_hash", flattenComputeRegionBackendServiceConsistentHash(res["consistentHash"], 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{}) { @@ -1028,49 +1028,49 @@ 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("failover_policy", flattenComputeRegionBackendServiceFailoverPolicy(res["failoverPolicy"], d)); err != nil { + if err := d.Set("failover_policy", flattenComputeRegionBackendServiceFailoverPolicy(res["failoverPolicy"], 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("locality_lb_policy", flattenComputeRegionBackendServiceLocalityLbPolicy(res["localityLbPolicy"], d)); err != nil { + if err := d.Set("locality_lb_policy", flattenComputeRegionBackendServiceLocalityLbPolicy(res["localityLbPolicy"], 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("outlier_detection", flattenComputeRegionBackendServiceOutlierDetection(res["outlierDetection"], d)); err != nil { + if err := d.Set("outlier_detection", flattenComputeRegionBackendServiceOutlierDetection(res["outlierDetection"], 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("log_config", flattenComputeRegionBackendServiceLogConfig(res["logConfig"], d)); err != nil { + if err := d.Set("log_config", flattenComputeRegionBackendServiceLogConfig(res["logConfig"], d, config)); err != nil { return fmt.Errorf("Error reading RegionBackendService: %s", err) } - if err := d.Set("network", flattenComputeRegionBackendServiceNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenComputeRegionBackendServiceNetwork(res["network"], 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 { @@ -1286,7 +1286,7 @@ func resourceComputeRegionBackendServiceImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenComputeRegionBackendServiceAffinityCookieTtlSec(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceAffinityCookieTtlSec(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 { @@ -1296,7 +1296,7 @@ func flattenComputeRegionBackendServiceAffinityCookieTtlSec(v interface{}, d *sc return v } -func flattenComputeRegionBackendServiceBackend(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackend(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1309,46 +1309,46 @@ 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), - "failover": flattenComputeRegionBackendServiceBackendFailover(original["failover"], 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), + "failover": flattenComputeRegionBackendServiceBackendFailover(original["failover"], 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 flattenComputeRegionBackendServiceBackendFailover(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceBackendFailover(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 { @@ -1358,7 +1358,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 { @@ -1368,7 +1368,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 { @@ -1378,7 +1378,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 { @@ -1388,19 +1388,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 flattenComputeRegionBackendServiceCircuitBreakers(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1410,20 +1410,20 @@ func flattenComputeRegionBackendServiceCircuitBreakers(v interface{}, d *schema. } transformed := make(map[string]interface{}) transformed["connect_timeout"] = - flattenComputeRegionBackendServiceCircuitBreakersConnectTimeout(original["connectTimeout"], d) + flattenComputeRegionBackendServiceCircuitBreakersConnectTimeout(original["connectTimeout"], d, config) transformed["max_requests_per_connection"] = - flattenComputeRegionBackendServiceCircuitBreakersMaxRequestsPerConnection(original["maxRequestsPerConnection"], d) + flattenComputeRegionBackendServiceCircuitBreakersMaxRequestsPerConnection(original["maxRequestsPerConnection"], d, config) transformed["max_connections"] = - flattenComputeRegionBackendServiceCircuitBreakersMaxConnections(original["maxConnections"], d) + flattenComputeRegionBackendServiceCircuitBreakersMaxConnections(original["maxConnections"], d, config) transformed["max_pending_requests"] = - flattenComputeRegionBackendServiceCircuitBreakersMaxPendingRequests(original["maxPendingRequests"], d) + flattenComputeRegionBackendServiceCircuitBreakersMaxPendingRequests(original["maxPendingRequests"], d, config) transformed["max_requests"] = - flattenComputeRegionBackendServiceCircuitBreakersMaxRequests(original["maxRequests"], d) + flattenComputeRegionBackendServiceCircuitBreakersMaxRequests(original["maxRequests"], d, config) transformed["max_retries"] = - flattenComputeRegionBackendServiceCircuitBreakersMaxRetries(original["maxRetries"], d) + flattenComputeRegionBackendServiceCircuitBreakersMaxRetries(original["maxRetries"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1433,12 +1433,12 @@ func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeout(v interface } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutSeconds(original["seconds"], d) + flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutNanos(original["nanos"], d) + flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutSeconds(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 { @@ -1448,7 +1448,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutSeconds(v in return v } -func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutNanos(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 { @@ -1458,7 +1458,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersConnectTimeoutNanos(v inte return v } -func flattenComputeRegionBackendServiceCircuitBreakersMaxRequestsPerConnection(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersMaxRequestsPerConnection(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 { @@ -1468,7 +1468,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersMaxRequestsPerConnection(v return v } -func flattenComputeRegionBackendServiceCircuitBreakersMaxConnections(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersMaxConnections(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 { @@ -1478,7 +1478,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersMaxConnections(v interface return v } -func flattenComputeRegionBackendServiceCircuitBreakersMaxPendingRequests(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersMaxPendingRequests(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 { @@ -1488,7 +1488,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersMaxPendingRequests(v inter return v } -func flattenComputeRegionBackendServiceCircuitBreakersMaxRequests(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersMaxRequests(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 { @@ -1498,7 +1498,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersMaxRequests(v interface{}, return v } -func flattenComputeRegionBackendServiceCircuitBreakersMaxRetries(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceCircuitBreakersMaxRetries(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 { @@ -1508,7 +1508,7 @@ func flattenComputeRegionBackendServiceCircuitBreakersMaxRetries(v interface{}, return v } -func flattenComputeRegionBackendServiceConsistentHash(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHash(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1518,14 +1518,14 @@ func flattenComputeRegionBackendServiceConsistentHash(v interface{}, d *schema.R } transformed := make(map[string]interface{}) transformed["http_cookie"] = - flattenComputeRegionBackendServiceConsistentHashHttpCookie(original["httpCookie"], d) + flattenComputeRegionBackendServiceConsistentHashHttpCookie(original["httpCookie"], d, config) transformed["http_header_name"] = - flattenComputeRegionBackendServiceConsistentHashHttpHeaderName(original["httpHeaderName"], d) + flattenComputeRegionBackendServiceConsistentHashHttpHeaderName(original["httpHeaderName"], d, config) transformed["minimum_ring_size"] = - flattenComputeRegionBackendServiceConsistentHashMinimumRingSize(original["minimumRingSize"], d) + flattenComputeRegionBackendServiceConsistentHashMinimumRingSize(original["minimumRingSize"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceConsistentHashHttpCookie(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpCookie(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1535,14 +1535,14 @@ func flattenComputeRegionBackendServiceConsistentHashHttpCookie(v interface{}, d } transformed := make(map[string]interface{}) transformed["ttl"] = - flattenComputeRegionBackendServiceConsistentHashHttpCookieTtl(original["ttl"], d) + flattenComputeRegionBackendServiceConsistentHashHttpCookieTtl(original["ttl"], d, config) transformed["name"] = - flattenComputeRegionBackendServiceConsistentHashHttpCookieName(original["name"], d) + flattenComputeRegionBackendServiceConsistentHashHttpCookieName(original["name"], d, config) transformed["path"] = - flattenComputeRegionBackendServiceConsistentHashHttpCookiePath(original["path"], d) + flattenComputeRegionBackendServiceConsistentHashHttpCookiePath(original["path"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtl(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtl(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1552,12 +1552,12 @@ func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtl(v interface{} } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlSeconds(original["seconds"], d) + flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlNanos(original["nanos"], d) + flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlSeconds(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 { @@ -1567,7 +1567,7 @@ func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlSeconds(v inte return v } -func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlNanos(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 { @@ -1577,19 +1577,19 @@ func flattenComputeRegionBackendServiceConsistentHashHttpCookieTtlNanos(v interf return v } -func flattenComputeRegionBackendServiceConsistentHashHttpCookieName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpCookieName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceConsistentHashHttpCookiePath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpCookiePath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceConsistentHashHttpHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashHttpHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceConsistentHashMinimumRingSize(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceConsistentHashMinimumRingSize(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 { @@ -1599,7 +1599,7 @@ func flattenComputeRegionBackendServiceConsistentHashMinimumRingSize(v 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 } @@ -1609,10 +1609,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 { @@ -1622,15 +1622,15 @@ 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 flattenComputeRegionBackendServiceFailoverPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceFailoverPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1640,49 +1640,49 @@ func flattenComputeRegionBackendServiceFailoverPolicy(v interface{}, d *schema.R } transformed := make(map[string]interface{}) transformed["disable_connection_drain_on_failover"] = - flattenComputeRegionBackendServiceFailoverPolicyDisableConnectionDrainOnFailover(original["disableConnectionDrainOnFailover"], d) + flattenComputeRegionBackendServiceFailoverPolicyDisableConnectionDrainOnFailover(original["disableConnectionDrainOnFailover"], d, config) transformed["drop_traffic_if_unhealthy"] = - flattenComputeRegionBackendServiceFailoverPolicyDropTrafficIfUnhealthy(original["dropTrafficIfUnhealthy"], d) + flattenComputeRegionBackendServiceFailoverPolicyDropTrafficIfUnhealthy(original["dropTrafficIfUnhealthy"], d, config) transformed["failover_ratio"] = - flattenComputeRegionBackendServiceFailoverPolicyFailoverRatio(original["failoverRatio"], d) + flattenComputeRegionBackendServiceFailoverPolicyFailoverRatio(original["failoverRatio"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceFailoverPolicyDisableConnectionDrainOnFailover(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceFailoverPolicyDisableConnectionDrainOnFailover(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceFailoverPolicyDropTrafficIfUnhealthy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceFailoverPolicyDropTrafficIfUnhealthy(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceFailoverPolicyFailoverRatio(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceFailoverPolicyFailoverRatio(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 flattenComputeRegionBackendServiceLocalityLbPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceLocalityLbPolicy(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 flattenComputeRegionBackendServiceOutlierDetection(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetection(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1692,30 +1692,30 @@ func flattenComputeRegionBackendServiceOutlierDetection(v interface{}, d *schema } transformed := make(map[string]interface{}) transformed["base_ejection_time"] = - flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTime(original["baseEjectionTime"], d) + flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTime(original["baseEjectionTime"], d, config) transformed["consecutive_errors"] = - flattenComputeRegionBackendServiceOutlierDetectionConsecutiveErrors(original["consecutiveErrors"], d) + flattenComputeRegionBackendServiceOutlierDetectionConsecutiveErrors(original["consecutiveErrors"], d, config) transformed["consecutive_gateway_failure"] = - flattenComputeRegionBackendServiceOutlierDetectionConsecutiveGatewayFailure(original["consecutiveGatewayFailure"], d) + flattenComputeRegionBackendServiceOutlierDetectionConsecutiveGatewayFailure(original["consecutiveGatewayFailure"], d, config) transformed["enforcing_consecutive_errors"] = - flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveErrors(original["enforcingConsecutiveErrors"], d) + flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveErrors(original["enforcingConsecutiveErrors"], d, config) transformed["enforcing_consecutive_gateway_failure"] = - flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(original["enforcingConsecutiveGatewayFailure"], d) + flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(original["enforcingConsecutiveGatewayFailure"], d, config) transformed["enforcing_success_rate"] = - flattenComputeRegionBackendServiceOutlierDetectionEnforcingSuccessRate(original["enforcingSuccessRate"], d) + flattenComputeRegionBackendServiceOutlierDetectionEnforcingSuccessRate(original["enforcingSuccessRate"], d, config) transformed["interval"] = - flattenComputeRegionBackendServiceOutlierDetectionInterval(original["interval"], d) + flattenComputeRegionBackendServiceOutlierDetectionInterval(original["interval"], d, config) transformed["max_ejection_percent"] = - flattenComputeRegionBackendServiceOutlierDetectionMaxEjectionPercent(original["maxEjectionPercent"], d) + flattenComputeRegionBackendServiceOutlierDetectionMaxEjectionPercent(original["maxEjectionPercent"], d, config) transformed["success_rate_minimum_hosts"] = - flattenComputeRegionBackendServiceOutlierDetectionSuccessRateMinimumHosts(original["successRateMinimumHosts"], d) + flattenComputeRegionBackendServiceOutlierDetectionSuccessRateMinimumHosts(original["successRateMinimumHosts"], d, config) transformed["success_rate_request_volume"] = - flattenComputeRegionBackendServiceOutlierDetectionSuccessRateRequestVolume(original["successRateRequestVolume"], d) + flattenComputeRegionBackendServiceOutlierDetectionSuccessRateRequestVolume(original["successRateRequestVolume"], d, config) transformed["success_rate_stdev_factor"] = - flattenComputeRegionBackendServiceOutlierDetectionSuccessRateStdevFactor(original["successRateStdevFactor"], d) + flattenComputeRegionBackendServiceOutlierDetectionSuccessRateStdevFactor(original["successRateStdevFactor"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1725,12 +1725,12 @@ func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTime(v interf } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeSeconds(original["seconds"], d) + flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeNanos(original["nanos"], d) + flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeSeconds(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 { @@ -1740,7 +1740,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeSeconds(v return v } -func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeNanos(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 { @@ -1750,7 +1750,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionBaseEjectionTimeNanos(v i return v } -func flattenComputeRegionBackendServiceOutlierDetectionConsecutiveErrors(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionConsecutiveErrors(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 { @@ -1760,7 +1760,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionConsecutiveErrors(v inter return v } -func flattenComputeRegionBackendServiceOutlierDetectionConsecutiveGatewayFailure(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionConsecutiveGatewayFailure(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 { @@ -1770,7 +1770,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionConsecutiveGatewayFailure return v } -func flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveErrors(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveErrors(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 { @@ -1780,7 +1780,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveError return v } -func flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveGatewayFailure(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 { @@ -1790,7 +1790,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionEnforcingConsecutiveGatew return v } -func flattenComputeRegionBackendServiceOutlierDetectionEnforcingSuccessRate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionEnforcingSuccessRate(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 { @@ -1800,7 +1800,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionEnforcingSuccessRate(v in return v } -func flattenComputeRegionBackendServiceOutlierDetectionInterval(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionInterval(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1810,12 +1810,12 @@ func flattenComputeRegionBackendServiceOutlierDetectionInterval(v interface{}, d } transformed := make(map[string]interface{}) transformed["seconds"] = - flattenComputeRegionBackendServiceOutlierDetectionIntervalSeconds(original["seconds"], d) + flattenComputeRegionBackendServiceOutlierDetectionIntervalSeconds(original["seconds"], d, config) transformed["nanos"] = - flattenComputeRegionBackendServiceOutlierDetectionIntervalNanos(original["nanos"], d) + flattenComputeRegionBackendServiceOutlierDetectionIntervalNanos(original["nanos"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceOutlierDetectionIntervalSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionIntervalSeconds(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 { @@ -1825,7 +1825,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionIntervalSeconds(v interfa return v } -func flattenComputeRegionBackendServiceOutlierDetectionIntervalNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionIntervalNanos(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 { @@ -1835,7 +1835,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionIntervalNanos(v interface return v } -func flattenComputeRegionBackendServiceOutlierDetectionMaxEjectionPercent(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionMaxEjectionPercent(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 { @@ -1845,7 +1845,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionMaxEjectionPercent(v inte return v } -func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateMinimumHosts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateMinimumHosts(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 { @@ -1855,7 +1855,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateMinimumHosts(v return v } -func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateRequestVolume(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateRequestVolume(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 { @@ -1865,7 +1865,7 @@ func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateRequestVolume( return v } -func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateStdevFactor(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateStdevFactor(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 { @@ -1875,15 +1875,15 @@ func flattenComputeRegionBackendServiceOutlierDetectionSuccessRateStdevFactor(v 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 { @@ -1893,7 +1893,7 @@ func flattenComputeRegionBackendServiceTimeoutSec(v interface{}, d *schema.Resou return v } -func flattenComputeRegionBackendServiceLogConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceLogConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1903,27 +1903,27 @@ func flattenComputeRegionBackendServiceLogConfig(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["enable"] = - flattenComputeRegionBackendServiceLogConfigEnable(original["enable"], d) + flattenComputeRegionBackendServiceLogConfigEnable(original["enable"], d, config) transformed["sample_rate"] = - flattenComputeRegionBackendServiceLogConfigSampleRate(original["sampleRate"], d) + flattenComputeRegionBackendServiceLogConfigSampleRate(original["sampleRate"], d, config) return []interface{}{transformed} } -func flattenComputeRegionBackendServiceLogConfigEnable(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceLogConfigEnable(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceLogConfigSampleRate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceLogConfigSampleRate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionBackendServiceNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionBackendServiceNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -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-beta/resource_compute_region_disk.go b/google-beta/resource_compute_region_disk.go index d68c946d8c..ec0ffe119b 100644 --- a/google-beta/resource_compute_region_disk.go +++ b/google-beta/resource_compute_region_disk.go @@ -420,55 +420,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 { @@ -665,35 +665,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 { @@ -703,14 +703,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 { @@ -720,28 +720,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 } @@ -751,33 +751,33 @@ 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) transformed["kms_key_name"] = - flattenComputeRegionDiskDiskEncryptionKeyKmsKeyName(original["kmsKeyName"], d) + flattenComputeRegionDiskDiskEncryptionKeyKmsKeyName(original["kmsKeyName"], 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 flattenComputeRegionDiskDiskEncryptionKeyKmsKeyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskDiskEncryptionKeyKmsKeyName(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 } @@ -787,26 +787,26 @@ func flattenComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schem } transformed := make(map[string]interface{}) transformed["raw_key"] = - flattenComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(original["rawKey"], d) + flattenComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(original["rawKey"], d, config) transformed["kms_key_name"] = - flattenComputeRegionDiskSourceSnapshotEncryptionKeyKmsKeyName(original["kmsKeyName"], d) + flattenComputeRegionDiskSourceSnapshotEncryptionKeyKmsKeyName(original["kmsKeyName"], 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 flattenComputeRegionDiskSourceSnapshotEncryptionKeyKmsKeyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionDiskSourceSnapshotEncryptionKeyKmsKeyName(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-beta/resource_compute_region_health_check.go b/google-beta/resource_compute_region_health_check.go index c38a8b0d06..b77a874f69 100644 --- a/google-beta/resource_compute_region_health_check.go +++ b/google-beta/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-beta/resource_compute_region_ssl_certificate.go b/google-beta/resource_compute_region_ssl_certificate.go index 932e970285..9e05cc8115 100644 --- a/google-beta/resource_compute_region_ssl_certificate.go +++ b/google-beta/resource_compute_region_ssl_certificate.go @@ -224,22 +224,22 @@ func resourceComputeRegionSslCertificateRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } - if err := d.Set("certificate", flattenComputeRegionSslCertificateCertificate(res["certificate"], d)); err != nil { + if err := d.Set("certificate", flattenComputeRegionSslCertificateCertificate(res["certificate"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionSslCertificateCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionSslCertificateCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } - if err := d.Set("description", flattenComputeRegionSslCertificateDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionSslCertificateDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } - if err := d.Set("certificate_id", flattenComputeRegionSslCertificateCertificateId(res["id"], d)); err != nil { + if err := d.Set("certificate_id", flattenComputeRegionSslCertificateCertificateId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } - if err := d.Set("name", flattenComputeRegionSslCertificateName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionSslCertificateName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } - if err := d.Set("region", flattenComputeRegionSslCertificateRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionSslCertificateRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionSslCertificate: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -303,19 +303,19 @@ func resourceComputeRegionSslCertificateImport(d *schema.ResourceData, meta inte return []*schema.ResourceData{d}, nil } -func flattenComputeRegionSslCertificateCertificate(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionSslCertificateCertificate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionSslCertificateCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionSslCertificateCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionSslCertificateDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionSslCertificateDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionSslCertificateCertificateId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionSslCertificateCertificateId(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 { @@ -325,11 +325,11 @@ func flattenComputeRegionSslCertificateCertificateId(v interface{}, d *schema.Re return v } -func flattenComputeRegionSslCertificateName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionSslCertificateName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionSslCertificateRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionSslCertificateRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google-beta/resource_compute_region_target_http_proxy.go b/google-beta/resource_compute_region_target_http_proxy.go index 9db728eddd..21829b874e 100644 --- a/google-beta/resource_compute_region_target_http_proxy.go +++ b/google-beta/resource_compute_region_target_http_proxy.go @@ -187,22 +187,22 @@ func resourceComputeRegionTargetHttpProxyRead(d *schema.ResourceData, meta inter return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionTargetHttpProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionTargetHttpProxyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } - if err := d.Set("description", flattenComputeRegionTargetHttpProxyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionTargetHttpProxyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } - if err := d.Set("proxy_id", flattenComputeRegionTargetHttpProxyProxyId(res["id"], d)); err != nil { + if err := d.Set("proxy_id", flattenComputeRegionTargetHttpProxyProxyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } - if err := d.Set("name", flattenComputeRegionTargetHttpProxyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionTargetHttpProxyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } - if err := d.Set("url_map", flattenComputeRegionTargetHttpProxyUrlMap(res["urlMap"], d)); err != nil { + if err := d.Set("url_map", flattenComputeRegionTargetHttpProxyUrlMap(res["urlMap"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } - if err := d.Set("region", flattenComputeRegionTargetHttpProxyRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionTargetHttpProxyRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpProxy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -310,15 +310,15 @@ func resourceComputeRegionTargetHttpProxyImport(d *schema.ResourceData, meta int return []*schema.ResourceData{d}, nil } -func flattenComputeRegionTargetHttpProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpProxyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionTargetHttpProxyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpProxyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionTargetHttpProxyProxyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpProxyProxyId(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 { @@ -328,18 +328,18 @@ func flattenComputeRegionTargetHttpProxyProxyId(v interface{}, d *schema.Resourc return v } -func flattenComputeRegionTargetHttpProxyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpProxyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionTargetHttpProxyUrlMap(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpProxyUrlMap(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionTargetHttpProxyRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpProxyRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google-beta/resource_compute_region_target_https_proxy.go b/google-beta/resource_compute_region_target_https_proxy.go index 47e2b4ea40..4c2455d116 100644 --- a/google-beta/resource_compute_region_target_https_proxy.go +++ b/google-beta/resource_compute_region_target_https_proxy.go @@ -204,25 +204,25 @@ func resourceComputeRegionTargetHttpsProxyRead(d *schema.ResourceData, meta inte return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionTargetHttpsProxyCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionTargetHttpsProxyCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("description", flattenComputeRegionTargetHttpsProxyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionTargetHttpsProxyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("proxy_id", flattenComputeRegionTargetHttpsProxyProxyId(res["id"], d)); err != nil { + if err := d.Set("proxy_id", flattenComputeRegionTargetHttpsProxyProxyId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("name", flattenComputeRegionTargetHttpsProxyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionTargetHttpsProxyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("ssl_certificates", flattenComputeRegionTargetHttpsProxySslCertificates(res["sslCertificates"], d)); err != nil { + if err := d.Set("ssl_certificates", flattenComputeRegionTargetHttpsProxySslCertificates(res["sslCertificates"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("url_map", flattenComputeRegionTargetHttpsProxyUrlMap(res["urlMap"], d)); err != nil { + if err := d.Set("url_map", flattenComputeRegionTargetHttpsProxyUrlMap(res["urlMap"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } - if err := d.Set("region", flattenComputeRegionTargetHttpsProxyRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionTargetHttpsProxyRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionTargetHttpsProxy: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -358,15 +358,15 @@ func resourceComputeRegionTargetHttpsProxyImport(d *schema.ResourceData, meta in return []*schema.ResourceData{d}, nil } -func flattenComputeRegionTargetHttpsProxyCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxyCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionTargetHttpsProxyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionTargetHttpsProxyProxyId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxyProxyId(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 { @@ -376,25 +376,25 @@ func flattenComputeRegionTargetHttpsProxyProxyId(v interface{}, d *schema.Resour return v } -func flattenComputeRegionTargetHttpsProxyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionTargetHttpsProxySslCertificates(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxySslCertificates(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return convertAndMapStringArr(v.([]interface{}), ConvertSelfLinkToV1) } -func flattenComputeRegionTargetHttpsProxyUrlMap(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxyUrlMap(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionTargetHttpsProxyRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionTargetHttpsProxyRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google-beta/resource_compute_region_url_map.go b/google-beta/resource_compute_region_url_map.go index fd10554d85..22b7fa7a11 100644 --- a/google-beta/resource_compute_region_url_map.go +++ b/google-beta/resource_compute_region_url_map.go @@ -1667,34 +1667,34 @@ func resourceComputeRegionUrlMapRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("creation_timestamp", flattenComputeRegionUrlMapCreationTimestamp(res["creationTimestamp"], d)); err != nil { + if err := d.Set("creation_timestamp", flattenComputeRegionUrlMapCreationTimestamp(res["creationTimestamp"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("default_service", flattenComputeRegionUrlMapDefaultService(res["defaultService"], d)); err != nil { + if err := d.Set("default_service", flattenComputeRegionUrlMapDefaultService(res["defaultService"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("description", flattenComputeRegionUrlMapDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenComputeRegionUrlMapDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("host_rule", flattenComputeRegionUrlMapHostRule(res["hostRules"], d)); err != nil { + if err := d.Set("host_rule", flattenComputeRegionUrlMapHostRule(res["hostRules"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("map_id", flattenComputeRegionUrlMapMapId(res["id"], d)); err != nil { + if err := d.Set("map_id", flattenComputeRegionUrlMapMapId(res["id"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("fingerprint", flattenComputeRegionUrlMapFingerprint(res["fingerprint"], d)); err != nil { + if err := d.Set("fingerprint", flattenComputeRegionUrlMapFingerprint(res["fingerprint"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("name", flattenComputeRegionUrlMapName(res["name"], d)); err != nil { + if err := d.Set("name", flattenComputeRegionUrlMapName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("path_matcher", flattenComputeRegionUrlMapPathMatcher(res["pathMatchers"], d)); err != nil { + if err := d.Set("path_matcher", flattenComputeRegionUrlMapPathMatcher(res["pathMatchers"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("test", flattenComputeRegionUrlMapTest(res["tests"], d)); err != nil { + if err := d.Set("test", flattenComputeRegionUrlMapTest(res["tests"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } - if err := d.Set("region", flattenComputeRegionUrlMapRegion(res["region"], d)); err != nil { + if err := d.Set("region", flattenComputeRegionUrlMapRegion(res["region"], d, config)); err != nil { return fmt.Errorf("Error reading RegionUrlMap: %s", err) } if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { @@ -1839,22 +1839,22 @@ func resourceComputeRegionUrlMapImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenComputeRegionUrlMapCreationTimestamp(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapCreationTimestamp(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapDefaultService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapDefaultService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapHostRule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapHostRule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1867,29 +1867,29 @@ func flattenComputeRegionUrlMapHostRule(v interface{}, d *schema.ResourceData) i continue } transformed.Add(map[string]interface{}{ - "description": flattenComputeRegionUrlMapHostRuleDescription(original["description"], d), - "hosts": flattenComputeRegionUrlMapHostRuleHosts(original["hosts"], d), - "path_matcher": flattenComputeRegionUrlMapHostRulePathMatcher(original["pathMatcher"], d), + "description": flattenComputeRegionUrlMapHostRuleDescription(original["description"], d, config), + "hosts": flattenComputeRegionUrlMapHostRuleHosts(original["hosts"], d, config), + "path_matcher": flattenComputeRegionUrlMapHostRulePathMatcher(original["pathMatcher"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapHostRuleDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapHostRuleDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapHostRuleHosts(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapHostRuleHosts(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeRegionUrlMapHostRulePathMatcher(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapHostRulePathMatcher(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapMapId(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapMapId(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 { @@ -1899,15 +1899,15 @@ func flattenComputeRegionUrlMapMapId(v interface{}, d *schema.ResourceData) inte return v } -func flattenComputeRegionUrlMapFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcher(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcher(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1920,31 +1920,31 @@ func flattenComputeRegionUrlMapPathMatcher(v interface{}, d *schema.ResourceData continue } transformed = append(transformed, map[string]interface{}{ - "default_service": flattenComputeRegionUrlMapPathMatcherDefaultService(original["defaultService"], d), - "description": flattenComputeRegionUrlMapPathMatcherDescription(original["description"], d), - "name": flattenComputeRegionUrlMapPathMatcherName(original["name"], d), - "route_rules": flattenComputeRegionUrlMapPathMatcherRouteRules(original["routeRules"], d), - "path_rule": flattenComputeRegionUrlMapPathMatcherPathRule(original["pathRules"], d), + "default_service": flattenComputeRegionUrlMapPathMatcherDefaultService(original["defaultService"], d, config), + "description": flattenComputeRegionUrlMapPathMatcherDescription(original["description"], d, config), + "name": flattenComputeRegionUrlMapPathMatcherName(original["name"], d, config), + "route_rules": flattenComputeRegionUrlMapPathMatcherRouteRules(original["routeRules"], d, config), + "path_rule": flattenComputeRegionUrlMapPathMatcherPathRule(original["pathRules"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherDefaultService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherDefaultService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -1957,17 +1957,17 @@ func flattenComputeRegionUrlMapPathMatcherRouteRules(v interface{}, d *schema.Re continue } transformed = append(transformed, map[string]interface{}{ - "priority": flattenComputeRegionUrlMapPathMatcherRouteRulesPriority(original["priority"], d), - "service": flattenComputeRegionUrlMapPathMatcherRouteRulesService(original["service"], d), - "header_action": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderAction(original["headerAction"], d), - "match_rules": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRules(original["matchRules"], d), - "route_action": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteAction(original["routeAction"], d), - "url_redirect": flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirect(original["urlRedirect"], d), + "priority": flattenComputeRegionUrlMapPathMatcherRouteRulesPriority(original["priority"], d, config), + "service": flattenComputeRegionUrlMapPathMatcherRouteRulesService(original["service"], d, config), + "header_action": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderAction(original["headerAction"], d, config), + "match_rules": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRules(original["matchRules"], d, config), + "route_action": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteAction(original["routeAction"], d, config), + "url_redirect": flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirect(original["urlRedirect"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesPriority(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesPriority(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 { @@ -1977,14 +1977,14 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesPriority(v interface{}, d *s return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -1994,16 +1994,16 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderAction(v interface{}, } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2016,30 +2016,30 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersTo continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2052,30 +2052,30 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersT continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRules(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRules(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2088,22 +2088,22 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRules(v interface{}, d continue } transformed = append(transformed, map[string]interface{}{ - "full_path_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(original["fullPathMatch"], d), - "header_matches": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(original["headerMatches"], d), - "ignore_case": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(original["ignoreCase"], d), - "metadata_filters": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(original["metadataFilters"], d), - "prefix_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(original["prefixMatch"], d), - "query_parameter_matches": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(original["queryParameterMatches"], d), - "regex_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(original["regexMatch"], d), + "full_path_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(original["fullPathMatch"], d, config), + "header_matches": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(original["headerMatches"], d, config), + "ignore_case": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(original["ignoreCase"], d, config), + "metadata_filters": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(original["metadataFilters"], d, config), + "prefix_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(original["prefixMatch"], d, config), + "query_parameter_matches": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(original["queryParameterMatches"], d, config), + "regex_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(original["regexMatch"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesFullPathMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2116,39 +2116,39 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatches(v in continue } transformed = append(transformed, map[string]interface{}{ - "exact_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(original["exactMatch"], d), - "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(original["headerName"], d), - "invert_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(original["invertMatch"], d), - "prefix_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(original["prefixMatch"], d), - "present_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(original["presentMatch"], d), - "range_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(original["rangeMatch"], d), - "regex_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(original["regexMatch"], d), - "suffix_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(original["suffixMatch"], d), + "exact_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(original["exactMatch"], d, config), + "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(original["headerName"], d, config), + "invert_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(original["invertMatch"], d, config), + "prefix_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(original["prefixMatch"], d, config), + "present_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(original["presentMatch"], d, config), + "range_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(original["rangeMatch"], d, config), + "regex_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(original["regexMatch"], d, config), + "suffix_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(original["suffixMatch"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesExactMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesInvertMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPrefixMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesPresentMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2158,12 +2158,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRange } transformed := make(map[string]interface{}) transformed["range_end"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(original["rangeEnd"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(original["rangeEnd"], d, config) transformed["range_start"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(original["rangeStart"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(original["rangeStart"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeEnd(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 { @@ -2173,7 +2173,7 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRange return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRangeMatchRangeStart(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 { @@ -2183,19 +2183,19 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRange return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesRegexMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesHeaderMatchesSuffixMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesIgnoreCase(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2208,13 +2208,13 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFilters(v continue } transformed = append(transformed, map[string]interface{}{ - "filter_labels": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(original["filterLabels"], d), - "filter_match_criteria": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d), + "filter_labels": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(original["filterLabels"], d, config), + "filter_match_criteria": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(original["filterMatchCriteria"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2227,29 +2227,29 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFil continue } transformed = append(transformed, map[string]interface{}{ - "name": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(original["name"], d), - "value": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(original["value"], d), + "name": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(original["name"], d, config), + "value": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(original["value"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterLabelsValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesMetadataFiltersFilterMatchCriteria(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesPrefixMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatches(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2262,35 +2262,35 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatc continue } transformed = append(transformed, map[string]interface{}{ - "exact_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(original["exactMatch"], d), - "name": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(original["name"], d), - "present_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(original["presentMatch"], d), - "regex_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(original["regexMatch"], d), + "exact_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(original["exactMatch"], d, config), + "name": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(original["name"], d, config), + "present_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(original["presentMatch"], d, config), + "regex_match": flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(original["regexMatch"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesExactMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesPresentMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesQueryParameterMatchesRegexMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesMatchRulesRegexMatch(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2300,22 +2300,22 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteAction(v interface{}, d } transformed := make(map[string]interface{}) transformed["cors_policy"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(original["corsPolicy"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(original["corsPolicy"], d, config) transformed["fault_injection_policy"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d, config) transformed["request_mirror_policy"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d, config) transformed["retry_policy"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(original["retryPolicy"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(original["retryPolicy"], d, config) transformed["timeout"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeout(original["timeout"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeout(original["timeout"], d, config) transformed["url_rewrite"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(original["urlRewrite"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(original["urlRewrite"], d, config) transformed["weighted_backend_services"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(original["weightedBackendServices"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(original["weightedBackendServices"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2325,52 +2325,52 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicy(v inte } transformed := make(map[string]interface{}) transformed["allow_credentials"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d, config) transformed["allow_headers"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d, config) transformed["allow_methods"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(original["allowMethods"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(original["allowMethods"], d, config) transformed["allow_origin_regexes"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d, config) transformed["allow_origins"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d, config) transformed["disabled"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(original["disabled"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(original["disabled"], d, config) transformed["expose_headers"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d, config) transformed["max_age"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(original["maxAge"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(original["maxAge"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge(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 { @@ -2380,7 +2380,7 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionCorsPolicyMaxAge( return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2390,12 +2390,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPol } transformed := make(map[string]interface{}) transformed["abort"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(original["abort"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(original["abort"], d, config) transformed["delay"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(original["delay"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(original["delay"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2405,12 +2405,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPol } transformed := make(map[string]interface{}) transformed["http_status"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d, config) transformed["percentage"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortHttpStatus(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 { @@ -2420,11 +2420,11 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPol return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2434,12 +2434,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPol } transformed := make(map[string]interface{}) transformed["fixed_delay"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d, config) transformed["percentage"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2449,12 +2449,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPol } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelayNanos(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 { @@ -2464,15 +2464,15 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPol return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2482,17 +2482,17 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPoli } transformed := make(map[string]interface{}) transformed["backend_service"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(original["backendService"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(original["backendService"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2502,14 +2502,14 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicy(v int } transformed := make(map[string]interface{}) transformed["num_retries"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(original["numRetries"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(original["numRetries"], d, config) transformed["per_try_timeout"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d, config) transformed["retry_conditions"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(original["retryConditions"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(original["retryConditions"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRetries(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 { @@ -2519,7 +2519,7 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyNumRet return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2529,12 +2529,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTry } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutNanos(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 { @@ -2544,15 +2544,15 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTry return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2562,12 +2562,12 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeout(v interfa } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(original["nanos"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(original["seconds"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(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 { @@ -2577,11 +2577,11 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutNanos(v in return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2591,20 +2591,20 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewrite(v inte } transformed := make(map[string]interface{}) transformed["host_rewrite"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d, config) transformed["path_prefix_rewrite"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2617,21 +2617,21 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendSe continue } transformed = append(transformed, map[string]interface{}{ - "backend_service": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(original["backendService"], d), - "header_action": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d), - "weight": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(original["weight"], d), + "backend_service": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(original["backendService"], d, config), + "header_action": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d, config), + "weight": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(original["weight"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2641,16 +2641,16 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendSe } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2663,30 +2663,30 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendSe continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2699,30 +2699,30 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendSe continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendServicesWeight(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 { @@ -2732,7 +2732,7 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesRouteActionWeightedBackendSe return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2742,44 +2742,44 @@ func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirect(v interface{}, d } transformed := make(map[string]interface{}) transformed["host_redirect"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(original["hostRedirect"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(original["hostRedirect"], d, config) transformed["https_redirect"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(original["httpsRedirect"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(original["httpsRedirect"], d, config) transformed["path_redirect"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(original["pathRedirect"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(original["pathRedirect"], d, config) transformed["prefix_redirect"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(original["prefixRedirect"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(original["prefixRedirect"], d, config) transformed["redirect_response_code"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d, config) transformed["strip_query"] = - flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(original["stripQuery"], d) + flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(original["stripQuery"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherRouteRulesUrlRedirectStripQuery(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRule(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -2792,29 +2792,29 @@ func flattenComputeRegionUrlMapPathMatcherPathRule(v interface{}, d *schema.Reso continue } transformed = append(transformed, map[string]interface{}{ - "service": flattenComputeRegionUrlMapPathMatcherPathRuleService(original["service"], d), - "paths": flattenComputeRegionUrlMapPathMatcherPathRulePaths(original["paths"], d), - "route_action": flattenComputeRegionUrlMapPathMatcherPathRuleRouteAction(original["routeAction"], d), - "url_redirect": flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirect(original["urlRedirect"], d), + "service": flattenComputeRegionUrlMapPathMatcherPathRuleService(original["service"], d, config), + "paths": flattenComputeRegionUrlMapPathMatcherPathRulePaths(original["paths"], d, config), + "route_action": flattenComputeRegionUrlMapPathMatcherPathRuleRouteAction(original["routeAction"], d, config), + "url_redirect": flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirect(original["urlRedirect"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherPathRuleService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherPathRulePaths(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRulePaths(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return schema.NewSet(schema.HashString, v.([]interface{})) } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2824,22 +2824,22 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteAction(v interface{}, d * } transformed := make(map[string]interface{}) transformed["cors_policy"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicy(original["corsPolicy"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicy(original["corsPolicy"], d, config) transformed["fault_injection_policy"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(original["faultInjectionPolicy"], d, config) transformed["request_mirror_policy"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(original["requestMirrorPolicy"], d, config) transformed["retry_policy"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicy(original["retryPolicy"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicy(original["retryPolicy"], d, config) transformed["timeout"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeout(original["timeout"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeout(original["timeout"], d, config) transformed["url_rewrite"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewrite(original["urlRewrite"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewrite(original["urlRewrite"], d, config) transformed["weighted_backend_services"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(original["weightedBackendServices"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(original["weightedBackendServices"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2849,52 +2849,52 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicy(v interf } transformed := make(map[string]interface{}) transformed["allow_credentials"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(original["allowCredentials"], d, config) transformed["allow_headers"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(original["allowHeaders"], d, config) transformed["allow_methods"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(original["allowMethods"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(original["allowMethods"], d, config) transformed["allow_origin_regexes"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(original["allowOriginRegexes"], d, config) transformed["allow_origins"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(original["allowOrigins"], d, config) transformed["disabled"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(original["disabled"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(original["disabled"], d, config) transformed["expose_headers"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(original["exposeHeaders"], d, config) transformed["max_age"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(original["maxAge"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(original["maxAge"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowCredentials(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowMethods(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOriginRegexes(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyAllowOrigins(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyDisabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyExposeHeaders(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(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 { @@ -2904,7 +2904,7 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionCorsPolicyMaxAge(v return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2914,12 +2914,12 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolic } transformed := make(map[string]interface{}) transformed["abort"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(original["abort"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(original["abort"], d, config) transformed["delay"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(original["delay"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(original["delay"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbort(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2929,12 +2929,12 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolic } transformed := make(map[string]interface{}) transformed["http_status"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(original["httpStatus"], d, config) transformed["percentage"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortHttpStatus(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 { @@ -2944,11 +2944,11 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolic return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyAbortPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2958,12 +2958,12 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolic } transformed := make(map[string]interface{}) transformed["fixed_delay"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(original["fixedDelay"], d, config) transformed["percentage"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(original["percentage"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelay(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -2973,12 +2973,12 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolic } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelayNanos(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 { @@ -2988,15 +2988,15 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolic return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayFixedDelaySeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionFaultInjectionPolicyDelayPercentage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3006,17 +3006,17 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicy } transformed := make(map[string]interface{}) transformed["backend_service"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(original["backendService"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(original["backendService"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRequestMirrorPolicyBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicy(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicy(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3026,14 +3026,14 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicy(v inter } transformed := make(map[string]interface{}) transformed["num_retries"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(original["numRetries"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(original["numRetries"], d, config) transformed["per_try_timeout"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(original["perTryTimeout"], d, config) transformed["retry_conditions"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(original["retryConditions"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(original["retryConditions"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetries(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 { @@ -3043,7 +3043,7 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyNumRetri return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3053,12 +3053,12 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTi } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutNanos(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 { @@ -3068,15 +3068,15 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTi return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyPerTryTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionRetryPolicyRetryConditions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeout(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeout(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3086,12 +3086,12 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeout(v interface } transformed := make(map[string]interface{}) transformed["nanos"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(original["nanos"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(original["nanos"], d, config) transformed["seconds"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(original["seconds"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(original["seconds"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(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 { @@ -3101,11 +3101,11 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutNanos(v inte return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionTimeoutSeconds(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3115,20 +3115,20 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewrite(v interf } transformed := make(map[string]interface{}) transformed["host_rewrite"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(original["hostRewrite"], d, config) transformed["path_prefix_rewrite"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(original["pathPrefixRewrite"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewriteHostRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionUrlRewritePathPrefixRewrite(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServices(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3141,21 +3141,21 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServ continue } transformed = append(transformed, map[string]interface{}{ - "backend_service": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(original["backendService"], d), - "header_action": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d), - "weight": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(original["weight"], d), + "backend_service": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(original["backendService"], d, config), + "header_action": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(original["headerAction"], d, config), + "weight": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(original["weight"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesBackendService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderAction(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3165,16 +3165,16 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServ } transformed := make(map[string]interface{}) transformed["request_headers_to_add"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(original["requestHeadersToAdd"], d, config) transformed["request_headers_to_remove"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(original["requestHeadersToRemove"], d, config) transformed["response_headers_to_add"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(original["responseHeadersToAdd"], d, config) transformed["response_headers_to_remove"] = - flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(original["responseHeadersToRemove"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3187,30 +3187,30 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServ continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionRequestHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAdd(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3223,30 +3223,30 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServ continue } transformed = append(transformed, map[string]interface{}{ - "header_name": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d), - "header_value": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d), - "replace": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d), + "header_name": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(original["headerName"], d, config), + "header_value": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(original["headerValue"], d, config), + "replace": flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(original["replace"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddHeaderValue(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToAddReplace(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesHeaderActionResponseHeadersToRemove(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServicesWeight(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 { @@ -3256,7 +3256,7 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleRouteActionWeightedBackendServ return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -3266,44 +3266,44 @@ func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirect(v interface{}, d * } transformed := make(map[string]interface{}) transformed["host_redirect"] = - flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(original["hostRedirect"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(original["hostRedirect"], d, config) transformed["https_redirect"] = - flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(original["httpsRedirect"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(original["httpsRedirect"], d, config) transformed["path_redirect"] = - flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(original["pathRedirect"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(original["pathRedirect"], d, config) transformed["prefix_redirect"] = - flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(original["prefixRedirect"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(original["prefixRedirect"], d, config) transformed["redirect_response_code"] = - flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(original["redirectResponseCode"], d, config) transformed["strip_query"] = - flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectStripQuery(original["stripQuery"], d) + flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectStripQuery(original["stripQuery"], d, config) return []interface{}{transformed} } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHostRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectHttpsRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPathRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectPrefixRedirect(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectRedirectResponseCode(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectStripQuery(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapPathMatcherPathRuleUrlRedirectStripQuery(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapTest(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapTest(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -3316,34 +3316,34 @@ func flattenComputeRegionUrlMapTest(v interface{}, d *schema.ResourceData) inter continue } transformed = append(transformed, map[string]interface{}{ - "description": flattenComputeRegionUrlMapTestDescription(original["description"], d), - "host": flattenComputeRegionUrlMapTestHost(original["host"], d), - "path": flattenComputeRegionUrlMapTestPath(original["path"], d), - "service": flattenComputeRegionUrlMapTestService(original["service"], d), + "description": flattenComputeRegionUrlMapTestDescription(original["description"], d, config), + "host": flattenComputeRegionUrlMapTestHost(original["host"], d, config), + "path": flattenComputeRegionUrlMapTestPath(original["path"], d, config), + "service": flattenComputeRegionUrlMapTestService(original["service"], d, config), }) } return transformed } -func flattenComputeRegionUrlMapTestDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapTestDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapTestHost(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapTestHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapTestPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapTestPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeRegionUrlMapTestService(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapTestService(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeRegionUrlMapRegion(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRegionUrlMapRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } diff --git a/google-beta/resource_compute_reservation.go b/google-beta/resource_compute_reservation.go index 52de368c82..b14b2dd680 100644 --- a/google-beta/resource_compute_reservation.go +++ b/google-beta/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-beta/resource_compute_resource_policy.go b/google-beta/resource_compute_resource_policy.go index b8120727fe..de80df736c 100644 --- a/google-beta/resource_compute_resource_policy.go +++ b/google-beta/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-beta/resource_compute_route.go b/google-beta/resource_compute_route.go index 257f85acc8..1a920f8b0c 100644 --- a/google-beta/resource_compute_route.go +++ b/google-beta/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-beta/resource_compute_router.go b/google-beta/resource_compute_router.go index 72a4f9e0c5..41159883cf 100644 --- a/google-beta/resource_compute_router.go +++ b/google-beta/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-beta/resource_compute_router_bgp_peer.go b/google-beta/resource_compute_router_bgp_peer.go index 95c0f224f3..829f7c1ae6 100644 --- a/google-beta/resource_compute_router_bgp_peer.go +++ b/google-beta/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-beta/resource_compute_router_nat.go b/google-beta/resource_compute_router_nat.go index c2fb348734..50a1968b23 100644 --- a/google-beta/resource_compute_router_nat.go +++ b/google-beta/resource_compute_router_nat.go @@ -459,40 +459,40 @@ 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("drain_nat_ips", flattenComputeRouterNatDrainNatIps(res["drainNatIps"], d)); err != nil { + if err := d.Set("drain_nat_ips", flattenComputeRouterNatDrainNatIps(res["drainNatIps"], 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) } @@ -676,33 +676,33 @@ 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 flattenComputeRouterNatDrainNatIps(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeRouterNatDrainNatIps(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 } @@ -715,35 +715,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 { @@ -753,7 +753,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 } @@ -767,7 +767,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 } @@ -781,7 +781,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 } @@ -795,7 +795,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 } @@ -809,7 +809,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 } @@ -819,16 +819,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 } @@ -1026,7 +1026,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-beta/resource_compute_snapshot.go b/google-beta/resource_compute_snapshot.go index 88462a215c..1add919ff1 100644 --- a/google-beta/resource_compute_snapshot.go +++ b/google-beta/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-beta/resource_compute_ssl_certificate.go b/google-beta/resource_compute_ssl_certificate.go index e213a0b5fb..293d2215a4 100644 --- a/google-beta/resource_compute_ssl_certificate.go +++ b/google-beta/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-beta/resource_compute_ssl_policy.go b/google-beta/resource_compute_ssl_policy.go index 715010f9be..504a59331c 100644 --- a/google-beta/resource_compute_ssl_policy.go +++ b/google-beta/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-beta/resource_compute_subnetwork.go b/google-beta/resource_compute_subnetwork.go index b684c06541..c8ccc0c652 100644 --- a/google-beta/resource_compute_subnetwork.go +++ b/google-beta/resource_compute_subnetwork.go @@ -178,7 +178,6 @@ If set to INTERNAL_HTTPS_LOAD_BALANCER you must also set the role.`, Type: schema.TypeString, Computed: true, Optional: true, - ForceNew: true, DiffSuppressFunc: compareSelfLinkOrResourceName, Description: `URL of the GCP region for this subnetwork.`, }, @@ -429,40 +428,40 @@ 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("purpose", flattenComputeSubnetworkPurpose(res["purpose"], d)); err != nil { + if err := d.Set("purpose", flattenComputeSubnetworkPurpose(res["purpose"], d, config)); err != nil { return fmt.Errorf("Error reading Subnetwork: %s", err) } - if err := d.Set("role", flattenComputeSubnetworkRole(res["role"], d)); err != nil { + if err := d.Set("role", flattenComputeSubnetworkRole(res["role"], 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 { @@ -715,42 +714,42 @@ 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 flattenComputeSubnetworkPurpose(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkPurpose(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkRole(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkRole(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -763,32 +762,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-beta/resource_compute_target_http_proxy.go b/google-beta/resource_compute_target_http_proxy.go index 2706042f78..a899eef633 100644 --- a/google-beta/resource_compute_target_http_proxy.go +++ b/google-beta/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-beta/resource_compute_target_https_proxy.go b/google-beta/resource_compute_target_https_proxy.go index 3b7777f6b2..a6117319df 100644 --- a/google-beta/resource_compute_target_https_proxy.go +++ b/google-beta/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-beta/resource_compute_target_instance.go b/google-beta/resource_compute_target_instance.go index 953ec01ca4..43bffb0184 100644 --- a/google-beta/resource_compute_target_instance.go +++ b/google-beta/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-beta/resource_compute_target_ssl_proxy.go b/google-beta/resource_compute_target_ssl_proxy.go index 5e120c95a3..965ff6702e 100644 --- a/google-beta/resource_compute_target_ssl_proxy.go +++ b/google-beta/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-beta/resource_compute_target_tcp_proxy.go b/google-beta/resource_compute_target_tcp_proxy.go index 4839909174..507ef6bfdf 100644 --- a/google-beta/resource_compute_target_tcp_proxy.go +++ b/google-beta/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-beta/resource_compute_url_map.go b/google-beta/resource_compute_url_map.go index 9cf8c9c703..38ae7975ec 100644 --- a/google-beta/resource_compute_url_map.go +++ b/google-beta/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-beta/resource_compute_vpn_gateway.go b/google-beta/resource_compute_vpn_gateway.go index e3dff6217b..1e752368d9 100644 --- a/google-beta/resource_compute_vpn_gateway.go +++ b/google-beta/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-beta/resource_compute_vpn_tunnel.go b/google-beta/resource_compute_vpn_tunnel.go index 9656999413..edb83632ee 100644 --- a/google-beta/resource_compute_vpn_tunnel.go +++ b/google-beta/resource_compute_vpn_tunnel.go @@ -530,64 +530,64 @@ 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("vpn_gateway", flattenComputeVpnTunnelVpnGateway(res["vpnGateway"], d)); err != nil { + if err := d.Set("vpn_gateway", flattenComputeVpnTunnelVpnGateway(res["vpnGateway"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("vpn_gateway_interface", flattenComputeVpnTunnelVpnGatewayInterface(res["vpnGatewayInterface"], d)); err != nil { + if err := d.Set("vpn_gateway_interface", flattenComputeVpnTunnelVpnGatewayInterface(res["vpnGatewayInterface"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("peer_external_gateway", flattenComputeVpnTunnelPeerExternalGateway(res["peerExternalGateway"], d)); err != nil { + if err := d.Set("peer_external_gateway", flattenComputeVpnTunnelPeerExternalGateway(res["peerExternalGateway"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("peer_external_gateway_interface", flattenComputeVpnTunnelPeerExternalGatewayInterface(res["peerExternalGatewayInterface"], d)); err != nil { + if err := d.Set("peer_external_gateway_interface", flattenComputeVpnTunnelPeerExternalGatewayInterface(res["peerExternalGatewayInterface"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("peer_gcp_gateway", flattenComputeVpnTunnelPeerGcpGateway(res["peerGcpGateway"], d)); err != nil { + if err := d.Set("peer_gcp_gateway", flattenComputeVpnTunnelPeerGcpGateway(res["peerGcpGateway"], 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("labels", flattenComputeVpnTunnelLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenComputeVpnTunnelLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading VpnTunnel: %s", err) } - if err := d.Set("label_fingerprint", flattenComputeVpnTunnelLabelFingerprint(res["labelFingerprint"], d)); err != nil { + if err := d.Set("label_fingerprint", flattenComputeVpnTunnelLabelFingerprint(res["labelFingerprint"], 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 { @@ -702,37 +702,37 @@ 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 flattenComputeVpnTunnelVpnGateway(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelVpnGateway(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeVpnTunnelVpnGatewayInterface(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelVpnGatewayInterface(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 { @@ -742,14 +742,14 @@ func flattenComputeVpnTunnelVpnGatewayInterface(v interface{}, d *schema.Resourc return v } -func flattenComputeVpnTunnelPeerExternalGateway(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelPeerExternalGateway(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return ConvertSelfLinkToV1(v.(string)) } -func flattenComputeVpnTunnelPeerExternalGatewayInterface(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelPeerExternalGatewayInterface(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 { @@ -759,29 +759,29 @@ func flattenComputeVpnTunnelPeerExternalGatewayInterface(v interface{}, d *schem return v } -func flattenComputeVpnTunnelPeerGcpGateway(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelPeerGcpGateway(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 { @@ -791,33 +791,33 @@ 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 flattenComputeVpnTunnelLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenComputeVpnTunnelLabelFingerprint(v interface{}, d *schema.ResourceData) interface{} { +func flattenComputeVpnTunnelLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -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-beta/resource_container_analysis_note.go b/google-beta/resource_container_analysis_note.go index eadba9f28a..15d00ca14f 100644 --- a/google-beta/resource_container_analysis_note.go +++ b/google-beta/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-beta/resource_data_fusion_instance.go b/google-beta/resource_data_fusion_instance.go index 390a7e7348..39efaddd89 100644 --- a/google-beta/resource_data_fusion_instance.go +++ b/google-beta/resource_data_fusion_instance.go @@ -308,52 +308,52 @@ func resourceDataFusionInstanceRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("name", flattenDataFusionInstanceName(res["name"], d)); err != nil { + if err := d.Set("name", flattenDataFusionInstanceName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("description", flattenDataFusionInstanceDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenDataFusionInstanceDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("type", flattenDataFusionInstanceType(res["type"], d)); err != nil { + if err := d.Set("type", flattenDataFusionInstanceType(res["type"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("enable_stackdriver_logging", flattenDataFusionInstanceEnableStackdriverLogging(res["enableStackdriverLogging"], d)); err != nil { + if err := d.Set("enable_stackdriver_logging", flattenDataFusionInstanceEnableStackdriverLogging(res["enableStackdriverLogging"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("enable_stackdriver_monitoring", flattenDataFusionInstanceEnableStackdriverMonitoring(res["enableStackdriverMonitoring"], d)); err != nil { + if err := d.Set("enable_stackdriver_monitoring", flattenDataFusionInstanceEnableStackdriverMonitoring(res["enableStackdriverMonitoring"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("labels", flattenDataFusionInstanceLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenDataFusionInstanceLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("options", flattenDataFusionInstanceOptions(res["options"], d)); err != nil { + if err := d.Set("options", flattenDataFusionInstanceOptions(res["options"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("create_time", flattenDataFusionInstanceCreateTime(res["createTime"], d)); err != nil { + if err := d.Set("create_time", flattenDataFusionInstanceCreateTime(res["createTime"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("update_time", flattenDataFusionInstanceUpdateTime(res["updateTime"], d)); err != nil { + if err := d.Set("update_time", flattenDataFusionInstanceUpdateTime(res["updateTime"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("state", flattenDataFusionInstanceState(res["state"], d)); err != nil { + if err := d.Set("state", flattenDataFusionInstanceState(res["state"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("state_message", flattenDataFusionInstanceStateMessage(res["stateMessage"], d)); err != nil { + if err := d.Set("state_message", flattenDataFusionInstanceStateMessage(res["stateMessage"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("service_endpoint", flattenDataFusionInstanceServiceEndpoint(res["serviceEndpoint"], d)); err != nil { + if err := d.Set("service_endpoint", flattenDataFusionInstanceServiceEndpoint(res["serviceEndpoint"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("version", flattenDataFusionInstanceVersion(res["version"], d)); err != nil { + if err := d.Set("version", flattenDataFusionInstanceVersion(res["version"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("service_account", flattenDataFusionInstanceServiceAccount(res["serviceAccount"], d)); err != nil { + if err := d.Set("service_account", flattenDataFusionInstanceServiceAccount(res["serviceAccount"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("private_instance", flattenDataFusionInstancePrivateInstance(res["privateInstance"], d)); err != nil { + if err := d.Set("private_instance", flattenDataFusionInstancePrivateInstance(res["privateInstance"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } - if err := d.Set("network_config", flattenDataFusionInstanceNetworkConfig(res["networkConfig"], d)); err != nil { + if err := d.Set("network_config", flattenDataFusionInstanceNetworkConfig(res["networkConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Instance: %s", err) } @@ -465,70 +465,70 @@ func resourceDataFusionInstanceImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenDataFusionInstanceName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenDataFusionInstanceDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceType(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceType(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceEnableStackdriverLogging(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceEnableStackdriverLogging(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceEnableStackdriverMonitoring(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceEnableStackdriverMonitoring(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceOptions(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceOptions(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceCreateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceUpdateTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceUpdateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceState(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceStateMessage(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceStateMessage(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceServiceEndpoint(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceServiceEndpoint(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceVersion(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceServiceAccount(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceServiceAccount(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstancePrivateInstance(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstancePrivateInstance(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceNetworkConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceNetworkConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -538,16 +538,16 @@ func flattenDataFusionInstanceNetworkConfig(v interface{}, d *schema.ResourceDat } transformed := make(map[string]interface{}) transformed["ip_allocation"] = - flattenDataFusionInstanceNetworkConfigIpAllocation(original["ipAllocation"], d) + flattenDataFusionInstanceNetworkConfigIpAllocation(original["ipAllocation"], d, config) transformed["network"] = - flattenDataFusionInstanceNetworkConfigNetwork(original["network"], d) + flattenDataFusionInstanceNetworkConfigNetwork(original["network"], d, config) return []interface{}{transformed} } -func flattenDataFusionInstanceNetworkConfigIpAllocation(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceNetworkConfigIpAllocation(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDataFusionInstanceNetworkConfigNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenDataFusionInstanceNetworkConfigNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_dataproc_autoscaling_policy.go b/google-beta/resource_dataproc_autoscaling_policy.go index e159d4b722..e507d9a2d4 100644 --- a/google-beta/resource_dataproc_autoscaling_policy.go +++ b/google-beta/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-beta/resource_deployment_manager_deployment.go b/google-beta/resource_deployment_manager_deployment.go index fd039975c0..eae3dea48d 100644 --- a/google-beta/resource_deployment_manager_deployment.go +++ b/google-beta/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-beta/resource_dialogflow_agent.go b/google-beta/resource_dialogflow_agent.go index 0702b05323..ac30d05776 100644 --- a/google-beta/resource_dialogflow_agent.go +++ b/google-beta/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-beta/resource_dns_managed_zone.go b/google-beta/resource_dns_managed_zone.go index ee27980188..85af383f0b 100644 --- a/google-beta/resource_dns_managed_zone.go +++ b/google-beta/resource_dns_managed_zone.go @@ -428,37 +428,37 @@ 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) } - if err := d.Set("forwarding_config", flattenDNSManagedZoneForwardingConfig(res["forwardingConfig"], d)); err != nil { + if err := d.Set("forwarding_config", flattenDNSManagedZoneForwardingConfig(res["forwardingConfig"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("peering_config", flattenDNSManagedZonePeeringConfig(res["peeringConfig"], d)); err != nil { + if err := d.Set("peering_config", flattenDNSManagedZonePeeringConfig(res["peeringConfig"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } - if err := d.Set("reverse_lookup", flattenDNSManagedZoneReverseLookup(res["reverseLookupConfig"], d)); err != nil { + if err := d.Set("reverse_lookup", flattenDNSManagedZoneReverseLookup(res["reverseLookupConfig"], d, config)); err != nil { return fmt.Errorf("Error reading ManagedZone: %s", err) } @@ -575,15 +575,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 } @@ -593,28 +593,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 } @@ -627,19 +627,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 { @@ -649,27 +649,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" } @@ -677,7 +677,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 } @@ -687,10 +687,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 } @@ -714,16 +714,16 @@ 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 } -func flattenDNSManagedZoneForwardingConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneForwardingConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -733,10 +733,10 @@ func flattenDNSManagedZoneForwardingConfig(v interface{}, d *schema.ResourceData } transformed := make(map[string]interface{}) transformed["target_name_servers"] = - flattenDNSManagedZoneForwardingConfigTargetNameServers(original["targetNameServers"], d) + flattenDNSManagedZoneForwardingConfigTargetNameServers(original["targetNameServers"], d, config) return []interface{}{transformed} } -func flattenDNSManagedZoneForwardingConfigTargetNameServers(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneForwardingConfigTargetNameServers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -757,21 +757,21 @@ func flattenDNSManagedZoneForwardingConfigTargetNameServers(v interface{}, d *sc continue } transformed.Add(map[string]interface{}{ - "ipv4_address": flattenDNSManagedZoneForwardingConfigTargetNameServersIpv4Address(original["ipv4Address"], d), - "forwarding_path": flattenDNSManagedZoneForwardingConfigTargetNameServersForwardingPath(original["forwardingPath"], d), + "ipv4_address": flattenDNSManagedZoneForwardingConfigTargetNameServersIpv4Address(original["ipv4Address"], d, config), + "forwarding_path": flattenDNSManagedZoneForwardingConfigTargetNameServersForwardingPath(original["forwardingPath"], d, config), }) } return transformed } -func flattenDNSManagedZoneForwardingConfigTargetNameServersIpv4Address(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneForwardingConfigTargetNameServersIpv4Address(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneForwardingConfigTargetNameServersForwardingPath(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneForwardingConfigTargetNameServersForwardingPath(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZonePeeringConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZonePeeringConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -781,10 +781,10 @@ func flattenDNSManagedZonePeeringConfig(v interface{}, d *schema.ResourceData) i } transformed := make(map[string]interface{}) transformed["target_network"] = - flattenDNSManagedZonePeeringConfigTargetNetwork(original["targetNetwork"], d) + flattenDNSManagedZonePeeringConfigTargetNetwork(original["targetNetwork"], d, config) return []interface{}{transformed} } -func flattenDNSManagedZonePeeringConfigTargetNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZonePeeringConfigTargetNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -794,14 +794,14 @@ func flattenDNSManagedZonePeeringConfigTargetNetwork(v interface{}, d *schema.Re } transformed := make(map[string]interface{}) transformed["network_url"] = - flattenDNSManagedZonePeeringConfigTargetNetworkNetworkUrl(original["networkUrl"], d) + flattenDNSManagedZonePeeringConfigTargetNetworkNetworkUrl(original["networkUrl"], d, config) return []interface{}{transformed} } -func flattenDNSManagedZonePeeringConfigTargetNetworkNetworkUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZonePeeringConfigTargetNetworkNetworkUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSManagedZoneReverseLookup(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSManagedZoneReverseLookup(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v != nil } diff --git a/google-beta/resource_dns_policy.go b/google-beta/resource_dns_policy.go index 1e6a372b7b..5b9503e4db 100644 --- a/google-beta/resource_dns_policy.go +++ b/google-beta/resource_dns_policy.go @@ -238,22 +238,22 @@ func resourceDNSPolicyRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("alternative_name_server_config", flattenDNSPolicyAlternativeNameServerConfig(res["alternativeNameServerConfig"], d)); err != nil { + if err := d.Set("alternative_name_server_config", flattenDNSPolicyAlternativeNameServerConfig(res["alternativeNameServerConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("description", flattenDNSPolicyDescription(res["description"], d)); err != nil { + if err := d.Set("description", flattenDNSPolicyDescription(res["description"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("enable_inbound_forwarding", flattenDNSPolicyEnableInboundForwarding(res["enableInboundForwarding"], d)); err != nil { + if err := d.Set("enable_inbound_forwarding", flattenDNSPolicyEnableInboundForwarding(res["enableInboundForwarding"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("enable_logging", flattenDNSPolicyEnableLogging(res["enableLogging"], d)); err != nil { + if err := d.Set("enable_logging", flattenDNSPolicyEnableLogging(res["enableLogging"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("name", flattenDNSPolicyName(res["name"], d)); err != nil { + if err := d.Set("name", flattenDNSPolicyName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } - if err := d.Set("networks", flattenDNSPolicyNetworks(res["networks"], d)); err != nil { + if err := d.Set("networks", flattenDNSPolicyNetworks(res["networks"], d, config)); err != nil { return fmt.Errorf("Error reading Policy: %s", err) } @@ -385,7 +385,7 @@ func resourceDNSPolicyImport(d *schema.ResourceData, meta interface{}) ([]*schem return []*schema.ResourceData{d}, nil } -func flattenDNSPolicyAlternativeNameServerConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyAlternativeNameServerConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -395,10 +395,10 @@ func flattenDNSPolicyAlternativeNameServerConfig(v interface{}, d *schema.Resour } transformed := make(map[string]interface{}) transformed["target_name_servers"] = - flattenDNSPolicyAlternativeNameServerConfigTargetNameServers(original["targetNameServers"], d) + flattenDNSPolicyAlternativeNameServerConfigTargetNameServers(original["targetNameServers"], d, config) return []interface{}{transformed} } -func flattenDNSPolicyAlternativeNameServerConfigTargetNameServers(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyAlternativeNameServerConfigTargetNameServers(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -419,32 +419,32 @@ func flattenDNSPolicyAlternativeNameServerConfigTargetNameServers(v interface{}, continue } transformed.Add(map[string]interface{}{ - "ipv4_address": flattenDNSPolicyAlternativeNameServerConfigTargetNameServersIpv4Address(original["ipv4Address"], d), + "ipv4_address": flattenDNSPolicyAlternativeNameServerConfigTargetNameServersIpv4Address(original["ipv4Address"], d, config), }) } return transformed } -func flattenDNSPolicyAlternativeNameServerConfigTargetNameServersIpv4Address(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyAlternativeNameServerConfigTargetNameServersIpv4Address(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSPolicyDescription(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyDescription(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSPolicyEnableInboundForwarding(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyEnableInboundForwarding(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSPolicyEnableLogging(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyEnableLogging(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSPolicyName(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenDNSPolicyNetworks(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyNetworks(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } @@ -465,12 +465,12 @@ func flattenDNSPolicyNetworks(v interface{}, d *schema.ResourceData) interface{} continue } transformed.Add(map[string]interface{}{ - "network_url": flattenDNSPolicyNetworksNetworkUrl(original["networkUrl"], d), + "network_url": flattenDNSPolicyNetworksNetworkUrl(original["networkUrl"], d, config), }) } return transformed } -func flattenDNSPolicyNetworksNetworkUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenDNSPolicyNetworksNetworkUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_filestore_instance.go b/google-beta/resource_filestore_instance.go index 7b110a067c..e398762be4 100644 --- a/google-beta/resource_filestore_instance.go +++ b/google-beta/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-beta/resource_firestore_index.go b/google-beta/resource_firestore_index.go index f720a3ccd4..377a27e274 100644 --- a/google-beta/resource_firestore_index.go +++ b/google-beta/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-beta/resource_healthcare_dataset.go b/google-beta/resource_healthcare_dataset.go index c12738cae5..767c958343 100644 --- a/google-beta/resource_healthcare_dataset.go +++ b/google-beta/resource_healthcare_dataset.go @@ -154,10 +154,10 @@ func resourceHealthcareDatasetRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("name", flattenHealthcareDatasetName(res["name"], d)); err != nil { + if err := d.Set("name", flattenHealthcareDatasetName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } - if err := d.Set("time_zone", flattenHealthcareDatasetTimeZone(res["timeZone"], d)); err != nil { + if err := d.Set("time_zone", flattenHealthcareDatasetTimeZone(res["timeZone"], d, config)); err != nil { return fmt.Errorf("Error reading Dataset: %s", err) } @@ -251,11 +251,11 @@ func resourceHealthcareDatasetImport(d *schema.ResourceData, meta interface{}) ( return []*schema.ResourceData{d}, nil } -func flattenHealthcareDatasetName(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareDatasetName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareDatasetTimeZone(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareDatasetTimeZone(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_healthcare_dicom_store.go b/google-beta/resource_healthcare_dicom_store.go index d94a19dffe..c5f4896f20 100644 --- a/google-beta/resource_healthcare_dicom_store.go +++ b/google-beta/resource_healthcare_dicom_store.go @@ -175,13 +175,13 @@ func resourceHealthcareDicomStoreRead(d *schema.ResourceData, meta interface{}) return nil } - if err := d.Set("name", flattenHealthcareDicomStoreName(res["name"], d)); err != nil { + if err := d.Set("name", flattenHealthcareDicomStoreName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading DicomStore: %s", err) } - if err := d.Set("labels", flattenHealthcareDicomStoreLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenHealthcareDicomStoreLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading DicomStore: %s", err) } - if err := d.Set("notification_config", flattenHealthcareDicomStoreNotificationConfig(res["notificationConfig"], d)); err != nil { + if err := d.Set("notification_config", flattenHealthcareDicomStoreNotificationConfig(res["notificationConfig"], d, config)); err != nil { return fmt.Errorf("Error reading DicomStore: %s", err) } @@ -270,15 +270,15 @@ func resourceHealthcareDicomStoreImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenHealthcareDicomStoreName(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareDicomStoreName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareDicomStoreLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareDicomStoreLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareDicomStoreNotificationConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareDicomStoreNotificationConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -288,10 +288,10 @@ func flattenHealthcareDicomStoreNotificationConfig(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["pubsub_topic"] = - flattenHealthcareDicomStoreNotificationConfigPubsubTopic(original["pubsubTopic"], d) + flattenHealthcareDicomStoreNotificationConfigPubsubTopic(original["pubsubTopic"], d, config) return []interface{}{transformed} } -func flattenHealthcareDicomStoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareDicomStoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_healthcare_fhir_store.go b/google-beta/resource_healthcare_fhir_store.go index f7dbe0dc93..d0251e08b0 100644 --- a/google-beta/resource_healthcare_fhir_store.go +++ b/google-beta/resource_healthcare_fhir_store.go @@ -246,25 +246,25 @@ func resourceHealthcareFhirStoreRead(d *schema.ResourceData, meta interface{}) e return nil } - if err := d.Set("name", flattenHealthcareFhirStoreName(res["name"], d)); err != nil { + if err := d.Set("name", flattenHealthcareFhirStoreName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } - if err := d.Set("enable_update_create", flattenHealthcareFhirStoreEnableUpdateCreate(res["enableUpdateCreate"], d)); err != nil { + if err := d.Set("enable_update_create", flattenHealthcareFhirStoreEnableUpdateCreate(res["enableUpdateCreate"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } - if err := d.Set("disable_referential_integrity", flattenHealthcareFhirStoreDisableReferentialIntegrity(res["disableReferentialIntegrity"], d)); err != nil { + if err := d.Set("disable_referential_integrity", flattenHealthcareFhirStoreDisableReferentialIntegrity(res["disableReferentialIntegrity"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } - if err := d.Set("disable_resource_versioning", flattenHealthcareFhirStoreDisableResourceVersioning(res["disableResourceVersioning"], d)); err != nil { + if err := d.Set("disable_resource_versioning", flattenHealthcareFhirStoreDisableResourceVersioning(res["disableResourceVersioning"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } - if err := d.Set("enable_history_import", flattenHealthcareFhirStoreEnableHistoryImport(res["enableHistoryImport"], d)); err != nil { + if err := d.Set("enable_history_import", flattenHealthcareFhirStoreEnableHistoryImport(res["enableHistoryImport"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } - if err := d.Set("labels", flattenHealthcareFhirStoreLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenHealthcareFhirStoreLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } - if err := d.Set("notification_config", flattenHealthcareFhirStoreNotificationConfig(res["notificationConfig"], d)); err != nil { + if err := d.Set("notification_config", flattenHealthcareFhirStoreNotificationConfig(res["notificationConfig"], d, config)); err != nil { return fmt.Errorf("Error reading FhirStore: %s", err) } @@ -363,31 +363,31 @@ func resourceHealthcareFhirStoreImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenHealthcareFhirStoreName(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareFhirStoreEnableUpdateCreate(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreEnableUpdateCreate(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareFhirStoreDisableReferentialIntegrity(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreDisableReferentialIntegrity(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareFhirStoreDisableResourceVersioning(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreDisableResourceVersioning(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareFhirStoreEnableHistoryImport(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreEnableHistoryImport(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareFhirStoreLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareFhirStoreNotificationConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreNotificationConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -397,10 +397,10 @@ func flattenHealthcareFhirStoreNotificationConfig(v interface{}, d *schema.Resou } transformed := make(map[string]interface{}) transformed["pubsub_topic"] = - flattenHealthcareFhirStoreNotificationConfigPubsubTopic(original["pubsubTopic"], d) + flattenHealthcareFhirStoreNotificationConfigPubsubTopic(original["pubsubTopic"], d, config) return []interface{}{transformed} } -func flattenHealthcareFhirStoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareFhirStoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_healthcare_hl7_v2_store.go b/google-beta/resource_healthcare_hl7_v2_store.go index d4cc07c113..b226c7c379 100644 --- a/google-beta/resource_healthcare_hl7_v2_store.go +++ b/google-beta/resource_healthcare_hl7_v2_store.go @@ -205,16 +205,16 @@ func resourceHealthcareHl7V2StoreRead(d *schema.ResourceData, meta interface{}) return nil } - if err := d.Set("name", flattenHealthcareHl7V2StoreName(res["name"], d)); err != nil { + if err := d.Set("name", flattenHealthcareHl7V2StoreName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Hl7V2Store: %s", err) } - if err := d.Set("parser_config", flattenHealthcareHl7V2StoreParserConfig(res["parserConfig"], d)); err != nil { + if err := d.Set("parser_config", flattenHealthcareHl7V2StoreParserConfig(res["parserConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Hl7V2Store: %s", err) } - if err := d.Set("labels", flattenHealthcareHl7V2StoreLabels(res["labels"], d)); err != nil { + if err := d.Set("labels", flattenHealthcareHl7V2StoreLabels(res["labels"], d, config)); err != nil { return fmt.Errorf("Error reading Hl7V2Store: %s", err) } - if err := d.Set("notification_config", flattenHealthcareHl7V2StoreNotificationConfig(res["notificationConfig"], d)); err != nil { + if err := d.Set("notification_config", flattenHealthcareHl7V2StoreNotificationConfig(res["notificationConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Hl7V2Store: %s", err) } @@ -313,11 +313,11 @@ func resourceHealthcareHl7V2StoreImport(d *schema.ResourceData, meta interface{} return []*schema.ResourceData{d}, nil } -func flattenHealthcareHl7V2StoreName(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareHl7V2StoreParserConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreParserConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -327,24 +327,24 @@ func flattenHealthcareHl7V2StoreParserConfig(v interface{}, d *schema.ResourceDa } transformed := make(map[string]interface{}) transformed["allow_null_header"] = - flattenHealthcareHl7V2StoreParserConfigAllowNullHeader(original["allowNullHeader"], d) + flattenHealthcareHl7V2StoreParserConfigAllowNullHeader(original["allowNullHeader"], d, config) transformed["segment_terminator"] = - flattenHealthcareHl7V2StoreParserConfigSegmentTerminator(original["segmentTerminator"], d) + flattenHealthcareHl7V2StoreParserConfigSegmentTerminator(original["segmentTerminator"], d, config) return []interface{}{transformed} } -func flattenHealthcareHl7V2StoreParserConfigAllowNullHeader(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreParserConfigAllowNullHeader(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareHl7V2StoreParserConfigSegmentTerminator(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreParserConfigSegmentTerminator(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareHl7V2StoreLabels(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenHealthcareHl7V2StoreNotificationConfig(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreNotificationConfig(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -354,10 +354,10 @@ func flattenHealthcareHl7V2StoreNotificationConfig(v interface{}, d *schema.Reso } transformed := make(map[string]interface{}) transformed["pubsub_topic"] = - flattenHealthcareHl7V2StoreNotificationConfigPubsubTopic(original["pubsubTopic"], d) + flattenHealthcareHl7V2StoreNotificationConfigPubsubTopic(original["pubsubTopic"], d, config) return []interface{}{transformed} } -func flattenHealthcareHl7V2StoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData) interface{} { +func flattenHealthcareHl7V2StoreNotificationConfigPubsubTopic(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_identity_platform_default_supported_idp_config.go b/google-beta/resource_identity_platform_default_supported_idp_config.go index dab4808f76..850730902a 100644 --- a/google-beta/resource_identity_platform_default_supported_idp_config.go +++ b/google-beta/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-beta/resource_identity_platform_inbound_saml_config.go b/google-beta/resource_identity_platform_inbound_saml_config.go index fd9dd03c2c..5630a060bb 100644 --- a/google-beta/resource_identity_platform_inbound_saml_config.go +++ b/google-beta/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-beta/resource_identity_platform_oauth_idp_config.go b/google-beta/resource_identity_platform_oauth_idp_config.go index 60e5e095ab..64916ea5b1 100644 --- a/google-beta/resource_identity_platform_oauth_idp_config.go +++ b/google-beta/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-beta/resource_identity_platform_tenant.go b/google-beta/resource_identity_platform_tenant.go index 087f29eec9..c901394b5f 100644 --- a/google-beta/resource_identity_platform_tenant.go +++ b/google-beta/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-beta/resource_identity_platform_tenant_default_supported_idp_config.go b/google-beta/resource_identity_platform_tenant_default_supported_idp_config.go index d41da9fb58..da0e3f1220 100644 --- a/google-beta/resource_identity_platform_tenant_default_supported_idp_config.go +++ b/google-beta/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-beta/resource_identity_platform_tenant_inbound_saml_config.go b/google-beta/resource_identity_platform_tenant_inbound_saml_config.go index 846fca37c3..a58c954722 100644 --- a/google-beta/resource_identity_platform_tenant_inbound_saml_config.go +++ b/google-beta/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-beta/resource_identity_platform_tenant_oauth_idp_config.go b/google-beta/resource_identity_platform_tenant_oauth_idp_config.go index dd1274ac25..2cc46ffa7c 100644 --- a/google-beta/resource_identity_platform_tenant_oauth_idp_config.go +++ b/google-beta/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-beta/resource_kms_crypto_key.go b/google-beta/resource_kms_crypto_key.go index f8d6684ab2..c948d5ab6c 100644 --- a/google-beta/resource_kms_crypto_key.go +++ b/google-beta/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-beta/resource_kms_key_ring.go b/google-beta/resource_kms_key_ring.go index 843491a545..35ce947866 100644 --- a/google-beta/resource_kms_key_ring.go +++ b/google-beta/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-beta/resource_logging_metric.go b/google-beta/resource_logging_metric.go index e69bff67fd..b45c0386b5 100644 --- a/google-beta/resource_logging_metric.go +++ b/google-beta/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-beta/resource_ml_engine_model.go b/google-beta/resource_ml_engine_model.go index a746e61df3..3544b7f63a 100644 --- a/google-beta/resource_ml_engine_model.go +++ b/google-beta/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-beta/resource_monitoring_alert_policy.go b/google-beta/resource_monitoring_alert_policy.go index 173fd14ff7..7de77ffebc 100644 --- a/google-beta/resource_monitoring_alert_policy.go +++ b/google-beta/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-beta/resource_monitoring_group.go b/google-beta/resource_monitoring_group.go index b7481b6cd4..7ca2fb46ad 100644 --- a/google-beta/resource_monitoring_group.go +++ b/google-beta/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-beta/resource_monitoring_notification_channel.go b/google-beta/resource_monitoring_notification_channel.go index 7f6aedafd5..3aa408b175 100644 --- a/google-beta/resource_monitoring_notification_channel.go +++ b/google-beta/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-beta/resource_monitoring_uptime_check_config.go b/google-beta/resource_monitoring_uptime_check_config.go index 2075f484a0..7ef58b1835 100644 --- a/google-beta/resource_monitoring_uptime_check_config.go +++ b/google-beta/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-beta/resource_pubsub_subscription.go b/google-beta/resource_pubsub_subscription.go index d93fbe720b..260b88e096 100644 --- a/google-beta/resource_pubsub_subscription.go +++ b/google-beta/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-beta/resource_pubsub_topic.go b/google-beta/resource_pubsub_topic.go index 1808e1ff02..0150d3c2b3 100644 --- a/google-beta/resource_pubsub_topic.go +++ b/google-beta/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-beta/resource_redis_instance.go b/google-beta/resource_redis_instance.go index 96da124def..09f9dcbb7b 100644 --- a/google-beta/resource_redis_instance.go +++ b/google-beta/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-beta/resource_resource_manager_lien.go b/google-beta/resource_resource_manager_lien.go index c570744070..b745b04317 100644 --- a/google-beta/resource_resource_manager_lien.go +++ b/google-beta/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-beta/resource_secret_manager_secret.go b/google-beta/resource_secret_manager_secret.go new file mode 100644 index 0000000000..3a584e76d6 --- /dev/null +++ b/google-beta/resource_secret_manager_secret.go @@ -0,0 +1,455 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "fmt" + "log" + "reflect" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceSecretManagerSecret() *schema.Resource { + return &schema.Resource{ + Create: resourceSecretManagerSecretCreate, + Read: resourceSecretManagerSecretRead, + Update: resourceSecretManagerSecretUpdate, + Delete: resourceSecretManagerSecretDelete, + + Importer: &schema.ResourceImporter{ + State: resourceSecretManagerSecretImport, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(4 * time.Minute), + Update: schema.DefaultTimeout(4 * time.Minute), + Delete: schema.DefaultTimeout(4 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "replication": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Description: `The replication policy of the secret data attached to the Secret. It cannot be changed +after the Secret has been created.`, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "automatic": { + Type: schema.TypeBool, + Optional: true, + Description: `The Secret will automatically be replicated without any restrictions.`, + ExactlyOneOf: []string{"replication.0.automatic", "replication.0.user_managed"}, + }, + "user_managed": { + Type: schema.TypeList, + Optional: true, + Description: `The Secret will automatically be replicated without any restrictions.`, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "replicas": { + Type: schema.TypeList, + Required: true, + Description: `The list of Replicas for this Secret. Cannot be empty.`, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "location": { + Type: schema.TypeString, + Required: true, + Description: `The canonical IDs of the location to replicate data. For example: "us-east1".`, + }, + }, + }, + }, + }, + }, + ExactlyOneOf: []string{"replication.0.automatic", "replication.0.user_managed"}, + }, + }, + }, + }, + "secret_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: `This must be unique within the project.`, + }, + "labels": { + Type: schema.TypeMap, + Optional: true, + Description: `The labels assigned to this Secret. + +Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, +and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + +Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, +and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + +No more than 64 labels can be assigned to a given resource. + +An object containing a list of "key": value pairs. Example: +{ "name": "wrench", "mass": "1.3kg", "count": "3" }.`, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + Description: `The time at which the Secret was created.`, + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: `The resource name of the Secret. Format: +'projects/{{project}}/secrets/{{secret_id}}'`, + }, + "project": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + }, + } +} + +func resourceSecretManagerSecretCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + obj := make(map[string]interface{}) + labelsProp, err := expandSecretManagerSecretLabels(d.Get("labels"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("labels"); !isEmptyValue(reflect.ValueOf(labelsProp)) && (ok || !reflect.DeepEqual(v, labelsProp)) { + obj["labels"] = labelsProp + } + replicationProp, err := expandSecretManagerSecretReplication(d.Get("replication"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("replication"); !isEmptyValue(reflect.ValueOf(replicationProp)) && (ok || !reflect.DeepEqual(v, replicationProp)) { + obj["replication"] = replicationProp + } + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}projects/{{project}}/secrets?secretId={{secret_id}}") + if err != nil { + return err + } + + log.Printf("[DEBUG] Creating new Secret: %#v", obj) + project, err := getProject(d, config) + if err != nil { + return err + } + res, err := sendRequestWithTimeout(config, "POST", project, url, obj, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return fmt.Errorf("Error creating Secret: %s", err) + } + + // Store the ID now + id, err := replaceVars(d, config, "projects/{{project}}/secrets/{{secret_id}}") + if err != nil { + return fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + log.Printf("[DEBUG] Finished creating Secret %q: %#v", d.Id(), res) + + return resourceSecretManagerSecretRead(d, meta) +} + +func resourceSecretManagerSecretRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}projects/{{project}}/secrets/{{secret_id}}") + if err != nil { + return err + } + + project, err := getProject(d, config) + if err != nil { + return err + } + res, err := sendRequest(config, "GET", project, url, nil) + if err != nil { + return handleNotFoundError(err, d, fmt.Sprintf("SecretManagerSecret %q", d.Id())) + } + + if err := d.Set("project", project); err != nil { + return fmt.Errorf("Error reading Secret: %s", err) + } + + if err := d.Set("name", flattenSecretManagerSecretName(res["name"], d, config)); err != nil { + return fmt.Errorf("Error reading Secret: %s", err) + } + if err := d.Set("create_time", flattenSecretManagerSecretCreateTime(res["createTime"], d, config)); err != nil { + return fmt.Errorf("Error reading Secret: %s", err) + } + if err := d.Set("labels", flattenSecretManagerSecretLabels(res["labels"], d, config)); err != nil { + return fmt.Errorf("Error reading Secret: %s", err) + } + if err := d.Set("replication", flattenSecretManagerSecretReplication(res["replication"], d, config)); err != nil { + return fmt.Errorf("Error reading Secret: %s", err) + } + + return nil +} + +func resourceSecretManagerSecretUpdate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + project, err := getProject(d, config) + if err != nil { + return err + } + + obj := make(map[string]interface{}) + labelsProp, err := expandSecretManagerSecretLabels(d.Get("labels"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("labels"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, labelsProp)) { + obj["labels"] = labelsProp + } + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}projects/{{project}}/secrets/{{secret_id}}") + if err != nil { + return err + } + + log.Printf("[DEBUG] Updating Secret %q: %#v", d.Id(), obj) + updateMask := []string{} + + if d.HasChange("labels") { + updateMask = append(updateMask, "labels") + } + // updateMask is a URL parameter but not present in the schema, so replaceVars + // won't set it + url, err = addQueryParams(url, map[string]string{"updateMask": strings.Join(updateMask, ",")}) + if err != nil { + return err + } + _, err = sendRequestWithTimeout(config, "PATCH", project, url, obj, d.Timeout(schema.TimeoutUpdate)) + + if err != nil { + return fmt.Errorf("Error updating Secret %q: %s", d.Id(), err) + } + + return resourceSecretManagerSecretRead(d, meta) +} + +func resourceSecretManagerSecretDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + project, err := getProject(d, config) + if err != nil { + return err + } + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}projects/{{project}}/secrets/{{secret_id}}") + if err != nil { + return err + } + + var obj map[string]interface{} + log.Printf("[DEBUG] Deleting Secret %q", d.Id()) + + res, err := sendRequestWithTimeout(config, "DELETE", project, url, obj, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return handleNotFoundError(err, d, "Secret") + } + + log.Printf("[DEBUG] Finished deleting Secret %q: %#v", d.Id(), res) + return nil +} + +func resourceSecretManagerSecretImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(*Config) + if err := parseImportId([]string{ + "projects/(?P[^/]+)/secrets/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)", + }, d, config); err != nil { + return nil, err + } + + // Replace import id for the resource id + id, err := replaceVars(d, config, "projects/{{project}}/secrets/{{secret_id}}") + if err != nil { + return nil, fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + return []*schema.ResourceData{d}, nil +} + +func flattenSecretManagerSecretName(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSecretManagerSecretCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSecretManagerSecretLabels(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSecretManagerSecretReplication(v interface{}, d *schema.ResourceData, config *Config) interface{} { + if v == nil { + return nil + } + original := v.(map[string]interface{}) + if len(original) == 0 { + return nil + } + transformed := make(map[string]interface{}) + transformed["automatic"] = + flattenSecretManagerSecretReplicationAutomatic(original["automatic"], d, config) + transformed["user_managed"] = + flattenSecretManagerSecretReplicationUserManaged(original["userManaged"], d, config) + return []interface{}{transformed} +} +func flattenSecretManagerSecretReplicationAutomatic(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v != nil +} + +func flattenSecretManagerSecretReplicationUserManaged(v interface{}, d *schema.ResourceData, config *Config) interface{} { + if v == nil { + return nil + } + original := v.(map[string]interface{}) + if len(original) == 0 { + return nil + } + transformed := make(map[string]interface{}) + transformed["replicas"] = + flattenSecretManagerSecretReplicationUserManagedReplicas(original["replicas"], d, config) + return []interface{}{transformed} +} +func flattenSecretManagerSecretReplicationUserManagedReplicas(v interface{}, d *schema.ResourceData, config *Config) interface{} { + if v == nil { + return v + } + l := v.([]interface{}) + transformed := make([]interface{}, 0, len(l)) + for _, raw := range l { + original := raw.(map[string]interface{}) + if len(original) < 1 { + // Do not include empty json objects coming back from the api + continue + } + transformed = append(transformed, map[string]interface{}{ + "location": flattenSecretManagerSecretReplicationUserManagedReplicasLocation(original["location"], d, config), + }) + } + return transformed +} +func flattenSecretManagerSecretReplicationUserManagedReplicasLocation(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func expandSecretManagerSecretLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { + if v == nil { + return map[string]string{}, nil + } + m := make(map[string]string) + for k, val := range v.(map[string]interface{}) { + m[k] = val.(string) + } + return m, nil +} + +func expandSecretManagerSecretReplication(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + l := v.([]interface{}) + if len(l) == 0 || l[0] == nil { + return nil, nil + } + raw := l[0] + original := raw.(map[string]interface{}) + transformed := make(map[string]interface{}) + + transformedAutomatic, err := expandSecretManagerSecretReplicationAutomatic(original["automatic"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedAutomatic); val.IsValid() && !isEmptyValue(val) { + transformed["automatic"] = transformedAutomatic + } + + transformedUserManaged, err := expandSecretManagerSecretReplicationUserManaged(original["user_managed"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedUserManaged); val.IsValid() && !isEmptyValue(val) { + transformed["userManaged"] = transformedUserManaged + } + + return transformed, nil +} + +func expandSecretManagerSecretReplicationAutomatic(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + if v == nil || !v.(bool) { + return nil, nil + } + + return struct{}{}, nil +} + +func expandSecretManagerSecretReplicationUserManaged(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + l := v.([]interface{}) + if len(l) == 0 || l[0] == nil { + return nil, nil + } + raw := l[0] + original := raw.(map[string]interface{}) + transformed := make(map[string]interface{}) + + transformedReplicas, err := expandSecretManagerSecretReplicationUserManagedReplicas(original["replicas"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedReplicas); val.IsValid() && !isEmptyValue(val) { + transformed["replicas"] = transformedReplicas + } + + return transformed, nil +} + +func expandSecretManagerSecretReplicationUserManagedReplicas(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + l := v.([]interface{}) + req := make([]interface{}, 0, len(l)) + for _, raw := range l { + if raw == nil { + continue + } + original := raw.(map[string]interface{}) + transformed := make(map[string]interface{}) + + transformedLocation, err := expandSecretManagerSecretReplicationUserManagedReplicasLocation(original["location"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedLocation); val.IsValid() && !isEmptyValue(val) { + transformed["location"] = transformedLocation + } + + req = append(req, transformed) + } + return req, nil +} + +func expandSecretManagerSecretReplicationUserManagedReplicasLocation(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} diff --git a/google-beta/resource_secret_manager_secret_generated_test.go b/google-beta/resource_secret_manager_secret_generated_test.go new file mode 100644 index 0000000000..45c80c9397 --- /dev/null +++ b/google-beta/resource_secret_manager_secret_generated_test.go @@ -0,0 +1,94 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccSecretManagerSecret_secretConfigBasicExample(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + CheckDestroy: testAccCheckSecretManagerSecretDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSecretManagerSecret_secretConfigBasicExample(context), + }, + }, + }) +} + +func testAccSecretManagerSecret_secretConfigBasicExample(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} +`, context) +} + +func testAccCheckSecretManagerSecretDestroy(s *terraform.State) error { + for name, rs := range s.RootModule().Resources { + if rs.Type != "google_secret_manager_secret" { + continue + } + if strings.HasPrefix(name, "data.") { + continue + } + + config := testAccProvider.Meta().(*Config) + + url, err := replaceVarsForTest(config, rs, "{{SecretManagerBasePath}}projects/{{project}}/secrets/{{secret_id}}") + if err != nil { + return err + } + + _, err = sendRequest(config, "GET", "", url, nil) + if err == nil { + return fmt.Errorf("SecretManagerSecret still exists at %s", url) + } + } + + return nil +} diff --git a/google-beta/resource_secret_manager_secret_sweeper_test.go b/google-beta/resource_secret_manager_secret_sweeper_test.go new file mode 100644 index 0000000000..53b656c0f6 --- /dev/null +++ b/google-beta/resource_secret_manager_secret_sweeper_test.go @@ -0,0 +1,119 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "context" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func init() { + resource.AddTestSweepers("SecretManagerSecret", &resource.Sweeper{ + Name: "SecretManagerSecret", + F: testSweepSecretManagerSecret, + }) +} + +// At the time of writing, the CI only passes us-central1 as the region +func testSweepSecretManagerSecret(region string) error { + resourceName := "SecretManagerSecret" + log.Printf("[INFO][SWEEPER_LOG] Starting sweeper for %s", resourceName) + + config, err := sharedConfigForRegion(region) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error getting shared config for region: %s", err) + return err + } + + err = config.LoadAndValidate(context.Background()) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error loading: %s", err) + return err + } + + // Setup variables to replace in list template + d := &ResourceDataMock{ + FieldsInSchema: map[string]interface{}{ + "project": config.Project, + "region": region, + "location": region, + "zone": "-", + }, + } + + listTemplate := strings.Split("https://secretmanager.googleapis.com/v1beta1/projects/{{project}}/secrets", "?")[0] + listUrl, err := replaceVars(d, config, listTemplate) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err) + return nil + } + + res, err := sendRequest(config, "GET", config.Project, listUrl, nil) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] Error in response from request %s: %s", listUrl, err) + return nil + } + + resourceList, ok := res["secrets"] + if !ok { + log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.") + return nil + } + + rl := resourceList.([]interface{}) + + log.Printf("[INFO][SWEEPER_LOG] Found %d items in %s list response.", len(rl), resourceName) + // items who don't match the tf-test prefix + nonPrefixCount := 0 + for _, ri := range rl { + obj := ri.(map[string]interface{}) + if obj["name"] == nil { + log.Printf("[INFO][SWEEPER_LOG] %s resource name was nil", resourceName) + return nil + } + + name := GetResourceNameFromSelfLink(obj["name"].(string)) + // Only sweep resources with the test prefix + if !strings.HasPrefix(name, "tf-test") { + nonPrefixCount++ + continue + } + + deleteTemplate := "https://secretmanager.googleapis.com/v1beta1/projects/{{project}}/secrets/{{secret_id}}" + deleteUrl, err := replaceVars(d, config, deleteTemplate) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err) + return nil + } + deleteUrl = deleteUrl + name + + // Don't wait on operations as we may have a lot to delete + _, err = sendRequest(config, "DELETE", config.Project, deleteUrl, nil) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] Error deleting for url %s : %s", deleteUrl, err) + } else { + log.Printf("[INFO][SWEEPER_LOG] Sent delete request for %s resource: %s", resourceName, name) + } + } + + if nonPrefixCount > 0 { + log.Printf("[INFO][SWEEPER_LOG] %d items without tf_test prefix remain.", nonPrefixCount) + } + + return nil +} diff --git a/google-beta/resource_secret_manager_secret_test.go b/google-beta/resource_secret_manager_secret_test.go new file mode 100644 index 0000000000..f4ff280765 --- /dev/null +++ b/google-beta/resource_secret_manager_secret_test.go @@ -0,0 +1,55 @@ +package google + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccSecretManagerSecret_import(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckSecretManagerSecretDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSecretManagerSecret_basic(context), + }, + { + ResourceName: "google_secret_manager_secret.secret-basic", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccSecretManagerSecret_basic(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + secret_id = "tf-test-secret-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} +`, context) +} diff --git a/google-beta/resource_secret_manager_secret_version.go b/google-beta/resource_secret_manager_secret_version.go new file mode 100644 index 0000000000..4af1753235 --- /dev/null +++ b/google-beta/resource_secret_manager_secret_version.go @@ -0,0 +1,328 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "encoding/base64" + "fmt" + "log" + "reflect" + "regexp" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceSecretManagerSecretVersionUpdate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + _, err := expandSecretManagerSecretVersionEnabled(d.Get("enabled"), d, config) + if err != nil { + return err + } + + return resourceSecretManagerSecretVersionRead(d, meta) +} + +func resourceSecretManagerSecretVersion() *schema.Resource { + return &schema.Resource{ + Create: resourceSecretManagerSecretVersionCreate, + Read: resourceSecretManagerSecretVersionRead, + Delete: resourceSecretManagerSecretVersionDelete, + + Importer: &schema.ResourceImporter{ + State: resourceSecretManagerSecretVersionImport, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(4 * time.Minute), + Delete: schema.DefaultTimeout(4 * time.Minute), + }, + + Update: resourceSecretManagerSecretVersionUpdate, + + Schema: map[string]*schema.Schema{ + "secret_data": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: `The secret data. Must be no larger than 64KiB. A base64-encoded string.`, + Sensitive: true, + }, + + "secret": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: compareSelfLinkOrResourceName, + Description: `Secret Manager secret resource`, + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: `The current state of the SecretVersion.`, + Default: true, + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + Description: `The time at which the Secret was created.`, + }, + "destroy_time": { + Type: schema.TypeString, + Computed: true, + Description: `The time at which the Secret was destroyed. Only present if state is DESTROYED.`, + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: `The resource name of the SecretVersion. Format: +'projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}'`, + }, + }, + } +} + +func resourceSecretManagerSecretVersionCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + obj := make(map[string]interface{}) + stateProp, err := expandSecretManagerSecretVersionEnabled(d.Get("enabled"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("enabled"); !isEmptyValue(reflect.ValueOf(stateProp)) && (ok || !reflect.DeepEqual(v, stateProp)) { + obj["state"] = stateProp + } + payloadProp, err := expandSecretManagerSecretVersionPayload(nil, d, config) + if err != nil { + return err + } else if !isEmptyValue(reflect.ValueOf(payloadProp)) { + obj["payload"] = payloadProp + } + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}{{secret}}:addVersion") + if err != nil { + return err + } + + log.Printf("[DEBUG] Creating new SecretVersion: %#v", obj) + res, err := sendRequestWithTimeout(config, "POST", "", url, obj, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return fmt.Errorf("Error creating SecretVersion: %s", err) + } + + // Store the ID now + id, err := replaceVars(d, config, "{{name}}") + if err != nil { + return fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + log.Printf("[DEBUG] Finished creating SecretVersion %q: %#v", d.Id(), res) + + // `name` is autogenerated from the api so needs to be set post-create + name, ok := res["name"] + if !ok { + return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.") + } + d.Set("name", name.(string)) + d.SetId(name.(string)) + + _, err = expandSecretManagerSecretVersionEnabled(d.Get("enabled"), d, config) + if err != nil { + return err + } + + return resourceSecretManagerSecretVersionRead(d, meta) +} + +func resourceSecretManagerSecretVersionRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}{{name}}") + if err != nil { + return err + } + + res, err := sendRequest(config, "GET", "", url, nil) + if err != nil { + return handleNotFoundError(err, d, fmt.Sprintf("SecretManagerSecretVersion %q", d.Id())) + } + + if err := d.Set("enabled", flattenSecretManagerSecretVersionEnabled(res["state"], d, config)); err != nil { + return fmt.Errorf("Error reading SecretVersion: %s", err) + } + if err := d.Set("name", flattenSecretManagerSecretVersionName(res["name"], d, config)); err != nil { + return fmt.Errorf("Error reading SecretVersion: %s", err) + } + if err := d.Set("create_time", flattenSecretManagerSecretVersionCreateTime(res["createTime"], d, config)); err != nil { + return fmt.Errorf("Error reading SecretVersion: %s", err) + } + if err := d.Set("destroy_time", flattenSecretManagerSecretVersionDestroyTime(res["destroyTime"], d, config)); err != nil { + return fmt.Errorf("Error reading SecretVersion: %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 := flattenSecretManagerSecretVersionPayload(res["payload"], d, config); flattenedProp != nil { + casted := flattenedProp.([]interface{})[0] + if casted != nil { + for k, v := range casted.(map[string]interface{}) { + d.Set(k, v) + } + } + } + + return nil +} + +func resourceSecretManagerSecretVersionDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}{{name}}:destroy") + if err != nil { + return err + } + + var obj map[string]interface{} + log.Printf("[DEBUG] Deleting SecretVersion %q", d.Id()) + + res, err := sendRequestWithTimeout(config, "POST", "", url, obj, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return handleNotFoundError(err, d, "SecretVersion") + } + + log.Printf("[DEBUG] Finished deleting SecretVersion %q: %#v", d.Id(), res) + return nil +} + +func resourceSecretManagerSecretVersionImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(*Config) + + // current import_formats can't import fields with forward slashes in their value + if err := parseImportId([]string{"(?P.+)"}, d, config); err != nil { + return nil, err + } + + name := d.Get("name").(string) + secretRegex := regexp.MustCompile("(projects/.+/secrets/.+)/versions/.+$") + + parts := secretRegex.FindStringSubmatch(name) + if len(parts) != 2 { + panic(fmt.Sprintf("Version name doesn not fit the format `projects/{{project}}/secrets/{{secret}}/versions{{version}}`")) + } + d.Set("secret", parts[1]) + + return []*schema.ResourceData{d}, nil +} + +func flattenSecretManagerSecretVersionEnabled(v interface{}, d *schema.ResourceData, config *Config) interface{} { + if v.(string) == "ENABLED" { + return true + } + + return false +} + +func flattenSecretManagerSecretVersionName(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSecretManagerSecretVersionCreateTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSecretManagerSecretVersionDestroyTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSecretManagerSecretVersionPayload(v interface{}, d *schema.ResourceData, config *Config) interface{} { + transformed := make(map[string]interface{}) + + // if this secret version is disabled, the api will return an error, as the value cannot be accessed, return what we have + if d.Get("enabled").(bool) == false { + transformed["secret_data"] = d.Get("secret_data") + return []interface{}{transformed} + } + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}{{name}}:access") + if err != nil { + return err + } + + parts := strings.Split(d.Get("name").(string), "/") + project := parts[1] + + accessRes := make(map[string]interface{}) + accessRes, err = sendRequest(config, "GET", project, url, nil) + if err != nil { + return err + } + + data, err := base64.StdEncoding.DecodeString(accessRes["payload"].(map[string]interface{})["data"].(string)) + if err != nil { + return err + } + transformed["secret_data"] = string(data) + return []interface{}{transformed} +} + +func expandSecretManagerSecretVersionEnabled(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + name := d.Get("name").(string) + if name == "" { + return "", nil + } + + url, err := replaceVars(d, config, "{{SecretManagerBasePath}}{{name}}") + if err != nil { + return nil, err + } + + if v == true { + url = fmt.Sprintf("%s:enable", url) + } else { + url = fmt.Sprintf("%s:disable", url) + } + + parts := strings.Split(name, "/") + project := parts[1] + + _, err = sendRequest(config, "POST", project, url, nil) + if err != nil { + return nil, err + } + + return nil, nil +} + +func expandSecretManagerSecretVersionPayload(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + transformed := make(map[string]interface{}) + transformedSecretData, err := expandSecretManagerSecretVersionPayloadSecretData(d.Get("secret_data"), d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedSecretData); val.IsValid() && !isEmptyValue(val) { + transformed["data"] = transformedSecretData + } + + return transformed, nil +} + +func expandSecretManagerSecretVersionPayloadSecretData(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + if v == nil { + return nil, nil + } + + return base64.StdEncoding.EncodeToString([]byte(v.(string))), nil +} diff --git a/google-beta/resource_secret_manager_secret_version_generated_test.go b/google-beta/resource_secret_manager_secret_version_generated_test.go new file mode 100644 index 0000000000..78430d6c11 --- /dev/null +++ b/google-beta/resource_secret_manager_secret_version_generated_test.go @@ -0,0 +1,96 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccSecretManagerSecretVersion_secretVersionBasicExample(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + CheckDestroy: testAccCheckSecretManagerSecretVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSecretManagerSecretVersion_secretVersionBasicExample(context), + }, + }, + }) +} + +func testAccSecretManagerSecretVersion_secretVersionBasicExample(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-version-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + automatic = true + } +} + + +resource "google_secret_manager_secret_version" "secret-version-basic" { + provider = google-beta + + secret = google_secret_manager_secret.secret-basic.name + + secret_data = "my-tf-test-secret%{random_suffix}" +} +`, context) +} + +func testAccCheckSecretManagerSecretVersionDestroy(s *terraform.State) error { + for name, rs := range s.RootModule().Resources { + if rs.Type != "google_secret_manager_secret_version" { + continue + } + if strings.HasPrefix(name, "data.") { + continue + } + + config := testAccProvider.Meta().(*Config) + + url, err := replaceVarsForTest(config, rs, "{{SecretManagerBasePath}}{{name}}") + if err != nil { + return err + } + + _, err = sendRequest(config, "GET", "", url, nil) + if err == nil { + return fmt.Errorf("SecretManagerSecretVersion still exists at %s", url) + } + } + + return nil +} diff --git a/google-beta/resource_secret_manager_secret_version_sweeper_test.go b/google-beta/resource_secret_manager_secret_version_sweeper_test.go new file mode 100644 index 0000000000..9af868eb33 --- /dev/null +++ b/google-beta/resource_secret_manager_secret_version_sweeper_test.go @@ -0,0 +1,119 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "context" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func init() { + resource.AddTestSweepers("SecretManagerSecretVersion", &resource.Sweeper{ + Name: "SecretManagerSecretVersion", + F: testSweepSecretManagerSecretVersion, + }) +} + +// At the time of writing, the CI only passes us-central1 as the region +func testSweepSecretManagerSecretVersion(region string) error { + resourceName := "SecretManagerSecretVersion" + log.Printf("[INFO][SWEEPER_LOG] Starting sweeper for %s", resourceName) + + config, err := sharedConfigForRegion(region) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error getting shared config for region: %s", err) + return err + } + + err = config.LoadAndValidate(context.Background()) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error loading: %s", err) + return err + } + + // Setup variables to replace in list template + d := &ResourceDataMock{ + FieldsInSchema: map[string]interface{}{ + "project": config.Project, + "region": region, + "location": region, + "zone": "-", + }, + } + + listTemplate := strings.Split("https://secretmanager.googleapis.com/v1beta1/{{name}}", "?")[0] + listUrl, err := replaceVars(d, config, listTemplate) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err) + return nil + } + + res, err := sendRequest(config, "GET", config.Project, listUrl, nil) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] Error in response from request %s: %s", listUrl, err) + return nil + } + + resourceList, ok := res["secretVersions"] + if !ok { + log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.") + return nil + } + + rl := resourceList.([]interface{}) + + log.Printf("[INFO][SWEEPER_LOG] Found %d items in %s list response.", len(rl), resourceName) + // items who don't match the tf-test prefix + nonPrefixCount := 0 + for _, ri := range rl { + obj := ri.(map[string]interface{}) + if obj["name"] == nil { + log.Printf("[INFO][SWEEPER_LOG] %s resource name was nil", resourceName) + return nil + } + + name := GetResourceNameFromSelfLink(obj["name"].(string)) + // Only sweep resources with the test prefix + if !strings.HasPrefix(name, "tf-test") { + nonPrefixCount++ + continue + } + + deleteTemplate := "https://secretmanager.googleapis.com/v1beta1/{{name}}:destroy" + deleteUrl, err := replaceVars(d, config, deleteTemplate) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err) + return nil + } + deleteUrl = deleteUrl + name + + // Don't wait on operations as we may have a lot to delete + _, err = sendRequest(config, "DELETE", config.Project, deleteUrl, nil) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] Error deleting for url %s : %s", deleteUrl, err) + } else { + log.Printf("[INFO][SWEEPER_LOG] Sent delete request for %s resource: %s", resourceName, name) + } + } + + if nonPrefixCount > 0 { + log.Printf("[INFO][SWEEPER_LOG] %d items without tf_test prefix remain.", nonPrefixCount) + } + + return nil +} diff --git a/google-beta/resource_secret_manager_secret_version_test.go b/google-beta/resource_secret_manager_secret_version_test.go new file mode 100644 index 0000000000..b2b4b2433f --- /dev/null +++ b/google-beta/resource_secret_manager_secret_version_test.go @@ -0,0 +1,97 @@ +package google + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccSecretManagerSecretVersion_update(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckSecretManagerSecretVersionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSecretManagerSecretVersion_basic(context), + }, + { + ResourceName: "google_secret_manager_secret_version.secret-version-basic", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccSecretManagerSecretVersion_disable(context), + }, + { + ResourceName: "google_secret_manager_secret_version.secret-version-basic", + ImportState: true, + ImportStateVerify: true, + // at this point the secret data is disabled and so reading the data on import will + // give an empty string + ImportStateVerifyIgnore: []string{"secret_data"}, + }, + { + Config: testAccSecretManagerSecretVersion_basic(context), + }, + { + ResourceName: "google_secret_manager_secret_version.secret-version-basic", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccSecretManagerSecretVersion_basic(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + secret_id = "tf-test-secret-version-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + automatic = true + } +} + +resource "google_secret_manager_secret_version" "secret-version-basic" { + secret = google_secret_manager_secret.secret-basic.name + + secret_data = "my-tf-test-secret%{random_suffix}" + enabled = true +} +`, context) +} + +func testAccSecretManagerSecretVersion_disable(context map[string]interface{}) string { + return Nprintf(` +resource "google_secret_manager_secret" "secret-basic" { + secret_id = "tf-test-secret-version-%{random_suffix}" + + labels = { + label = "my-label" + } + + replication { + automatic = true + } +} + +resource "google_secret_manager_secret_version" "secret-version-basic" { + secret = google_secret_manager_secret.secret-basic.name + + secret_data = "my-tf-test-secret%{random_suffix}" + enabled = false +} +`, context) +} diff --git a/google-beta/resource_security_center_source.go b/google-beta/resource_security_center_source.go index c01d9acc86..4c2dd495c5 100644 --- a/google-beta/resource_security_center_source.go +++ b/google-beta/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-beta/resource_security_scanner_scan_config.go b/google-beta/resource_security_scanner_scan_config.go index 669be78e4d..5e79fda425 100644 --- a/google-beta/resource_security_scanner_scan_config.go +++ b/google-beta/resource_security_scanner_scan_config.go @@ -313,34 +313,34 @@ func resourceSecurityScannerScanConfigRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("name", flattenSecurityScannerScanConfigName(res["name"], d)); err != nil { + if err := d.Set("name", flattenSecurityScannerScanConfigName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("display_name", flattenSecurityScannerScanConfigDisplayName(res["displayName"], d)); err != nil { + if err := d.Set("display_name", flattenSecurityScannerScanConfigDisplayName(res["displayName"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("max_qps", flattenSecurityScannerScanConfigMaxQps(res["maxQps"], d)); err != nil { + if err := d.Set("max_qps", flattenSecurityScannerScanConfigMaxQps(res["maxQps"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("starting_urls", flattenSecurityScannerScanConfigStartingUrls(res["startingUrls"], d)); err != nil { + if err := d.Set("starting_urls", flattenSecurityScannerScanConfigStartingUrls(res["startingUrls"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("authentication", flattenSecurityScannerScanConfigAuthentication(res["authentication"], d)); err != nil { + if err := d.Set("authentication", flattenSecurityScannerScanConfigAuthentication(res["authentication"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("user_agent", flattenSecurityScannerScanConfigUserAgent(res["userAgent"], d)); err != nil { + if err := d.Set("user_agent", flattenSecurityScannerScanConfigUserAgent(res["userAgent"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("blacklist_patterns", flattenSecurityScannerScanConfigBlacklistPatterns(res["blacklistPatterns"], d)); err != nil { + if err := d.Set("blacklist_patterns", flattenSecurityScannerScanConfigBlacklistPatterns(res["blacklistPatterns"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("schedule", flattenSecurityScannerScanConfigSchedule(res["schedule"], d)); err != nil { + if err := d.Set("schedule", flattenSecurityScannerScanConfigSchedule(res["schedule"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("target_platforms", flattenSecurityScannerScanConfigTargetPlatforms(res["targetPlatforms"], d)); err != nil { + if err := d.Set("target_platforms", flattenSecurityScannerScanConfigTargetPlatforms(res["targetPlatforms"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } - if err := d.Set("export_to_security_command_center", flattenSecurityScannerScanConfigExportToSecurityCommandCenter(res["exportToSecurityCommandCenter"], d)); err != nil { + if err := d.Set("export_to_security_command_center", flattenSecurityScannerScanConfigExportToSecurityCommandCenter(res["exportToSecurityCommandCenter"], d, config)); err != nil { return fmt.Errorf("Error reading ScanConfig: %s", err) } @@ -506,15 +506,15 @@ func resourceSecurityScannerScanConfigImport(d *schema.ResourceData, meta interf return []*schema.ResourceData{d}, nil } -func flattenSecurityScannerScanConfigName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigMaxQps(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigMaxQps(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 { @@ -524,11 +524,11 @@ func flattenSecurityScannerScanConfigMaxQps(v interface{}, d *schema.ResourceDat return v } -func flattenSecurityScannerScanConfigStartingUrls(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigStartingUrls(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigAuthentication(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthentication(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -538,12 +538,12 @@ func flattenSecurityScannerScanConfigAuthentication(v interface{}, d *schema.Res } transformed := make(map[string]interface{}) transformed["google_account"] = - flattenSecurityScannerScanConfigAuthenticationGoogleAccount(original["googleAccount"], d) + flattenSecurityScannerScanConfigAuthenticationGoogleAccount(original["googleAccount"], d, config) transformed["custom_account"] = - flattenSecurityScannerScanConfigAuthenticationCustomAccount(original["customAccount"], d) + flattenSecurityScannerScanConfigAuthenticationCustomAccount(original["customAccount"], d, config) return []interface{}{transformed} } -func flattenSecurityScannerScanConfigAuthenticationGoogleAccount(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationGoogleAccount(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -553,20 +553,20 @@ func flattenSecurityScannerScanConfigAuthenticationGoogleAccount(v interface{}, } transformed := make(map[string]interface{}) transformed["username"] = - flattenSecurityScannerScanConfigAuthenticationGoogleAccountUsername(original["username"], d) + flattenSecurityScannerScanConfigAuthenticationGoogleAccountUsername(original["username"], d, config) transformed["password"] = - flattenSecurityScannerScanConfigAuthenticationGoogleAccountPassword(original["password"], d) + flattenSecurityScannerScanConfigAuthenticationGoogleAccountPassword(original["password"], d, config) return []interface{}{transformed} } -func flattenSecurityScannerScanConfigAuthenticationGoogleAccountUsername(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationGoogleAccountUsername(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigAuthenticationGoogleAccountPassword(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationGoogleAccountPassword(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("authentication.0.custom_account.0.password") } -func flattenSecurityScannerScanConfigAuthenticationCustomAccount(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationCustomAccount(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -576,34 +576,34 @@ func flattenSecurityScannerScanConfigAuthenticationCustomAccount(v interface{}, } transformed := make(map[string]interface{}) transformed["username"] = - flattenSecurityScannerScanConfigAuthenticationCustomAccountUsername(original["username"], d) + flattenSecurityScannerScanConfigAuthenticationCustomAccountUsername(original["username"], d, config) transformed["password"] = - flattenSecurityScannerScanConfigAuthenticationCustomAccountPassword(original["password"], d) + flattenSecurityScannerScanConfigAuthenticationCustomAccountPassword(original["password"], d, config) transformed["login_url"] = - flattenSecurityScannerScanConfigAuthenticationCustomAccountLoginUrl(original["loginUrl"], d) + flattenSecurityScannerScanConfigAuthenticationCustomAccountLoginUrl(original["loginUrl"], d, config) return []interface{}{transformed} } -func flattenSecurityScannerScanConfigAuthenticationCustomAccountUsername(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationCustomAccountUsername(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigAuthenticationCustomAccountPassword(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationCustomAccountPassword(v interface{}, d *schema.ResourceData, config *Config) interface{} { return d.Get("authentication.0.google_account.0.password") } -func flattenSecurityScannerScanConfigAuthenticationCustomAccountLoginUrl(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigAuthenticationCustomAccountLoginUrl(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigUserAgent(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigUserAgent(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigBlacklistPatterns(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigBlacklistPatterns(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigSchedule(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigSchedule(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return nil } @@ -613,16 +613,16 @@ func flattenSecurityScannerScanConfigSchedule(v interface{}, d *schema.ResourceD } transformed := make(map[string]interface{}) transformed["schedule_time"] = - flattenSecurityScannerScanConfigScheduleScheduleTime(original["scheduleTime"], d) + flattenSecurityScannerScanConfigScheduleScheduleTime(original["scheduleTime"], d, config) transformed["interval_duration_days"] = - flattenSecurityScannerScanConfigScheduleIntervalDurationDays(original["intervalDurationDays"], d) + flattenSecurityScannerScanConfigScheduleIntervalDurationDays(original["intervalDurationDays"], d, config) return []interface{}{transformed} } -func flattenSecurityScannerScanConfigScheduleScheduleTime(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigScheduleScheduleTime(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigScheduleIntervalDurationDays(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigScheduleIntervalDurationDays(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 { @@ -632,11 +632,11 @@ func flattenSecurityScannerScanConfigScheduleIntervalDurationDays(v interface{}, return v } -func flattenSecurityScannerScanConfigTargetPlatforms(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigTargetPlatforms(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenSecurityScannerScanConfigExportToSecurityCommandCenter(v interface{}, d *schema.ResourceData) interface{} { +func flattenSecurityScannerScanConfigExportToSecurityCommandCenter(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } diff --git a/google-beta/resource_source_repo_repository.go b/google-beta/resource_source_repo_repository.go index 32921f5549..9525a5794b 100644 --- a/google-beta/resource_source_repo_repository.go +++ b/google-beta/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-beta/resource_spanner_database.go b/google-beta/resource_spanner_database.go index d7ac87be4a..15518a29c3 100644 --- a/google-beta/resource_spanner_database.go +++ b/google-beta/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-beta/resource_spanner_instance.go b/google-beta/resource_spanner_instance.go index 2cbcba7846..af8ed5b101 100644 --- a/google-beta/resource_spanner_instance.go +++ b/google-beta/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-beta/resource_sql_database.go b/google-beta/resource_sql_database.go index 5d81d52099..70623c2dba 100644 --- a/google-beta/resource_sql_database.go +++ b/google-beta/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-beta/resource_sql_database_instance_test.go b/google-beta/resource_sql_database_instance_test.go index dd32665f76..9e7fa0f813 100644 --- a/google-beta/resource_sql_database_instance_test.go +++ b/google-beta/resource_sql_database_instance_test.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + sqladmin "google.golang.org/api/sqladmin/v1beta4" ) diff --git a/google-beta/resource_storage_bucket_access_control.go b/google-beta/resource_storage_bucket_access_control.go index 55d2c59ac0..e88569ae0e 100644 --- a/google-beta/resource_storage_bucket_access_control.go +++ b/google-beta/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-beta/resource_storage_default_object_access_control.go b/google-beta/resource_storage_default_object_access_control.go index 75812b2441..241285fda0 100644 --- a/google-beta/resource_storage_default_object_access_control.go +++ b/google-beta/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-beta/resource_storage_object_access_control.go b/google-beta/resource_storage_object_access_control.go index 5045ffae97..30b5662fb3 100644 --- a/google-beta/resource_storage_object_access_control.go +++ b/google-beta/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-beta/resource_tpu_node.go b/google-beta/resource_tpu_node.go index 69dc8247ba..824a22c484 100644 --- a/google-beta/resource_tpu_node.go +++ b/google-beta/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/google-beta/resource_vpc_access_connector.go b/google-beta/resource_vpc_access_connector.go index 078a9b2ff4..553a0c730d 100644 --- a/google-beta/resource_vpc_access_connector.go +++ b/google-beta/resource_vpc_access_connector.go @@ -216,22 +216,22 @@ func resourceVPCAccessConnectorRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error reading Connector: %s", err) } - if err := d.Set("name", flattenVPCAccessConnectorName(res["name"], d)); err != nil { + if err := d.Set("name", flattenVPCAccessConnectorName(res["name"], d, config)); err != nil { return fmt.Errorf("Error reading Connector: %s", err) } - if err := d.Set("network", flattenVPCAccessConnectorNetwork(res["network"], d)); err != nil { + if err := d.Set("network", flattenVPCAccessConnectorNetwork(res["network"], d, config)); err != nil { return fmt.Errorf("Error reading Connector: %s", err) } - if err := d.Set("ip_cidr_range", flattenVPCAccessConnectorIpCidrRange(res["ipCidrRange"], d)); err != nil { + if err := d.Set("ip_cidr_range", flattenVPCAccessConnectorIpCidrRange(res["ipCidrRange"], d, config)); err != nil { return fmt.Errorf("Error reading Connector: %s", err) } - if err := d.Set("state", flattenVPCAccessConnectorState(res["state"], d)); err != nil { + if err := d.Set("state", flattenVPCAccessConnectorState(res["state"], d, config)); err != nil { return fmt.Errorf("Error reading Connector: %s", err) } - if err := d.Set("min_throughput", flattenVPCAccessConnectorMinThroughput(res["minThroughput"], d)); err != nil { + if err := d.Set("min_throughput", flattenVPCAccessConnectorMinThroughput(res["minThroughput"], d, config)); err != nil { return fmt.Errorf("Error reading Connector: %s", err) } - if err := d.Set("max_throughput", flattenVPCAccessConnectorMaxThroughput(res["maxThroughput"], d)); err != nil { + if err := d.Set("max_throughput", flattenVPCAccessConnectorMaxThroughput(res["maxThroughput"], d, config)); err != nil { return fmt.Errorf("Error reading Connector: %s", err) } @@ -292,26 +292,26 @@ func resourceVPCAccessConnectorImport(d *schema.ResourceData, meta interface{}) return []*schema.ResourceData{d}, nil } -func flattenVPCAccessConnectorName(v interface{}, d *schema.ResourceData) interface{} { +func flattenVPCAccessConnectorName(v interface{}, d *schema.ResourceData, config *Config) interface{} { if v == nil { return v } return NameFromSelfLinkStateFunc(v) } -func flattenVPCAccessConnectorNetwork(v interface{}, d *schema.ResourceData) interface{} { +func flattenVPCAccessConnectorNetwork(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenVPCAccessConnectorIpCidrRange(v interface{}, d *schema.ResourceData) interface{} { +func flattenVPCAccessConnectorIpCidrRange(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenVPCAccessConnectorState(v interface{}, d *schema.ResourceData) interface{} { +func flattenVPCAccessConnectorState(v interface{}, d *schema.ResourceData, config *Config) interface{} { return v } -func flattenVPCAccessConnectorMinThroughput(v interface{}, d *schema.ResourceData) interface{} { +func flattenVPCAccessConnectorMinThroughput(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 { @@ -321,7 +321,7 @@ func flattenVPCAccessConnectorMinThroughput(v interface{}, d *schema.ResourceDat return v } -func flattenVPCAccessConnectorMaxThroughput(v interface{}, d *schema.ResourceData) interface{} { +func flattenVPCAccessConnectorMaxThroughput(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/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 0000000000..ca58f2453b --- /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 db207a34ba..fb81aa4f2c 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 0228382087..651e7d611c 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 782c7fa544..5b614db60e 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 a7ff19d949..78e16de29a 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 } ``` @@ -72,19 +72,19 @@ 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 } ``` ## google\_compute\_instance\_iam\_binding ```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", @@ -96,9 +96,9 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -115,9 +115,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" } @@ -127,9 +127,9 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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 83de671c21..9f6f3ae539 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 d3d9f84633..916c6dea54 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 } ``` @@ -75,7 +75,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 } ``` ## google\_iap\_app\_engine\_service\_iam\_binding 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 b0968e5a10..150f71c63a 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 } ``` @@ -77,7 +77,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 } ``` ## google\_iap\_app\_engine\_version\_iam\_binding diff --git a/website/docs/r/iap_tunnel_instance_iam.html.markdown b/website/docs/r/iap_tunnel_instance_iam.html.markdown index 8f7680d2c1..b1d4d7af68 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 } ``` @@ -72,19 +72,19 @@ 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 } ``` ## google\_iap\_tunnel\_instance\_iam\_binding ```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", @@ -96,9 +96,9 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -115,9 +115,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" } @@ -127,9 +127,9 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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 87230e314c..8f102d9e30 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 } ``` @@ -71,17 +71,17 @@ 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 } ``` ## google\_iap\_web\_backend\_service\_iam\_binding ```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", @@ -93,8 +93,8 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -111,8 +111,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" } @@ -122,8 +122,8 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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 890fd220ea..57bedbb20b 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 } ``` @@ -70,15 +70,15 @@ 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 } ``` ## google\_iap\_web\_iam\_binding ```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", @@ -90,7 +90,7 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -107,7 +107,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" } @@ -117,7 +117,7 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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 2f569eba3f..75f7921a5b 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 } ``` @@ -71,17 +71,17 @@ 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 } ``` ## google\_iap\_web\_type\_app\_engine\_iam\_binding ```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", @@ -93,8 +93,8 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -111,8 +111,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" } @@ -122,8 +122,8 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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 14cb25d361..609303dec4 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 } ``` @@ -70,15 +70,15 @@ 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 } ``` ## google\_iap\_web\_type\_compute\_iam\_binding ```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", @@ -90,7 +90,7 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -107,7 +107,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" } @@ -117,7 +117,7 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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 4f01964ccf..3567ae38bb 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 09d82f8a80..5a2ebe69c0 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/secret_manager_secret.html.markdown b/website/docs/r/secret_manager_secret.html.markdown new file mode 100644 index 0000000000..57b4303730 --- /dev/null +++ b/website/docs/r/secret_manager_secret.html.markdown @@ -0,0 +1,160 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- +subcategory: "Secret Manager" +layout: "google" +page_title: "Google: google_secret_manager_secret" +sidebar_current: "docs-google-secret-manager-secret" +description: |- + A Secret is a logical secret whose value and versions can be accessed. +--- + +# google\_secret\_manager\_secret + +A Secret is a logical secret whose value and versions can be accessed. + +~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. +See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. + +To get more information about Secret, see: + +* [API documentation](https://cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets) + + +## Example Usage - Secret Config Basic + + +```hcl +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-" + + labels = { + label = "my-label" + } + + replication { + user_managed { + replicas { + location = "us-central1" + } + replicas { + location = "us-east1" + } + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `replication` - + (Required) + The replication policy of the secret data attached to the Secret. It cannot be changed + after the Secret has been created. Structure is documented below. + +* `secret_id` - + (Required) + This must be unique within the project. + + +The `replication` block supports: + +* `automatic` - + (Optional) + The Secret will automatically be replicated without any restrictions. + +* `user_managed` - + (Optional) + The Secret will automatically be replicated without any restrictions. Structure is documented below. + + +The `user_managed` block supports: + +* `replicas` - + (Required) + The list of Replicas for this Secret. Cannot be empty. Structure is documented below. + + +The `replicas` block supports: + +* `location` - + (Required) + The canonical IDs of the location to replicate data. For example: "us-east1". + +- - - + + +* `labels` - + (Optional) + The labels assigned to this Secret. + Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, + and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, + and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + No more than 64 labels can be assigned to a given resource. + An object containing a list of "key": value pairs. Example: + { "name": "wrench", "mass": "1.3kg", "count": "3" }. + +* `project` - (Optional) The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are exported: + +* `id` - an identifier for the resource with format `projects/{{project}}/secrets/{{secret_id}}` + +* `name` - + The resource name of the Secret. Format: + `projects/{{project}}/secrets/{{secret_id}}` + +* `create_time` - + The time at which the Secret was created. + + +## Timeouts + +This resource provides the following +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - Default is 4 minutes. +- `update` - Default is 4 minutes. +- `delete` - Default is 4 minutes. + +## Import + +Secret can be imported using any of these accepted formats: + +``` +$ terraform import -provider=google-beta google_secret_manager_secret.default projects/{{project}}/secrets/{{secret_id}} +$ terraform import -provider=google-beta google_secret_manager_secret.default {{project}}/{{secret_id}} +$ terraform import -provider=google-beta google_secret_manager_secret.default {{secret_id}} +``` + +-> If you're importing a resource with beta features, make sure to include `-provider=google-beta` +as an argument so that Terraform uses the correct provider to import your resource. + +## User Project Overrides + +This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override). diff --git a/website/docs/r/secret_manager_secret_iam.html.markdown b/website/docs/r/secret_manager_secret_iam.html.markdown new file mode 100644 index 0000000000..423ebf318d --- /dev/null +++ b/website/docs/r/secret_manager_secret_iam.html.markdown @@ -0,0 +1,147 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- +subcategory: "Secret Manager" +layout: "google" +page_title: "Google: google_secret_manager_secret_iam" +sidebar_current: "docs-google-secret-manager-secret-iam" +description: |- + Collection of resources to manage IAM policy for SecretManagerSecret +--- + +# IAM policy for SecretManagerSecret +Three different resources help you manage your IAM policy for SecretManager Secret. Each of these resources serves a different use case: + +* `google_secret_manager_secret_iam_policy`: Authoritative. Sets the IAM policy for the secret and replaces any existing policy already attached. +* `google_secret_manager_secret_iam_binding`: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the secret are preserved. +* `google_secret_manager_secret_iam_member`: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the secret are preserved. + +~> **Note:** `google_secret_manager_secret_iam_policy` **cannot** be used in conjunction with `google_secret_manager_secret_iam_binding` and `google_secret_manager_secret_iam_member` or they will fight over what your policy should be. + +~> **Note:** `google_secret_manager_secret_iam_binding` resources **can be** used in conjunction with `google_secret_manager_secret_iam_member` resources **only if** they do not grant privilege to the same role. + +~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. +See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. + + +## google\_secret\_manager\_secret\_iam\_policy + +```hcl +data "google_iam_policy" "admin" { + binding { + role = "roles/viewer" + members = [ + "user:jane@example.com", + ] + } +} + +resource "google_secret_manager_secret_iam_policy" "editor" { + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + policy_data = data.google_iam_policy.admin.policy_data +} +``` + +## google\_secret\_manager\_secret\_iam\_binding + +```hcl +resource "google_secret_manager_secret_iam_binding" "editor" { + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + role = "roles/viewer" + members = [ + "user:jane@example.com", + ] +} +``` + +## google\_secret\_manager\_secret\_iam\_member + +```hcl +resource "google_secret_manager_secret_iam_member" "editor" { + project = google_secret_manager_secret.secret-basic.project + secret_id = google_secret_manager_secret.secret-basic.secret_id + role = "roles/viewer" + member = "user:jane@example.com" +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `project` - (Optional) The ID of the project in which the resource belongs. + If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used. + +* `member/members` - (Required) Identities that will be granted the privilege in `role`. + Each entry can have one of the following values: + * **allUsers**: A special identifier that represents anyone who is on the internet; with or without a Google account. + * **allAuthenticatedUsers**: A special identifier that represents anyone who is authenticated with a Google account or a service account. + * **user:{emailid}**: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.com. + * **serviceAccount:{emailid}**: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. + * **group:{emailid}**: An email address that represents a Google group. For example, admins@example.com. + * **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com. + +* `role` - (Required) The role that should be applied. Only one + `google_secret_manager_secret_iam_binding` can be used per role. Note that custom roles must be of the format + `[projects|organizations]/{parent-name}/roles/{role-name}`. + +* `policy_data` - (Required only by `google_secret_manager_secret_iam_policy`) The policy data generated by + a `google_iam_policy` data source. + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are +exported: + +* `etag` - (Computed) The etag of the IAM policy. + +## Import + +For all import syntaxes, the "resource in question" can take any of the following forms: + +* projects/{{project}}/secrets/{{secret_id}} +* {{project}}/{{secret_id}} +* {{secret_id}} + +Any variables not passed in the import command will be taken from the provider configuration. + +SecretManager secret IAM resources can be imported using the resource identifiers, role, and member. + +IAM member imports use space-delimited identifiers: the resource in question, the role, and the member identity, e.g. +``` +$ terraform import -provider=google-beta google_secret_manager_secret_iam_member.editor "projects/{{project}}/secrets/{{secret_id}} roles/viewer jane@example.com" +``` + +IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g. +``` +$ terraform import google_secret_manager_secret_iam_binding.editor "projects/{{project}}/secrets/{{secret_id}} roles/viewer" +``` + +IAM policy imports use the identifier of the resource in question, e.g. +``` +$ terraform import -provider=google-beta google_secret_manager_secret_iam_policy.editor projects/{{project}}/secrets/{{secret_id}} +``` + +-> If you're importing a resource with beta features, make sure to include `-provider=google-beta` +as an argument so that Terraform uses the correct provider to import your resource. + +-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the + full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`. + +## User Project Overrides + +This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override). diff --git a/website/docs/r/secret_manager_secret_version.html.markdown b/website/docs/r/secret_manager_secret_version.html.markdown new file mode 100644 index 0000000000..b9e8a08142 --- /dev/null +++ b/website/docs/r/secret_manager_secret_version.html.markdown @@ -0,0 +1,120 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- +subcategory: "Secret Manager" +layout: "google" +page_title: "Google: google_secret_manager_secret_version" +sidebar_current: "docs-google-secret-manager-secret-version" +description: |- + A secret version resource. +--- + +# google\_secret\_manager\_secret\_version + +A secret version resource. + +~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. +See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. + + + +## Example Usage - Secret Version Basic + + +```hcl +resource "google_secret_manager_secret" "secret-basic" { + provider = google-beta + + secret_id = "tf-test-secret-version-" + + labels = { + label = "my-label" + } + + replication { + automatic = true + } +} + + +resource "google_secret_manager_secret_version" "secret-version-basic" { + provider = google-beta + + secret = google_secret_manager_secret.secret-basic.name + + secret_data = "my-tf-test-secret" +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `secret` - + (Required) + Secret Manager secret resource + + +- - - + + +* `enabled` - + (Optional) + The current state of the SecretVersion. + +* `secret_data` - + (Optional) + The secret data. Must be no larger than 64KiB. A base64-encoded string. + + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are exported: + +* `id` - an identifier for the resource with format `{{name}}` + +* `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. + + +## Timeouts + +This resource provides the following +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - Default is 4 minutes. +- `delete` - Default is 4 minutes. + +## Import + +SecretVersion can be imported using any of these accepted formats: + +``` +$ terraform import -provider=google-beta google_secret_manager_secret_version.default {{name}}/{{name}} +``` + +-> If you're importing a resource with beta features, make sure to include `-provider=google-beta` +as an argument so that Terraform uses the correct provider to import your resource. diff --git a/website/docs/r/sourcerepo_repository_iam.html.markdown b/website/docs/r/sourcerepo_repository_iam.html.markdown index daf8d2d35f..41a2a42df3 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 ab076bdb7b..3a0dee0273 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 } ``` @@ -70,15 +70,15 @@ 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 } ``` ## google\_storage\_bucket\_iam\_binding ```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", @@ -90,7 +90,7 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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", @@ -107,7 +107,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" } @@ -117,7 +117,7 @@ With IAM Conditions ([beta](https://terraform.io/docs/providers/google/provider_ ```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"