Skip to content

Commit 3765ae2

Browse files
authored
Merge pull request #4075 from modular-magician/codegen-pr-2081
Provider level compile
2 parents 53f5c1d + da56764 commit 3765ae2

File tree

2 files changed

+39
-37
lines changed

2 files changed

+39
-37
lines changed

google/config.go

+25-25
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,35 @@ type Config struct {
6969
tokenSource oauth2.TokenSource
7070

7171
AccessContextManagerBasePath string
72+
AppEngineBasePath string
7273
BinaryAuthorizationBasePath string
74+
CloudBuildBasePath string
7375
CloudSchedulerBasePath string
76+
ComputeBasePath string
77+
DnsBasePath string
78+
FilestoreBasePath string
7479
FirestoreBasePath string
80+
KmsBasePath string
81+
LoggingBasePath string
7582
MonitoringBasePath string
83+
PubsubBasePath string
7684
RedisBasePath string
85+
ResourceManagerBasePath string
86+
SourceRepoBasePath string
87+
SpannerBasePath string
88+
SqlBasePath string
89+
StorageBasePath string
7790
TpuBasePath string
7891

7992
CloudBillingBasePath string
8093
clientBilling *cloudbilling.APIService
8194

82-
CloudBuildBasePath string
83-
clientBuild *cloudbuild.Service
95+
clientBuild *cloudbuild.Service
8496

8597
ComposerBasePath string
8698
clientComposer *composer.Service
8799

88-
ComputeBasePath string
89-
clientCompute *compute.Service
100+
clientCompute *compute.Service
90101

91102
ComputeBetaBasePath string
92103
clientComputeBeta *computeBeta.Service
@@ -106,46 +117,36 @@ type Config struct {
106117
DataflowBasePath string
107118
clientDataflow *dataflow.Service
108119

109-
DnsBasePath string
110-
clientDns *dns.Service
120+
clientDns *dns.Service
111121

112122
DnsBetaBasePath string
113123
clientDnsBeta *dnsBeta.Service
114124

115-
FilestoreBasePath string
116-
clientFilestore *file.Service
125+
clientFilestore *file.Service
117126

118127
IamCredentialsBasePath string
119128
clientIamCredentials *iamcredentials.Service
120129

121-
KmsBasePath string
122-
clientKms *cloudkms.Service
130+
clientKms *cloudkms.Service
123131

124-
LoggingBasePath string
125-
clientLogging *cloudlogging.Service
132+
clientLogging *cloudlogging.Service
126133

127-
PubsubBasePath string
128-
clientPubsub *pubsub.Service
134+
clientPubsub *pubsub.Service
129135

130-
ResourceManagerBasePath string
131-
clientResourceManager *cloudresourcemanager.Service
136+
clientResourceManager *cloudresourcemanager.Service
132137

133138
ResourceManagerV2Beta1BasePath string
134139
clientResourceManagerV2Beta1 *resourceManagerV2Beta1.Service
135140

136141
RuntimeconfigBasePath string
137142
clientRuntimeconfig *runtimeconfig.Service
138143

139-
SpannerBasePath string
140-
clientSpanner *spanner.Service
144+
clientSpanner *spanner.Service
141145

142-
SourceRepoBasePath string
143-
clientSourceRepo *sourcerepo.Service
146+
clientSourceRepo *sourcerepo.Service
144147

145-
StorageBasePath string
146-
clientStorage *storage.Service
148+
clientStorage *storage.Service
147149

148-
SqlBasePath string
149150
clientSqlAdmin *sqladmin.Service
150151

151152
IAMBasePath string
@@ -167,8 +168,7 @@ type Config struct {
167168
CloudIoTBasePath string
168169
clientCloudIoT *cloudiot.Service
169170

170-
AppEngineBasePath string
171-
clientAppEngine *appengine.APIService
171+
clientAppEngine *appengine.APIService
172172

173173
ServiceNetworkingBasePath string
174174
clientServiceNetworking *servicenetworking.APIService

google/provider.go

+14-12
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@ func Provider() terraform.ResourceProvider {
101101
AccessContextManagerCustomEndpointEntryKey: AccessContextManagerCustomEndpointEntry,
102102
AppEngineCustomEndpointEntryKey: AppEngineCustomEndpointEntry,
103103
BinaryAuthorizationCustomEndpointEntryKey: BinaryAuthorizationCustomEndpointEntry,
104-
ComputeCustomEndpointEntryKey: ComputeCustomEndpointEntry,
105104
CloudBuildCustomEndpointEntryKey: CloudBuildCustomEndpointEntry,
106105
CloudSchedulerCustomEndpointEntryKey: CloudSchedulerCustomEndpointEntry,
106+
ComputeCustomEndpointEntryKey: ComputeCustomEndpointEntry,
107107
DnsCustomEndpointEntryKey: DnsCustomEndpointEntry,
108108
FilestoreCustomEndpointEntryKey: FilestoreCustomEndpointEntry,
109109
FirestoreCustomEndpointEntryKey: FirestoreCustomEndpointEntry,
110110
KmsCustomEndpointEntryKey: KmsCustomEndpointEntry,
111+
LoggingCustomEndpointEntryKey: LoggingCustomEndpointEntry,
111112
MonitoringCustomEndpointEntryKey: MonitoringCustomEndpointEntry,
112113
PubsubCustomEndpointEntryKey: PubsubCustomEndpointEntry,
113114
RedisCustomEndpointEntryKey: RedisCustomEndpointEntry,
@@ -129,7 +130,6 @@ func Provider() terraform.ResourceProvider {
129130
DataflowCustomEndpointEntryKey: DataflowCustomEndpointEntry,
130131
DnsBetaCustomEndpointEntryKey: DnsBetaCustomEndpointEntry,
131132
IamCredentialsCustomEndpointEntryKey: IamCredentialsCustomEndpointEntry,
132-
LoggingCustomEndpointEntryKey: LoggingCustomEndpointEntry,
133133
ResourceManagerV2Beta1CustomEndpointEntryKey: ResourceManagerV2Beta1CustomEndpointEntry,
134134
RuntimeconfigCustomEndpointEntryKey: RuntimeconfigCustomEndpointEntry,
135135
IAMCustomEndpointEntryKey: IAMCustomEndpointEntry,
@@ -212,13 +212,15 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
212212
GeneratedAccessContextManagerResourcesMap,
213213
GeneratedAppEngineResourcesMap,
214214
GeneratedBinaryAuthorizationResourcesMap,
215-
GeneratedComputeResourcesMap,
216215
GeneratedCloudBuildResourcesMap,
217216
GeneratedCloudSchedulerResourcesMap,
217+
GeneratedComputeResourcesMap,
218218
GeneratedDnsResourcesMap,
219219
GeneratedFilestoreResourcesMap,
220220
GeneratedFirestoreResourcesMap,
221221
GeneratedKmsResourcesMap,
222+
GeneratedLoggingResourcesMap,
223+
GeneratedMonitoringResourcesMap,
222224
GeneratedPubsubResourcesMap,
223225
GeneratedRedisResourcesMap,
224226
GeneratedResourceManagerResourcesMap,
@@ -227,7 +229,6 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
227229
GeneratedSqlResourcesMap,
228230
GeneratedStorageResourcesMap,
229231
GeneratedTpuResourcesMap,
230-
GeneratedMonitoringResourcesMap,
231232
map[string]*schema.Resource{
232233
"google_app_engine_application": resourceAppEngineApplication(),
233234
"google_bigquery_dataset": resourceBigQueryDataset(),
@@ -287,7 +288,6 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
287288
"google_folder_organization_policy": resourceGoogleFolderOrganizationPolicy(),
288289
"google_logging_billing_account_sink": resourceLoggingBillingAccountSink(),
289290
"google_logging_billing_account_exclusion": ResourceLoggingExclusion(BillingAccountLoggingExclusionSchema, NewBillingAccountLoggingExclusionUpdater, billingAccountLoggingExclusionIdParseFunc),
290-
"google_logging_metric": resourceLoggingMetric(),
291291
"google_logging_organization_sink": resourceLoggingOrganizationSink(),
292292
"google_logging_organization_exclusion": ResourceLoggingExclusion(OrganizationLoggingExclusionSchema, NewOrganizationLoggingExclusionUpdater, organizationLoggingExclusionIdParseFunc),
293293
"google_logging_folder_sink": resourceLoggingFolderSink(),
@@ -379,17 +379,18 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
379379
}
380380
config.BatchingConfig = batchCfg
381381

382+
// Generated products
382383
config.AccessContextManagerBasePath = d.Get(AccessContextManagerCustomEndpointEntryKey).(string)
383-
config.CloudSchedulerBasePath = d.Get(CloudSchedulerCustomEndpointEntryKey).(string)
384-
config.FirestoreBasePath = d.Get(FirestoreCustomEndpointEntryKey).(string)
385-
386384
config.AppEngineBasePath = d.Get(AppEngineCustomEndpointEntryKey).(string)
387385
config.BinaryAuthorizationBasePath = d.Get(BinaryAuthorizationCustomEndpointEntryKey).(string)
388-
config.ComputeBasePath = d.Get(ComputeCustomEndpointEntryKey).(string)
389386
config.CloudBuildBasePath = d.Get(CloudBuildCustomEndpointEntryKey).(string)
387+
config.CloudSchedulerBasePath = d.Get(CloudSchedulerCustomEndpointEntryKey).(string)
388+
config.ComputeBasePath = d.Get(ComputeCustomEndpointEntryKey).(string)
390389
config.DnsBasePath = d.Get(DnsCustomEndpointEntryKey).(string)
391390
config.FilestoreBasePath = d.Get(FilestoreCustomEndpointEntryKey).(string)
391+
config.FirestoreBasePath = d.Get(FirestoreCustomEndpointEntryKey).(string)
392392
config.KmsBasePath = d.Get(KmsCustomEndpointEntryKey).(string)
393+
config.LoggingBasePath = d.Get(LoggingCustomEndpointEntryKey).(string)
393394
config.MonitoringBasePath = d.Get(MonitoringCustomEndpointEntryKey).(string)
394395
config.PubsubBasePath = d.Get(PubsubCustomEndpointEntryKey).(string)
395396
config.RedisBasePath = d.Get(RedisCustomEndpointEntryKey).(string)
@@ -400,6 +401,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
400401
config.StorageBasePath = d.Get(StorageCustomEndpointEntryKey).(string)
401402
config.TpuBasePath = d.Get(TpuCustomEndpointEntryKey).(string)
402403

404+
// Handwritten Products / Versioned / Atypical Entries
405+
403406
config.CloudBillingBasePath = d.Get(CloudBillingCustomEndpointEntryKey).(string)
404407
config.ComposerBasePath = d.Get(ComposerCustomEndpointEntryKey).(string)
405408
config.ComputeBetaBasePath = d.Get(ComputeBetaCustomEndpointEntryKey).(string)
@@ -410,7 +413,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
410413
config.DataflowBasePath = d.Get(DataflowCustomEndpointEntryKey).(string)
411414
config.DnsBetaBasePath = d.Get(DnsBetaCustomEndpointEntryKey).(string)
412415
config.IamCredentialsBasePath = d.Get(IamCredentialsCustomEndpointEntryKey).(string)
413-
config.LoggingBasePath = d.Get(LoggingCustomEndpointEntryKey).(string)
414416
config.ResourceManagerV2Beta1BasePath = d.Get(ResourceManagerV2Beta1CustomEndpointEntryKey).(string)
415417
config.RuntimeconfigBasePath = d.Get(RuntimeconfigCustomEndpointEntryKey).(string)
416418
config.IAMBasePath = d.Get(IAMCustomEndpointEntryKey).(string)
@@ -438,13 +440,14 @@ func ConfigureBasePaths(c *Config) {
438440
c.AccessContextManagerBasePath = AccessContextManagerDefaultBasePath
439441
c.AppEngineBasePath = AppEngineDefaultBasePath
440442
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
441-
c.ComputeBasePath = ComputeDefaultBasePath
442443
c.CloudBuildBasePath = CloudBuildDefaultBasePath
443444
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
445+
c.ComputeBasePath = ComputeDefaultBasePath
444446
c.DnsBasePath = DnsDefaultBasePath
445447
c.FilestoreBasePath = FilestoreDefaultBasePath
446448
c.FirestoreBasePath = FirestoreDefaultBasePath
447449
c.KmsBasePath = KmsDefaultBasePath
450+
c.LoggingBasePath = LoggingDefaultBasePath
448451
c.MonitoringBasePath = MonitoringDefaultBasePath
449452
c.PubsubBasePath = PubsubDefaultBasePath
450453
c.RedisBasePath = RedisDefaultBasePath
@@ -465,7 +468,6 @@ func ConfigureBasePaths(c *Config) {
465468
c.DataflowBasePath = DataflowDefaultBasePath
466469
c.DnsBetaBasePath = DnsBetaDefaultBasePath
467470
c.IamCredentialsBasePath = IamCredentialsDefaultBasePath
468-
c.LoggingBasePath = LoggingDefaultBasePath
469471
c.ResourceManagerV2Beta1BasePath = ResourceManagerV2Beta1DefaultBasePath
470472
c.RuntimeconfigBasePath = RuntimeconfigDefaultBasePath
471473
c.IAMBasePath = IAMDefaultBasePath

0 commit comments

Comments
 (0)