Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initialisms in product names #4372

Merged
merged 1 commit into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ type Config struct {
CloudSchedulerBasePath string
ComputeBasePath string
DataprocBasePath string
DnsBasePath string
DNSBasePath string
FilestoreBasePath string
FirestoreBasePath string
KmsBasePath string
KMSBasePath string
LoggingBasePath string
MLEngineBasePath string
MonitoringBasePath string
Expand All @@ -92,9 +92,9 @@ type Config struct {
SecurityCenterBasePath string
SourceRepoBasePath string
SpannerBasePath string
SqlBasePath string
SQLBasePath string
StorageBasePath string
TpuBasePath string
TPUBasePath string

CloudBillingBasePath string
clientBilling *cloudbilling.APIService
Expand Down Expand Up @@ -204,10 +204,10 @@ var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/v1/"
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
var DnsDefaultBasePath = "https://www.googleapis.com/dns/v1/"
var DNSDefaultBasePath = "https://www.googleapis.com/dns/v1/"
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
var KmsDefaultBasePath = "https://cloudkms.googleapis.com/v1/"
var KMSDefaultBasePath = "https://cloudkms.googleapis.com/v1/"
var LoggingDefaultBasePath = "https://logging.googleapis.com/v2/"
var MLEngineDefaultBasePath = "https://ml.googleapis.com/v1/"
var MonitoringDefaultBasePath = "https://monitoring.googleapis.com/v3/"
Expand All @@ -217,9 +217,9 @@ var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.co
var SecurityCenterDefaultBasePath = "https://securitycenter.googleapis.com/v1/"
var SourceRepoDefaultBasePath = "https://sourcerepo.googleapis.com/v1/"
var SpannerDefaultBasePath = "https://spanner.googleapis.com/v1/"
var SqlDefaultBasePath = "https://www.googleapis.com/sql/v1beta4/"
var SQLDefaultBasePath = "https://www.googleapis.com/sql/v1beta4/"
var StorageDefaultBasePath = "https://www.googleapis.com/storage/v1/"
var TpuDefaultBasePath = "https://tpu.googleapis.com/v1/"
var TPUDefaultBasePath = "https://tpu.googleapis.com/v1/"

var defaultClientScopes = []string{
"https://www.googleapis.com/auth/compute",
Expand Down Expand Up @@ -297,7 +297,7 @@ func (c *Config) LoadAndValidate() error {
c.clientContainerBeta.UserAgent = userAgent
c.clientContainerBeta.BasePath = containerBetaClientBasePath

dnsClientBasePath := removeBasePathVersion(c.DnsBasePath) + "v1/projects/"
dnsClientBasePath := removeBasePathVersion(c.DNSBasePath) + "v1/projects/"
log.Printf("[INFO] Instantiating Google Cloud DNS client for path %s", dnsClientBasePath)
c.clientDns, err = dns.NewService(context, option.WithHTTPClient(client))
if err != nil {
Expand All @@ -315,7 +315,7 @@ func (c *Config) LoadAndValidate() error {
c.clientDnsBeta.UserAgent = userAgent
c.clientDnsBeta.BasePath = dnsBetaClientBasePath

kmsClientBasePath := removeBasePathVersion(c.KmsBasePath)
kmsClientBasePath := removeBasePathVersion(c.KMSBasePath)
log.Printf("[INFO] Instantiating Google Cloud KMS client for path %s", kmsClientBasePath)
c.clientKms, err = cloudkms.NewService(context, option.WithHTTPClient(client))
if err != nil {
Expand All @@ -342,7 +342,7 @@ func (c *Config) LoadAndValidate() error {
c.clientStorage.UserAgent = userAgent
c.clientStorage.BasePath = storageClientBasePath

sqlClientBasePath := removeBasePathVersion(c.SqlBasePath) + "v1beta4/"
sqlClientBasePath := removeBasePathVersion(c.SQLBasePath) + "v1beta4/"
log.Printf("[INFO] Instantiating Google SqlAdmin client for path %s", sqlClientBasePath)
c.clientSqlAdmin, err = sqladmin.NewService(context, option.WithHTTPClient(client))
if err != nil {
Expand Down Expand Up @@ -666,10 +666,10 @@ func ConfigureBasePaths(c *Config) {
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DnsBasePath = DnsDefaultBasePath
c.DNSBasePath = DNSDefaultBasePath
c.FilestoreBasePath = FilestoreDefaultBasePath
c.FirestoreBasePath = FirestoreDefaultBasePath
c.KmsBasePath = KmsDefaultBasePath
c.KMSBasePath = KMSDefaultBasePath
c.LoggingBasePath = LoggingDefaultBasePath
c.MLEngineBasePath = MLEngineDefaultBasePath
c.MonitoringBasePath = MonitoringDefaultBasePath
Expand All @@ -679,9 +679,9 @@ func ConfigureBasePaths(c *Config) {
c.SecurityCenterBasePath = SecurityCenterDefaultBasePath
c.SourceRepoBasePath = SourceRepoDefaultBasePath
c.SpannerBasePath = SpannerDefaultBasePath
c.SqlBasePath = SqlDefaultBasePath
c.SQLBasePath = SQLDefaultBasePath
c.StorageBasePath = StorageDefaultBasePath
c.TpuBasePath = TpuDefaultBasePath
c.TPUBasePath = TPUDefaultBasePath

// Handwritten Products / Versioned / Atypical Entries
c.CloudBillingBasePath = CloudBillingDefaultBasePath
Expand Down
2 changes: 1 addition & 1 deletion google/data_source_dns_managed_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAccDataSourceDnsManagedZone_basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDnsManagedZoneDestroy,
CheckDestroy: testAccCheckDNSManagedZoneDestroy,
Steps: []resource.TestStep{
{
Config: testAccDataSourceDnsManagedZone_basic(),
Expand Down
4 changes: 2 additions & 2 deletions google/data_source_google_kms_crypto_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func dataSourceGoogleKmsCryptoKey() *schema.Resource {
dsSchema := datasourceSchemaFromResourceSchema(resourceKmsCryptoKey().Schema)
dsSchema := datasourceSchemaFromResourceSchema(resourceKMSCryptoKey().Schema)
addRequiredFieldsToSchema(dsSchema, "name")
addRequiredFieldsToSchema(dsSchema, "key_ring")

Expand All @@ -31,5 +31,5 @@ func dataSourceGoogleKmsCryptoKeyRead(d *schema.ResourceData, meta interface{})

d.SetId(cryptoKeyId.cryptoKeyId())

return resourceKmsCryptoKeyRead(d, meta)
return resourceKMSCryptoKeyRead(d, meta)
}
6 changes: 3 additions & 3 deletions google/data_source_google_kms_crypto_key_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func dataSourceGoogleKmsCryptoKeyVersion() *schema.Resource {
func dataSourceGoogleKmsCryptoKeyVersionRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)

url, err := replaceVars(d, config, "{{KmsBasePath}}{{crypto_key}}/cryptoKeyVersions/{{version}}")
url, err := replaceVars(d, config, "{{KMSBasePath}}{{crypto_key}}/cryptoKeyVersions/{{version}}")
if err != nil {
return err
}
Expand Down Expand Up @@ -88,7 +88,7 @@ func dataSourceGoogleKmsCryptoKeyVersionRead(d *schema.ResourceData, meta interf
return fmt.Errorf("Error reading CryptoKeyVersion: %s", err)
}

url, err = replaceVars(d, config, "{{KmsBasePath}}{{crypto_key}}")
url, err = replaceVars(d, config, "{{KMSBasePath}}{{crypto_key}}")
if err != nil {
return err
}
Expand All @@ -100,7 +100,7 @@ func dataSourceGoogleKmsCryptoKeyVersionRead(d *schema.ResourceData, meta interf
}

if res["purpose"] == "ASYMMETRIC_SIGN" || res["purpose"] == "ASYMMETRIC_DECRYPT" {
url, err = replaceVars(d, config, "{{KmsBasePath}}{{crypto_key}}/cryptoKeyVersions/{{version}}/publicKey")
url, err = replaceVars(d, config, "{{KMSBasePath}}{{crypto_key}}/cryptoKeyVersions/{{version}}/publicKey")
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions google/data_source_google_kms_key_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func dataSourceGoogleKmsKeyRing() *schema.Resource {
dsSchema := datasourceSchemaFromResourceSchema(resourceKmsKeyRing().Schema)
dsSchema := datasourceSchemaFromResourceSchema(resourceKMSKeyRing().Schema)
addRequiredFieldsToSchema(dsSchema, "name")
addRequiredFieldsToSchema(dsSchema, "location")
addOptionalFieldsToSchema(dsSchema, "project")
Expand All @@ -31,5 +31,5 @@ func dataSourceGoogleKmsKeyRingRead(d *schema.ResourceData, meta interface{}) er
}
d.SetId(keyRingId.terraformId())

return resourceKmsKeyRingRead(d, meta)
return resourceKMSKeyRingRead(d, meta)
}
2 changes: 1 addition & 1 deletion google/data_source_tpu_tensorflow_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/terraform/terraform"
)

func TestAccTpuTensorflowVersions_basic(t *testing.T) {
func TestAccTPUTensorflowVersions_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
Expand Down
26 changes: 13 additions & 13 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func Provider() terraform.ResourceProvider {
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_DNS_CUSTOM_ENDPOINT",
}, DnsDefaultBasePath),
}, DNSDefaultBasePath),
},
"filestore_custom_endpoint": {
Type: schema.TypeString,
Expand All @@ -213,7 +213,7 @@ func Provider() terraform.ResourceProvider {
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_KMS_CUSTOM_ENDPOINT",
}, KmsDefaultBasePath),
}, KMSDefaultBasePath),
},
"logging_custom_endpoint": {
Type: schema.TypeString,
Expand Down Expand Up @@ -293,7 +293,7 @@ func Provider() terraform.ResourceProvider {
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_SQL_CUSTOM_ENDPOINT",
}, SqlDefaultBasePath),
}, SQLDefaultBasePath),
},
"storage_custom_endpoint": {
Type: schema.TypeString,
Expand All @@ -309,7 +309,7 @@ func Provider() terraform.ResourceProvider {
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_TPU_CUSTOM_ENDPOINT",
}, TpuDefaultBasePath),
}, TPUDefaultBasePath),
},

