From 54a56b5c2cae3a272e2150112b107edd4daa6471 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 4 Mar 2019 12:56:31 -0800 Subject: [PATCH] Changes ancillary to supporting the Terraform mapper. (#491) Signed-off-by: Modular Magician --- google-beta/bootstrap_utils_test.go | 2 +- google-beta/config.go | 2 +- google-beta/config_test.go | 12 +-- google-beta/provider.go | 2 +- ...rce_access_context_manager_access_level.go | 36 ++++---- ...ce_access_context_manager_access_policy.go | 4 +- ...ccess_context_manager_service_perimeter.go | 20 ++--- .../resource_app_engine_firewall_rule.go | 8 +- .../resource_binary_authorization_attestor.go | 18 ++-- .../resource_binary_authorization_policy.go | 22 ++--- google-beta/resource_cloud_build_trigger.go | 38 ++++----- google-beta/resource_cloud_scheduler_job.go | 56 ++++++------- .../resource_composer_environment_test.go | 2 +- google-beta/resource_compute_address.go | 18 ++-- google-beta/resource_compute_autoscaler.go | 34 ++++---- .../resource_compute_backend_bucket.go | 8 +- google-beta/resource_compute_disk.go | 42 +++++----- google-beta/resource_compute_firewall.go | 38 ++++----- .../resource_compute_forwarding_rule.go | 36 ++++---- .../resource_compute_global_address.go | 20 ++--- google-beta/resource_compute_health_check.go | 56 ++++++------- .../resource_compute_http_health_check.go | 18 ++-- .../resource_compute_https_health_check.go | 18 ++-- google-beta/resource_compute_image.go | 24 +++--- .../resource_compute_instance_migrate_test.go | 2 +- ...esource_compute_interconnect_attachment.go | 18 ++-- ...esource_compute_managed_ssl_certificate.go | 10 +-- .../resource_compute_region_autoscaler.go | 34 ++++---- google-beta/resource_compute_region_disk.go | 34 ++++---- google-beta/resource_compute_route.go | 20 ++--- google-beta/resource_compute_router.go | 22 ++--- google-beta/resource_compute_snapshot.go | 22 ++--- .../resource_compute_ssl_certificate.go | 8 +- google-beta/resource_compute_ssl_policy.go | 10 +-- google-beta/resource_compute_subnetwork.go | 22 ++--- .../resource_compute_target_http_proxy.go | 6 +- .../resource_compute_target_https_proxy.go | 12 +-- .../resource_compute_target_ssl_proxy.go | 12 +-- .../resource_compute_target_tcp_proxy.go | 8 +- google-beta/resource_compute_url_map.go | 40 ++++----- google-beta/resource_compute_vpn_gateway.go | 8 +- google-beta/resource_compute_vpn_tunnel.go | 24 +++--- .../resource_container_analysis_note.go | 8 +- google-beta/resource_dns_managed_zone.go | 22 ++--- google-beta/resource_filestore_instance.go | 22 ++--- .../resource_monitoring_alert_policy.go | 82 +++++++++---------- google-beta/resource_monitoring_group.go | 8 +- ...esource_monitoring_notification_channel.go | 12 +-- ...resource_monitoring_uptime_check_config.go | 60 +++++++------- google-beta/resource_pubsub_subscription.go | 10 +-- google-beta/resource_pubsub_topic.go | 4 +- google-beta/resource_redis_instance.go | 22 ++--- google-beta/resource_resource_manager_lien.go | 8 +- .../resource_source_repo_repository.go | 2 +- google-beta/resource_spanner_database.go | 6 +- google-beta/resource_spanner_instance.go | 10 +-- .../resource_sql_database_instance_test.go | 2 +- ...e_storage_default_object_access_control.go | 8 +- .../resource_storage_object_access_control.go | 8 +- google-beta/test_utils.go | 15 ++++ google-beta/utils.go | 2 + 61 files changed, 587 insertions(+), 570 deletions(-) diff --git a/google-beta/bootstrap_utils_test.go b/google-beta/bootstrap_utils_test.go index 8da2e03192..f4f869acf6 100644 --- a/google-beta/bootstrap_utils_test.go +++ b/google-beta/bootstrap_utils_test.go @@ -52,7 +52,7 @@ func BootstrapKMSKey(t *testing.T) bootstrappedKMS { Zone: getTestZoneFromEnv(), } - if err := config.loadAndValidate(); err != nil { + if err := config.LoadAndValidate(); err != nil { t.Errorf("Unable to bootstrap KMS key: %s", err) } diff --git a/google-beta/config.go b/google-beta/config.go index b2be9ea33f..25f97d8a78 100644 --- a/google-beta/config.go +++ b/google-beta/config.go @@ -106,7 +106,7 @@ var defaultClientScopes = []string{ "https://www.googleapis.com/auth/devstorage.full_control", } -func (c *Config) loadAndValidate() error { +func (c *Config) LoadAndValidate() error { if len(c.Scopes) == 0 { c.Scopes = defaultClientScopes } diff --git a/google-beta/config_test.go b/google-beta/config_test.go index ffe6069928..3e67eab546 100644 --- a/google-beta/config_test.go +++ b/google-beta/config_test.go @@ -21,7 +21,7 @@ func TestConfigLoadAndValidate_accountFilePath(t *testing.T) { Region: "us-central1", } - err := config.loadAndValidate() + err := config.LoadAndValidate() if err != nil { t.Fatalf("error: %v", err) } @@ -38,7 +38,7 @@ func TestConfigLoadAndValidate_accountFileJSON(t *testing.T) { Region: "us-central1", } - err = config.loadAndValidate() + err = config.LoadAndValidate() if err != nil { t.Fatalf("error: %v", err) } @@ -51,7 +51,7 @@ func TestConfigLoadAndValidate_accountFileJSONInvalid(t *testing.T) { Region: "us-central1", } - if config.loadAndValidate() == nil { + if config.LoadAndValidate() == nil { t.Fatalf("expected error, but got nil") } } @@ -71,7 +71,7 @@ func TestAccConfigLoadValidate_credentials(t *testing.T) { Region: "us-central1", } - err := config.loadAndValidate() + err := config.LoadAndValidate() if err != nil { t.Fatalf("error: %v", err) } @@ -107,7 +107,7 @@ func TestAccConfigLoadValidate_accessToken(t *testing.T) { Region: "us-central1", } - err = config.loadAndValidate() + err = config.LoadAndValidate() if err != nil { t.Fatalf("error: %v", err) } @@ -125,7 +125,7 @@ func TestConfigLoadAndValidate_customScopes(t *testing.T) { Region: "us-central1", Scopes: []string{"https://www.googleapis.com/auth/compute"}, } - err := config.loadAndValidate() + err := config.LoadAndValidate() if err != nil { t.Fatalf("unexpected error: %v", err) } diff --git a/google-beta/provider.go b/google-beta/provider.go index e5e4050b14..da24d4dfee 100644 --- a/google-beta/provider.go +++ b/google-beta/provider.go @@ -293,7 +293,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { config.Scopes[i] = scope.(string) } - if err := config.loadAndValidate(); err != nil { + if err := config.LoadAndValidate(); err != nil { return nil, err } diff --git a/google-beta/resource_access_context_manager_access_level.go b/google-beta/resource_access_context_manager_access_level.go index e9438a7656..6046870679 100644 --- a/google-beta/resource_access_context_manager_access_level.go +++ b/google-beta/resource_access_context_manager_access_level.go @@ -518,15 +518,15 @@ func flattenAccessContextManagerAccessLevelName(v interface{}, d *schema.Resourc return v } -func expandAccessContextManagerAccessLevelTitle(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelTitle(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasic(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasic(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -552,11 +552,11 @@ func expandAccessContextManagerAccessLevelBasic(v interface{}, d *schema.Resourc return transformed, nil } -func expandAccessContextManagerAccessLevelBasicCombiningFunction(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicCombiningFunction(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditions(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditions(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -606,23 +606,23 @@ func expandAccessContextManagerAccessLevelBasicConditions(v interface{}, d *sche return req, nil } -func expandAccessContextManagerAccessLevelBasicConditionsIpSubnetworks(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsIpSubnetworks(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsRequiredAccessLevels(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsRequiredAccessLevels(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsMembers(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsMembers(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsNegate(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsNegate(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -662,19 +662,19 @@ func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicy(v interfac return transformed, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireScreenLock(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyRequireScreenLock(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedEncryptionStatuses(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedEncryptionStatuses(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedDeviceManagementLevels(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyAllowedDeviceManagementLevels(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraints(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraints(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -703,19 +703,19 @@ func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstrain return req, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsMinimumVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelBasicConditionsDevicePolicyOsConstraintsOsType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelParent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelParent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessLevelName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessLevelName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_access_context_manager_access_policy.go b/google-beta/resource_access_context_manager_access_policy.go index f3e26eeb0e..2adab83e52 100644 --- a/google-beta/resource_access_context_manager_access_policy.go +++ b/google-beta/resource_access_context_manager_access_policy.go @@ -298,10 +298,10 @@ func flattenAccessContextManagerAccessPolicyTitle(v interface{}, d *schema.Resou return v } -func expandAccessContextManagerAccessPolicyParent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessPolicyParent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerAccessPolicyTitle(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerAccessPolicyTitle(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_access_context_manager_service_perimeter.go b/google-beta/resource_access_context_manager_service_perimeter.go index 3d78c4470f..478b2b1ec1 100644 --- a/google-beta/resource_access_context_manager_service_perimeter.go +++ b/google-beta/resource_access_context_manager_service_perimeter.go @@ -424,19 +424,19 @@ func flattenAccessContextManagerServicePerimeterName(v interface{}, d *schema.Re return v } -func expandAccessContextManagerServicePerimeterTitle(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterTitle(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterPerimeterType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterPerimeterType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterStatus(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterStatus(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -476,27 +476,27 @@ func expandAccessContextManagerServicePerimeterStatus(v interface{}, d *schema.R return transformed, nil } -func expandAccessContextManagerServicePerimeterStatusResources(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterStatusResources(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterStatusAccessLevels(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterStatusAccessLevels(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterStatusUnrestrictedServices(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterStatusUnrestrictedServices(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterStatusRestrictedServices(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterStatusRestrictedServices(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterParent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterParent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAccessContextManagerServicePerimeterName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAccessContextManagerServicePerimeterName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_app_engine_firewall_rule.go b/google-beta/resource_app_engine_firewall_rule.go index 94300166f3..743e31fdaa 100644 --- a/google-beta/resource_app_engine_firewall_rule.go +++ b/google-beta/resource_app_engine_firewall_rule.go @@ -284,18 +284,18 @@ func flattenAppEngineFirewallRulePriority(v interface{}, d *schema.ResourceData) return v } -func expandAppEngineFirewallRuleDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAppEngineFirewallRuleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAppEngineFirewallRuleSourceRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAppEngineFirewallRuleSourceRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAppEngineFirewallRuleAction(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAppEngineFirewallRuleAction(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandAppEngineFirewallRulePriority(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandAppEngineFirewallRulePriority(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_binary_authorization_attestor.go b/google-beta/resource_binary_authorization_attestor.go index 6dcc9ddba1..b14b5d0a0d 100644 --- a/google-beta/resource_binary_authorization_attestor.go +++ b/google-beta/resource_binary_authorization_attestor.go @@ -321,15 +321,15 @@ func flattenBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationService return v } -func expandBinaryAuthorizationAttestorName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationAttestorDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -362,7 +362,7 @@ func expandBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d return transformed, nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { r := regexp.MustCompile("projects/(.+)/notes/(.+)") if r.MatchString(v.(string)) { return v.(string), nil @@ -376,7 +376,7 @@ func expandBinaryAuthorizationAttestorAttestationAuthorityNoteNoteReference(v in return fmt.Sprintf("projects/%s/notes/%s", project, v.(string)), nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -412,18 +412,18 @@ func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v inter return req, nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationServiceAccountEmail(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationAttestorAttestationAuthorityNoteDelegationServiceAccountEmail(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_binary_authorization_policy.go b/google-beta/resource_binary_authorization_policy.go index b9a9233c1e..50cfd05589 100644 --- a/google-beta/resource_binary_authorization_policy.go +++ b/google-beta/resource_binary_authorization_policy.go @@ -420,11 +420,11 @@ func flattenBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(v inter return v } -func expandBinaryAuthorizationPolicyDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationPolicyAdmissionWhitelistPatterns(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyAdmissionWhitelistPatterns(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -446,11 +446,11 @@ func expandBinaryAuthorizationPolicyAdmissionWhitelistPatterns(v interface{}, d return req, nil } -func expandBinaryAuthorizationPolicyAdmissionWhitelistPatternsNamePattern(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyAdmissionWhitelistPatternsNamePattern(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationPolicyClusterAdmissionRules(v interface{}, d *schema.ResourceData, config *Config) (map[string]interface{}, error) { +func expandBinaryAuthorizationPolicyClusterAdmissionRules(v interface{}, d TerraformResourceData, config *Config) (map[string]interface{}, error) { if v == nil { return map[string]interface{}{}, nil } @@ -480,11 +480,11 @@ func expandBinaryAuthorizationPolicyClusterAdmissionRules(v interface{}, d *sche return m, nil } -func expandBinaryAuthorizationPolicyClusterAdmissionRulesEvaluationMode(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyClusterAdmissionRulesEvaluationMode(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { r := regexp.MustCompile("projects/(.+)/attestors/(.+)") // It's possible that all entries in the list will specify a project, in @@ -511,11 +511,11 @@ func expandBinaryAuthorizationPolicyClusterAdmissionRulesRequireAttestationsBy(v }), nil } -func expandBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -548,11 +548,11 @@ func expandBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *schem return transformed, nil } -func expandBinaryAuthorizationPolicyDefaultAdmissionRuleEvaluationMode(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyDefaultAdmissionRuleEvaluationMode(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { r := regexp.MustCompile("projects/(.+)/attestors/(.+)") // It's possible that all entries in the list will specify a project, in @@ -579,6 +579,6 @@ func expandBinaryAuthorizationPolicyDefaultAdmissionRuleRequireAttestationsBy(v }), nil } -func expandBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandBinaryAuthorizationPolicyDefaultAdmissionRuleEnforcementMode(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_cloud_build_trigger.go b/google-beta/resource_cloud_build_trigger.go index 692d124183..33d01b65dd 100644 --- a/google-beta/resource_cloud_build_trigger.go +++ b/google-beta/resource_cloud_build_trigger.go @@ -552,15 +552,15 @@ func flattenCloudBuildTriggerBuildStepArgs(v interface{}, d *schema.ResourceData return v } -func expandCloudBuildTriggerDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerDisabled(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerDisabled(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerSubstitutions(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandCloudBuildTriggerSubstitutions(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -571,19 +571,19 @@ func expandCloudBuildTriggerSubstitutions(v interface{}, d *schema.ResourceData, return m, nil } -func expandCloudBuildTriggerFilename(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerFilename(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerIgnoredFiles(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerIgnoredFiles(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerIncludedFiles(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerIncludedFiles(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerTriggerTemplate(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplate(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -637,31 +637,31 @@ func expandCloudBuildTriggerTriggerTemplate(v interface{}, d *schema.ResourceDat return transformed, nil } -func expandCloudBuildTriggerTriggerTemplateProjectId(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplateProjectId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerTriggerTemplateRepoName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplateRepoName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerTriggerTemplateDir(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplateDir(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerTriggerTemplateBranchName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplateBranchName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerTriggerTemplateTagName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplateTagName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerTriggerTemplateCommitSha(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerTriggerTemplateCommitSha(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerBuild(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerBuild(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -694,15 +694,15 @@ func expandCloudBuildTriggerBuild(v interface{}, d *schema.ResourceData, config return transformed, nil } -func expandCloudBuildTriggerBuildTags(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerBuildTags(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerBuildImages(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerBuildImages(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerBuildStep(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerBuildStep(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -731,10 +731,10 @@ func expandCloudBuildTriggerBuildStep(v interface{}, d *schema.ResourceData, con return req, nil } -func expandCloudBuildTriggerBuildStepName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerBuildStepName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudBuildTriggerBuildStepArgs(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudBuildTriggerBuildStepArgs(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_cloud_scheduler_job.go b/google-beta/resource_cloud_scheduler_job.go index 45747b6cae..501cc7b4b8 100644 --- a/google-beta/resource_cloud_scheduler_job.go +++ b/google-beta/resource_cloud_scheduler_job.go @@ -644,7 +644,7 @@ func flattenCloudSchedulerJobHttpTargetHeaders(v interface{}, d *schema.Resource return headers } -func expandCloudSchedulerJobName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { var jobName string project, err := getProject(d, config) if err != nil { @@ -666,19 +666,19 @@ func expandCloudSchedulerJobName(v interface{}, d *schema.ResourceData, config * return jobName, nil } -func expandCloudSchedulerJobDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobSchedule(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobSchedule(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobTimeZone(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobTimeZone(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobRetryConfig(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobRetryConfig(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -725,27 +725,27 @@ func expandCloudSchedulerJobRetryConfig(v interface{}, d *schema.ResourceData, c return transformed, nil } -func expandCloudSchedulerJobRetryConfigRetryCount(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobRetryConfigRetryCount(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobRetryConfigMaxRetryDuration(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobRetryConfigMaxRetryDuration(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobRetryConfigMinBackoffDuration(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobRetryConfigMinBackoffDuration(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobRetryConfigMaxBackoffDuration(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobRetryConfigMaxBackoffDuration(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobRetryConfigMaxDoublings(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobRetryConfigMaxDoublings(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobPubsubTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobPubsubTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -778,15 +778,15 @@ func expandCloudSchedulerJobPubsubTarget(v interface{}, d *schema.ResourceData, return transformed, nil } -func expandCloudSchedulerJobPubsubTargetTopicName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobPubsubTargetTopicName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobPubsubTargetData(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobPubsubTargetData(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobPubsubTargetAttributes(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandCloudSchedulerJobPubsubTargetAttributes(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -797,7 +797,7 @@ func expandCloudSchedulerJobPubsubTargetAttributes(v interface{}, d *schema.Reso return m, nil } -func expandCloudSchedulerJobAppEngineHttpTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -844,11 +844,11 @@ func expandCloudSchedulerJobAppEngineHttpTarget(v interface{}, d *schema.Resourc return transformed, nil } -func expandCloudSchedulerJobAppEngineHttpTargetHttpMethod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetHttpMethod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -881,27 +881,27 @@ func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRouting(v interface{}, d return transformed, nil } -func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRoutingService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRoutingService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRoutingVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRoutingVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRoutingInstance(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetAppEngineRoutingInstance(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobAppEngineHttpTargetRelativeUri(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetRelativeUri(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobAppEngineHttpTargetBody(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobAppEngineHttpTargetBody(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobAppEngineHttpTargetHeaders(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandCloudSchedulerJobAppEngineHttpTargetHeaders(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -912,7 +912,7 @@ func expandCloudSchedulerJobAppEngineHttpTargetHeaders(v interface{}, d *schema. return m, nil } -func expandCloudSchedulerJobHttpTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobHttpTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -952,19 +952,19 @@ func expandCloudSchedulerJobHttpTarget(v interface{}, d *schema.ResourceData, co return transformed, nil } -func expandCloudSchedulerJobHttpTargetUri(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobHttpTargetUri(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobHttpTargetHttpMethod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobHttpTargetHttpMethod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobHttpTargetBody(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandCloudSchedulerJobHttpTargetBody(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandCloudSchedulerJobHttpTargetHeaders(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandCloudSchedulerJobHttpTargetHeaders(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } diff --git a/google-beta/resource_composer_environment_test.go b/google-beta/resource_composer_environment_test.go index 78b4fb38bf..1ab32580c3 100644 --- a/google-beta/resource_composer_environment_test.go +++ b/google-beta/resource_composer_environment_test.go @@ -396,7 +396,7 @@ func testSweepComposerResources(region string) error { return fmt.Errorf("error getting shared config for region: %s", err) } - err = config.loadAndValidate() + err = config.LoadAndValidate() if err != nil { log.Fatalf("error loading: %s", err) } diff --git a/google-beta/resource_compute_address.go b/google-beta/resource_compute_address.go index ffd718a516..bbca640d57 100644 --- a/google-beta/resource_compute_address.go +++ b/google-beta/resource_compute_address.go @@ -488,27 +488,27 @@ func flattenComputeAddressRegion(v interface{}, d *schema.ResourceData) interfac return NameFromSelfLinkStateFunc(v) } -func expandComputeAddressAddress(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressAddress(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAddressAddressType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressAddressType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAddressDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAddressName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAddressNetworkTier(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressNetworkTier(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAddressSubnetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressSubnetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseRegionalFieldValue("subnetworks", v.(string), "project", "region", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for subnetwork: %s", err) @@ -516,7 +516,7 @@ func expandComputeAddressSubnetwork(v interface{}, d *schema.ResourceData, confi return f.RelativeLink(), nil } -func expandComputeAddressLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeAddressLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -527,11 +527,11 @@ func expandComputeAddressLabels(v interface{}, d *schema.ResourceData, config *C return m, nil } -func expandComputeAddressLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAddressRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAddressRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_autoscaler.go b/google-beta/resource_compute_autoscaler.go index 6224ee76b0..2c5f5b3cf1 100644 --- a/google-beta/resource_compute_autoscaler.go +++ b/google-beta/resource_compute_autoscaler.go @@ -553,15 +553,15 @@ func flattenComputeAutoscalerZone(v interface{}, d *schema.ResourceData) interfa return ConvertSelfLinkToV1(v.(string)) } -func expandComputeAutoscalerName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -615,19 +615,19 @@ func expandComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceD return transformed, nil } -func expandComputeAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -646,11 +646,11 @@ func expandComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *sc return transformed, nil } -func expandComputeAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -693,23 +693,23 @@ func expandComputeAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.Res return req, nil } -func expandComputeAutoscalerAutoscalingPolicyMetricName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMetricName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMetricType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyMetricFilter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyMetricFilter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -728,11 +728,11 @@ func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interfac return transformed, nil } -func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeAutoscalerTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { if v == nil || v.(string) == "" { return "", nil } @@ -743,7 +743,7 @@ func expandComputeAutoscalerTarget(v interface{}, d *schema.ResourceData, config return "https://www.googleapis.com/compute/v1/" + f.RelativeLink(), nil } -func expandComputeAutoscalerZone(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeAutoscalerZone(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("zones", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for zone: %s", err) diff --git a/google-beta/resource_compute_backend_bucket.go b/google-beta/resource_compute_backend_bucket.go index e82cc69819..4ce8b55ff1 100644 --- a/google-beta/resource_compute_backend_bucket.go +++ b/google-beta/resource_compute_backend_bucket.go @@ -328,18 +328,18 @@ func flattenComputeBackendBucketName(v interface{}, d *schema.ResourceData) inte return v } -func expandComputeBackendBucketBucketName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeBackendBucketBucketName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeBackendBucketDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeBackendBucketDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeBackendBucketEnableCdn(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeBackendBucketEnableCdn(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeBackendBucketName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeBackendBucketName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_disk.go b/google-beta/resource_compute_disk.go index 93d4562b3f..ba99416fd1 100644 --- a/google-beta/resource_compute_disk.go +++ b/google-beta/resource_compute_disk.go @@ -1013,15 +1013,15 @@ func flattenComputeDiskSourceSnapshotId(v interface{}, d *schema.ResourceData) i return v } -func expandComputeDiskLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeDiskLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -1032,15 +1032,15 @@ func expandComputeDiskLabels(v interface{}, d *schema.ResourceData, config *Conf return m, nil } -func expandComputeDiskName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskSize(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSize(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseZonalFieldValue("diskTypes", v.(string), "project", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for type: %s", err) @@ -1048,11 +1048,11 @@ func expandComputeDiskType(v interface{}, d *schema.ResourceData, config *Config return f.RelativeLink(), nil } -func expandComputeDiskImage(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskImage(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskZone(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskZone(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("zones", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for zone: %s", err) @@ -1060,7 +1060,7 @@ func expandComputeDiskZone(v interface{}, d *schema.ResourceData, config *Config return f.RelativeLink(), nil } -func expandComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceImageEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1093,19 +1093,19 @@ func expandComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.Resource return transformed, nil } -func expandComputeDiskSourceImageEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceImageEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskSourceImageEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceImageEncryptionKeySha256(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskSourceImageEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceImageEncryptionKeyKmsKeySelfLink(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskDiskEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1138,19 +1138,19 @@ func expandComputeDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, c return transformed, nil } -func expandComputeDiskDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskDiskEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskDiskEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskDiskEncryptionKeySha256(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskDiskEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskDiskEncryptionKeyKmsKeySelfLink(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskSnapshot(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSnapshot(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("snapshots", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for snapshot: %s", err) @@ -1158,7 +1158,7 @@ func expandComputeDiskSnapshot(v interface{}, d *schema.ResourceData, config *Co return f.RelativeLink(), nil } -func expandComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceSnapshotEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1191,15 +1191,15 @@ func expandComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.Resou return transformed, nil } -func expandComputeDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskSourceSnapshotEncryptionKeyKmsKeySelfLink(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceSnapshotEncryptionKeyKmsKeySelfLink(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeDiskSourceSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeDiskSourceSnapshotEncryptionKeySha256(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_firewall.go b/google-beta/resource_compute_firewall.go index 97cb112232..5578215a12 100644 --- a/google-beta/resource_compute_firewall.go +++ b/google-beta/resource_compute_firewall.go @@ -749,7 +749,7 @@ func flattenComputeFirewallTargetTags(v interface{}, d *schema.ResourceData) int return schema.NewSet(schema.HashString, v.([]interface{})) } -func expandComputeFirewallAllow(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallAllow(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() l := v.([]interface{}) req := make([]interface{}, 0, len(l)) @@ -779,15 +779,15 @@ func expandComputeFirewallAllow(v interface{}, d *schema.ResourceData, config *C return req, nil } -func expandComputeFirewallAllowProtocol(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallAllowProtocol(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallAllowPorts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallAllowPorts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallDeny(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDeny(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() l := v.([]interface{}) req := make([]interface{}, 0, len(l)) @@ -817,40 +817,40 @@ func expandComputeFirewallDeny(v interface{}, d *schema.ResourceData, config *Co return req, nil } -func expandComputeFirewallDenyProtocol(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDenyProtocol(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallDenyPorts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDenyPorts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallDestinationRanges(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDestinationRanges(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeFirewallDirection(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDirection(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallDisabled(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallDisabled(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallEnableLogging(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallEnableLogging(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) @@ -858,31 +858,31 @@ func expandComputeFirewallNetwork(v interface{}, d *schema.ResourceData, config return f.RelativeLink(), nil } -func expandComputeFirewallPriority(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallPriority(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeFirewallSourceRanges(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallSourceRanges(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeFirewallSourceServiceAccounts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallSourceServiceAccounts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeFirewallSourceTags(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallSourceTags(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeFirewallTargetServiceAccounts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallTargetServiceAccounts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeFirewallTargetTags(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeFirewallTargetTags(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } diff --git a/google-beta/resource_compute_forwarding_rule.go b/google-beta/resource_compute_forwarding_rule.go index 923fbeb19d..d45c12ea37 100644 --- a/google-beta/resource_compute_forwarding_rule.go +++ b/google-beta/resource_compute_forwarding_rule.go @@ -708,19 +708,19 @@ func flattenComputeForwardingRuleRegion(v interface{}, d *schema.ResourceData) i return NameFromSelfLinkStateFunc(v) } -func expandComputeForwardingRuleDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleIPAddress(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleIPAddress(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleIPProtocol(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleIPProtocol(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleBackendService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleBackendService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { // This method returns a full self link from a partial self link. if v == nil || v.(string) == "" { // It does not try to construct anything from empty. @@ -749,19 +749,19 @@ func expandComputeForwardingRuleBackendService(v interface{}, d *schema.Resource return url + v.(string), nil } -func expandComputeForwardingRuleIpVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleIpVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleLoadBalancingScheme(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleLoadBalancingScheme(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) @@ -769,15 +769,15 @@ func expandComputeForwardingRuleNetwork(v interface{}, d *schema.ResourceData, c return f.RelativeLink(), nil } -func expandComputeForwardingRulePortRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRulePortRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRulePorts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRulePorts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v.(*schema.Set).List(), nil } -func expandComputeForwardingRuleSubnetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleSubnetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseRegionalFieldValue("subnetworks", v.(string), "project", "region", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for subnetwork: %s", err) @@ -785,7 +785,7 @@ func expandComputeForwardingRuleSubnetwork(v interface{}, d *schema.ResourceData return f.RelativeLink(), nil } -func expandComputeForwardingRuleTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { // This method returns a full self link from a partial self link. if v == nil || v.(string) == "" { // It does not try to construct anything from empty. @@ -814,7 +814,7 @@ func expandComputeForwardingRuleTarget(v interface{}, d *schema.ResourceData, co return url + v.(string), nil } -func expandComputeForwardingRuleLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeForwardingRuleLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -825,23 +825,23 @@ func expandComputeForwardingRuleLabels(v interface{}, d *schema.ResourceData, co return m, nil } -func expandComputeForwardingRuleLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleAllPorts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleAllPorts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleNetworkTier(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleNetworkTier(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleServiceLabel(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleServiceLabel(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeForwardingRuleRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeForwardingRuleRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_global_address.go b/google-beta/resource_compute_global_address.go index 64c67ec0c7..5e3032637c 100644 --- a/google-beta/resource_compute_global_address.go +++ b/google-beta/resource_compute_global_address.go @@ -491,19 +491,19 @@ func flattenComputeGlobalAddressNetwork(v interface{}, d *schema.ResourceData) i return ConvertSelfLinkToV1(v.(string)) } -func expandComputeGlobalAddressAddress(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressAddress(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeGlobalAddressLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -514,27 +514,27 @@ func expandComputeGlobalAddressLabels(v interface{}, d *schema.ResourceData, con return m, nil } -func expandComputeGlobalAddressLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressIpVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressIpVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressPrefixLength(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressPrefixLength(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressAddressType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressAddressType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressPurpose(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressPurpose(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeGlobalAddressNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeGlobalAddressNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) diff --git a/google-beta/resource_compute_health_check.go b/google-beta/resource_compute_health_check.go index 2d5bff70de..354bfea8b1 100644 --- a/google-beta/resource_compute_health_check.go +++ b/google-beta/resource_compute_health_check.go @@ -786,31 +786,31 @@ func flattenComputeHealthCheckSslHealthCheckProxyHeader(v interface{}, d *schema return v } -func expandComputeHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckCheckIntervalSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHealthyThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckTimeoutSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckUnhealthyThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpHealthCheck(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -857,27 +857,27 @@ func expandComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceDa return transformed, nil } -func expandComputeHealthCheckHttpHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpHealthCheckHost(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpHealthCheckRequestPath(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpHealthCheckResponse(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpHealthCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpHealthCheckProxyHeader(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpsHealthCheck(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -924,27 +924,27 @@ func expandComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceD return transformed, nil } -func expandComputeHealthCheckHttpsHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpsHealthCheckHost(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpsHealthCheckRequestPath(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpsHealthCheckResponse(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpsHealthCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckTcpHealthCheck(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -984,23 +984,23 @@ func expandComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceDat return transformed, nil } -func expandComputeHealthCheckTcpHealthCheckRequest(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckTcpHealthCheckRequest(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckTcpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckTcpHealthCheckResponse(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckTcpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckTcpHealthCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckTcpHealthCheckProxyHeader(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckSslHealthCheck(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1040,19 +1040,19 @@ func expandComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceDat return transformed, nil } -func expandComputeHealthCheckSslHealthCheckRequest(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckSslHealthCheckRequest(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckSslHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckSslHealthCheckResponse(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckSslHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckSslHealthCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHealthCheckSslHealthCheckProxyHeader(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHealthCheckSslHealthCheckProxyHeader(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_http_health_check.go b/google-beta/resource_compute_http_health_check.go index dab93450af..a0494533ad 100644 --- a/google-beta/resource_compute_http_health_check.go +++ b/google-beta/resource_compute_http_health_check.go @@ -479,38 +479,38 @@ func flattenComputeHttpHealthCheckUnhealthyThreshold(v interface{}, d *schema.Re return v } -func expandComputeHttpHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckCheckIntervalSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckHealthyThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckHost(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckRequestPath(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckTimeoutSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpHealthCheckUnhealthyThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_https_health_check.go b/google-beta/resource_compute_https_health_check.go index 3167c32b9d..01ff31441f 100644 --- a/google-beta/resource_compute_https_health_check.go +++ b/google-beta/resource_compute_https_health_check.go @@ -479,38 +479,38 @@ func flattenComputeHttpsHealthCheckUnhealthyThreshold(v interface{}, d *schema.R return v } -func expandComputeHttpsHealthCheckCheckIntervalSec(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckCheckIntervalSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckHealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckHealthyThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckHost(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckHost(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckRequestPath(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckRequestPath(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckTimeoutSec(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckTimeoutSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeHttpsHealthCheckUnhealthyThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeHttpsHealthCheckUnhealthyThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_image.go b/google-beta/resource_compute_image.go index 868633e5b1..26730c082c 100644 --- a/google-beta/resource_compute_image.go +++ b/google-beta/resource_compute_image.go @@ -466,19 +466,19 @@ func flattenComputeImageSourceDisk(v interface{}, d *schema.ResourceData) interf return ConvertSelfLinkToV1(v.(string)) } -func expandComputeImageDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageDiskSizeGb(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageDiskSizeGb(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageFamily(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageFamily(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeImageLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -489,11 +489,11 @@ func expandComputeImageLabels(v interface{}, d *schema.ResourceData, config *Con return m, nil } -func expandComputeImageLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageLicenses(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageLicenses(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -506,11 +506,11 @@ func expandComputeImageLicenses(v interface{}, d *schema.ResourceData, config *C return req, nil } -func expandComputeImageName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageRawDisk(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageRawDisk(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -543,19 +543,19 @@ func expandComputeImageRawDisk(v interface{}, d *schema.ResourceData, config *Co return transformed, nil } -func expandComputeImageRawDiskContainerType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageRawDiskContainerType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageRawDiskSha1(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageRawDiskSha1(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageRawDiskSource(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageRawDiskSource(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeImageSourceDisk(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeImageSourceDisk(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseZonalFieldValue("disks", v.(string), "project", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for source_disk: %s", err) diff --git a/google-beta/resource_compute_instance_migrate_test.go b/google-beta/resource_compute_instance_migrate_test.go index a866775b9b..d558e833e8 100644 --- a/google-beta/resource_compute_instance_migrate_test.go +++ b/google-beta/resource_compute_instance_migrate_test.go @@ -901,7 +901,7 @@ func getInitializedConfig(t *testing.T) *Config { Region: getTestRegionFromEnv(), Zone: getTestZoneFromEnv(), } - err := config.loadAndValidate() + err := config.LoadAndValidate() if err != nil { t.Fatal(err) } diff --git a/google-beta/resource_compute_interconnect_attachment.go b/google-beta/resource_compute_interconnect_attachment.go index e55a6d9e6d..92f63d1ad4 100644 --- a/google-beta/resource_compute_interconnect_attachment.go +++ b/google-beta/resource_compute_interconnect_attachment.go @@ -485,23 +485,23 @@ func flattenComputeInterconnectAttachmentRegion(v interface{}, d *schema.Resourc return ConvertSelfLinkToV1(v.(string)) } -func expandComputeInterconnectAttachmentInterconnect(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentInterconnect(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentEdgeAvailabilityDomain(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentEdgeAvailabilityDomain(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentRouter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentRouter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseRegionalFieldValue("routers", v.(string), "project", "region", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for router: %s", err) @@ -509,19 +509,19 @@ func expandComputeInterconnectAttachmentRouter(v interface{}, d *schema.Resource return f.RelativeLink(), nil } -func expandComputeInterconnectAttachmentName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentCandidateSubnets(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentCandidateSubnets(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentVlanTag8021q(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentVlanTag8021q(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeInterconnectAttachmentRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeInterconnectAttachmentRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_managed_ssl_certificate.go b/google-beta/resource_compute_managed_ssl_certificate.go index 515aa6897e..e220510e69 100644 --- a/google-beta/resource_compute_managed_ssl_certificate.go +++ b/google-beta/resource_compute_managed_ssl_certificate.go @@ -340,15 +340,15 @@ func flattenComputeManagedSslCertificateExpireTime(v interface{}, d *schema.Reso return v } -func expandComputeManagedSslCertificateDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeManagedSslCertificateDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeManagedSslCertificateName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeManagedSslCertificateName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeManagedSslCertificateManaged(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeManagedSslCertificateManaged(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -367,10 +367,10 @@ func expandComputeManagedSslCertificateManaged(v interface{}, d *schema.Resource return transformed, nil } -func expandComputeManagedSslCertificateManagedDomains(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeManagedSslCertificateManagedDomains(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeManagedSslCertificateType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeManagedSslCertificateType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_region_autoscaler.go b/google-beta/resource_compute_region_autoscaler.go index 84693f9d30..1f4654ca9b 100644 --- a/google-beta/resource_compute_region_autoscaler.go +++ b/google-beta/resource_compute_region_autoscaler.go @@ -550,15 +550,15 @@ func flattenComputeRegionAutoscalerRegion(v interface{}, d *schema.ResourceData) return ConvertSelfLinkToV1(v.(string)) } -func expandComputeRegionAutoscalerName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -612,19 +612,19 @@ func expandComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.Res return transformed, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMinReplicas(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMaxReplicas(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -643,11 +643,11 @@ func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, return transformed, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilizationTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -690,23 +690,23 @@ func expandComputeRegionAutoscalerAutoscalingPolicyMetric(v interface{}, d *sche return req, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMetricName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMetricName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMetricTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMetricType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyMetricFilter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyMetricFilter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -725,15 +725,15 @@ func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v in return transformed, nil } -func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerTarget(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerTarget(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionAutoscalerRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionAutoscalerRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_region_disk.go b/google-beta/resource_compute_region_disk.go index dc315d316f..76c71422a7 100644 --- a/google-beta/resource_compute_region_disk.go +++ b/google-beta/resource_compute_region_disk.go @@ -728,15 +728,15 @@ func flattenComputeRegionDiskSourceSnapshotId(v interface{}, d *schema.ResourceD return v } -func expandComputeRegionDiskLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeRegionDiskLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -747,15 +747,15 @@ func expandComputeRegionDiskLabels(v interface{}, d *schema.ResourceData, config return m, nil } -func expandComputeRegionDiskName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskSize(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskSize(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskReplicaZones(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskReplicaZones(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -768,7 +768,7 @@ func expandComputeRegionDiskReplicaZones(v interface{}, d *schema.ResourceData, return req, nil } -func expandComputeRegionDiskType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseRegionalFieldValue("diskTypes", v.(string), "project", "region", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for type: %s", err) @@ -776,7 +776,7 @@ func expandComputeRegionDiskType(v interface{}, d *schema.ResourceData, config * return f.RelativeLink(), nil } -func expandComputeRegionDiskRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) @@ -784,7 +784,7 @@ func expandComputeRegionDiskRegion(v interface{}, d *schema.ResourceData, config return f.RelativeLink(), nil } -func expandComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskDiskEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -817,19 +817,19 @@ func expandComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.ResourceD return transformed, nil } -func expandComputeRegionDiskDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskDiskEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskDiskEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskDiskEncryptionKeySha256(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskDiskEncryptionKeyKmsKeyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskDiskEncryptionKeyKmsKeyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskSnapshot(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskSnapshot(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("snapshots", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for snapshot: %s", err) @@ -837,7 +837,7 @@ func expandComputeRegionDiskSnapshot(v interface{}, d *schema.ResourceData, conf return f.RelativeLink(), nil } -func expandComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -870,15 +870,15 @@ func expandComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schema return transformed, nil } -func expandComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskSourceSnapshotEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskSourceSnapshotEncryptionKeyKmsKeyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskSourceSnapshotEncryptionKeyKmsKeyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRegionDiskSourceSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRegionDiskSourceSnapshotEncryptionKeySha256(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_route.go b/google-beta/resource_compute_route.go index 9aa2a16779..5b05129f38 100644 --- a/google-beta/resource_compute_route.go +++ b/google-beta/resource_compute_route.go @@ -413,19 +413,19 @@ func flattenComputeRouteNextHopNetwork(v interface{}, d *schema.ResourceData) in return v } -func expandComputeRouteDestRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteDestRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouteDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouteName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouteNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) @@ -433,15 +433,15 @@ func expandComputeRouteNetwork(v interface{}, d *schema.ResourceData, config *Co return f.RelativeLink(), nil } -func expandComputeRoutePriority(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRoutePriority(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouteTags(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteTags(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v.(*schema.Set).List(), nil } -func expandComputeRouteNextHopGateway(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteNextHopGateway(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { if v == "default-internet-gateway" { project, err := getProject(d, config) if err != nil { @@ -453,7 +453,7 @@ func expandComputeRouteNextHopGateway(v interface{}, d *schema.ResourceData, con } } -func expandComputeRouteNextHopInstance(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteNextHopInstance(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { if v == "" { return v, nil } @@ -468,11 +468,11 @@ func expandComputeRouteNextHopInstance(v interface{}, d *schema.ResourceData, co return nextInstance.SelfLink, nil } -func expandComputeRouteNextHopIp(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteNextHopIp(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouteNextHopVpnTunnel(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouteNextHopVpnTunnel(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseRegionalFieldValue("vpnTunnels", v.(string), "project", "region", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for next_hop_vpn_tunnel: %s", err) diff --git a/google-beta/resource_compute_router.go b/google-beta/resource_compute_router.go index e72fb5d9c8..dd36d55e55 100644 --- a/google-beta/resource_compute_router.go +++ b/google-beta/resource_compute_router.go @@ -465,15 +465,15 @@ func flattenComputeRouterRegion(v interface{}, d *schema.ResourceData) interface return NameFromSelfLinkStateFunc(v) } -func expandComputeRouterName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) @@ -481,7 +481,7 @@ func expandComputeRouterNetwork(v interface{}, d *schema.ResourceData, config *C return f.RelativeLink(), nil } -func expandComputeRouterBgp(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgp(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -521,19 +521,19 @@ func expandComputeRouterBgp(v interface{}, d *schema.ResourceData, config *Confi return transformed, nil } -func expandComputeRouterBgpAsn(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgpAsn(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterBgpAdvertiseMode(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgpAdvertiseMode(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterBgpAdvertisedGroups(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgpAdvertisedGroups(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterBgpAdvertisedIpRanges(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgpAdvertisedIpRanges(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -562,15 +562,15 @@ func expandComputeRouterBgpAdvertisedIpRanges(v interface{}, d *schema.ResourceD return req, nil } -func expandComputeRouterBgpAdvertisedIpRangesRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgpAdvertisedIpRangesRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterBgpAdvertisedIpRangesDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterBgpAdvertisedIpRangesDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeRouterRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeRouterRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_snapshot.go b/google-beta/resource_compute_snapshot.go index 3f89eb8966..3300d2ecc3 100644 --- a/google-beta/resource_compute_snapshot.go +++ b/google-beta/resource_compute_snapshot.go @@ -537,15 +537,15 @@ func flattenComputeSnapshotSnapshotEncryptionKeySha256(v interface{}, d *schema. return v } -func expandComputeSnapshotName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSnapshotDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSnapshotLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeSnapshotLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -556,11 +556,11 @@ func expandComputeSnapshotLabels(v interface{}, d *schema.ResourceData, config * return m, nil } -func expandComputeSnapshotLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSnapshotSourceDisk(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotSourceDisk(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseZonalFieldValue("disks", v.(string), "project", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for source_disk: %s", err) @@ -568,7 +568,7 @@ func expandComputeSnapshotSourceDisk(v interface{}, d *schema.ResourceData, conf return f.RelativeLink(), nil } -func expandComputeSnapshotZone(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotZone(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("zones", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for zone: %s", err) @@ -576,7 +576,7 @@ func expandComputeSnapshotZone(v interface{}, d *schema.ResourceData, config *Co return f.RelativeLink(), nil } -func expandComputeSnapshotSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotSnapshotEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -602,15 +602,15 @@ func expandComputeSnapshotSnapshotEncryptionKey(v interface{}, d *schema.Resourc return transformed, nil } -func expandComputeSnapshotSnapshotEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotSnapshotEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSnapshotSnapshotEncryptionKeySha256(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotSnapshotEncryptionKeySha256(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSnapshotSourceDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotSourceDiskEncryptionKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -629,7 +629,7 @@ func expandComputeSnapshotSourceDiskEncryptionKey(v interface{}, d *schema.Resou return transformed, nil } -func expandComputeSnapshotSourceDiskEncryptionKeyRawKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSnapshotSourceDiskEncryptionKeyRawKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_ssl_certificate.go b/google-beta/resource_compute_ssl_certificate.go index 09141a0fb2..ec9c5c2322 100644 --- a/google-beta/resource_compute_ssl_certificate.go +++ b/google-beta/resource_compute_ssl_certificate.go @@ -300,15 +300,15 @@ func flattenComputeSslCertificateName(v interface{}, d *schema.ResourceData) int return v } -func expandComputeSslCertificateCertificate(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslCertificateCertificate(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSslCertificateDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslCertificateDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSslCertificateName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslCertificateName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { var certName string if v, ok := d.GetOk("name"); ok { certName = v.(string) @@ -324,6 +324,6 @@ func expandComputeSslCertificateName(v interface{}, d *schema.ResourceData, conf return certName, nil } -func expandComputeSslCertificatePrivateKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslCertificatePrivateKey(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_ssl_policy.go b/google-beta/resource_compute_ssl_policy.go index f14564ff94..87e2db0a4d 100644 --- a/google-beta/resource_compute_ssl_policy.go +++ b/google-beta/resource_compute_ssl_policy.go @@ -408,23 +408,23 @@ func flattenComputeSslPolicyFingerprint(v interface{}, d *schema.ResourceData) i return v } -func expandComputeSslPolicyDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslPolicyDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSslPolicyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslPolicyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSslPolicyProfile(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslPolicyProfile(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSslPolicyMinTlsVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslPolicyMinTlsVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSslPolicyCustomFeatures(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSslPolicyCustomFeatures(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } diff --git a/google-beta/resource_compute_subnetwork.go b/google-beta/resource_compute_subnetwork.go index 0853ed22b5..27e7640691 100644 --- a/google-beta/resource_compute_subnetwork.go +++ b/google-beta/resource_compute_subnetwork.go @@ -630,19 +630,19 @@ func flattenComputeSubnetworkRegion(v interface{}, d *schema.ResourceData) inter return NameFromSelfLinkStateFunc(v) } -func expandComputeSubnetworkDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkIpCidrRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkIpCidrRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) @@ -650,15 +650,15 @@ func expandComputeSubnetworkNetwork(v interface{}, d *schema.ResourceData, confi return f.RelativeLink(), nil } -func expandComputeSubnetworkEnableFlowLogs(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkEnableFlowLogs(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkSecondaryIpRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -687,19 +687,19 @@ func expandComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceDa return req, nil } -func expandComputeSubnetworkSecondaryIpRangeRangeName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkSecondaryIpRangeRangeName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkSecondaryIpRangeIpCidrRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkSecondaryIpRangeIpCidrRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkPrivateIpGoogleAccess(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkPrivateIpGoogleAccess(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeSubnetworkRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeSubnetworkRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_target_http_proxy.go b/google-beta/resource_compute_target_http_proxy.go index 5a023b89ac..91b7e09275 100644 --- a/google-beta/resource_compute_target_http_proxy.go +++ b/google-beta/resource_compute_target_http_proxy.go @@ -320,15 +320,15 @@ func flattenComputeTargetHttpProxyUrlMap(v interface{}, d *schema.ResourceData) return ConvertSelfLinkToV1(v.(string)) } -func expandComputeTargetHttpProxyDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpProxyDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetHttpProxyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpProxyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetHttpProxyUrlMap(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpProxyUrlMap(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("urlMaps", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for url_map: %s", err) diff --git a/google-beta/resource_compute_target_https_proxy.go b/google-beta/resource_compute_target_https_proxy.go index 28ad0512ba..22c5252205 100644 --- a/google-beta/resource_compute_target_https_proxy.go +++ b/google-beta/resource_compute_target_https_proxy.go @@ -498,19 +498,19 @@ func flattenComputeTargetHttpsProxyUrlMap(v interface{}, d *schema.ResourceData) return ConvertSelfLinkToV1(v.(string)) } -func expandComputeTargetHttpsProxyDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpsProxyDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetHttpsProxyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpsProxyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetHttpsProxyQuicOverride(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpsProxyQuicOverride(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetHttpsProxySslCertificates(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpsProxySslCertificates(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -523,7 +523,7 @@ func expandComputeTargetHttpsProxySslCertificates(v interface{}, d *schema.Resou return req, nil } -func expandComputeTargetHttpsProxySslPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpsProxySslPolicy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("sslPolicies", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for ssl_policy: %s", err) @@ -531,7 +531,7 @@ func expandComputeTargetHttpsProxySslPolicy(v interface{}, d *schema.ResourceDat return f.RelativeLink(), nil } -func expandComputeTargetHttpsProxyUrlMap(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetHttpsProxyUrlMap(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("urlMaps", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for url_map: %s", err) diff --git a/google-beta/resource_compute_target_ssl_proxy.go b/google-beta/resource_compute_target_ssl_proxy.go index 28b7535ae9..2311ca8a41 100644 --- a/google-beta/resource_compute_target_ssl_proxy.go +++ b/google-beta/resource_compute_target_ssl_proxy.go @@ -500,19 +500,19 @@ func flattenComputeTargetSslProxySslPolicy(v interface{}, d *schema.ResourceData return ConvertSelfLinkToV1(v.(string)) } -func expandComputeTargetSslProxyDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetSslProxyDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetSslProxyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetSslProxyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetSslProxyProxyHeader(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetSslProxyProxyHeader(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetSslProxyBackendService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetSslProxyBackendService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("backendServices", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for backend_service: %s", err) @@ -520,7 +520,7 @@ func expandComputeTargetSslProxyBackendService(v interface{}, d *schema.Resource return f.RelativeLink(), nil } -func expandComputeTargetSslProxySslCertificates(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetSslProxySslCertificates(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -533,7 +533,7 @@ func expandComputeTargetSslProxySslCertificates(v interface{}, d *schema.Resourc return req, nil } -func expandComputeTargetSslProxySslPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetSslProxySslPolicy(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("sslPolicies", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for ssl_policy: %s", err) diff --git a/google-beta/resource_compute_target_tcp_proxy.go b/google-beta/resource_compute_target_tcp_proxy.go index 505f14cff7..c3265dba30 100644 --- a/google-beta/resource_compute_target_tcp_proxy.go +++ b/google-beta/resource_compute_target_tcp_proxy.go @@ -378,19 +378,19 @@ func flattenComputeTargetTcpProxyBackendService(v interface{}, d *schema.Resourc return ConvertSelfLinkToV1(v.(string)) } -func expandComputeTargetTcpProxyDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetTcpProxyDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetTcpProxyName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetTcpProxyName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetTcpProxyProxyHeader(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetTcpProxyProxyHeader(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeTargetTcpProxyBackendService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeTargetTcpProxyBackendService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("backendServices", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for backend_service: %s", err) diff --git a/google-beta/resource_compute_url_map.go b/google-beta/resource_compute_url_map.go index f9c532a8bf..e277453202 100644 --- a/google-beta/resource_compute_url_map.go +++ b/google-beta/resource_compute_url_map.go @@ -636,15 +636,15 @@ func flattenComputeUrlMapTestService(v interface{}, d *schema.ResourceData) inte // ResourceRef only supports 1 type and UrlMap has references to a BackendBucket or BackendService. Just read the self_link string // instead of extracting the name and making a self_link out of it. -func expandComputeUrlMapDefaultService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapDefaultService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapHost_rule(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapHost_rule(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() l := v.([]interface{}) req := make([]interface{}, 0, len(l)) @@ -681,28 +681,28 @@ func expandComputeUrlMapHost_rule(v interface{}, d *schema.ResourceData, config return req, nil } -func expandComputeUrlMapHost_ruleDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapHost_ruleDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapHost_ruleHosts(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapHost_ruleHosts(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeUrlMapHost_rulePathMatcher(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapHost_rulePathMatcher(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapPath_matcher(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcher(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -747,19 +747,19 @@ func expandComputeUrlMapPath_matcher(v interface{}, d *schema.ResourceData, conf // ResourceRef only supports 1 type and UrlMap has references to a BackendBucket or BackendService. Just read the self_link string // instead of extracting the name and making a self_link out of it. -func expandComputeUrlMapPath_matcherDefaultService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcherDefaultService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapPath_matcherDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcherDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapPath_matcherName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcherName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapPath_matcherPath_rule(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcherPath_rule(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -788,18 +788,18 @@ func expandComputeUrlMapPath_matcherPath_rule(v interface{}, d *schema.ResourceD return req, nil } -func expandComputeUrlMapPath_matcherPath_rulePaths(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcherPath_rulePaths(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } // ResourceRef only supports 1 type and UrlMap has references to a BackendBucket or BackendService. Just read the self_link string // instead of extracting the name and making a self_link out of it. -func expandComputeUrlMapPath_matcherPath_ruleService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapPath_matcherPath_ruleService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapTest(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapTest(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -842,20 +842,20 @@ func expandComputeUrlMapTest(v interface{}, d *schema.ResourceData, config *Conf return req, nil } -func expandComputeUrlMapTestDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapTestDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapTestHost(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapTestHost(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeUrlMapTestPath(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapTestPath(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } // ResourceRef only supports 1 type and UrlMap has references to a BackendBucket or BackendService. Just read the self_link string // instead of extracting the name and making a self_link out of it. -func expandComputeUrlMapTestService(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeUrlMapTestService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_compute_vpn_gateway.go b/google-beta/resource_compute_vpn_gateway.go index c052821e55..ba6ed6ede9 100644 --- a/google-beta/resource_compute_vpn_gateway.go +++ b/google-beta/resource_compute_vpn_gateway.go @@ -275,15 +275,15 @@ func flattenComputeVpnGatewayRegion(v interface{}, d *schema.ResourceData) inter return NameFromSelfLinkStateFunc(v) } -func expandComputeVpnGatewayDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnGatewayDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnGatewayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnGatewayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnGatewayNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnGatewayNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for network: %s", err) @@ -291,7 +291,7 @@ func expandComputeVpnGatewayNetwork(v interface{}, d *schema.ResourceData, confi return f.RelativeLink(), nil } -func expandComputeVpnGatewayRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnGatewayRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_compute_vpn_tunnel.go b/google-beta/resource_compute_vpn_tunnel.go index b6d96d3c1e..7b05f3a8b2 100644 --- a/google-beta/resource_compute_vpn_tunnel.go +++ b/google-beta/resource_compute_vpn_tunnel.go @@ -630,15 +630,15 @@ func flattenComputeVpnTunnelRegion(v interface{}, d *schema.ResourceData) interf return NameFromSelfLinkStateFunc(v) } -func expandComputeVpnTunnelName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnTunnelDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnTunnelTargetVpnGateway(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelTargetVpnGateway(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseRegionalFieldValue("targetVpnGateways", v.(string), "project", "region", "zone", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for target_vpn_gateway: %s", err) @@ -646,7 +646,7 @@ func expandComputeVpnTunnelTargetVpnGateway(v interface{}, d *schema.ResourceDat return f.RelativeLink(), nil } -func expandComputeVpnTunnelRouter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelRouter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { if v == nil || v.(string) == "" { return "", nil } @@ -657,29 +657,29 @@ func expandComputeVpnTunnelRouter(v interface{}, d *schema.ResourceData, config return "https://www.googleapis.com/compute/v1/" + f.RelativeLink(), nil } -func expandComputeVpnTunnelPeerIp(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelPeerIp(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnTunnelSharedSecret(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelSharedSecret(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnTunnelIkeVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelIkeVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnTunnelLocalTrafficSelector(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelLocalTrafficSelector(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeVpnTunnelRemoteTrafficSelector(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelRemoteTrafficSelector(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() return v, nil } -func expandComputeVpnTunnelLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandComputeVpnTunnelLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -690,11 +690,11 @@ func expandComputeVpnTunnelLabels(v interface{}, d *schema.ResourceData, config return m, nil } -func expandComputeVpnTunnelLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelLabelFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandComputeVpnTunnelRegion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandComputeVpnTunnelRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for region: %s", err) diff --git a/google-beta/resource_container_analysis_note.go b/google-beta/resource_container_analysis_note.go index 0e9676b3e2..8e7536408c 100644 --- a/google-beta/resource_container_analysis_note.go +++ b/google-beta/resource_container_analysis_note.go @@ -258,11 +258,11 @@ func flattenContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(v int return v } -func expandContainerAnalysisNoteName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandContainerAnalysisNoteName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -281,7 +281,7 @@ func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.Re return transformed, nil } -func expandContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -300,6 +300,6 @@ func expandContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *schem return transformed, nil } -func expandContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandContainerAnalysisNoteAttestationAuthorityHintHumanReadableName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_dns_managed_zone.go b/google-beta/resource_dns_managed_zone.go index 2cbf654871..4e3b5938f1 100644 --- a/google-beta/resource_dns_managed_zone.go +++ b/google-beta/resource_dns_managed_zone.go @@ -473,19 +473,19 @@ func flattenDnsManagedZoneForwardingConfigTargetNameServersIpv4Address(v interfa return v } -func expandDnsManagedZoneDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandDnsManagedZoneDnsName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneDnsName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandDnsManagedZoneName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandDnsManagedZoneLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandDnsManagedZoneLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -496,11 +496,11 @@ func expandDnsManagedZoneLabels(v interface{}, d *schema.ResourceData, config *C return m, nil } -func expandDnsManagedZoneVisibility(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneVisibility(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandDnsManagedZonePrivateVisibilityConfig(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZonePrivateVisibilityConfig(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -519,7 +519,7 @@ func expandDnsManagedZonePrivateVisibilityConfig(v interface{}, d *schema.Resour return transformed, nil } -func expandDnsManagedZonePrivateVisibilityConfigNetworks(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZonePrivateVisibilityConfigNetworks(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() l := v.([]interface{}) req := make([]interface{}, 0, len(l)) @@ -542,11 +542,11 @@ func expandDnsManagedZonePrivateVisibilityConfigNetworks(v interface{}, d *schem return req, nil } -func expandDnsManagedZonePrivateVisibilityConfigNetworksNetworkUrl(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZonePrivateVisibilityConfigNetworksNetworkUrl(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandDnsManagedZoneForwardingConfig(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneForwardingConfig(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -565,7 +565,7 @@ func expandDnsManagedZoneForwardingConfig(v interface{}, d *schema.ResourceData, return transformed, nil } -func expandDnsManagedZoneForwardingConfigTargetNameServers(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneForwardingConfigTargetNameServers(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() l := v.([]interface{}) req := make([]interface{}, 0, len(l)) @@ -588,6 +588,6 @@ func expandDnsManagedZoneForwardingConfigTargetNameServers(v interface{}, d *sch return req, nil } -func expandDnsManagedZoneForwardingConfigTargetNameServersIpv4Address(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandDnsManagedZoneForwardingConfigTargetNameServersIpv4Address(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_filestore_instance.go b/google-beta/resource_filestore_instance.go index b7b7b8717f..b8c9596c4c 100644 --- a/google-beta/resource_filestore_instance.go +++ b/google-beta/resource_filestore_instance.go @@ -492,15 +492,15 @@ func flattenFilestoreInstanceEtag(v interface{}, d *schema.ResourceData) interfa return v } -func expandFilestoreInstanceDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceTier(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceTier(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandFilestoreInstanceLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -511,7 +511,7 @@ func expandFilestoreInstanceLabels(v interface{}, d *schema.ResourceData, config return m, nil } -func expandFilestoreInstanceFileShares(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceFileShares(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -540,15 +540,15 @@ func expandFilestoreInstanceFileShares(v interface{}, d *schema.ResourceData, co return req, nil } -func expandFilestoreInstanceFileSharesName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceFileSharesName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceFileSharesCapacityGb(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceFileSharesCapacityGb(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceNetworks(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceNetworks(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -591,18 +591,18 @@ func expandFilestoreInstanceNetworks(v interface{}, d *schema.ResourceData, conf return req, nil } -func expandFilestoreInstanceNetworksNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceNetworksNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceNetworksModes(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceNetworksModes(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceNetworksReservedIpRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceNetworksReservedIpRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandFilestoreInstanceNetworksIpAddresses(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandFilestoreInstanceNetworksIpAddresses(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_monitoring_alert_policy.go b/google-beta/resource_monitoring_alert_policy.go index 604c923a3c..5f2b861691 100644 --- a/google-beta/resource_monitoring_alert_policy.go +++ b/google-beta/resource_monitoring_alert_policy.go @@ -890,19 +890,19 @@ func flattenMonitoringAlertPolicyDocumentationMimeType(v interface{}, d *schema. return v } -func expandMonitoringAlertPolicyDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyCombiner(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyCombiner(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyEnabled(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyEnabled(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditions(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -945,7 +945,7 @@ func expandMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceData return req, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -985,7 +985,7 @@ func expandMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *sche return transformed, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentAggregations(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentAggregations(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -1028,23 +1028,23 @@ func expandMonitoringAlertPolicyConditionsConditionAbsentAggregations(v interfac return req, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsPerSeriesAligner(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsGroupByFields(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsGroupByFields(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsAlignmentPeriod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeriesReducer(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1070,27 +1070,27 @@ func expandMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, return transformed, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentTriggerPercent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentTriggerPercent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentTriggerCount(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentDuration(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentDuration(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionAbsentFilter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionAbsentFilter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1158,15 +1158,15 @@ func expandMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d *s return transformed, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdThresholdValue(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdThresholdValue(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorFilter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorFilter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregations(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregations(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -1209,31 +1209,31 @@ func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregati return req, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsPerSeriesAligner(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsGroupByFields(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsGroupByFields(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsAlignmentPeriod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDenominatorAggregationsCrossSeriesReducer(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdDuration(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdDuration(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdComparison(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdComparison(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1259,15 +1259,15 @@ func expandMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{ return transformed, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdTriggerPercent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdTriggerPercent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdTriggerCount(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdAggregations(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdAggregations(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -1310,39 +1310,39 @@ func expandMonitoringAlertPolicyConditionsConditionThresholdAggregations(v inter return req, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsPerSeriesAligner(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsPerSeriesAligner(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsGroupByFields(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsGroupByFields(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsAlignmentPeriod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsAlignmentPeriod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsCrossSeriesReducer(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdAggregationsCrossSeriesReducer(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsConditionThresholdFilter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsConditionThresholdFilter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyConditionsDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyConditionsDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyNotificationChannels(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyNotificationChannels(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyLabels(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyLabels(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyDocumentation(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyDocumentation(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1368,10 +1368,10 @@ func expandMonitoringAlertPolicyDocumentation(v interface{}, d *schema.ResourceD return transformed, nil } -func expandMonitoringAlertPolicyDocumentationContent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyDocumentationContent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringAlertPolicyDocumentationMimeType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringAlertPolicyDocumentationMimeType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_monitoring_group.go b/google-beta/resource_monitoring_group.go index 1cc728025e..1c2e386836 100644 --- a/google-beta/resource_monitoring_group.go +++ b/google-beta/resource_monitoring_group.go @@ -288,18 +288,18 @@ func flattenMonitoringGroupFilter(v interface{}, d *schema.ResourceData) interfa return v } -func expandMonitoringGroupParentName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringGroupParentName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringGroupIsCluster(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringGroupIsCluster(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringGroupDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringGroupDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringGroupFilter(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringGroupFilter(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_monitoring_notification_channel.go b/google-beta/resource_monitoring_notification_channel.go index dbe6bf5fed..8396031ba1 100644 --- a/google-beta/resource_monitoring_notification_channel.go +++ b/google-beta/resource_monitoring_notification_channel.go @@ -392,7 +392,7 @@ func flattenMonitoringNotificationChannelEnabled(v interface{}, d *schema.Resour return v } -func expandMonitoringNotificationChannelLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandMonitoringNotificationChannelLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -403,11 +403,11 @@ func expandMonitoringNotificationChannelLabels(v interface{}, d *schema.Resource return m, nil } -func expandMonitoringNotificationChannelType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringNotificationChannelType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringNotificationChannelUserLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandMonitoringNotificationChannelUserLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -418,14 +418,14 @@ func expandMonitoringNotificationChannelUserLabels(v interface{}, d *schema.Reso return m, nil } -func expandMonitoringNotificationChannelDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringNotificationChannelDescription(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringNotificationChannelDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringNotificationChannelDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringNotificationChannelEnabled(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringNotificationChannelEnabled(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_monitoring_uptime_check_config.go b/google-beta/resource_monitoring_uptime_check_config.go index 8e7f1818f3..c563e12477 100644 --- a/google-beta/resource_monitoring_uptime_check_config.go +++ b/google-beta/resource_monitoring_uptime_check_config.go @@ -791,19 +791,19 @@ func flattenMonitoringUptimeCheckConfigMonitoredResourceLabels(v interface{}, d return v } -func expandMonitoringUptimeCheckConfigDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigPeriod(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigPeriod(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigTimeout(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigTimeout(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigContentMatchers(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigContentMatchers(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -825,19 +825,19 @@ func expandMonitoringUptimeCheckConfigContentMatchers(v interface{}, d *schema.R return req, nil } -func expandMonitoringUptimeCheckConfigContentMatchersContent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigContentMatchersContent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigSelectedRegions(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigSelectedRegions(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigIsInternal(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigIsInternal(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigInternalCheckers(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigInternalCheckers(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) req := make([]interface{}, 0, len(l)) for _, raw := range l { @@ -887,27 +887,27 @@ func expandMonitoringUptimeCheckConfigInternalCheckers(v interface{}, d *schema. return req, nil } -func expandMonitoringUptimeCheckConfigInternalCheckersGcpZone(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigInternalCheckersGcpZone(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigInternalCheckersPeerProjectId(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigInternalCheckersPeerProjectId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigInternalCheckersName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigInternalCheckersName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigInternalCheckersNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigInternalCheckersNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigInternalCheckersDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigInternalCheckersDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigHttpCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheck(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -961,7 +961,7 @@ func expandMonitoringUptimeCheckConfigHttpCheck(v interface{}, d *schema.Resourc return transformed, nil } -func expandMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -987,19 +987,19 @@ func expandMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d *schema return transformed, nil } -func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigHttpCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigHttpCheckHeaders(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandMonitoringUptimeCheckConfigHttpCheckHeaders(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -1010,19 +1010,19 @@ func expandMonitoringUptimeCheckConfigHttpCheckHeaders(v interface{}, d *schema. return m, nil } -func expandMonitoringUptimeCheckConfigHttpCheckPath(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckPath(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigHttpCheckUseSsl(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckUseSsl(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigHttpCheckMaskHeaders(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigHttpCheckMaskHeaders(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigTcpCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigTcpCheck(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1041,11 +1041,11 @@ func expandMonitoringUptimeCheckConfigTcpCheck(v interface{}, d *schema.Resource return transformed, nil } -func expandMonitoringUptimeCheckConfigTcpCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigTcpCheckPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigResourceGroup(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigResourceGroup(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1071,15 +1071,15 @@ func expandMonitoringUptimeCheckConfigResourceGroup(v interface{}, d *schema.Res return transformed, nil } -func expandMonitoringUptimeCheckConfigResourceGroupResourceType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigResourceGroupResourceType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigResourceGroupGroupId(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigResourceGroupGroupId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return GetResourceNameFromSelfLink(v.(string)), nil } -func expandMonitoringUptimeCheckConfigMonitoredResource(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigMonitoredResource(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -1105,11 +1105,11 @@ func expandMonitoringUptimeCheckConfigMonitoredResource(v interface{}, d *schema return transformed, nil } -func expandMonitoringUptimeCheckConfigMonitoredResourceType(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandMonitoringUptimeCheckConfigMonitoredResourceType(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandMonitoringUptimeCheckConfigMonitoredResourceLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandMonitoringUptimeCheckConfigMonitoredResourceLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } diff --git a/google-beta/resource_pubsub_subscription.go b/google-beta/resource_pubsub_subscription.go index 8af355b94f..d33e519c6d 100644 --- a/google-beta/resource_pubsub_subscription.go +++ b/google-beta/resource_pubsub_subscription.go @@ -392,7 +392,7 @@ func expandPubsubSubscriptionTopic(v interface{}, d *schema.ResourceData, config } } -func expandPubsubSubscriptionLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandPubsubSubscriptionLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -403,7 +403,7 @@ func expandPubsubSubscriptionLabels(v interface{}, d *schema.ResourceData, confi return m, nil } -func expandPubsubSubscriptionPushConfig(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandPubsubSubscriptionPushConfig(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { return nil, nil @@ -429,11 +429,11 @@ func expandPubsubSubscriptionPushConfig(v interface{}, d *schema.ResourceData, c return transformed, nil } -func expandPubsubSubscriptionPushConfigPushEndpoint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandPubsubSubscriptionPushConfigPushEndpoint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandPubsubSubscriptionPushConfigAttributes(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandPubsubSubscriptionPushConfigAttributes(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -444,7 +444,7 @@ func expandPubsubSubscriptionPushConfigAttributes(v interface{}, d *schema.Resou return m, nil } -func expandPubsubSubscriptionAckDeadlineSeconds(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandPubsubSubscriptionAckDeadlineSeconds(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_pubsub_topic.go b/google-beta/resource_pubsub_topic.go index 558a8bf30e..1b982848b5 100644 --- a/google-beta/resource_pubsub_topic.go +++ b/google-beta/resource_pubsub_topic.go @@ -178,11 +178,11 @@ func flattenPubsubTopicLabels(v interface{}, d *schema.ResourceData) interface{} return v } -func expandPubsubTopicName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandPubsubTopicName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return GetResourceNameFromSelfLink(v.(string)), nil } -func expandPubsubTopicLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandPubsubTopicLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } diff --git a/google-beta/resource_redis_instance.go b/google-beta/resource_redis_instance.go index 60b5d488f4..ceefa21c5b 100644 --- a/google-beta/resource_redis_instance.go +++ b/google-beta/resource_redis_instance.go @@ -526,11 +526,11 @@ func flattenRedisInstanceTier(v interface{}, d *schema.ResourceData) interface{} return v } -func expandRedisInstanceAlternativeLocationId(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceAlternativeLocationId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandRedisInstanceAuthorizedNetwork(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceAuthorizedNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { fv, err := ParseNetworkFieldValue(v.(string), d, config) if err != nil { return nil, err @@ -538,11 +538,11 @@ func expandRedisInstanceAuthorizedNetwork(v interface{}, d *schema.ResourceData, return fv.RelativeLink(), nil } -func expandRedisInstanceDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandRedisInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandRedisInstanceLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -553,7 +553,7 @@ func expandRedisInstanceLabels(v interface{}, d *schema.ResourceData, config *Co return m, nil } -func expandRedisInstanceRedisConfigs(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandRedisInstanceRedisConfigs(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } @@ -564,11 +564,11 @@ func expandRedisInstanceRedisConfigs(v interface{}, d *schema.ResourceData, conf return m, nil } -func expandRedisInstanceLocationId(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceLocationId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandRedisInstanceName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { project, err := getProject(d, config) if err != nil { return nil, err @@ -582,18 +582,18 @@ func expandRedisInstanceName(v interface{}, d *schema.ResourceData, config *Conf return fmt.Sprintf("projects/%s/locations/%s/instances/%s", project, region, v.(string)), nil } -func expandRedisInstanceMemorySizeGb(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceMemorySizeGb(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandRedisInstanceRedisVersion(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceRedisVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandRedisInstanceReservedIpRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceReservedIpRange(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandRedisInstanceTier(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandRedisInstanceTier(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_resource_manager_lien.go b/google-beta/resource_resource_manager_lien.go index d3dcc5f30a..bb089e8850 100644 --- a/google-beta/resource_resource_manager_lien.go +++ b/google-beta/resource_resource_manager_lien.go @@ -280,19 +280,19 @@ func flattenResourceManagerLienRestrictions(v interface{}, d *schema.ResourceDat return v } -func expandResourceManagerLienReason(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandResourceManagerLienReason(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandResourceManagerLienOrigin(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandResourceManagerLienOrigin(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandResourceManagerLienParent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandResourceManagerLienParent(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandResourceManagerLienRestrictions(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandResourceManagerLienRestrictions(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_source_repo_repository.go b/google-beta/resource_source_repo_repository.go index 809d9d4e9e..75282c972f 100644 --- a/google-beta/resource_source_repo_repository.go +++ b/google-beta/resource_source_repo_repository.go @@ -191,6 +191,6 @@ func flattenSourceRepoRepositorySize(v interface{}, d *schema.ResourceData) inte return v } -func expandSourceRepoRepositoryName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSourceRepoRepositoryName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return replaceVars(d, config, "projects/{{project}}/repos/{{name}}") } diff --git a/google-beta/resource_spanner_database.go b/google-beta/resource_spanner_database.go index d5238dfc96..61b34e997e 100644 --- a/google-beta/resource_spanner_database.go +++ b/google-beta/resource_spanner_database.go @@ -213,15 +213,15 @@ func flattenSpannerDatabaseInstance(v interface{}, d *schema.ResourceData) inter return ConvertSelfLinkToV1(v.(string)) } -func expandSpannerDatabaseName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerDatabaseName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandSpannerDatabaseDdl(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerDatabaseDdl(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandSpannerDatabaseInstance(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerDatabaseInstance(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("instances", v.(string), "project", d, config, true) if err != nil { return nil, fmt.Errorf("Invalid value for instance: %s", err) diff --git a/google-beta/resource_spanner_instance.go b/google-beta/resource_spanner_instance.go index dab3abe365..864478def0 100644 --- a/google-beta/resource_spanner_instance.go +++ b/google-beta/resource_spanner_instance.go @@ -358,11 +358,11 @@ func flattenSpannerInstanceState(v interface{}, d *schema.ResourceData) interfac return v } -func expandSpannerInstanceName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerInstanceName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandSpannerInstanceConfig(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerInstanceConfig(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { r := regexp.MustCompile("projects/(.+)/instanceConfigs/(.+)") if r.MatchString(v.(string)) { return v.(string), nil @@ -376,15 +376,15 @@ func expandSpannerInstanceConfig(v interface{}, d *schema.ResourceData, config * return fmt.Sprintf("projects/%s/instanceConfigs/%s", project, v.(string)), nil } -func expandSpannerInstanceDisplayName(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerInstanceDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandSpannerInstanceNum_nodes(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandSpannerInstanceNum_nodes(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandSpannerInstanceLabels(v interface{}, d *schema.ResourceData, config *Config) (map[string]string, error) { +func expandSpannerInstanceLabels(v interface{}, d TerraformResourceData, config *Config) (map[string]string, error) { if v == nil { return map[string]string{}, nil } diff --git a/google-beta/resource_sql_database_instance_test.go b/google-beta/resource_sql_database_instance_test.go index 9b866eea9c..e1b39c8a45 100644 --- a/google-beta/resource_sql_database_instance_test.go +++ b/google-beta/resource_sql_database_instance_test.go @@ -40,7 +40,7 @@ func testSweepDatabases(region string) error { return fmt.Errorf("error getting shared config for region: %s", err) } - err = config.loadAndValidate() + err = config.LoadAndValidate() if err != nil { log.Fatalf("error loading: %s", err) } diff --git a/google-beta/resource_storage_default_object_access_control.go b/google-beta/resource_storage_default_object_access_control.go index a692b1e649..76810b1232 100644 --- a/google-beta/resource_storage_default_object_access_control.go +++ b/google-beta/resource_storage_default_object_access_control.go @@ -328,18 +328,18 @@ func flattenStorageDefaultObjectAccessControlRole(v interface{}, d *schema.Resou return v } -func expandStorageDefaultObjectAccessControlBucket(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageDefaultObjectAccessControlBucket(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandStorageDefaultObjectAccessControlEntity(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageDefaultObjectAccessControlEntity(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandStorageDefaultObjectAccessControlObject(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageDefaultObjectAccessControlObject(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandStorageDefaultObjectAccessControlRole(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageDefaultObjectAccessControlRole(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/resource_storage_object_access_control.go b/google-beta/resource_storage_object_access_control.go index a8cb0d520c..a5dfad2478 100644 --- a/google-beta/resource_storage_object_access_control.go +++ b/google-beta/resource_storage_object_access_control.go @@ -338,18 +338,18 @@ func flattenStorageObjectAccessControlRole(v interface{}, d *schema.ResourceData return v } -func expandStorageObjectAccessControlBucket(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageObjectAccessControlBucket(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandStorageObjectAccessControlEntity(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageObjectAccessControlEntity(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandStorageObjectAccessControlObject(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageObjectAccessControlObject(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } -func expandStorageObjectAccessControlRole(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) { +func expandStorageObjectAccessControlRole(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/google-beta/test_utils.go b/google-beta/test_utils.go index d2075ba55d..3327eacd74 100644 --- a/google-beta/test_utils.go +++ b/google-beta/test_utils.go @@ -1,6 +1,7 @@ package google import ( + "reflect" "strconv" ) @@ -21,7 +22,21 @@ func (d *ResourceDataMock) HasChange(key string) bool { return exists } +func (d *ResourceDataMock) Get(key string) interface{} { + v, _ := d.GetOk(key) + return v +} + func (d *ResourceDataMock) GetOk(key string) (interface{}, bool) { + v, ok := d.GetOkExists(key) + if ok && !isEmptyValue(reflect.ValueOf(v)) { + return v, true + } else { + return v, false + } +} + +func (d *ResourceDataMock) GetOkExists(key string) (interface{}, bool) { for k, v := range d.FieldsInSchema { if key == k { return v, true diff --git a/google-beta/utils.go b/google-beta/utils.go index 68dfb8efbc..9f233f2529 100644 --- a/google-beta/utils.go +++ b/google-beta/utils.go @@ -19,7 +19,9 @@ import ( type TerraformResourceData interface { HasChange(string) bool + GetOkExists(string) (interface{}, bool) GetOk(string) (interface{}, bool) + Get(string) interface{} Set(string, interface{}) error SetId(string) Id() string