Skip to content

Commit

Permalink
Provider level compile
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
slevenick authored and modular-magician committed Jul 23, 2019
1 parent 53f5c1d commit da56764
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
50 changes: 25 additions & 25 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,35 @@ type Config struct {
tokenSource oauth2.TokenSource

AccessContextManagerBasePath string
AppEngineBasePath string
BinaryAuthorizationBasePath string
CloudBuildBasePath string
CloudSchedulerBasePath string
ComputeBasePath string
DnsBasePath string
FilestoreBasePath string
FirestoreBasePath string
KmsBasePath string
LoggingBasePath string
MonitoringBasePath string
PubsubBasePath string
RedisBasePath string
ResourceManagerBasePath string
SourceRepoBasePath string
SpannerBasePath string
SqlBasePath string
StorageBasePath string
TpuBasePath string

CloudBillingBasePath string
clientBilling *cloudbilling.APIService

CloudBuildBasePath string
clientBuild *cloudbuild.Service
clientBuild *cloudbuild.Service

ComposerBasePath string
clientComposer *composer.Service

ComputeBasePath string
clientCompute *compute.Service
clientCompute *compute.Service

ComputeBetaBasePath string
clientComputeBeta *computeBeta.Service
Expand All @@ -106,46 +117,36 @@ type Config struct {
DataflowBasePath string
clientDataflow *dataflow.Service

DnsBasePath string
clientDns *dns.Service
clientDns *dns.Service

DnsBetaBasePath string
clientDnsBeta *dnsBeta.Service

FilestoreBasePath string
clientFilestore *file.Service
clientFilestore *file.Service

IamCredentialsBasePath string
clientIamCredentials *iamcredentials.Service

KmsBasePath string
clientKms *cloudkms.Service
clientKms *cloudkms.Service

LoggingBasePath string
clientLogging *cloudlogging.Service
clientLogging *cloudlogging.Service

PubsubBasePath string
clientPubsub *pubsub.Service
clientPubsub *pubsub.Service

ResourceManagerBasePath string
clientResourceManager *cloudresourcemanager.Service
clientResourceManager *cloudresourcemanager.Service

ResourceManagerV2Beta1BasePath string
clientResourceManagerV2Beta1 *resourceManagerV2Beta1.Service

RuntimeconfigBasePath string
clientRuntimeconfig *runtimeconfig.Service

SpannerBasePath string
clientSpanner *spanner.Service
clientSpanner *spanner.Service

SourceRepoBasePath string
clientSourceRepo *sourcerepo.Service
clientSourceRepo *sourcerepo.Service

StorageBasePath string
clientStorage *storage.Service
clientStorage *storage.Service

SqlBasePath string
clientSqlAdmin *sqladmin.Service

IAMBasePath string
Expand All @@ -167,8 +168,7 @@ type Config struct {
CloudIoTBasePath string
clientCloudIoT *cloudiot.Service

AppEngineBasePath string
clientAppEngine *appengine.APIService
clientAppEngine *appengine.APIService

ServiceNetworkingBasePath string
clientServiceNetworking *servicenetworking.APIService
Expand Down
26 changes: 14 additions & 12 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@ func Provider() terraform.ResourceProvider {
AccessContextManagerCustomEndpointEntryKey: AccessContextManagerCustomEndpointEntry,
AppEngineCustomEndpointEntryKey: AppEngineCustomEndpointEntry,
BinaryAuthorizationCustomEndpointEntryKey: BinaryAuthorizationCustomEndpointEntry,
ComputeCustomEndpointEntryKey: ComputeCustomEndpointEntry,
CloudBuildCustomEndpointEntryKey: CloudBuildCustomEndpointEntry,
CloudSchedulerCustomEndpointEntryKey: CloudSchedulerCustomEndpointEntry,
ComputeCustomEndpointEntryKey: ComputeCustomEndpointEntry,
DnsCustomEndpointEntryKey: DnsCustomEndpointEntry,
FilestoreCustomEndpointEntryKey: FilestoreCustomEndpointEntry,
FirestoreCustomEndpointEntryKey: FirestoreCustomEndpointEntry,
KmsCustomEndpointEntryKey: KmsCustomEndpointEntry,
LoggingCustomEndpointEntryKey: LoggingCustomEndpointEntry,
MonitoringCustomEndpointEntryKey: MonitoringCustomEndpointEntry,
PubsubCustomEndpointEntryKey: PubsubCustomEndpointEntry,
RedisCustomEndpointEntryKey: RedisCustomEndpointEntry,
Expand All @@ -129,7 +130,6 @@ func Provider() terraform.ResourceProvider {
DataflowCustomEndpointEntryKey: DataflowCustomEndpointEntry,
DnsBetaCustomEndpointEntryKey: DnsBetaCustomEndpointEntry,
IamCredentialsCustomEndpointEntryKey: IamCredentialsCustomEndpointEntry,
LoggingCustomEndpointEntryKey: LoggingCustomEndpointEntry,
ResourceManagerV2Beta1CustomEndpointEntryKey: ResourceManagerV2Beta1CustomEndpointEntry,
RuntimeconfigCustomEndpointEntryKey: RuntimeconfigCustomEndpointEntry,
IAMCustomEndpointEntryKey: IAMCustomEndpointEntry,
Expand Down Expand Up @@ -212,13 +212,15 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
GeneratedAccessContextManagerResourcesMap,
GeneratedAppEngineResourcesMap,
GeneratedBinaryAuthorizationResourcesMap,
GeneratedComputeResourcesMap,
GeneratedCloudBuildResourcesMap,
GeneratedCloudSchedulerResourcesMap,
GeneratedComputeResourcesMap,
GeneratedDnsResourcesMap,
GeneratedFilestoreResourcesMap,
GeneratedFirestoreResourcesMap,
GeneratedKmsResourcesMap,
GeneratedLoggingResourcesMap,
GeneratedMonitoringResourcesMap,
GeneratedPubsubResourcesMap,
GeneratedRedisResourcesMap,
GeneratedResourceManagerResourcesMap,
Expand All @@ -227,7 +229,6 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
GeneratedSqlResourcesMap,
GeneratedStorageResourcesMap,
GeneratedTpuResourcesMap,
GeneratedMonitoringResourcesMap,
map[string]*schema.Resource{
"google_app_engine_application": resourceAppEngineApplication(),
"google_bigquery_dataset": resourceBigQueryDataset(),
Expand Down Expand Up @@ -287,7 +288,6 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_folder_organization_policy": resourceGoogleFolderOrganizationPolicy(),
"google_logging_billing_account_sink": resourceLoggingBillingAccountSink(),
"google_logging_billing_account_exclusion": ResourceLoggingExclusion(BillingAccountLoggingExclusionSchema, NewBillingAccountLoggingExclusionUpdater, billingAccountLoggingExclusionIdParseFunc),
"google_logging_metric": resourceLoggingMetric(),
"google_logging_organization_sink": resourceLoggingOrganizationSink(),
"google_logging_organization_exclusion": ResourceLoggingExclusion(OrganizationLoggingExclusionSchema, NewOrganizationLoggingExclusionUpdater, organizationLoggingExclusionIdParseFunc),
"google_logging_folder_sink": resourceLoggingFolderSink(),
Expand Down Expand Up @@ -379,17 +379,18 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
}
config.BatchingConfig = batchCfg

// Generated products
config.AccessContextManagerBasePath = d.Get(AccessContextManagerCustomEndpointEntryKey).(string)
config.CloudSchedulerBasePath = d.Get(CloudSchedulerCustomEndpointEntryKey).(string)
config.FirestoreBasePath = d.Get(FirestoreCustomEndpointEntryKey).(string)

config.AppEngineBasePath = d.Get(AppEngineCustomEndpointEntryKey).(string)
config.BinaryAuthorizationBasePath = d.Get(BinaryAuthorizationCustomEndpointEntryKey).(string)
config.ComputeBasePath = d.Get(ComputeCustomEndpointEntryKey).(string)
config.CloudBuildBasePath = d.Get(CloudBuildCustomEndpointEntryKey).(string)
config.CloudSchedulerBasePath = d.Get(CloudSchedulerCustomEndpointEntryKey).(string)
config.ComputeBasePath = d.Get(ComputeCustomEndpointEntryKey).(string)
config.DnsBasePath = d.Get(DnsCustomEndpointEntryKey).(string)
config.FilestoreBasePath = d.Get(FilestoreCustomEndpointEntryKey).(string)
config.FirestoreBasePath = d.Get(FirestoreCustomEndpointEntryKey).(string)
config.KmsBasePath = d.Get(KmsCustomEndpointEntryKey).(string)
config.LoggingBasePath = d.Get(LoggingCustomEndpointEntryKey).(string)
config.MonitoringBasePath = d.Get(MonitoringCustomEndpointEntryKey).(string)
config.PubsubBasePath = d.Get(PubsubCustomEndpointEntryKey).(string)
config.RedisBasePath = d.Get(RedisCustomEndpointEntryKey).(string)
Expand All @@ -400,6 +401,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.StorageBasePath = d.Get(StorageCustomEndpointEntryKey).(string)
config.TpuBasePath = d.Get(TpuCustomEndpointEntryKey).(string)

// Handwritten Products / Versioned / Atypical Entries

config.CloudBillingBasePath = d.Get(CloudBillingCustomEndpointEntryKey).(string)
config.ComposerBasePath = d.Get(ComposerCustomEndpointEntryKey).(string)
config.ComputeBetaBasePath = d.Get(ComputeBetaCustomEndpointEntryKey).(string)
Expand All @@ -410,7 +413,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.DataflowBasePath = d.Get(DataflowCustomEndpointEntryKey).(string)
config.DnsBetaBasePath = d.Get(DnsBetaCustomEndpointEntryKey).(string)
config.IamCredentialsBasePath = d.Get(IamCredentialsCustomEndpointEntryKey).(string)
config.LoggingBasePath = d.Get(LoggingCustomEndpointEntryKey).(string)
config.ResourceManagerV2Beta1BasePath = d.Get(ResourceManagerV2Beta1CustomEndpointEntryKey).(string)
config.RuntimeconfigBasePath = d.Get(RuntimeconfigCustomEndpointEntryKey).(string)
config.IAMBasePath = d.Get(IAMCustomEndpointEntryKey).(string)
Expand Down Expand Up @@ -438,13 +440,14 @@ func ConfigureBasePaths(c *Config) {
c.AccessContextManagerBasePath = AccessContextManagerDefaultBasePath
c.AppEngineBasePath = AppEngineDefaultBasePath
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.CloudBuildBasePath = CloudBuildDefaultBasePath
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.DnsBasePath = DnsDefaultBasePath
c.FilestoreBasePath = FilestoreDefaultBasePath
c.FirestoreBasePath = FirestoreDefaultBasePath
c.KmsBasePath = KmsDefaultBasePath
c.LoggingBasePath = LoggingDefaultBasePath
c.MonitoringBasePath = MonitoringDefaultBasePath
c.PubsubBasePath = PubsubDefaultBasePath
c.RedisBasePath = RedisDefaultBasePath
Expand All @@ -465,7 +468,6 @@ func ConfigureBasePaths(c *Config) {
c.DataflowBasePath = DataflowDefaultBasePath
c.DnsBetaBasePath = DnsBetaDefaultBasePath
c.IamCredentialsBasePath = IamCredentialsDefaultBasePath
c.LoggingBasePath = LoggingDefaultBasePath
c.ResourceManagerV2Beta1BasePath = ResourceManagerV2Beta1DefaultBasePath
c.RuntimeconfigBasePath = RuntimeconfigDefaultBasePath
c.IAMBasePath = IAMDefaultBasePath
Expand Down

0 comments on commit da56764

Please sign in to comment.