Skip to content

Commit

Permalink
Fix initialisms in product names
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
rileykarson authored and modular-magician committed Aug 29, 2019
1 parent f985b92 commit 4dd9348
Show file tree
Hide file tree
Showing 30 changed files with 458 additions and 458 deletions.
30 changes: 15 additions & 15 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ type Config struct {
CloudBuildBasePath string
CloudSchedulerBasePath string
ComputeBasePath string
DNSBasePath string
DataprocBasePath string
DnsBasePath string
FilestoreBasePath string
FirestoreBasePath string
KmsBasePath string
KMSBasePath string
LoggingBasePath string
MLEngineBasePath string
MonitoringBasePath string
PubsubBasePath string
RedisBasePath string
ResourceManagerBasePath string
SQLBasePath string
SecurityCenterBasePath string
SourceRepoBasePath string
SpannerBasePath string
SqlBasePath string
StorageBasePath string
TpuBasePath string
TPUBasePath string

CloudBillingBasePath string
clientBilling *cloudbilling.APIService
Expand Down Expand Up @@ -203,23 +203,23 @@ var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/v1/"
var DNSDefaultBasePath = "https://www.googleapis.com/dns/v1/"
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/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/"
var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/"
var RedisDefaultBasePath = "https://redis.googleapis.com/v1/"
var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/"
var SQLDefaultBasePath = "https://www.googleapis.com/sql/v1beta4/"
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 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 @@ -665,23 +665,23 @@ func ConfigureBasePaths(c *Config) {
c.CloudBuildBasePath = CloudBuildDefaultBasePath
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.DNSBasePath = DNSDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DnsBasePath = DnsDefaultBasePath
c.FilestoreBasePath = FilestoreDefaultBasePath
c.FirestoreBasePath = FirestoreDefaultBasePath
c.KmsBasePath = KmsDefaultBasePath
c.KMSBasePath = KMSDefaultBasePath
c.LoggingBasePath = LoggingDefaultBasePath
c.MLEngineBasePath = MLEngineDefaultBasePath
c.MonitoringBasePath = MonitoringDefaultBasePath
c.PubsubBasePath = PubsubDefaultBasePath
c.RedisBasePath = RedisDefaultBasePath
c.ResourceManagerBasePath = ResourceManagerDefaultBasePath
c.SQLBasePath = SQLDefaultBasePath
c.SecurityCenterBasePath = SecurityCenterDefaultBasePath
c.SourceRepoBasePath = SourceRepoDefaultBasePath
c.SpannerBasePath = SpannerDefaultBasePath
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
50 changes: 25 additions & 25 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ func Provider() terraform.ResourceProvider {
"GOOGLE_COMPUTE_CUSTOM_ENDPOINT",
}, ComputeDefaultBasePath),
},
"dataproc_custom_endpoint": {
"dns_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_DATAPROC_CUSTOM_ENDPOINT",
}, DataprocDefaultBasePath),
"GOOGLE_DNS_CUSTOM_ENDPOINT",
}, DNSDefaultBasePath),
},
"dns_custom_endpoint": {
"dataproc_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_DNS_CUSTOM_ENDPOINT",
}, DnsDefaultBasePath),
"GOOGLE_DATAPROC_CUSTOM_ENDPOINT",
}, DataprocDefaultBasePath),
},
"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 @@ -263,6 +263,14 @@ func Provider() terraform.ResourceProvider {
"GOOGLE_RESOURCE_MANAGER_CUSTOM_ENDPOINT",
}, ResourceManagerDefaultBasePath),
},
"sql_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_SQL_CUSTOM_ENDPOINT",
}, SQLDefaultBasePath),
},
"security_center_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand All @@ -287,14 +295,6 @@ func Provider() terraform.ResourceProvider {
"GOOGLE_SPANNER_CUSTOM_ENDPOINT",
}, SpannerDefaultBasePath),
},
"sql_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_SQL_CUSTOM_ENDPOINT",
}, SqlDefaultBasePath),
},
"storage_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
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 @@ -475,17 +475,17 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_pubsub_subscription": resourcePubsubSubscription(),
"google_redis_instance": resourceRedisInstance(),
"google_resource_manager_lien": resourceResourceManagerLien(),
"google_sql_database": resourceSQLDatabase(),
"google_scc_source": resourceSecurityCenterSource(),
"google_sourcerepo_repository": resourceSourceRepoRepository(),
"google_sourcerepo_repository_iam_binding": ResourceIamBinding(SourceRepoRepositoryIamSchema, SourceRepoRepositoryIamUpdaterProducer, SourceRepoRepositoryIdParseFunc),
"google_sourcerepo_repository_iam_member": ResourceIamMember(SourceRepoRepositoryIamSchema, SourceRepoRepositoryIamUpdaterProducer, SourceRepoRepositoryIdParseFunc),
"google_sourcerepo_repository_iam_policy": ResourceIamPolicy(SourceRepoRepositoryIamSchema, SourceRepoRepositoryIamUpdaterProducer, SourceRepoRepositoryIdParseFunc),
"google_spanner_instance": resourceSpannerInstance(),
"google_spanner_database": resourceSpannerDatabase(),
"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 @@ -647,23 +647,23 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.CloudBuildBasePath = d.Get("cloud_build_custom_endpoint").(string)
config.CloudSchedulerBasePath = d.Get("cloud_scheduler_custom_endpoint").(string)
config.ComputeBasePath = d.Get("compute_custom_endpoint").(string)
config.DNSBasePath = d.Get("dns_custom_endpoint").(string)
config.DataprocBasePath = d.Get("dataproc_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)
config.PubsubBasePath = d.Get("pubsub_custom_endpoint").(string)
config.RedisBasePath = d.Get("redis_custom_endpoint").(string)
config.ResourceManagerBasePath = d.Get("resource_manager_custom_endpoint").(string)
config.SQLBasePath = d.Get("sql_custom_endpoint").(string)
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.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
Loading

0 comments on commit 4dd9348

Please sign in to comment.