// Handwritten Products / Versioned / Atypical Entries
Expand Down Expand Up @@ -457,11 +457,11 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_compute_vpn_gateway": resourceComputeVpnGateway(),
"google_compute_url_map": resourceComputeUrlMap(),
"google_compute_vpn_tunnel": resourceComputeVpnTunnel(),
"google_dns_managed_zone": resourceDnsManagedZone(),
"google_dns_managed_zone": resourceDNSManagedZone(),
"google_filestore_instance": resourceFilestoreInstance(),
"google_firestore_index": resourceFirestoreIndex(),
"google_kms_key_ring": resourceKmsKeyRing(),
"google_kms_crypto_key": resourceKmsCryptoKey(),
"google_kms_key_ring": resourceKMSKeyRing(),
"google_kms_crypto_key": resourceKMSCryptoKey(),
"google_logging_metric": resourceLoggingMetric(),
"google_ml_engine_model": resourceMLEngineModel(),
"google_monitoring_alert_policy": resourceMonitoringAlertPolicy(),
Expand All @@ -482,10 +482,10 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_sourcerepo_repository_iam_policy": ResourceIamPolicy(SourceRepoRepositoryIamSchema, SourceRepoRepositoryIamUpdaterProducer, SourceRepoRepositoryIdParseFunc),
"google_spanner_instance": resourceSpannerInstance(),
"google_spanner_database": resourceSpannerDatabase(),
"google_sql_database": resourceSqlDatabase(),
"google_sql_database": resourceSQLDatabase(),
"google_storage_object_access_control": resourceStorageObjectAccessControl(),
"google_storage_default_object_access_control": resourceStorageDefaultObjectAccessControl(),
"google_tpu_node": resourceTpuNode(),
"google_tpu_node": resourceTPUNode(),
},
map[string]*schema.Resource{
"google_app_engine_application": resourceAppEngineApplication(),
Expand Down Expand Up @@ -648,10 +648,10 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.CloudSchedulerBasePath = d.Get("cloud_scheduler_custom_endpoint").(string)
config.ComputeBasePath = d.Get("compute_custom_endpoint").(string)
config.DataprocBasePath = d.Get("dataproc_custom_endpoint").(string)
config.DnsBasePath = d.Get("dns_custom_endpoint").(string)
config.DNSBasePath = d.Get("dns_custom_endpoint").(string)
config.FilestoreBasePath = d.Get("filestore_custom_endpoint").(string)
config.FirestoreBasePath = d.Get("firestore_custom_endpoint").(string)
config.KmsBasePath = d.Get("kms_custom_endpoint").(string)
config.KMSBasePath = d.Get("kms_custom_endpoint").(string)
config.LoggingBasePath = d.Get("logging_custom_endpoint").(string)
config.MLEngineBasePath = d.Get("ml_engine_custom_endpoint").(string)
config.MonitoringBasePath = d.Get("monitoring_custom_endpoint").(string)
Expand All @@ -661,9 +661,9 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.SecurityCenterBasePath = d.Get("security_center_custom_endpoint").(string)
config.SourceRepoBasePath = d.Get("source_repo_custom_endpoint").(string)
config.SpannerBasePath = d.Get("spanner_custom_endpoint").(string)
config.SqlBasePath = d.Get("sql_custom_endpoint").(string)
config.SQLBasePath = d.Get("sql_custom_endpoint").(string)
config.StorageBasePath = d.Get("storage_custom_endpoint").(string)
config.TpuBasePath = d.Get("tpu_custom_endpoint").(string)
config.TPUBasePath = d.Get("tpu_custom_endpoint").(string)

// Handwritten Products / Versioned / Atypical Entries

Expand Down
10 changes: 5 additions & 5 deletions google/resource_app_engine_standard_app_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func resourceAppEngineStandardAppVersionCreate(d *schema.ResourceData, meta inte
config := meta.(*Config)

obj := make(map[string]interface{})
idProp, err := expandAppEngineStandardAppVersionVersion_id(d.Get("version_id"), d, config)
idProp, err := expandAppEngineStandardAppVersionVersionId(d.Get("version_id"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("version_id"); !isEmptyValue(reflect.ValueOf(idProp)) && (ok || !reflect.DeepEqual(v, idProp)) {
Expand Down Expand Up @@ -385,7 +385,7 @@ func resourceAppEngineStandardAppVersionRead(d *schema.ResourceData, meta interf
if err := d.Set("name", flattenAppEngineStandardAppVersionName(res["name"], d)); err != nil {
return fmt.Errorf("Error reading StandardAppVersion: %s", err)
}
if err := d.Set("version_id", flattenAppEngineStandardAppVersionVersion_id(res["id"], d)); err != nil {
if err := d.Set("version_id", flattenAppEngineStandardAppVersionVersionId(res["id"], d)); err != nil {
return fmt.Errorf("Error reading StandardAppVersion: %s", err)
}
if err := d.Set("runtime", flattenAppEngineStandardAppVersionRuntime(res["runtime"], d)); err != nil {
Expand Down Expand Up @@ -413,7 +413,7 @@ func resourceAppEngineStandardAppVersionUpdate(d *schema.ResourceData, meta inte
}

obj := make(map[string]interface{})
idProp, err := expandAppEngineStandardAppVersionVersion_id(d.Get("version_id"), d, config)
idProp, err := expandAppEngineStandardAppVersionVersionId(d.Get("version_id"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("version_id"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, idProp)) {
Expand Down Expand Up @@ -581,7 +581,7 @@ func flattenAppEngineStandardAppVersionName(v interface{}, d *schema.ResourceDat
return v
}

func flattenAppEngineStandardAppVersionVersion_id(v interface{}, d *schema.ResourceData) interface{} {
func flattenAppEngineStandardAppVersionVersionId(v interface{}, d *schema.ResourceData) interface{} {
return v
}

Expand Down Expand Up @@ -734,7 +734,7 @@ func flattenAppEngineStandardAppVersionLibrariesVersion(v interface{}, d *schema
return v
}

func expandAppEngineStandardAppVersionVersion_id(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
func expandAppEngineStandardAppVersionVersionId(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

Expand Down
4 changes: 2 additions & 2 deletions google/resource_cloud_build_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func resourceCloudBuildTriggerRead(d *schema.ResourceData, meta interface{}) err
return fmt.Errorf("Error reading Trigger: %s", err)
}

if err := d.Set("trigger_id", flattenCloudBuildTriggerTrigger_id(res["id"], d)); err != nil {
if err := d.Set("trigger_id", flattenCloudBuildTriggerTriggerId(res["id"], d)); err != nil {
return fmt.Errorf("Error reading Trigger: %s", err)
}
if err := d.Set("description", flattenCloudBuildTriggerDescription(res["description"], d)); err != nil {
Expand Down Expand Up @@ -497,7 +497,7 @@ func resourceCloudBuildTriggerImport(d *schema.ResourceData, meta interface{}) (
return []*schema.ResourceData{d}, nil
}

func flattenCloudBuildTriggerTrigger_id(v interface{}, d *schema.ResourceData) interface{} {
func flattenCloudBuildTriggerTriggerId(v interface{}, d *schema.ResourceData) interface{} {
return v
}

Expand Down
12 changes: 6 additions & 6 deletions google/resource_compute_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,10 @@ func flattenComputeBackendServiceConnectionDraining(v interface{}, d *schema.Res
}
transformed := make(map[string]interface{})
transformed["connection_draining_timeout_sec"] =
flattenComputeBackendServiceConnectionDrainingConnection_draining_timeout_sec(original["drainingTimeoutSec"], d)
flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(original["drainingTimeoutSec"], d)
return []interface{}{transformed}
}
func flattenComputeBackendServiceConnectionDrainingConnection_draining_timeout_sec(v interface{}, d *schema.ResourceData) interface{} {
func flattenComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(v interface{}, d *schema.ResourceData) interface{} {
// Handles the string fixed64 format
if strVal, ok := v.(string); ok {
if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil {
Expand Down Expand Up @@ -1394,17 +1394,17 @@ func expandComputeBackendServiceCdnPolicySignedUrlCacheMaxAgeSec(v interface{},

func expandComputeBackendServiceConnectionDraining(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
transformed := make(map[string]interface{})
transformedConnection_draining_timeout_sec, err := expandComputeBackendServiceConnectionDrainingConnection_draining_timeout_sec(d.Get("connection_draining_timeout_sec"), d, config)
transformedConnectionDrainingTimeoutSec, err := expandComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(d.Get("connection_draining_timeout_sec"), d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedConnection_draining_timeout_sec); val.IsValid() && !isEmptyValue(val) {
transformed["drainingTimeoutSec"] = transformedConnection_draining_timeout_sec
} else if val := reflect.ValueOf(transformedConnectionDrainingTimeoutSec); val.IsValid() && !isEmptyValue(val) {
transformed["drainingTimeoutSec"] = transformedConnectionDrainingTimeoutSec
}

return transformed, nil
}

func expandComputeBackendServiceConnectionDrainingConnection_draining_timeout_sec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
func expandComputeBackendServiceConnectionDrainingConnectionDrainingTimeoutSec(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

Expand Down
Loading