Skip to content

Commit 88a7980

Browse files
Auto-generate the Cloud IoT Core Device Registry resource (#3357) (#2106)
Signed-off-by: Modular Magician <[email protected]>
1 parent 2d6a2b7 commit 88a7980

14 files changed

+1578
-874
lines changed

.changelog/3357.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ type Config struct {
9191
BinaryAuthorizationBasePath string
9292
CloudBuildBasePath string
9393
CloudFunctionsBasePath string
94+
CloudIotBasePath string
9495
CloudRunBasePath string
9596
CloudSchedulerBasePath string
9697
CloudTasksBasePath string
@@ -240,6 +241,7 @@ var BillingDefaultBasePath = "https://billingbudgets.googleapis.com/v1beta1/"
240241
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
241242
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
242243
var CloudFunctionsDefaultBasePath = "https://cloudfunctions.googleapis.com/v1/"
244+
var CloudIotDefaultBasePath = "https://cloudiot.googleapis.com/v1/"
243245
var CloudRunDefaultBasePath = "https://{{location}}-run.googleapis.com/"
244246
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
245247
var CloudTasksDefaultBasePath = "https://cloudtasks.googleapis.com/v2/"
@@ -764,6 +766,7 @@ func ConfigureBasePaths(c *Config) {
764766
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
765767
c.CloudBuildBasePath = CloudBuildDefaultBasePath
766768
c.CloudFunctionsBasePath = CloudFunctionsDefaultBasePath
769+
c.CloudIotBasePath = CloudIotDefaultBasePath
767770
c.CloudRunBasePath = CloudRunDefaultBasePath
768771
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
769772
c.CloudTasksBasePath = CloudTasksDefaultBasePath
@@ -819,7 +822,6 @@ func ConfigureBasePaths(c *Config) {
819822
c.IAMBasePath = IAMDefaultBasePath
820823
c.ServiceNetworkingBasePath = ServiceNetworkingDefaultBasePath
821824
c.BigQueryBasePath = BigQueryDefaultBasePath
822-
c.CloudIoTBasePath = CloudIoTDefaultBasePath
823825
c.StorageTransferBasePath = StorageTransferDefaultBasePath
824826
c.BigtableAdminBasePath = BigtableAdminDefaultBasePath
825827
}

google-beta/provider.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ func Provider() terraform.ResourceProvider {
205205
"GOOGLE_CLOUD_FUNCTIONS_CUSTOM_ENDPOINT",
206206
}, CloudFunctionsDefaultBasePath),
207207
},
208+
"cloud_iot_custom_endpoint": {
209+
Type: schema.TypeString,
210+
Optional: true,
211+
ValidateFunc: validateCustomEndpoint,
212+
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
213+
"GOOGLE_CLOUD_IOT_CUSTOM_ENDPOINT",
214+
}, CloudIotDefaultBasePath),
215+
},
208216
"cloud_run_custom_endpoint": {
209217
Type: schema.TypeString,
210218
Optional: true,
@@ -541,7 +549,6 @@ func Provider() terraform.ResourceProvider {
541549
IAMCustomEndpointEntryKey: IAMCustomEndpointEntry,
542550
ServiceNetworkingCustomEndpointEntryKey: ServiceNetworkingCustomEndpointEntry,
543551
ServiceUsageCustomEndpointEntryKey: ServiceUsageCustomEndpointEntry,
544-
CloudIoTCustomEndpointEntryKey: CloudIoTCustomEndpointEntry,
545552
StorageTransferCustomEndpointEntryKey: StorageTransferCustomEndpointEntry,
546553
BigtableAdminCustomEndpointEntryKey: BigtableAdminCustomEndpointEntry,
547554
},
@@ -631,9 +638,9 @@ func Provider() terraform.ResourceProvider {
631638
return provider
632639
}
633640

634-
// Generated resources: 155
641+
// Generated resources: 156
635642
// Generated IAM resources: 66
636-
// Total generated resources: 221
643+
// Total generated resources: 222
637644
func ResourceMap() map[string]*schema.Resource {
638645
resourceMap, _ := ResourceMapWithErrors()
639646
return resourceMap
@@ -673,6 +680,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
673680
"google_cloudfunctions_function_iam_binding": ResourceIamBinding(CloudFunctionsCloudFunctionIamSchema, CloudFunctionsCloudFunctionIamUpdaterProducer, CloudFunctionsCloudFunctionIdParseFunc),
674681
"google_cloudfunctions_function_iam_member": ResourceIamMember(CloudFunctionsCloudFunctionIamSchema, CloudFunctionsCloudFunctionIamUpdaterProducer, CloudFunctionsCloudFunctionIdParseFunc),
675682
"google_cloudfunctions_function_iam_policy": ResourceIamPolicy(CloudFunctionsCloudFunctionIamSchema, CloudFunctionsCloudFunctionIamUpdaterProducer, CloudFunctionsCloudFunctionIdParseFunc),
683+
"google_cloudiot_registry": resourceCloudIotDeviceRegistry(),
676684
"google_cloud_run_domain_mapping": resourceCloudRunDomainMapping(),
677685
"google_cloud_run_service": resourceCloudRunService(),
678686
"google_cloud_run_service_iam_binding": ResourceIamBinding(CloudRunServiceIamSchema, CloudRunServiceIamUpdaterProducer, CloudRunServiceIdParseFunc),
@@ -877,7 +885,6 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
877885
"google_billing_account_iam_member": ResourceIamMember(IamBillingAccountSchema, NewBillingAccountIamUpdater, BillingAccountIdParseFunc),
878886
"google_billing_account_iam_policy": ResourceIamPolicy(IamBillingAccountSchema, NewBillingAccountIamUpdater, BillingAccountIdParseFunc),
879887
"google_cloudfunctions_function": resourceCloudFunctionsFunction(),
880-
"google_cloudiot_registry": resourceCloudIoTRegistry(),
881888
"google_composer_environment": resourceComposerEnvironment(),
882889
"google_compute_attached_disk": resourceComputeAttachedDisk(),
883890
"google_compute_instance": resourceComputeInstance(),
@@ -1041,6 +1048,7 @@ func providerConfigure(d *schema.ResourceData, p *schema.Provider, terraformVers
10411048
config.BinaryAuthorizationBasePath = d.Get("binary_authorization_custom_endpoint").(string)
10421049
config.CloudBuildBasePath = d.Get("cloud_build_custom_endpoint").(string)
10431050
config.CloudFunctionsBasePath = d.Get("cloud_functions_custom_endpoint").(string)
1051+
config.CloudIotBasePath = d.Get("cloud_iot_custom_endpoint").(string)
10441052
config.CloudRunBasePath = d.Get("cloud_run_custom_endpoint").(string)
10451053
config.CloudSchedulerBasePath = d.Get("cloud_scheduler_custom_endpoint").(string)
10461054
config.CloudTasksBasePath = d.Get("cloud_tasks_custom_endpoint").(string)
@@ -1098,7 +1106,6 @@ func providerConfigure(d *schema.ResourceData, p *schema.Provider, terraformVers
10981106
config.IAMBasePath = d.Get(IAMCustomEndpointEntryKey).(string)
10991107
config.ServiceNetworkingBasePath = d.Get(ServiceNetworkingCustomEndpointEntryKey).(string)
11001108
config.ServiceUsageBasePath = d.Get(ServiceUsageCustomEndpointEntryKey).(string)
1101-
config.CloudIoTBasePath = d.Get(CloudIoTCustomEndpointEntryKey).(string)
11021109
config.StorageTransferBasePath = d.Get(StorageTransferCustomEndpointEntryKey).(string)
11031110
config.BigtableAdminBasePath = d.Get(BigtableAdminCustomEndpointEntryKey).(string)
11041111

google-beta/provider_handwritten_endpoint.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@ var CloudBillingCustomEndpointEntry = &schema.Schema{
1919
}, CloudBillingDefaultBasePath),
2020
}
2121

22-
var CloudIoTDefaultBasePath = "https://cloudiot.googleapis.com/v1/"
23-
var CloudIoTCustomEndpointEntryKey = "cloud_iot_custom_endpoint"
24-
var CloudIoTCustomEndpointEntry = &schema.Schema{
25-
Type: schema.TypeString,
26-
Optional: true,
27-
ValidateFunc: validateCustomEndpoint,
28-
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
29-
"GOOGLE_CLOUD_IOT_CUSTOM_ENDPOINT",
30-
}, CloudIoTDefaultBasePath),
31-
}
32-
3322
var ComposerDefaultBasePath = "https://composer.googleapis.com/v1beta1/"
3423
var ComposerCustomEndpointEntryKey = "composer_custom_endpoint"
3524
var ComposerCustomEndpointEntry = &schema.Schema{

0 commit comments

Comments
 (0)