From f92f682e0354094d4dd2b1fee8a7a2f39311d5c2 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Mon, 28 Feb 2022 14:30:20 -0800 Subject: [PATCH] Upgrade dcl (#5762) * upgrade dcl * Fix go.sum --- mmv1/third_party/terraform/go.mod.erb | 2 +- mmv1/third_party/terraform/go.sum | 4 +- tpgtools/go.mod | 2 +- tpgtools/go.sum | 4 +- tpgtools/serialization.go | 2172 ++++++++++++++++--------- 5 files changed, 1427 insertions(+), 757 deletions(-) diff --git a/mmv1/third_party/terraform/go.mod.erb b/mmv1/third_party/terraform/go.mod.erb index 87eb6cf00e56..9e013e30d9ea 100644 --- a/mmv1/third_party/terraform/go.mod.erb +++ b/mmv1/third_party/terraform/go.mod.erb @@ -4,7 +4,7 @@ module github.com/hashicorp/terraform-provider-google<%= "-" + version unless ve require ( cloud.google.com/go/bigtable v1.10.1 cloud.google.com/go/iam v0.1.1 // indirect - github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220125025424-6dfdf699127c + github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220225200700-e76d50f1e637 github.com/apparentlymart/go-cidr v1.1.0 github.com/client9/misspell v0.3.4 github.com/davecgh/go-spew v1.1.1 diff --git a/mmv1/third_party/terraform/go.sum b/mmv1/third_party/terraform/go.sum index a6d3f0d1c210..9deda5ce1050 100644 --- a/mmv1/third_party/terraform/go.sum +++ b/mmv1/third_party/terraform/go.sum @@ -1502,4 +1502,6 @@ rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= \ No newline at end of file +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220225200700-e76d50f1e637 h1:+s2wWcAciNo96AT+Ci9pwXuWm9qlY/ubLFWRaqE0tZg= +github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220225200700-e76d50f1e637/go.mod h1:UJoDYx6t3+xCOd+dZX8+NrEB+Y/eW1pQlvxh2Gt7y5E= diff --git a/tpgtools/go.mod b/tpgtools/go.mod index b8e6fba78257..067f440e9f28 100644 --- a/tpgtools/go.mod +++ b/tpgtools/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( bitbucket.org/creachadair/stringset v0.0.9 - github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220125025424-6dfdf699127c + github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220225200700-e76d50f1e637 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/hcl v1.0.0 diff --git a/tpgtools/go.sum b/tpgtools/go.sum index 27b40481652a..50640bf516da 100644 --- a/tpgtools/go.sum +++ b/tpgtools/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220125025424-6dfdf699127c h1:6cvYJTwBPUv9kpg5aG5ktpKcsddjRChgh9UmIy569rc= -github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220125025424-6dfdf699127c/go.mod h1:oEeBHikdF/NrnUy0ornVaY1OT+jGvTqm+LQS0+ZDKzU= +github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220225200700-e76d50f1e637 h1:+s2wWcAciNo96AT+Ci9pwXuWm9qlY/ubLFWRaqE0tZg= +github.com/GoogleCloudPlatform/declarative-resource-client-library v0.0.0-20220225200700-e76d50f1e637/go.mod h1:UJoDYx6t3+xCOd+dZX8+NrEB+Y/eW1pQlvxh2Gt7y5E= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= diff --git a/tpgtools/serialization.go b/tpgtools/serialization.go index 99d6411bd86f..eba1a7a5f11e 100644 --- a/tpgtools/serialization.go +++ b/tpgtools/serialization.go @@ -2500,7 +2500,7 @@ func convertDataprocWorkflowTemplateBetaPlacementManagedClusterToHCL(r *dataproc if r.ClusterName != nil { outputConfig += fmt.Sprintf("\tcluster_name = %#v\n", *r.ClusterName) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigToHCL(r.Config); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigToHCL(r.Config); v != "" { outputConfig += fmt.Sprintf("\tconfig %s\n", v) } outputConfig += "\tlabels = {" @@ -2511,185 +2511,47 @@ func convertDataprocWorkflowTemplateBetaPlacementManagedClusterToHCL(r *dataproc return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaParametersToHCL(r *dataprocBeta.WorkflowTemplateParameters) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Fields != nil { - outputConfig += "\tfields = [" - for _, v := range r.Fields { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" - } - if r.Name != nil { - outputConfig += fmt.Sprintf("\tname = %#v\n", *r.Name) - } - if r.Description != nil { - outputConfig += fmt.Sprintf("\tdescription = %#v\n", *r.Description) - } - if v := convertDataprocWorkflowTemplateBetaParametersValidationToHCL(r.Validation); v != "" { - outputConfig += fmt.Sprintf("\tvalidation %s\n", v) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaParametersValidationToHCL(r *dataprocBeta.WorkflowTemplateParametersValidation) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateBetaParametersValidationRegexToHCL(r.Regex); v != "" { - outputConfig += fmt.Sprintf("\tregex %s\n", v) - } - if v := convertDataprocWorkflowTemplateBetaParametersValidationValuesToHCL(r.Values); v != "" { - outputConfig += fmt.Sprintf("\tvalues %s\n", v) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaParametersValidationRegexToHCL(r *dataprocBeta.WorkflowTemplateParametersValidationRegex) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Regexes != nil { - outputConfig += "\tregexes = [" - for _, v := range r.Regexes { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaParametersValidationValuesToHCL(r *dataprocBeta.WorkflowTemplateParametersValidationValues) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Values != nil { - outputConfig += "\tvalues = [" - for _, v := range r.Values { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigToHCL(r *dataprocBeta.ClusterInstanceGroupConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Accelerators != nil { - for _, v := range r.Accelerators { - outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigAcceleratorsToHCL(&v)) - } - } - if v := convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfigToHCL(r.DiskConfig); v != "" { - outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) - } - if r.Image != nil { - outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) - } - if r.MachineType != nil { - outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) - } - if r.MinCpuPlatform != nil { - outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) - } - if r.NumInstances != nil { - outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) - } - if r.Preemptibility != nil { - outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigAcceleratorsToHCL(r *dataprocBeta.ClusterInstanceGroupConfigAccelerators) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.AcceleratorCount != nil { - outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) - } - if r.AcceleratorType != nil { - outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfigToHCL(r *dataprocBeta.ClusterInstanceGroupConfigDiskConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.BootDiskSizeGb != nil { - outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) - } - if r.BootDiskType != nil { - outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) - } - if r.NumLocalSsds != nil { - outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigManagedGroupConfigToHCL(r *dataprocBeta.ClusterInstanceGroupConfigManagedGroupConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateBetaClusterClusterConfigToHCL(r *dataprocBeta.ClusterClusterConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfig) string { if r == nil { return "" } outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfigToHCL(r.AutoscalingConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigAutoscalingConfigToHCL(r.AutoscalingConfig); v != "" { outputConfig += fmt.Sprintf("\tautoscaling_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfigToHCL(r.EncryptionConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEncryptionConfigToHCL(r.EncryptionConfig); v != "" { outputConfig += fmt.Sprintf("\tencryption_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfigToHCL(r.EndpointConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEndpointConfigToHCL(r.EndpointConfig); v != "" { outputConfig += fmt.Sprintf("\tendpoint_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigToHCL(r.GceClusterConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigToHCL(r.GceClusterConfig); v != "" { outputConfig += fmt.Sprintf("\tgce_cluster_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigToHCL(r.GkeClusterConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigToHCL(r.GkeClusterConfig); v != "" { outputConfig += fmt.Sprintf("\tgke_cluster_config %s\n", v) } if r.InitializationActions != nil { for _, v := range r.InitializationActions { - outputConfig += fmt.Sprintf("\tinitialization_actions %s\n", convertDataprocWorkflowTemplateBetaClusterClusterConfigInitializationActionsToHCL(&v)) + outputConfig += fmt.Sprintf("\tinitialization_actions %s\n", convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigInitializationActionsToHCL(&v)) } } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfigToHCL(r.LifecycleConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigLifecycleConfigToHCL(r.LifecycleConfig); v != "" { outputConfig += fmt.Sprintf("\tlifecycle_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigToHCL(r.MasterConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigToHCL(r.MasterConfig); v != "" { outputConfig += fmt.Sprintf("\tmaster_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigMetastoreConfigToHCL(r.MetastoreConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMetastoreConfigToHCL(r.MetastoreConfig); v != "" { outputConfig += fmt.Sprintf("\tmetastore_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigToHCL(r.SecondaryWorkerConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigToHCL(r.SecondaryWorkerConfig); v != "" { outputConfig += fmt.Sprintf("\tsecondary_worker_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigToHCL(r.SecurityConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigToHCL(r.SecurityConfig); v != "" { outputConfig += fmt.Sprintf("\tsecurity_config %s\n", v) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigSoftwareConfigToHCL(r.SoftwareConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSoftwareConfigToHCL(r.SoftwareConfig); v != "" { outputConfig += fmt.Sprintf("\tsoftware_config %s\n", v) } if r.StagingBucket != nil { @@ -2698,13 +2560,13 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigToHCL(r *dataprocBet if r.TempBucket != nil { outputConfig += fmt.Sprintf("\ttemp_bucket = %#v\n", *r.TempBucket) } - if v := convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigToHCL(r.WorkerConfig); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigToHCL(r.WorkerConfig); v != "" { outputConfig += fmt.Sprintf("\tworker_config %s\n", v) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfigToHCL(r *dataprocBeta.ClusterClusterConfigAutoscalingConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigAutoscalingConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig) string { if r == nil { return "" } @@ -2715,7 +2577,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfigToH return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfigToHCL(r *dataprocBeta.ClusterClusterConfigEncryptionConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEncryptionConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig) string { if r == nil { return "" } @@ -2726,7 +2588,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfigToHC return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfigToHCL(r *dataprocBeta.ClusterClusterConfigEndpointConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEndpointConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigEndpointConfig) string { if r == nil { return "" } @@ -2737,7 +2599,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfigToHCL( return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigToHCL(r *dataprocBeta.ClusterClusterConfigGceClusterConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig) string { if r == nil { return "" } @@ -2753,13 +2615,13 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigToHC if r.Network != nil { outputConfig += fmt.Sprintf("\tnetwork = %#v\n", *r.Network) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r.NodeGroupAffinity); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r.NodeGroupAffinity); v != "" { outputConfig += fmt.Sprintf("\tnode_group_affinity %s\n", v) } if r.PrivateIPv6GoogleAccess != nil { outputConfig += fmt.Sprintf("\tprivate_ipv6_google_access = %#v\n", *r.PrivateIPv6GoogleAccess) } - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigReservationAffinityToHCL(r.ReservationAffinity); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigReservationAffinityToHCL(r.ReservationAffinity); v != "" { outputConfig += fmt.Sprintf("\treservation_affinity %s\n", v) } if r.ServiceAccount != nil { @@ -2788,7 +2650,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigToHC return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r *dataprocBeta.ClusterClusterConfigGceClusterConfigNodeGroupAffinity) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity) string { if r == nil { return "" } @@ -2799,7 +2661,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNode return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigReservationAffinityToHCL(r *dataprocBeta.ClusterClusterConfigGceClusterConfigReservationAffinity) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigReservationAffinityToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity) string { if r == nil { return "" } @@ -2820,18 +2682,18 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigRese return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigToHCL(r *dataprocBeta.ClusterClusterConfigGkeClusterConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig) string { if r == nil { return "" } outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetToHCL(r.NamespacedGkeDeploymentTarget); v != "" { + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetToHCL(r.NamespacedGkeDeploymentTarget); v != "" { outputConfig += fmt.Sprintf("\tnamespaced_gke_deployment_target %s\n", v) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetToHCL(r *dataprocBeta.ClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget) string { if r == nil { return "" } @@ -2845,7 +2707,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigName return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigInitializationActionsToHCL(r *dataprocBeta.ClusterClusterConfigInitializationActions) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigInitializationActionsToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigInitializationActions) string { if r == nil { return "" } @@ -2859,7 +2721,7 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigInitializationAction return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfigToHCL(r *dataprocBeta.ClusterClusterConfigLifecycleConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigLifecycleConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig) string { if r == nil { return "" } @@ -2876,112 +2738,390 @@ func convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfigToHCL return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigMetastoreConfigToHCL(r *dataprocBeta.ClusterClusterConfigMetastoreConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigMasterConfig) string { if r == nil { return "" } outputConfig := "{\n" - if r.DataprocMetastoreService != nil { - outputConfig += fmt.Sprintf("\tdataproc_metastore_service = %#v\n", *r.DataprocMetastoreService) + if r.Accelerators != nil { + for _, v := range r.Accelerators { + outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigAcceleratorsToHCL(&v)) + } + } + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigDiskConfigToHCL(r.DiskConfig); v != "" { + outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) + } + if r.Image != nil { + outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) + } + if r.MachineType != nil { + outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) + } + if r.MinCpuPlatform != nil { + outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) + } + if r.NumInstances != nil { + outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) + } + if r.Preemptibility != nil { + outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigToHCL(r *dataprocBeta.ClusterClusterConfigSecurityConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigAcceleratorsToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators) string { if r == nil { return "" } outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigKerberosConfigToHCL(r.KerberosConfig); v != "" { - outputConfig += fmt.Sprintf("\tkerberos_config %s\n", v) + if r.AcceleratorCount != nil { + outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) + } + if r.AcceleratorType != nil { + outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigKerberosConfigToHCL(r *dataprocBeta.ClusterClusterConfigSecurityConfigKerberosConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigDiskConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig) string { if r == nil { return "" } outputConfig := "{\n" - if r.CrossRealmTrustAdminServer != nil { - outputConfig += fmt.Sprintf("\tcross_realm_trust_admin_server = %#v\n", *r.CrossRealmTrustAdminServer) - } - if r.CrossRealmTrustKdc != nil { - outputConfig += fmt.Sprintf("\tcross_realm_trust_kdc = %#v\n", *r.CrossRealmTrustKdc) + if r.BootDiskSizeGb != nil { + outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) } - if r.CrossRealmTrustRealm != nil { - outputConfig += fmt.Sprintf("\tcross_realm_trust_realm = %#v\n", *r.CrossRealmTrustRealm) + if r.BootDiskType != nil { + outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) } - if r.CrossRealmTrustSharedPassword != nil { - outputConfig += fmt.Sprintf("\tcross_realm_trust_shared_password = %#v\n", *r.CrossRealmTrustSharedPassword) + if r.NumLocalSsds != nil { + outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) } - if r.EnableKerberos != nil { - outputConfig += fmt.Sprintf("\tenable_kerberos = %#v\n", *r.EnableKerberos) + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigManagedGroupConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig) string { + if r == nil { + return "" } - if r.KdcDbKey != nil { - outputConfig += fmt.Sprintf("\tkdc_db_key = %#v\n", *r.KdcDbKey) + outputConfig := "{\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMetastoreConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig) string { + if r == nil { + return "" } - if r.KeyPassword != nil { - outputConfig += fmt.Sprintf("\tkey_password = %#v\n", *r.KeyPassword) + outputConfig := "{\n" + if r.DataprocMetastoreService != nil { + outputConfig += fmt.Sprintf("\tdataproc_metastore_service = %#v\n", *r.DataprocMetastoreService) } - if r.Keystore != nil { - outputConfig += fmt.Sprintf("\tkeystore = %#v\n", *r.Keystore) + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig) string { + if r == nil { + return "" } - if r.KeystorePassword != nil { - outputConfig += fmt.Sprintf("\tkeystore_password = %#v\n", *r.KeystorePassword) + outputConfig := "{\n" + if r.Accelerators != nil { + for _, v := range r.Accelerators { + outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsToHCL(&v)) + } } - if r.KmsKey != nil { - outputConfig += fmt.Sprintf("\tkms_key = %#v\n", *r.KmsKey) + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigToHCL(r.DiskConfig); v != "" { + outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) } - if r.Realm != nil { - outputConfig += fmt.Sprintf("\trealm = %#v\n", *r.Realm) + if r.Image != nil { + outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) } - if r.RootPrincipalPassword != nil { - outputConfig += fmt.Sprintf("\troot_principal_password = %#v\n", *r.RootPrincipalPassword) + if r.MachineType != nil { + outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) } - if r.TgtLifetimeHours != nil { - outputConfig += fmt.Sprintf("\ttgt_lifetime_hours = %#v\n", *r.TgtLifetimeHours) + if r.MinCpuPlatform != nil { + outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) } - if r.Truststore != nil { - outputConfig += fmt.Sprintf("\ttruststore = %#v\n", *r.Truststore) + if r.NumInstances != nil { + outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) } - if r.TruststorePassword != nil { - outputConfig += fmt.Sprintf("\ttruststore_password = %#v\n", *r.TruststorePassword) + if r.Preemptibility != nil { + outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSoftwareConfigToHCL(r *dataprocBeta.ClusterClusterConfigSoftwareConfig) string { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators) string { if r == nil { return "" } outputConfig := "{\n" - if r.ImageVersion != nil { - outputConfig += fmt.Sprintf("\timage_version = %#v\n", *r.ImageVersion) - } - if r.OptionalComponents != nil { - outputConfig += "\toptional_components = [" - for _, v := range r.OptionalComponents { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" + if r.AcceleratorCount != nil { + outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) } - outputConfig += "\tproperties = {" - for k, v := range r.Properties { - outputConfig += fmt.Sprintf("%v = %q, ", k, v) + if r.AcceleratorType != nil { + outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) } - outputConfig += "}\n" return outputConfig + "}" } -// EventarcTriggerBetaAsHCL returns a string representation of the specified resource in HCL. -// The generated HCL will include every settable field as a literal - that is, no -// variables, no references. This may not be the best possible representation, but -// the crucial point is that `terraform import; terraform apply` will not produce -// any changes. We do not validate that the resource specified will pass terraform -// validation unless is an object returned from the API after an Apply. -func EventarcTriggerBetaAsHCL(r eventarcBeta.Trigger, hasGAEquivalent bool) (string, error) { - outputConfig := "resource \"google_eventarc_trigger\" \"output\" {\n" +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.BootDiskSizeGb != nil { + outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) + } + if r.BootDiskType != nil { + outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) + } + if r.NumLocalSsds != nil { + outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSecurityConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigKerberosConfigToHCL(r.KerberosConfig); v != "" { + outputConfig += fmt.Sprintf("\tkerberos_config %s\n", v) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigKerberosConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.CrossRealmTrustAdminServer != nil { + outputConfig += fmt.Sprintf("\tcross_realm_trust_admin_server = %#v\n", *r.CrossRealmTrustAdminServer) + } + if r.CrossRealmTrustKdc != nil { + outputConfig += fmt.Sprintf("\tcross_realm_trust_kdc = %#v\n", *r.CrossRealmTrustKdc) + } + if r.CrossRealmTrustRealm != nil { + outputConfig += fmt.Sprintf("\tcross_realm_trust_realm = %#v\n", *r.CrossRealmTrustRealm) + } + if r.CrossRealmTrustSharedPassword != nil { + outputConfig += fmt.Sprintf("\tcross_realm_trust_shared_password = %#v\n", *r.CrossRealmTrustSharedPassword) + } + if r.EnableKerberos != nil { + outputConfig += fmt.Sprintf("\tenable_kerberos = %#v\n", *r.EnableKerberos) + } + if r.KdcDbKey != nil { + outputConfig += fmt.Sprintf("\tkdc_db_key = %#v\n", *r.KdcDbKey) + } + if r.KeyPassword != nil { + outputConfig += fmt.Sprintf("\tkey_password = %#v\n", *r.KeyPassword) + } + if r.Keystore != nil { + outputConfig += fmt.Sprintf("\tkeystore = %#v\n", *r.Keystore) + } + if r.KeystorePassword != nil { + outputConfig += fmt.Sprintf("\tkeystore_password = %#v\n", *r.KeystorePassword) + } + if r.KmsKey != nil { + outputConfig += fmt.Sprintf("\tkms_key = %#v\n", *r.KmsKey) + } + if r.Realm != nil { + outputConfig += fmt.Sprintf("\trealm = %#v\n", *r.Realm) + } + if r.RootPrincipalPassword != nil { + outputConfig += fmt.Sprintf("\troot_principal_password = %#v\n", *r.RootPrincipalPassword) + } + if r.TgtLifetimeHours != nil { + outputConfig += fmt.Sprintf("\ttgt_lifetime_hours = %#v\n", *r.TgtLifetimeHours) + } + if r.Truststore != nil { + outputConfig += fmt.Sprintf("\ttruststore = %#v\n", *r.Truststore) + } + if r.TruststorePassword != nil { + outputConfig += fmt.Sprintf("\ttruststore_password = %#v\n", *r.TruststorePassword) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSoftwareConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.ImageVersion != nil { + outputConfig += fmt.Sprintf("\timage_version = %#v\n", *r.ImageVersion) + } + if r.OptionalComponents != nil { + outputConfig += "\toptional_components = [" + for _, v := range r.OptionalComponents { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } + outputConfig += "\tproperties = {" + for k, v := range r.Properties { + outputConfig += fmt.Sprintf("%v = %q, ", k, v) + } + outputConfig += "}\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigWorkerConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Accelerators != nil { + for _, v := range r.Accelerators { + outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigAcceleratorsToHCL(&v)) + } + } + if v := convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigDiskConfigToHCL(r.DiskConfig); v != "" { + outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) + } + if r.Image != nil { + outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) + } + if r.MachineType != nil { + outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) + } + if r.MinCpuPlatform != nil { + outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) + } + if r.NumInstances != nil { + outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) + } + if r.Preemptibility != nil { + outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigAcceleratorsToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.AcceleratorCount != nil { + outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) + } + if r.AcceleratorType != nil { + outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigDiskConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.BootDiskSizeGb != nil { + outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) + } + if r.BootDiskType != nil { + outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) + } + if r.NumLocalSsds != nil { + outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigManagedGroupConfigToHCL(r *dataprocBeta.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaParametersToHCL(r *dataprocBeta.WorkflowTemplateParameters) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Fields != nil { + outputConfig += "\tfields = [" + for _, v := range r.Fields { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } + if r.Name != nil { + outputConfig += fmt.Sprintf("\tname = %#v\n", *r.Name) + } + if r.Description != nil { + outputConfig += fmt.Sprintf("\tdescription = %#v\n", *r.Description) + } + if v := convertDataprocWorkflowTemplateBetaParametersValidationToHCL(r.Validation); v != "" { + outputConfig += fmt.Sprintf("\tvalidation %s\n", v) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaParametersValidationToHCL(r *dataprocBeta.WorkflowTemplateParametersValidation) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if v := convertDataprocWorkflowTemplateBetaParametersValidationRegexToHCL(r.Regex); v != "" { + outputConfig += fmt.Sprintf("\tregex %s\n", v) + } + if v := convertDataprocWorkflowTemplateBetaParametersValidationValuesToHCL(r.Values); v != "" { + outputConfig += fmt.Sprintf("\tvalues %s\n", v) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaParametersValidationRegexToHCL(r *dataprocBeta.WorkflowTemplateParametersValidationRegex) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Regexes != nil { + outputConfig += "\tregexes = [" + for _, v := range r.Regexes { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateBetaParametersValidationValuesToHCL(r *dataprocBeta.WorkflowTemplateParametersValidationValues) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Values != nil { + outputConfig += "\tvalues = [" + for _, v := range r.Values { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } + return outputConfig + "}" +} + +// EventarcTriggerBetaAsHCL returns a string representation of the specified resource in HCL. +// The generated HCL will include every settable field as a literal - that is, no +// variables, no references. This may not be the best possible representation, but +// the crucial point is that `terraform import; terraform apply` will not produce +// any changes. We do not validate that the resource specified will pass terraform +// validation unless is an object returned from the API after an Apply. +func EventarcTriggerBetaAsHCL(r eventarcBeta.Trigger, hasGAEquivalent bool) (string, error) { + outputConfig := "resource \"google_eventarc_trigger\" \"output\" {\n" if v := convertEventarcTriggerBetaDestinationToHCL(r.Destination); v != "" { outputConfig += fmt.Sprintf("\tdestination %s\n", v) } @@ -6922,7 +7062,7 @@ func convertDataprocWorkflowTemplatePlacementManagedClusterToHCL(r *dataproc.Wor if r.ClusterName != nil { outputConfig += fmt.Sprintf("\tcluster_name = %#v\n", *r.ClusterName) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigToHCL(r.Config); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigToHCL(r.Config); v != "" { outputConfig += fmt.Sprintf("\tconfig %s\n", v) } outputConfig += "\tlabels = {" @@ -6933,179 +7073,41 @@ func convertDataprocWorkflowTemplatePlacementManagedClusterToHCL(r *dataproc.Wor return outputConfig + "}" } -func convertDataprocWorkflowTemplateParametersToHCL(r *dataproc.WorkflowTemplateParameters) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfig) string { if r == nil { return "" } outputConfig := "{\n" - if r.Fields != nil { - outputConfig += "\tfields = [" - for _, v := range r.Fields { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigToHCL(r.AutoscalingConfig); v != "" { + outputConfig += fmt.Sprintf("\tautoscaling_config %s\n", v) } - if r.Name != nil { - outputConfig += fmt.Sprintf("\tname = %#v\n", *r.Name) - } - if r.Description != nil { - outputConfig += fmt.Sprintf("\tdescription = %#v\n", *r.Description) - } - if v := convertDataprocWorkflowTemplateParametersValidationToHCL(r.Validation); v != "" { - outputConfig += fmt.Sprintf("\tvalidation %s\n", v) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateParametersValidationToHCL(r *dataproc.WorkflowTemplateParametersValidation) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateParametersValidationRegexToHCL(r.Regex); v != "" { - outputConfig += fmt.Sprintf("\tregex %s\n", v) - } - if v := convertDataprocWorkflowTemplateParametersValidationValuesToHCL(r.Values); v != "" { - outputConfig += fmt.Sprintf("\tvalues %s\n", v) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateParametersValidationRegexToHCL(r *dataproc.WorkflowTemplateParametersValidationRegex) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Regexes != nil { - outputConfig += "\tregexes = [" - for _, v := range r.Regexes { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateParametersValidationValuesToHCL(r *dataproc.WorkflowTemplateParametersValidationValues) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Values != nil { - outputConfig += "\tvalues = [" - for _, v := range r.Values { - outputConfig += fmt.Sprintf("%#v, ", v) - } - outputConfig += "]\n" - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigToHCL(r *dataproc.ClusterInstanceGroupConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.Accelerators != nil { - for _, v := range r.Accelerators { - outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplateClusterInstanceGroupConfigAcceleratorsToHCL(&v)) - } - } - if v := convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfigToHCL(r.DiskConfig); v != "" { - outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) - } - if r.Image != nil { - outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) - } - if r.MachineType != nil { - outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) - } - if r.MinCpuPlatform != nil { - outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) - } - if r.NumInstances != nil { - outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) - } - if r.Preemptibility != nil { - outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigAcceleratorsToHCL(r *dataproc.ClusterInstanceGroupConfigAccelerators) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.AcceleratorCount != nil { - outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) - } - if r.AcceleratorType != nil { - outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfigToHCL(r *dataproc.ClusterInstanceGroupConfigDiskConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if r.BootDiskSizeGb != nil { - outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) - } - if r.BootDiskType != nil { - outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) - } - if r.NumLocalSsds != nil { - outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) - } - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigManagedGroupConfigToHCL(r *dataproc.ClusterInstanceGroupConfigManagedGroupConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - return outputConfig + "}" -} - -func convertDataprocWorkflowTemplateClusterClusterConfigToHCL(r *dataproc.ClusterClusterConfig) string { - if r == nil { - return "" - } - outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfigToHCL(r.AutoscalingConfig); v != "" { - outputConfig += fmt.Sprintf("\tautoscaling_config %s\n", v) - } - if v := convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfigToHCL(r.EncryptionConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigToHCL(r.EncryptionConfig); v != "" { outputConfig += fmt.Sprintf("\tencryption_config %s\n", v) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfigToHCL(r.EndpointConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigEndpointConfigToHCL(r.EndpointConfig); v != "" { outputConfig += fmt.Sprintf("\tendpoint_config %s\n", v) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigToHCL(r.GceClusterConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigToHCL(r.GceClusterConfig); v != "" { outputConfig += fmt.Sprintf("\tgce_cluster_config %s\n", v) } if r.InitializationActions != nil { for _, v := range r.InitializationActions { - outputConfig += fmt.Sprintf("\tinitialization_actions %s\n", convertDataprocWorkflowTemplateClusterClusterConfigInitializationActionsToHCL(&v)) + outputConfig += fmt.Sprintf("\tinitialization_actions %s\n", convertDataprocWorkflowTemplatePlacementManagedClusterConfigInitializationActionsToHCL(&v)) } } - if v := convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfigToHCL(r.LifecycleConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigToHCL(r.LifecycleConfig); v != "" { outputConfig += fmt.Sprintf("\tlifecycle_config %s\n", v) } - if v := convertDataprocWorkflowTemplateClusterInstanceGroupConfigToHCL(r.MasterConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigToHCL(r.MasterConfig); v != "" { outputConfig += fmt.Sprintf("\tmaster_config %s\n", v) } - if v := convertDataprocWorkflowTemplateClusterInstanceGroupConfigToHCL(r.SecondaryWorkerConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigToHCL(r.SecondaryWorkerConfig); v != "" { outputConfig += fmt.Sprintf("\tsecondary_worker_config %s\n", v) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigToHCL(r.SecurityConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigToHCL(r.SecurityConfig); v != "" { outputConfig += fmt.Sprintf("\tsecurity_config %s\n", v) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfigToHCL(r.SoftwareConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigToHCL(r.SoftwareConfig); v != "" { outputConfig += fmt.Sprintf("\tsoftware_config %s\n", v) } if r.StagingBucket != nil { @@ -7114,13 +7116,13 @@ func convertDataprocWorkflowTemplateClusterClusterConfigToHCL(r *dataproc.Cluste if r.TempBucket != nil { outputConfig += fmt.Sprintf("\ttemp_bucket = %#v\n", *r.TempBucket) } - if v := convertDataprocWorkflowTemplateClusterInstanceGroupConfigToHCL(r.WorkerConfig); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigToHCL(r.WorkerConfig); v != "" { outputConfig += fmt.Sprintf("\tworker_config %s\n", v) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfigToHCL(r *dataproc.ClusterClusterConfigAutoscalingConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig) string { if r == nil { return "" } @@ -7131,7 +7133,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfigToHCL(r return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfigToHCL(r *dataproc.ClusterClusterConfigEncryptionConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig) string { if r == nil { return "" } @@ -7142,7 +7144,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfigToHCL(r return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfigToHCL(r *dataproc.ClusterClusterConfigEndpointConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigEndpointConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigEndpointConfig) string { if r == nil { return "" } @@ -7153,7 +7155,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfigToHCL(r *d return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigToHCL(r *dataproc.ClusterClusterConfigGceClusterConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig) string { if r == nil { return "" } @@ -7169,13 +7171,13 @@ func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigToHCL(r if r.Network != nil { outputConfig += fmt.Sprintf("\tnetwork = %#v\n", *r.Network) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r.NodeGroupAffinity); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r.NodeGroupAffinity); v != "" { outputConfig += fmt.Sprintf("\tnode_group_affinity %s\n", v) } if r.PrivateIPv6GoogleAccess != nil { outputConfig += fmt.Sprintf("\tprivate_ipv6_google_access = %#v\n", *r.PrivateIPv6GoogleAccess) } - if v := convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservationAffinityToHCL(r.ReservationAffinity); v != "" { + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinityToHCL(r.ReservationAffinity); v != "" { outputConfig += fmt.Sprintf("\treservation_affinity %s\n", v) } if r.ServiceAccount != nil { @@ -7204,7 +7206,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigToHCL(r return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r *dataproc.ClusterClusterConfigGceClusterConfigNodeGroupAffinity) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity) string { if r == nil { return "" } @@ -7215,7 +7217,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGrou return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservationAffinityToHCL(r *dataproc.ClusterClusterConfigGceClusterConfigReservationAffinity) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinityToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity) string { if r == nil { return "" } @@ -7236,7 +7238,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservat return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigInitializationActionsToHCL(r *dataproc.ClusterClusterConfigInitializationActions) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigInitializationActionsToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigInitializationActions) string { if r == nil { return "" } @@ -7250,7 +7252,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigInitializationActionsToH return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfigToHCL(r *dataproc.ClusterClusterConfigLifecycleConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig) string { if r == nil { return "" } @@ -7267,18 +7269,158 @@ func convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfigToHCL(r * return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigToHCL(r *dataproc.ClusterClusterConfigSecurityConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigMasterConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Accelerators != nil { + for _, v := range r.Accelerators { + outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsToHCL(&v)) + } + } + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigToHCL(r.DiskConfig); v != "" { + outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) + } + if r.Image != nil { + outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) + } + if r.MachineType != nil { + outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) + } + if r.MinCpuPlatform != nil { + outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) + } + if r.NumInstances != nil { + outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) + } + if r.Preemptibility != nil { + outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.AcceleratorCount != nil { + outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) + } + if r.AcceleratorType != nil { + outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.BootDiskSizeGb != nil { + outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) + } + if r.BootDiskType != nil { + outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) + } + if r.NumLocalSsds != nil { + outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Accelerators != nil { + for _, v := range r.Accelerators { + outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsToHCL(&v)) + } + } + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigToHCL(r.DiskConfig); v != "" { + outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) + } + if r.Image != nil { + outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) + } + if r.MachineType != nil { + outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) + } + if r.MinCpuPlatform != nil { + outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) + } + if r.NumInstances != nil { + outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) + } + if r.Preemptibility != nil { + outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators) string { if r == nil { return "" } outputConfig := "{\n" - if v := convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosConfigToHCL(r.KerberosConfig); v != "" { + if r.AcceleratorCount != nil { + outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) + } + if r.AcceleratorType != nil { + outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.BootDiskSizeGb != nil { + outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) + } + if r.BootDiskType != nil { + outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) + } + if r.NumLocalSsds != nil { + outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSecurityConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigToHCL(r.KerberosConfig); v != "" { outputConfig += fmt.Sprintf("\tkerberos_config %s\n", v) } return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosConfigToHCL(r *dataproc.ClusterClusterConfigSecurityConfigKerberosConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig) string { if r == nil { return "" } @@ -7331,7 +7473,7 @@ func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosCo return outputConfig + "}" } -func convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfigToHCL(r *dataproc.ClusterClusterConfigSoftwareConfig) string { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig) string { if r == nil { return "" } @@ -7346,11 +7488,149 @@ func convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfigToHCL(r *d } outputConfig += "]\n" } - outputConfig += "\tproperties = {" - for k, v := range r.Properties { - outputConfig += fmt.Sprintf("%v = %q, ", k, v) - } - outputConfig += "}\n" + outputConfig += "\tproperties = {" + for k, v := range r.Properties { + outputConfig += fmt.Sprintf("%v = %q, ", k, v) + } + outputConfig += "}\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigWorkerConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Accelerators != nil { + for _, v := range r.Accelerators { + outputConfig += fmt.Sprintf("\taccelerators %s\n", convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsToHCL(&v)) + } + } + if v := convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigToHCL(r.DiskConfig); v != "" { + outputConfig += fmt.Sprintf("\tdisk_config %s\n", v) + } + if r.Image != nil { + outputConfig += fmt.Sprintf("\timage = %#v\n", *r.Image) + } + if r.MachineType != nil { + outputConfig += fmt.Sprintf("\tmachine_type = %#v\n", *r.MachineType) + } + if r.MinCpuPlatform != nil { + outputConfig += fmt.Sprintf("\tmin_cpu_platform = %#v\n", *r.MinCpuPlatform) + } + if r.NumInstances != nil { + outputConfig += fmt.Sprintf("\tnum_instances = %#v\n", *r.NumInstances) + } + if r.Preemptibility != nil { + outputConfig += fmt.Sprintf("\tpreemptibility = %#v\n", *r.Preemptibility) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.AcceleratorCount != nil { + outputConfig += fmt.Sprintf("\taccelerator_count = %#v\n", *r.AcceleratorCount) + } + if r.AcceleratorType != nil { + outputConfig += fmt.Sprintf("\taccelerator_type = %#v\n", *r.AcceleratorType) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.BootDiskSizeGb != nil { + outputConfig += fmt.Sprintf("\tboot_disk_size_gb = %#v\n", *r.BootDiskSizeGb) + } + if r.BootDiskType != nil { + outputConfig += fmt.Sprintf("\tboot_disk_type = %#v\n", *r.BootDiskType) + } + if r.NumLocalSsds != nil { + outputConfig += fmt.Sprintf("\tnum_local_ssds = %#v\n", *r.NumLocalSsds) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigToHCL(r *dataproc.WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig) string { + if r == nil { + return "" + } + outputConfig := "{\n" + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateParametersToHCL(r *dataproc.WorkflowTemplateParameters) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Fields != nil { + outputConfig += "\tfields = [" + for _, v := range r.Fields { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } + if r.Name != nil { + outputConfig += fmt.Sprintf("\tname = %#v\n", *r.Name) + } + if r.Description != nil { + outputConfig += fmt.Sprintf("\tdescription = %#v\n", *r.Description) + } + if v := convertDataprocWorkflowTemplateParametersValidationToHCL(r.Validation); v != "" { + outputConfig += fmt.Sprintf("\tvalidation %s\n", v) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateParametersValidationToHCL(r *dataproc.WorkflowTemplateParametersValidation) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if v := convertDataprocWorkflowTemplateParametersValidationRegexToHCL(r.Regex); v != "" { + outputConfig += fmt.Sprintf("\tregex %s\n", v) + } + if v := convertDataprocWorkflowTemplateParametersValidationValuesToHCL(r.Values); v != "" { + outputConfig += fmt.Sprintf("\tvalues %s\n", v) + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateParametersValidationRegexToHCL(r *dataproc.WorkflowTemplateParametersValidationRegex) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Regexes != nil { + outputConfig += "\tregexes = [" + for _, v := range r.Regexes { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } + return outputConfig + "}" +} + +func convertDataprocWorkflowTemplateParametersValidationValuesToHCL(r *dataproc.WorkflowTemplateParametersValidationValues) string { + if r == nil { + return "" + } + outputConfig := "{\n" + if r.Values != nil { + outputConfig += "\tvalues = [" + for _, v := range r.Values { + outputConfig += fmt.Sprintf("%#v, ", v) + } + outputConfig += "]\n" + } return outputConfig + "}" } @@ -10586,7 +10866,7 @@ func convertDataprocWorkflowTemplateBetaPlacementManagedCluster(i interface{}) m in := i.(map[string]interface{}) return map[string]interface{}{ "clusterName": in["cluster_name"], - "config": convertDataprocWorkflowTemplateBetaClusterClusterConfig(in["config"]), + "config": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfig(in["config"]), "labels": in["labels"], } } @@ -10602,102 +10882,277 @@ func convertDataprocWorkflowTemplateBetaPlacementManagedClusterList(i interface{ return out } -func convertDataprocWorkflowTemplateBetaParameters(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "fields": in["fields"], - "name": in["name"], - "description": in["description"], - "validation": convertDataprocWorkflowTemplateBetaParametersValidation(in["validation"]), + "autoscalingConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigAutoscalingConfig(in["autoscaling_config"]), + "encryptionConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEncryptionConfig(in["encryption_config"]), + "endpointConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEndpointConfig(in["endpoint_config"]), + "gceClusterConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfig(in["gce_cluster_config"]), + "gkeClusterConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfig(in["gke_cluster_config"]), + "initializationActions": in["initialization_actions"], + "lifecycleConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigLifecycleConfig(in["lifecycle_config"]), + "masterConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfig(in["master_config"]), + "metastoreConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMetastoreConfig(in["metastore_config"]), + "secondaryWorkerConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfig(in["secondary_worker_config"]), + "securityConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfig(in["security_config"]), + "softwareConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSoftwareConfig(in["software_config"]), + "stagingBucket": in["staging_bucket"], + "tempBucket": in["temp_bucket"], + "workerConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfig(in["worker_config"]), } } -func convertDataprocWorkflowTemplateBetaParametersList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaParameters(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaParametersValidation(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigAutoscalingConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "regex": convertDataprocWorkflowTemplateBetaParametersValidationRegex(in["regex"]), - "values": convertDataprocWorkflowTemplateBetaParametersValidationValues(in["values"]), + "policy": in["policy"], } } -func convertDataprocWorkflowTemplateBetaParametersValidationList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigAutoscalingConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaParametersValidation(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigAutoscalingConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaParametersValidationRegex(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEncryptionConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "regexes": in["regexes"], + "gcePdKmsKeyName": in["gce_pd_kms_key_name"], } } -func convertDataprocWorkflowTemplateBetaParametersValidationRegexList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEncryptionConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaParametersValidationRegex(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEncryptionConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaParametersValidationValues(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEndpointConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "values": in["values"], + "enableHttpPortAccess": in["enable_http_port_access"], + "httpPorts": in["http_ports"], } } -func convertDataprocWorkflowTemplateBetaParametersValidationValuesList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEndpointConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaParametersValidationValues(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigEndpointConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfig(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "internalIPOnly": in["internal_ip_only"], + "metadata": in["metadata"], + "network": in["network"], + "nodeGroupAffinity": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(in["node_group_affinity"]), + "privateIPv6GoogleAccess": in["private_ipv6_google_access"], + "reservationAffinity": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigReservationAffinity(in["reservation_affinity"]), + "serviceAccount": in["service_account"], + "serviceAccountScopes": in["service_account_scopes"], + "subnetwork": in["subnetwork"], + "tags": in["tags"], + "zone": in["zone"], + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "nodeGroup": in["node_group"], + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigReservationAffinity(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "consumeReservationType": in["consume_reservation_type"], + "key": in["key"], + "values": in["values"], + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigReservationAffinityList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGceClusterConfigReservationAffinity(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfig(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "namespacedGkeDeploymentTarget": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(in["namespaced_gke_deployment_target"]), + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "clusterNamespace": in["cluster_namespace"], + "targetGkeCluster": in["target_gke_cluster"], + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigInitializationActions(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "executableFile": in["executable_file"], + "executionTimeout": in["execution_timeout"], + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigInitializationActionsList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigInitializationActions(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigLifecycleConfig(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "autoDeleteTime": in["auto_delete_time"], + "autoDeleteTtl": in["auto_delete_ttl"], + "idleDeleteTtl": in["idle_delete_ttl"], + "idleStartTime": in["idle_start_time"], + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigLifecycleConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigLifecycleConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ "accelerators": in["accelerators"], - "diskConfig": convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfig(in["disk_config"]), + "diskConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigDiskConfig(in["disk_config"]), "image": in["image"], "machineType": in["machine_type"], "minCpuPlatform": in["min_cpu_platform"], @@ -10705,22 +11160,22 @@ func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfig(i interface{} "preemptibility": in["preemptibility"], "instanceNames": in["instance_names"], "isPreemptible": in["is_preemptible"], - "managedGroupConfig": convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigManagedGroupConfig(in["managed_group_config"]), + "managedGroupConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigManagedGroupConfig(in["managed_group_config"]), } } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigAccelerators(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigAccelerators(i interface{}) map[string]interface{} { if i == nil { return nil } @@ -10731,18 +11186,18 @@ func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigAccelerators(i } } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigAccelerators(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigAccelerators(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigDiskConfig(i interface{}) map[string]interface{} { if i == nil { return nil } @@ -10754,18 +11209,18 @@ func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfig(i i } } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigDiskConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigDiskConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigManagedGroupConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigManagedGroupConfig(i interface{}) map[string]interface{} { if i == nil { return nil } @@ -10776,376 +11231,395 @@ func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigManagedGroupCo } } -func convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfigManagedGroupConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMasterConfigManagedGroupConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMetastoreConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "autoscalingConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfig(in["autoscaling_config"]), - "encryptionConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfig(in["encryption_config"]), - "endpointConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfig(in["endpoint_config"]), - "gceClusterConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfig(in["gce_cluster_config"]), - "gkeClusterConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfig(in["gke_cluster_config"]), - "initializationActions": in["initialization_actions"], - "lifecycleConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfig(in["lifecycle_config"]), - "masterConfig": convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfig(in["master_config"]), - "metastoreConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigMetastoreConfig(in["metastore_config"]), - "secondaryWorkerConfig": convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfig(in["secondary_worker_config"]), - "securityConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfig(in["security_config"]), - "softwareConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigSoftwareConfig(in["software_config"]), - "stagingBucket": in["staging_bucket"], - "tempBucket": in["temp_bucket"], - "workerConfig": convertDataprocWorkflowTemplateBetaClusterInstanceGroupConfig(in["worker_config"]), + "dataprocMetastoreService": in["dataproc_metastore_service"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMetastoreConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigMetastoreConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "policy": in["policy"], + "accelerators": in["accelerators"], + "diskConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(in["disk_config"]), + "image": in["image"], + "machineType": in["machine_type"], + "minCpuPlatform": in["min_cpu_platform"], + "numInstances": in["num_instances"], + "preemptibility": in["preemptibility"], + "instanceNames": in["instance_names"], + "isPreemptible": in["is_preemptible"], + "managedGroupConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(in["managed_group_config"]), } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigAutoscalingConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "gcePdKmsKeyName": in["gce_pd_kms_key_name"], + "acceleratorCount": in["accelerator_count"], + "acceleratorType": in["accelerator_type"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigEncryptionConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "enableHttpPortAccess": in["enable_http_port_access"], - "httpPorts": in["http_ports"], + "bootDiskSizeGb": in["boot_disk_size_gb"], + "bootDiskType": in["boot_disk_type"], + "numLocalSsds": in["num_local_ssds"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigEndpointConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "internalIPOnly": in["internal_ip_only"], - "metadata": in["metadata"], - "network": in["network"], - "nodeGroupAffinity": convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNodeGroupAffinity(in["node_group_affinity"]), - "privateIPv6GoogleAccess": in["private_ipv6_google_access"], - "reservationAffinity": convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigReservationAffinity(in["reservation_affinity"]), - "serviceAccount": in["service_account"], - "serviceAccountScopes": in["service_account_scopes"], - "subnetwork": in["subnetwork"], - "tags": in["tags"], - "zone": in["zone"], + "instanceGroupManagerName": in["instance_group_manager_name"], + "instanceTemplateName": in["instance_template_name"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNodeGroupAffinity(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "nodeGroup": in["node_group"], + "kerberosConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigKerberosConfig(in["kerberos_config"]), } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNodeGroupAffinityList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigNodeGroupAffinity(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigReservationAffinity(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigKerberosConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "consumeReservationType": in["consume_reservation_type"], - "key": in["key"], - "values": in["values"], + "crossRealmTrustAdminServer": in["cross_realm_trust_admin_server"], + "crossRealmTrustKdc": in["cross_realm_trust_kdc"], + "crossRealmTrustRealm": in["cross_realm_trust_realm"], + "crossRealmTrustSharedPassword": in["cross_realm_trust_shared_password"], + "enableKerberos": in["enable_kerberos"], + "kdcDbKey": in["kdc_db_key"], + "keyPassword": in["key_password"], + "keystore": in["keystore"], + "keystorePassword": in["keystore_password"], + "kmsKey": in["kms_key"], + "realm": in["realm"], + "rootPrincipalPassword": in["root_principal_password"], + "tgtLifetimeHours": in["tgt_lifetime_hours"], + "truststore": in["truststore"], + "truststorePassword": in["truststore_password"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigReservationAffinityList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigKerberosConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigGceClusterConfigReservationAffinity(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSecurityConfigKerberosConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSoftwareConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "namespacedGkeDeploymentTarget": convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(in["namespaced_gke_deployment_target"]), + "imageVersion": in["image_version"], + "optionalComponents": in["optional_components"], + "properties": in["properties"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSoftwareConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigSoftwareConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "clusterNamespace": in["cluster_namespace"], - "targetGkeCluster": in["target_gke_cluster"], + "accelerators": in["accelerators"], + "diskConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigDiskConfig(in["disk_config"]), + "image": in["image"], + "machineType": in["machine_type"], + "minCpuPlatform": in["min_cpu_platform"], + "numInstances": in["num_instances"], + "preemptibility": in["preemptibility"], + "instanceNames": in["instance_names"], + "isPreemptible": in["is_preemptible"], + "managedGroupConfig": convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigManagedGroupConfig(in["managed_group_config"]), + } +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigAccelerators(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "acceleratorCount": in["accelerator_count"], + "acceleratorType": in["accelerator_type"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigAccelerators(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigInitializationActions(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigDiskConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "executableFile": in["executable_file"], - "executionTimeout": in["execution_timeout"], + "bootDiskSizeGb": in["boot_disk_size_gb"], + "bootDiskType": in["boot_disk_type"], + "numLocalSsds": in["num_local_ssds"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigInitializationActionsList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigInitializationActions(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigDiskConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigManagedGroupConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "autoDeleteTime": in["auto_delete_time"], - "autoDeleteTtl": in["auto_delete_ttl"], - "idleDeleteTtl": in["idle_delete_ttl"], - "idleStartTime": in["idle_start_time"], + "instanceGroupManagerName": in["instance_group_manager_name"], + "instanceTemplateName": in["instance_template_name"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigLifecycleConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaPlacementManagedClusterConfigWorkerConfigManagedGroupConfig(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigMetastoreConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaParameters(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "dataprocMetastoreService": in["dataproc_metastore_service"], + "fields": in["fields"], + "name": in["name"], + "description": in["description"], + "validation": convertDataprocWorkflowTemplateBetaParametersValidation(in["validation"]), } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigMetastoreConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaParametersList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigMetastoreConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaParameters(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaParametersValidation(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "kerberosConfig": convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigKerberosConfig(in["kerberos_config"]), + "regex": convertDataprocWorkflowTemplateBetaParametersValidationRegex(in["regex"]), + "values": convertDataprocWorkflowTemplateBetaParametersValidationValues(in["values"]), } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaParametersValidationList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaParametersValidation(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigKerberosConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaParametersValidationRegex(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "crossRealmTrustAdminServer": in["cross_realm_trust_admin_server"], - "crossRealmTrustKdc": in["cross_realm_trust_kdc"], - "crossRealmTrustRealm": in["cross_realm_trust_realm"], - "crossRealmTrustSharedPassword": in["cross_realm_trust_shared_password"], - "enableKerberos": in["enable_kerberos"], - "kdcDbKey": in["kdc_db_key"], - "keyPassword": in["key_password"], - "keystore": in["keystore"], - "keystorePassword": in["keystore_password"], - "kmsKey": in["kms_key"], - "realm": in["realm"], - "rootPrincipalPassword": in["root_principal_password"], - "tgtLifetimeHours": in["tgt_lifetime_hours"], - "truststore": in["truststore"], - "truststorePassword": in["truststore_password"], + "regexes": in["regexes"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigKerberosConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaParametersValidationRegexList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigSecurityConfigKerberosConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaParametersValidationRegex(v)) } return out } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSoftwareConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateBetaParametersValidationValues(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "imageVersion": in["image_version"], - "optionalComponents": in["optional_components"], - "properties": in["properties"], + "values": in["values"], } } -func convertDataprocWorkflowTemplateBetaClusterClusterConfigSoftwareConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateBetaParametersValidationValuesList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateBetaClusterClusterConfigSoftwareConfig(v)) + out = append(out, convertDataprocWorkflowTemplateBetaParametersValidationValues(v)) } return out } @@ -14483,366 +14957,593 @@ func convertDataprocWorkflowTemplateJobsPysparkJobLoggingConfig(i interface{}) m } } -func convertDataprocWorkflowTemplateJobsPysparkJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateJobsPysparkJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsPysparkJobLoggingConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsScheduling(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "maxFailuresPerHour": in["max_failures_per_hour"], + "maxFailuresTotal": in["max_failures_total"], + } +} + +func convertDataprocWorkflowTemplateJobsSchedulingList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsScheduling(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkJob(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "archiveUris": in["archive_uris"], + "args": in["args"], + "fileUris": in["file_uris"], + "jarFileUris": in["jar_file_uris"], + "loggingConfig": convertDataprocWorkflowTemplateJobsSparkJobLoggingConfig(in["logging_config"]), + "mainClass": in["main_class"], + "mainJarFileUri": in["main_jar_file_uri"], + "properties": in["properties"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkJobList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkJob(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkJobLoggingConfig(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "driverLogLevels": in["driver_log_levels"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkJobLoggingConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkRJob(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "mainRFileUri": in["main_r_file_uri"], + "archiveUris": in["archive_uris"], + "args": in["args"], + "fileUris": in["file_uris"], + "loggingConfig": convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfig(in["logging_config"]), + "properties": in["properties"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkRJobList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkRJob(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfig(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "driverLogLevels": in["driver_log_levels"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkSqlJob(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "jarFileUris": in["jar_file_uris"], + "loggingConfig": convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfig(in["logging_config"]), + "properties": in["properties"], + "queryFileUri": in["query_file_uri"], + "queryList": convertDataprocWorkflowTemplateJobsSparkSqlJobQueryList(in["query_list"]), + "scriptVariables": in["script_variables"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkSqlJobList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkSqlJob(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfig(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "driverLogLevels": in["driver_log_levels"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfig(v)) + } + return out +} + +func convertDataprocWorkflowTemplateJobsSparkSqlJobQueryList(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "queries": in["queries"], + } +} + +func convertDataprocWorkflowTemplateJobsSparkSqlJobQueryListList(i interface{}) (out []map[string]interface{}) { + if i == nil { + return nil + } + + for _, v := range i.([]interface{}) { + out = append(out, convertDataprocWorkflowTemplateJobsSparkSqlJobQueryList(v)) + } + return out +} + +func convertDataprocWorkflowTemplatePlacement(i interface{}) map[string]interface{} { + if i == nil { + return nil + } + in := i.(map[string]interface{}) + return map[string]interface{}{ + "clusterSelector": convertDataprocWorkflowTemplatePlacementClusterSelector(in["cluster_selector"]), + "managedCluster": convertDataprocWorkflowTemplatePlacementManagedCluster(in["managed_cluster"]), + } +} + +func convertDataprocWorkflowTemplatePlacementList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsPysparkJobLoggingConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacement(v)) } return out } -func convertDataprocWorkflowTemplateJobsScheduling(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementClusterSelector(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "maxFailuresPerHour": in["max_failures_per_hour"], - "maxFailuresTotal": in["max_failures_total"], + "clusterLabels": in["cluster_labels"], + "zone": in["zone"], } } -func convertDataprocWorkflowTemplateJobsSchedulingList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementClusterSelectorList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsScheduling(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementClusterSelector(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkJob(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedCluster(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "archiveUris": in["archive_uris"], - "args": in["args"], - "fileUris": in["file_uris"], - "jarFileUris": in["jar_file_uris"], - "loggingConfig": convertDataprocWorkflowTemplateJobsSparkJobLoggingConfig(in["logging_config"]), - "mainClass": in["main_class"], - "mainJarFileUri": in["main_jar_file_uri"], - "properties": in["properties"], + "clusterName": in["cluster_name"], + "config": convertDataprocWorkflowTemplatePlacementManagedClusterConfig(in["config"]), + "labels": in["labels"], } } -func convertDataprocWorkflowTemplateJobsSparkJobList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkJob(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedCluster(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkJobLoggingConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "driverLogLevels": in["driver_log_levels"], + "autoscalingConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig(in["autoscaling_config"]), + "encryptionConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigEncryptionConfig(in["encryption_config"]), + "endpointConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigEndpointConfig(in["endpoint_config"]), + "gceClusterConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfig(in["gce_cluster_config"]), + "initializationActions": in["initialization_actions"], + "lifecycleConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig(in["lifecycle_config"]), + "masterConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfig(in["master_config"]), + "secondaryWorkerConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig(in["secondary_worker_config"]), + "securityConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfig(in["security_config"]), + "softwareConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigSoftwareConfig(in["software_config"]), + "stagingBucket": in["staging_bucket"], + "tempBucket": in["temp_bucket"], + "workerConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfig(in["worker_config"]), } } -func convertDataprocWorkflowTemplateJobsSparkJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkJobLoggingConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfig(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkRJob(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "mainRFileUri": in["main_r_file_uri"], - "archiveUris": in["archive_uris"], - "args": in["args"], - "fileUris": in["file_uris"], - "loggingConfig": convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfig(in["logging_config"]), - "properties": in["properties"], + "policy": in["policy"], } } -func convertDataprocWorkflowTemplateJobsSparkRJobList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkRJob(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigEncryptionConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "driverLogLevels": in["driver_log_levels"], + "gcePdKmsKeyName": in["gce_pd_kms_key_name"], } } -func convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkRJobLoggingConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigEncryptionConfig(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkSqlJob(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigEndpointConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "jarFileUris": in["jar_file_uris"], - "loggingConfig": convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfig(in["logging_config"]), - "properties": in["properties"], - "queryFileUri": in["query_file_uri"], - "queryList": convertDataprocWorkflowTemplateJobsSparkSqlJobQueryList(in["query_list"]), - "scriptVariables": in["script_variables"], + "enableHttpPortAccess": in["enable_http_port_access"], + "httpPorts": in["http_ports"], } } -func convertDataprocWorkflowTemplateJobsSparkSqlJobList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigEndpointConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkSqlJob(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigEndpointConfig(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "driverLogLevels": in["driver_log_levels"], + "internalIPOnly": in["internal_ip_only"], + "metadata": in["metadata"], + "network": in["network"], + "nodeGroupAffinity": convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(in["node_group_affinity"]), + "privateIPv6GoogleAccess": in["private_ipv6_google_access"], + "reservationAffinity": convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity(in["reservation_affinity"]), + "serviceAccount": in["service_account"], + "serviceAccountScopes": in["service_account_scopes"], + "subnetwork": in["subnetwork"], + "tags": in["tags"], + "zone": in["zone"], } } -func convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkSqlJobLoggingConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfig(v)) } return out } -func convertDataprocWorkflowTemplateJobsSparkSqlJobQueryList(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "queries": in["queries"], + "nodeGroup": in["node_group"], } } -func convertDataprocWorkflowTemplateJobsSparkSqlJobQueryListList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateJobsSparkSqlJobQueryList(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(v)) } return out } -func convertDataprocWorkflowTemplatePlacement(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "clusterSelector": convertDataprocWorkflowTemplatePlacementClusterSelector(in["cluster_selector"]), - "managedCluster": convertDataprocWorkflowTemplatePlacementManagedCluster(in["managed_cluster"]), + "consumeReservationType": in["consume_reservation_type"], + "key": in["key"], + "values": in["values"], } } -func convertDataprocWorkflowTemplatePlacementList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinityList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplatePlacement(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity(v)) } return out } -func convertDataprocWorkflowTemplatePlacementClusterSelector(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigInitializationActions(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "clusterLabels": in["cluster_labels"], - "zone": in["zone"], + "executableFile": in["executable_file"], + "executionTimeout": in["execution_timeout"], } } -func convertDataprocWorkflowTemplatePlacementClusterSelectorList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigInitializationActionsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplatePlacementClusterSelector(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigInitializationActions(v)) } return out } -func convertDataprocWorkflowTemplatePlacementManagedCluster(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "clusterName": in["cluster_name"], - "config": convertDataprocWorkflowTemplateClusterClusterConfig(in["config"]), - "labels": in["labels"], + "autoDeleteTime": in["auto_delete_time"], + "autoDeleteTtl": in["auto_delete_ttl"], + "idleDeleteTtl": in["idle_delete_ttl"], + "idleStartTime": in["idle_start_time"], } } -func convertDataprocWorkflowTemplatePlacementManagedClusterList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplatePlacementManagedCluster(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig(v)) } return out } -func convertDataprocWorkflowTemplateParameters(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "fields": in["fields"], - "name": in["name"], - "description": in["description"], - "validation": convertDataprocWorkflowTemplateParametersValidation(in["validation"]), + "accelerators": in["accelerators"], + "diskConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig(in["disk_config"]), + "image": in["image"], + "machineType": in["machine_type"], + "minCpuPlatform": in["min_cpu_platform"], + "numInstances": in["num_instances"], + "preemptibility": in["preemptibility"], + "instanceNames": in["instance_names"], + "isPreemptible": in["is_preemptible"], + "managedGroupConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig(in["managed_group_config"]), } } -func convertDataprocWorkflowTemplateParametersList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateParameters(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfig(v)) } return out } -func convertDataprocWorkflowTemplateParametersValidation(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "regex": convertDataprocWorkflowTemplateParametersValidationRegex(in["regex"]), - "values": convertDataprocWorkflowTemplateParametersValidationValues(in["values"]), + "acceleratorCount": in["accelerator_count"], + "acceleratorType": in["accelerator_type"], } } -func convertDataprocWorkflowTemplateParametersValidationList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateParametersValidation(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators(v)) } return out } -func convertDataprocWorkflowTemplateParametersValidationRegex(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "regexes": in["regexes"], + "bootDiskSizeGb": in["boot_disk_size_gb"], + "bootDiskType": in["boot_disk_type"], + "numLocalSsds": in["num_local_ssds"], } } -func convertDataprocWorkflowTemplateParametersValidationRegexList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateParametersValidationRegex(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig(v)) } return out } -func convertDataprocWorkflowTemplateParametersValidationValues(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "values": in["values"], + "instanceGroupManagerName": in["instance_group_manager_name"], + "instanceTemplateName": in["instance_template_name"], } } -func convertDataprocWorkflowTemplateParametersValidationValuesList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateParametersValidationValues(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ "accelerators": in["accelerators"], - "diskConfig": convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfig(in["disk_config"]), + "diskConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(in["disk_config"]), "image": in["image"], "machineType": in["machine_type"], "minCpuPlatform": in["min_cpu_platform"], @@ -14850,22 +15551,22 @@ func convertDataprocWorkflowTemplateClusterInstanceGroupConfig(i interface{}) ma "preemptibility": in["preemptibility"], "instanceNames": in["instance_names"], "isPreemptible": in["is_preemptible"], - "managedGroupConfig": convertDataprocWorkflowTemplateClusterInstanceGroupConfigManagedGroupConfig(in["managed_group_config"]), + "managedGroupConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(in["managed_group_config"]), } } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterInstanceGroupConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigAccelerators(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(i interface{}) map[string]interface{} { if i == nil { return nil } @@ -14876,18 +15577,18 @@ func convertDataprocWorkflowTemplateClusterInstanceGroupConfigAccelerators(i int } } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterInstanceGroupConfigAccelerators(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(v)) } return out } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(i interface{}) map[string]interface{} { if i == nil { return nil } @@ -14899,18 +15600,18 @@ func convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfig(i inter } } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterInstanceGroupConfigDiskConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigManagedGroupConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(i interface{}) map[string]interface{} { if i == nil { return nil } @@ -14921,310 +15622,277 @@ func convertDataprocWorkflowTemplateClusterInstanceGroupConfigManagedGroupConfig } } -func convertDataprocWorkflowTemplateClusterInstanceGroupConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { - if i == nil { - return nil - } - - for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterInstanceGroupConfigManagedGroupConfig(v)) - } - return out -} - -func convertDataprocWorkflowTemplateClusterClusterConfig(i interface{}) map[string]interface{} { - if i == nil { - return nil - } - in := i.(map[string]interface{}) - return map[string]interface{}{ - "autoscalingConfig": convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfig(in["autoscaling_config"]), - "encryptionConfig": convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfig(in["encryption_config"]), - "endpointConfig": convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfig(in["endpoint_config"]), - "gceClusterConfig": convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfig(in["gce_cluster_config"]), - "initializationActions": in["initialization_actions"], - "lifecycleConfig": convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfig(in["lifecycle_config"]), - "masterConfig": convertDataprocWorkflowTemplateClusterInstanceGroupConfig(in["master_config"]), - "secondaryWorkerConfig": convertDataprocWorkflowTemplateClusterInstanceGroupConfig(in["secondary_worker_config"]), - "securityConfig": convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfig(in["security_config"]), - "softwareConfig": convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfig(in["software_config"]), - "stagingBucket": in["staging_bucket"], - "tempBucket": in["temp_bucket"], - "workerConfig": convertDataprocWorkflowTemplateClusterInstanceGroupConfig(in["worker_config"]), - } -} - -func convertDataprocWorkflowTemplateClusterClusterConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "policy": in["policy"], + "kerberosConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig(in["kerberos_config"]), } } -func convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigAutoscalingConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "gcePdKmsKeyName": in["gce_pd_kms_key_name"], + "crossRealmTrustAdminServer": in["cross_realm_trust_admin_server"], + "crossRealmTrustKdc": in["cross_realm_trust_kdc"], + "crossRealmTrustRealm": in["cross_realm_trust_realm"], + "crossRealmTrustSharedPassword": in["cross_realm_trust_shared_password"], + "enableKerberos": in["enable_kerberos"], + "kdcDbKey": in["kdc_db_key"], + "keyPassword": in["key_password"], + "keystore": in["keystore"], + "keystorePassword": in["keystore_password"], + "kmsKey": in["kms_key"], + "realm": in["realm"], + "rootPrincipalPassword": in["root_principal_password"], + "tgtLifetimeHours": in["tgt_lifetime_hours"], + "truststore": in["truststore"], + "truststorePassword": in["truststore_password"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigEncryptionConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSoftwareConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "enableHttpPortAccess": in["enable_http_port_access"], - "httpPorts": in["http_ports"], + "imageVersion": in["image_version"], + "optionalComponents": in["optional_components"], + "properties": in["properties"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigEndpointConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigSoftwareConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "internalIPOnly": in["internal_ip_only"], - "metadata": in["metadata"], - "network": in["network"], - "nodeGroupAffinity": convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGroupAffinity(in["node_group_affinity"]), - "privateIPv6GoogleAccess": in["private_ipv6_google_access"], - "reservationAffinity": convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservationAffinity(in["reservation_affinity"]), - "serviceAccount": in["service_account"], - "serviceAccountScopes": in["service_account_scopes"], - "subnetwork": in["subnetwork"], - "tags": in["tags"], - "zone": in["zone"], + "accelerators": in["accelerators"], + "diskConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig(in["disk_config"]), + "image": in["image"], + "machineType": in["machine_type"], + "minCpuPlatform": in["min_cpu_platform"], + "numInstances": in["num_instances"], + "preemptibility": in["preemptibility"], + "instanceNames": in["instance_names"], + "isPreemptible": in["is_preemptible"], + "managedGroupConfig": convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig(in["managed_group_config"]), } } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfig(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGroupAffinity(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "nodeGroup": in["node_group"], + "acceleratorCount": in["accelerator_count"], + "acceleratorType": in["accelerator_type"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGroupAffinityList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigNodeGroupAffinity(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservationAffinity(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "consumeReservationType": in["consume_reservation_type"], - "key": in["key"], - "values": in["values"], + "bootDiskSizeGb": in["boot_disk_size_gb"], + "bootDiskType": in["boot_disk_type"], + "numLocalSsds": in["num_local_ssds"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservationAffinityList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservationAffinity(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigInitializationActions(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "executableFile": in["executable_file"], - "executionTimeout": in["execution_timeout"], + "instanceGroupManagerName": in["instance_group_manager_name"], + "instanceTemplateName": in["instance_template_name"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigInitializationActionsList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigInitializationActions(v)) + out = append(out, convertDataprocWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateParameters(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "autoDeleteTime": in["auto_delete_time"], - "autoDeleteTtl": in["auto_delete_ttl"], - "idleDeleteTtl": in["idle_delete_ttl"], - "idleStartTime": in["idle_start_time"], + "fields": in["fields"], + "name": in["name"], + "description": in["description"], + "validation": convertDataprocWorkflowTemplateParametersValidation(in["validation"]), } } -func convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateParametersList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigLifecycleConfig(v)) + out = append(out, convertDataprocWorkflowTemplateParameters(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateParametersValidation(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "kerberosConfig": convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosConfig(in["kerberos_config"]), + "regex": convertDataprocWorkflowTemplateParametersValidationRegex(in["regex"]), + "values": convertDataprocWorkflowTemplateParametersValidationValues(in["values"]), } } -func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateParametersValidationList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfig(v)) + out = append(out, convertDataprocWorkflowTemplateParametersValidation(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateParametersValidationRegex(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "crossRealmTrustAdminServer": in["cross_realm_trust_admin_server"], - "crossRealmTrustKdc": in["cross_realm_trust_kdc"], - "crossRealmTrustRealm": in["cross_realm_trust_realm"], - "crossRealmTrustSharedPassword": in["cross_realm_trust_shared_password"], - "enableKerberos": in["enable_kerberos"], - "kdcDbKey": in["kdc_db_key"], - "keyPassword": in["key_password"], - "keystore": in["keystore"], - "keystorePassword": in["keystore_password"], - "kmsKey": in["kms_key"], - "realm": in["realm"], - "rootPrincipalPassword": in["root_principal_password"], - "tgtLifetimeHours": in["tgt_lifetime_hours"], - "truststore": in["truststore"], - "truststorePassword": in["truststore_password"], + "regexes": in["regexes"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateParametersValidationRegexList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigSecurityConfigKerberosConfig(v)) + out = append(out, convertDataprocWorkflowTemplateParametersValidationRegex(v)) } return out } -func convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfig(i interface{}) map[string]interface{} { +func convertDataprocWorkflowTemplateParametersValidationValues(i interface{}) map[string]interface{} { if i == nil { return nil } in := i.(map[string]interface{}) return map[string]interface{}{ - "imageVersion": in["image_version"], - "optionalComponents": in["optional_components"], - "properties": in["properties"], + "values": in["values"], } } -func convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfigList(i interface{}) (out []map[string]interface{}) { +func convertDataprocWorkflowTemplateParametersValidationValuesList(i interface{}) (out []map[string]interface{}) { if i == nil { return nil } for _, v := range i.([]interface{}) { - out = append(out, convertDataprocWorkflowTemplateClusterClusterConfigSoftwareConfig(v)) + out = append(out, convertDataprocWorkflowTemplateParametersValidationValues(v)) } return out }