From 48418c886b7e396fe10156118f29323aa29dcd56 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 8 Jan 2025 17:14:36 +0100 Subject: [PATCH 1/6] apply schema customizations through AttributeBuilders --- .../pluginfw/tfschema/struct_to_schema.go | 27 ++++++++----------- .../tfschema/struct_to_schema_test.go | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/internal/providers/pluginfw/tfschema/struct_to_schema.go b/internal/providers/pluginfw/tfschema/struct_to_schema.go index f3a80976c..9a26dca10 100644 --- a/internal/providers/pluginfw/tfschema/struct_to_schema.go +++ b/internal/providers/pluginfw/tfschema/struct_to_schema.go @@ -18,7 +18,7 @@ import ( ) type CustomizableSchemaProvider interface { - ApplySchemaCustomizations(cs CustomizableSchema, path ...string) CustomizableSchema + ApplySchemaCustomizations(map[string]AttributeBuilder) map[string]AttributeBuilder } type structTag struct { @@ -30,7 +30,6 @@ type structTag struct { func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { scmAttr := map[string]AttributeBuilder{} rk := v.Kind() - typeProvidesSchemaCustomization := v.Type().Implements(reflect.TypeOf((*CustomizableSchemaProvider)(nil)).Elem()) if rk == reflect.Ptr { v = v.Elem() rk = v.Kind() @@ -39,13 +38,15 @@ func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { panic(fmt.Errorf("schema value of Struct is expected, but got %s: %#v. %s", rk.String(), v, common.TerraformBugErrorMessage)) } + schemaProvider, implementsSchemaProvider := v.Interface().(CustomizableSchemaProvider) + for _, field := range tfreflect.ListAllFields(v) { typeField := field.StructField fieldName := typeField.Tag.Get("tfsdk") if fieldName == "-" { continue } - structTag := getStructTag(typeField) + structTag, hasStructTag := getStructTag(typeField) value := field.Value.Interface() if _, ok := value.(attr.Value); !ok { panic(fmt.Errorf("unexpected type %T in tfsdk structs, expected a plugin framework value type. %s", value, common.TerraformBugErrorMessage)) @@ -147,9 +148,7 @@ func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { attr := scmAttr[fieldName] - if typeProvidesSchemaCustomization { - attr = attr.SetOptional() // default to optional, ToSchema may override this - } else { + if hasStructTag && !implementsSchemaProvider { if structTag.computed { // Computed attributes are always computed and may be optional. attr = attr.SetComputed() @@ -168,16 +167,20 @@ func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { scmAttr[fieldName] = attr } + + if implementsSchemaProvider { + scmAttr = schemaProvider.ApplySchemaCustomizations(scmAttr) + } return NestedBlockObject{Attributes: scmAttr} } -func getStructTag(field reflect.StructField) structTag { +func getStructTag(field reflect.StructField) (structTag, bool) { tagValue := field.Tag.Get("tf") return structTag{ optional: strings.Contains(tagValue, "optional"), computed: strings.Contains(tagValue, "computed"), singleObject: strings.Contains(tagValue, "object"), - } + }, tagValue != "" } // ResourceStructToSchema builds a resource schema from a tfsdk struct, with custoimzations applied. @@ -197,10 +200,6 @@ func ResourceStructToSchemaMap(ctx context.Context, v any, customizeSchema func( nestedBlockObj := typeToSchema(ctx, reflect.ValueOf(v)) cs := *ConstructCustomizableSchema(nestedBlockObj) - if schemaProvider, ok := v.(CustomizableSchemaProvider); ok { - cs = schemaProvider.ApplySchemaCustomizations(cs) - } - if customizeSchema != nil { cs = customizeSchema(cs) } @@ -213,10 +212,6 @@ func DataSourceStructToSchemaMap(ctx context.Context, v any, customizeSchema fun nestedBlockObj := typeToSchema(ctx, reflect.ValueOf(v)) cs := *ConstructCustomizableSchema(nestedBlockObj) - if schemaProvider, ok := v.(CustomizableSchemaProvider); ok { - cs = schemaProvider.ApplySchemaCustomizations(cs) - } - if customizeSchema != nil { cs = customizeSchema(cs) } diff --git a/internal/providers/pluginfw/tfschema/struct_to_schema_test.go b/internal/providers/pluginfw/tfschema/struct_to_schema_test.go index be22464d6..7eda21249 100644 --- a/internal/providers/pluginfw/tfschema/struct_to_schema_test.go +++ b/internal/providers/pluginfw/tfschema/struct_to_schema_test.go @@ -20,7 +20,7 @@ type TestStringTfSdk struct { } type TestBoolTfSdk struct { - Enabled types.Bool `tfsdk:"enabled" tf:""` + Enabled types.Bool `tfsdk:"enabled" tf:"required"` } type TestIntTfSdk struct { From cef65706b8e0f64828bd15a2aebd6d9c291cd6bb Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 8 Jan 2025 17:16:00 +0100 Subject: [PATCH 2/6] use explicit tf annotations temporarily --- internal/providers/pluginfw/products/app/data_app.go | 2 +- .../providers/pluginfw/products/catalog/data_functions.go | 4 ++-- .../pluginfw/products/library/resource_library.go | 4 +++- .../products/qualitymonitor/resource_quality_monitor.go | 8 +++++--- .../products/registered_model/data_registered_model.go | 2 +- .../registered_model/data_registered_model_versions.go | 2 +- .../providers/pluginfw/products/sharing/resource_share.go | 1 + .../providers/pluginfw/products/volume/data_volumes.go | 4 ++-- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/internal/providers/pluginfw/products/app/data_app.go b/internal/providers/pluginfw/products/app/data_app.go index b49b43a34..d93b0cb42 100644 --- a/internal/providers/pluginfw/products/app/data_app.go +++ b/internal/providers/pluginfw/products/app/data_app.go @@ -24,7 +24,7 @@ type dataSourceApp struct { } type dataApp struct { - Name types.String `tfsdk:"name"` + Name types.String `tfsdk:"name" tf:"required"` App types.Object `tfsdk:"app" tf:"computed"` } diff --git a/internal/providers/pluginfw/products/catalog/data_functions.go b/internal/providers/pluginfw/products/catalog/data_functions.go index a252f97a5..4ce99e5b5 100644 --- a/internal/providers/pluginfw/products/catalog/data_functions.go +++ b/internal/providers/pluginfw/products/catalog/data_functions.go @@ -32,8 +32,8 @@ type FunctionsDataSource struct { } type FunctionsData struct { - CatalogName types.String `tfsdk:"catalog_name"` - SchemaName types.String `tfsdk:"schema_name"` + CatalogName types.String `tfsdk:"catalog_name" tf:"required"` + SchemaName types.String `tfsdk:"schema_name" tf:"required"` IncludeBrowse types.Bool `tfsdk:"include_browse" tf:"optional"` Functions types.List `tfsdk:"functions" tf:"optional,computed"` } diff --git a/internal/providers/pluginfw/products/library/resource_library.go b/internal/providers/pluginfw/products/library/resource_library.go index 89af2516c..84a7b5a30 100644 --- a/internal/providers/pluginfw/products/library/resource_library.go +++ b/internal/providers/pluginfw/products/library/resource_library.go @@ -75,7 +75,7 @@ func readLibrary(ctx context.Context, w *databricks.WorkspaceClient, waitParams type LibraryExtended struct { compute_tf.Library_SdkV2 ClusterId types.String `tfsdk:"cluster_id"` - ID types.String `tfsdk:"id" tf:"optional,computed"` // Adding ID field to stay compatible with SDKv2 + ID types.String `tfsdk:"id"` // Adding ID field to stay compatible with SDKv2 } type LibraryResource struct { @@ -103,6 +103,8 @@ func (r *LibraryResource) Schema(ctx context.Context, req resource.SchemaRequest c.AddPlanModifier(listplanmodifier.RequiresReplace(), field) } } + c.SetRequired("cluster_id") + c.SetOptional("id") c.SetComputed("id") return c }) diff --git a/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go index ef3c435b5..c547bd386 100644 --- a/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go +++ b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go @@ -57,9 +57,9 @@ func waitForMonitor(ctx context.Context, w *databricks.WorkspaceClient, monitor type MonitorInfoExtended struct { catalog_tf.MonitorInfo_SdkV2 - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` - SkipBuiltinDashboard types.Bool `tfsdk:"skip_builtin_dashboard" tf:"optional"` - ID types.String `tfsdk:"id" tf:"optional,computed"` // Adding ID field to stay compatible with SDKv2 + WarehouseId types.String `tfsdk:"warehouse_id"` + SkipBuiltinDashboard types.Bool `tfsdk:"skip_builtin_dashboard"` + ID types.String `tfsdk:"id"` // Adding ID field to stay compatible with SDKv2 } var _ pluginfwcommon.ComplexFieldTypeProvider = MonitorInfoExtended{} @@ -87,6 +87,8 @@ func (r *QualityMonitorResource) Schema(ctx context.Context, req resource.Schema c.SetReadOnly("status") c.SetReadOnly("dashboard_id") c.SetReadOnly("schedule", "pause_status") + c.SetOptional("warehouse_id") + c.SetOptional("skip_builtin_dashboard") c.SetComputed("id") return c }) diff --git a/internal/providers/pluginfw/products/registered_model/data_registered_model.go b/internal/providers/pluginfw/products/registered_model/data_registered_model.go index 284d4df9f..02b808b84 100644 --- a/internal/providers/pluginfw/products/registered_model/data_registered_model.go +++ b/internal/providers/pluginfw/products/registered_model/data_registered_model.go @@ -34,7 +34,7 @@ type RegisteredModelDataSource struct { } type RegisteredModelData struct { - FullName types.String `tfsdk:"full_name"` + FullName types.String `tfsdk:"full_name" tf:"required"` IncludeAliases types.Bool `tfsdk:"include_aliases" tf:"optional"` IncludeBrowse types.Bool `tfsdk:"include_browse" tf:"optional"` ModelInfo types.List `tfsdk:"model_info" tf:"optional,computed"` diff --git a/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go b/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go index 95e863cd0..febc5152e 100644 --- a/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go +++ b/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go @@ -27,7 +27,7 @@ type RegisteredModelVersionsDataSource struct { } type RegisteredModelVersionsData struct { - FullName types.String `tfsdk:"full_name"` + FullName types.String `tfsdk:"full_name" tf:"required"` ModelVersions types.List `tfsdk:"model_versions" tf:"optional,computed"` } diff --git a/internal/providers/pluginfw/products/sharing/resource_share.go b/internal/providers/pluginfw/products/sharing/resource_share.go index 19b24485e..8c33d17be 100644 --- a/internal/providers/pluginfw/products/sharing/resource_share.go +++ b/internal/providers/pluginfw/products/sharing/resource_share.go @@ -155,6 +155,7 @@ func (r *ShareResource) Schema(ctx context.Context, req resource.SchemaRequest, c.SetRequired("object", "data_object_type") c.SetRequired("object", "partition", "value", "op") c.SetRequired("object", "partition", "value", "name") + c.SetOptional("owner") return c }) diff --git a/internal/providers/pluginfw/products/volume/data_volumes.go b/internal/providers/pluginfw/products/volume/data_volumes.go index 6727dc20c..64593ecb2 100644 --- a/internal/providers/pluginfw/products/volume/data_volumes.go +++ b/internal/providers/pluginfw/products/volume/data_volumes.go @@ -31,8 +31,8 @@ type VolumesDataSource struct { } type VolumesList struct { - CatalogName types.String `tfsdk:"catalog_name"` - SchemaName types.String `tfsdk:"schema_name"` + CatalogName types.String `tfsdk:"catalog_name" tf:"required"` + SchemaName types.String `tfsdk:"schema_name" tf:"required"` Ids types.List `tfsdk:"ids" tf:"optional,computed"` } From 15a34b44579c2272cd26d471092a245fc63b0119 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 8 Jan 2025 17:17:14 +0100 Subject: [PATCH 3/6] generate sdk --- internal/service/apps_tf/legacy_model.go | 372 +- internal/service/apps_tf/model.go | 361 +- internal/service/billing_tf/legacy_model.go | 407 +- internal/service/billing_tf/model.go | 393 +- internal/service/catalog_tf/legacy_model.go | 3327 ++++++++++------- internal/service/catalog_tf/model.go | 3207 +++++++++------- .../service/cleanrooms_tf/legacy_model.go | 367 +- internal/service/cleanrooms_tf/model.go | 347 +- internal/service/compute_tf/legacy_model.go | 2874 ++++++++------ internal/service/compute_tf/model.go | 2774 ++++++++------ .../service/dashboards_tf/legacy_model.go | 491 +-- internal/service/dashboards_tf/model.go | 478 +-- internal/service/files_tf/legacy_model.go | 171 +- internal/service/files_tf/model.go | 171 +- internal/service/iam_tf/legacy_model.go | 591 +-- internal/service/iam_tf/model.go | 586 +-- internal/service/jobs_tf/legacy_model.go | 2600 +++++++------ internal/service/jobs_tf/model.go | 2445 ++++++------ .../service/marketplace_tf/legacy_model.go | 1259 ++++--- internal/service/marketplace_tf/model.go | 1214 +++--- internal/service/ml_tf/legacy_model.go | 1609 ++++---- internal/service/ml_tf/model.go | 1590 ++++---- internal/service/oauth2_tf/legacy_model.go | 350 +- internal/service/oauth2_tf/model.go | 342 +- internal/service/pipelines_tf/legacy_model.go | 1099 +++--- internal/service/pipelines_tf/model.go | 1055 +++--- .../service/provisioning_tf/legacy_model.go | 724 ++-- internal/service/provisioning_tf/model.go | 698 ++-- internal/service/serving_tf/legacy_model.go | 1173 +++--- internal/service/serving_tf/model.go | 1123 +++--- internal/service/settings_tf/legacy_model.go | 1475 ++++---- internal/service/settings_tf/model.go | 1422 +++---- internal/service/sharing_tf/legacy_model.go | 577 +-- internal/service/sharing_tf/model.go | 568 +-- internal/service/sql_tf/legacy_model.go | 2418 +++++++----- internal/service/sql_tf/model.go | 2348 +++++++----- .../service/vectorsearch_tf/legacy_model.go | 495 ++- internal/service/vectorsearch_tf/model.go | 480 ++- internal/service/workspace_tf/legacy_model.go | 694 ++-- internal/service/workspace_tf/model.go | 686 ++-- 40 files changed, 26242 insertions(+), 19119 deletions(-) diff --git a/internal/service/apps_tf/legacy_model.go b/internal/service/apps_tf/legacy_model.go index e1c45f306..ce2070da6 100755 --- a/internal/service/apps_tf/legacy_model.go +++ b/internal/service/apps_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -25,41 +26,41 @@ import ( type App_SdkV2 struct { // The active deployment of the app. A deployment is considered active when // it has been deployed to the app compute. - ActiveDeployment types.List `tfsdk:"active_deployment" tf:"computed,object"` + ActiveDeployment types.List `tfsdk:"active_deployment"` - AppStatus types.List `tfsdk:"app_status" tf:"computed,object"` + AppStatus types.List `tfsdk:"app_status"` - ComputeStatus types.List `tfsdk:"compute_status" tf:"computed,object"` + ComputeStatus types.List `tfsdk:"compute_status"` // The creation time of the app. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // The email of the user that created the app. - Creator types.String `tfsdk:"creator" tf:"computed"` + Creator types.String `tfsdk:"creator"` // The default workspace file system path of the source code from which app // deployment are created. This field tracks the workspace source code path // of the last active deployment. - DefaultSourceCodePath types.String `tfsdk:"default_source_code_path" tf:"computed"` + DefaultSourceCodePath types.String `tfsdk:"default_source_code_path"` // The description of the app. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The name of the app. The name must contain only lowercase alphanumeric // characters and hyphens. It must be unique within the workspace. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The pending deployment of the app. A deployment is considered pending // when it is being prepared for deployment to the app compute. - PendingDeployment types.List `tfsdk:"pending_deployment" tf:"computed,object"` + PendingDeployment types.List `tfsdk:"pending_deployment"` // Resources for the app. - Resources types.List `tfsdk:"resources" tf:"optional"` + Resources types.List `tfsdk:"resources"` - ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id" tf:"computed"` + ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id"` - ServicePrincipalId types.Int64 `tfsdk:"service_principal_id" tf:"computed"` + ServicePrincipalId types.Int64 `tfsdk:"service_principal_id"` - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"computed"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // The update time of the app. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` // The email of the user that last updated the app. - Updater types.String `tfsdk:"updater" tf:"computed"` + Updater types.String `tfsdk:"updater"` // The URL of the app once it is deployed. - Url types.String `tfsdk:"url" tf:"computed"` + Url types.String `tfsdk:"url"` } func (newState *App_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan App_SdkV2) { @@ -68,28 +69,29 @@ func (newState *App_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan App_SdkV func (newState *App_SdkV2) SyncEffectiveFieldsDuringRead(existingState App_SdkV2) { } -func (c App_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "active_deployment")...) - AppDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "active_deployment")...) - cs.SetComputed(append(path, "app_status")...) - ApplicationStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "app_status")...) - cs.SetComputed(append(path, "compute_status")...) - ComputeStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "compute_status")...) - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "creator")...) - cs.SetComputed(append(path, "default_source_code_path")...) - cs.SetRequired(append(path, "name")...) - cs.SetComputed(append(path, "pending_deployment")...) - AppDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pending_deployment")...) - AppResource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "resources")...) - cs.SetComputed(append(path, "service_principal_client_id")...) - cs.SetComputed(append(path, "service_principal_id")...) - cs.SetComputed(append(path, "service_principal_name")...) - cs.SetComputed(append(path, "update_time")...) - cs.SetComputed(append(path, "updater")...) - cs.SetComputed(append(path, "url")...) - - return cs +func (c App_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active_deployment"] = attrs["active_deployment"].SetComputed() + attrs["active_deployment"] = attrs["active_deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["app_status"] = attrs["app_status"].SetComputed() + attrs["app_status"] = attrs["app_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["compute_status"] = attrs["compute_status"].SetComputed() + attrs["compute_status"] = attrs["compute_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["creator"] = attrs["creator"].SetComputed() + attrs["default_source_code_path"] = attrs["default_source_code_path"].SetComputed() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["pending_deployment"] = attrs["pending_deployment"].SetComputed() + attrs["pending_deployment"] = attrs["pending_deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["resources"] = attrs["resources"].SetOptional() + attrs["service_principal_client_id"] = attrs["service_principal_client_id"].SetComputed() + attrs["service_principal_id"] = attrs["service_principal_id"].SetComputed() + attrs["service_principal_name"] = attrs["service_principal_name"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() + attrs["updater"] = attrs["updater"].SetComputed() + attrs["url"] = attrs["url"].SetComputed() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in App. @@ -301,13 +303,13 @@ func (o *App_SdkV2) SetResources(ctx context.Context, v []AppResource_SdkV2) { type AppAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AppAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppAccessControlRequest_SdkV2) { @@ -316,9 +318,13 @@ func (newState *AppAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *AppAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppAccessControlRequest_SdkV2) { } -func (c AppAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppAccessControlRequest. @@ -360,15 +366,15 @@ func (o AppAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type { type AppAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AppAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppAccessControlResponse_SdkV2) { @@ -377,10 +383,14 @@ func (newState *AppAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *AppAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppAccessControlResponse_SdkV2) { } -func (c AppAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c AppAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppAccessControlResponse. @@ -454,15 +464,15 @@ func (o *AppAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Context, type AppDeployment_SdkV2 struct { // The creation time of the deployment. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // The email of the user creates the deployment. - Creator types.String `tfsdk:"creator" tf:"computed"` + Creator types.String `tfsdk:"creator"` // The deployment artifacts for an app. - DeploymentArtifacts types.List `tfsdk:"deployment_artifacts" tf:"computed,object"` + DeploymentArtifacts types.List `tfsdk:"deployment_artifacts"` // The unique id of the deployment. - DeploymentId types.String `tfsdk:"deployment_id" tf:"optional"` + DeploymentId types.String `tfsdk:"deployment_id"` // The mode of which the deployment will manage the source code. - Mode types.String `tfsdk:"mode" tf:"optional"` + Mode types.String `tfsdk:"mode"` // The workspace file system path of the source code used to create the app // deployment. This is different from // `deployment_artifacts.source_code_path`, which is the path used by the @@ -470,11 +480,11 @@ type AppDeployment_SdkV2 struct { // the app in the workspace during deployment creation, whereas the latter // provides a system generated stable snapshotted source code path used by // the deployment. - SourceCodePath types.String `tfsdk:"source_code_path" tf:"optional"` + SourceCodePath types.String `tfsdk:"source_code_path"` // Status and status message of the deployment - Status types.List `tfsdk:"status" tf:"computed,object"` + Status types.List `tfsdk:"status"` // The update time of the deployment. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *AppDeployment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeployment_SdkV2) { @@ -483,16 +493,19 @@ func (newState *AppDeployment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AppDeployment_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppDeployment_SdkV2) { } -func (c AppDeployment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "creator")...) - cs.SetComputed(append(path, "deployment_artifacts")...) - AppDeploymentArtifacts_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "deployment_artifacts")...) - cs.SetComputed(append(path, "status")...) - AppDeploymentStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - cs.SetComputed(append(path, "update_time")...) +func (c AppDeployment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["creator"] = attrs["creator"].SetComputed() + attrs["deployment_artifacts"] = attrs["deployment_artifacts"].SetComputed() + attrs["deployment_artifacts"] = attrs["deployment_artifacts"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["deployment_id"] = attrs["deployment_id"].SetOptional() + attrs["mode"] = attrs["mode"].SetOptional() + attrs["source_code_path"] = attrs["source_code_path"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["update_time"] = attrs["update_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppDeployment. @@ -602,7 +615,7 @@ func (o *AppDeployment_SdkV2) SetStatus(ctx context.Context, v AppDeploymentStat type AppDeploymentArtifacts_SdkV2 struct { // The snapshotted workspace file system path of the source code loaded by // the deployed app. - SourceCodePath types.String `tfsdk:"source_code_path" tf:"optional"` + SourceCodePath types.String `tfsdk:"source_code_path"` } func (newState *AppDeploymentArtifacts_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeploymentArtifacts_SdkV2) { @@ -611,9 +624,10 @@ func (newState *AppDeploymentArtifacts_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *AppDeploymentArtifacts_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppDeploymentArtifacts_SdkV2) { } -func (c AppDeploymentArtifacts_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppDeploymentArtifacts_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["source_code_path"] = attrs["source_code_path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppDeploymentArtifacts. @@ -649,9 +663,9 @@ func (o AppDeploymentArtifacts_SdkV2) Type(ctx context.Context) attr.Type { type AppDeploymentStatus_SdkV2 struct { // Message corresponding with the deployment state. - Message types.String `tfsdk:"message" tf:"computed"` + Message types.String `tfsdk:"message"` // State of the deployment. - State types.String `tfsdk:"state" tf:"computed"` + State types.String `tfsdk:"state"` } func (newState *AppDeploymentStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeploymentStatus_SdkV2) { @@ -660,11 +674,11 @@ func (newState *AppDeploymentStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *AppDeploymentStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppDeploymentStatus_SdkV2) { } -func (c AppDeploymentStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "message")...) - cs.SetComputed(append(path, "state")...) +func (c AppDeploymentStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetComputed() + attrs["state"] = attrs["state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppDeploymentStatus. @@ -701,11 +715,11 @@ func (o AppDeploymentStatus_SdkV2) Type(ctx context.Context) attr.Type { } type AppPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *AppPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppPermission_SdkV2) { @@ -714,9 +728,12 @@ func (newState *AppPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AppPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppPermission_SdkV2) { } -func (c AppPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermission. @@ -785,11 +802,11 @@ func (o *AppPermission_SdkV2) SetInheritedFromObject(ctx context.Context, v []ty } type AppPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *AppPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppPermissions_SdkV2) { @@ -798,10 +815,12 @@ func (newState *AppPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AppPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppPermissions_SdkV2) { } -func (c AppPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c AppPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermissions. @@ -870,9 +889,9 @@ func (o *AppPermissions_SdkV2) SetAccessControlList(ctx context.Context, v []App } type AppPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *AppPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppPermissionsDescription_SdkV2) { @@ -881,9 +900,11 @@ func (newState *AppPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *AppPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppPermissionsDescription_SdkV2) { } -func (c AppPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermissionsDescription. @@ -920,7 +941,7 @@ func (o AppPermissionsDescription_SdkV2) Type(ctx context.Context) attr.Type { } type AppPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The app for which to get or manage permissions. AppName types.String `tfsdk:"-"` } @@ -931,11 +952,11 @@ func (newState *AppPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *AppPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppPermissionsRequest_SdkV2) { } -func (c AppPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "app_name")...) +func (c AppPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["app_name"] = attrs["app_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermissionsRequest. @@ -1003,17 +1024,17 @@ func (o *AppPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Context, type AppResource_SdkV2 struct { // Description of the App Resource. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - Job types.List `tfsdk:"job" tf:"optional,object"` + Job types.List `tfsdk:"job"` // Name of the App Resource. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - Secret types.List `tfsdk:"secret" tf:"optional,object"` + Secret types.List `tfsdk:"secret"` - ServingEndpoint types.List `tfsdk:"serving_endpoint" tf:"optional,object"` + ServingEndpoint types.List `tfsdk:"serving_endpoint"` - SqlWarehouse types.List `tfsdk:"sql_warehouse" tf:"optional,object"` + SqlWarehouse types.List `tfsdk:"sql_warehouse"` } func (newState *AppResource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResource_SdkV2) { @@ -1022,14 +1043,19 @@ func (newState *AppResource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AppResource_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppResource_SdkV2) { } -func (c AppResource_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppResourceJob_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job")...) - cs.SetRequired(append(path, "name")...) - AppResourceSecret_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "secret")...) - AppResourceServingEndpoint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "serving_endpoint")...) - AppResourceSqlWarehouse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_warehouse")...) +func (c AppResource_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["job"] = attrs["job"].SetOptional() + attrs["job"] = attrs["job"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["secret"] = attrs["secret"].SetOptional() + attrs["secret"] = attrs["secret"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["serving_endpoint"] = attrs["serving_endpoint"].SetOptional() + attrs["serving_endpoint"] = attrs["serving_endpoint"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sql_warehouse"] = attrs["sql_warehouse"].SetOptional() + attrs["sql_warehouse"] = attrs["sql_warehouse"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResource. @@ -1192,10 +1218,10 @@ func (o *AppResource_SdkV2) SetSqlWarehouse(ctx context.Context, v AppResourceSq type AppResourceJob_SdkV2 struct { // Id of the job to grant permission on. - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", // "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` } func (newState *AppResourceJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceJob_SdkV2) { @@ -1204,11 +1230,11 @@ func (newState *AppResourceJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AppResourceJob_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppResourceJob_SdkV2) { } -func (c AppResourceJob_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "permission")...) +func (c AppResourceJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceJob. @@ -1246,12 +1272,12 @@ func (o AppResourceJob_SdkV2) Type(ctx context.Context) attr.Type { type AppResourceSecret_SdkV2 struct { // Key of the secret to grant permission on. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Permission to grant on the secret scope. For secrets, only one permission // is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` // Scope of the secret to grant permission on. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *AppResourceSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceSecret_SdkV2) { @@ -1260,12 +1286,12 @@ func (newState *AppResourceSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AppResourceSecret_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppResourceSecret_SdkV2) { } -func (c AppResourceSecret_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "permission")...) - cs.SetRequired(append(path, "scope")...) +func (c AppResourceSecret_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceSecret. @@ -1305,10 +1331,10 @@ func (o AppResourceSecret_SdkV2) Type(ctx context.Context) attr.Type { type AppResourceServingEndpoint_SdkV2 struct { // Name of the serving endpoint to grant permission on. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Permission to grant on the serving endpoint. Supported permissions are: // "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` } func (newState *AppResourceServingEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceServingEndpoint_SdkV2) { @@ -1317,11 +1343,11 @@ func (newState *AppResourceServingEndpoint_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *AppResourceServingEndpoint_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppResourceServingEndpoint_SdkV2) { } -func (c AppResourceServingEndpoint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "permission")...) +func (c AppResourceServingEndpoint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceServingEndpoint. @@ -1359,10 +1385,10 @@ func (o AppResourceServingEndpoint_SdkV2) Type(ctx context.Context) attr.Type { type AppResourceSqlWarehouse_SdkV2 struct { // Id of the SQL warehouse to grant permission on. - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Permission to grant on the SQL warehouse. Supported permissions are: // "CAN_MANAGE", "CAN_USE", "IS_OWNER". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` } func (newState *AppResourceSqlWarehouse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceSqlWarehouse_SdkV2) { @@ -1371,11 +1397,11 @@ func (newState *AppResourceSqlWarehouse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *AppResourceSqlWarehouse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AppResourceSqlWarehouse_SdkV2) { } -func (c AppResourceSqlWarehouse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "permission")...) +func (c AppResourceSqlWarehouse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceSqlWarehouse. @@ -1413,9 +1439,9 @@ func (o AppResourceSqlWarehouse_SdkV2) Type(ctx context.Context) attr.Type { type ApplicationStatus_SdkV2 struct { // Application status message - Message types.String `tfsdk:"message" tf:"computed"` + Message types.String `tfsdk:"message"` // State of the application. - State types.String `tfsdk:"state" tf:"computed"` + State types.String `tfsdk:"state"` } func (newState *ApplicationStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ApplicationStatus_SdkV2) { @@ -1424,11 +1450,11 @@ func (newState *ApplicationStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ApplicationStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState ApplicationStatus_SdkV2) { } -func (c ApplicationStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "message")...) - cs.SetComputed(append(path, "state")...) +func (c ApplicationStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetComputed() + attrs["state"] = attrs["state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ApplicationStatus. @@ -1466,9 +1492,9 @@ func (o ApplicationStatus_SdkV2) Type(ctx context.Context) attr.Type { type ComputeStatus_SdkV2 struct { // Compute status message - Message types.String `tfsdk:"message" tf:"computed"` + Message types.String `tfsdk:"message"` // State of the app compute. - State types.String `tfsdk:"state" tf:"computed"` + State types.String `tfsdk:"state"` } func (newState *ComputeStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComputeStatus_SdkV2) { @@ -1477,11 +1503,11 @@ func (newState *ComputeStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ComputeStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState ComputeStatus_SdkV2) { } -func (c ComputeStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "message")...) - cs.SetComputed(append(path, "state")...) +func (c ComputeStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetComputed() + attrs["state"] = attrs["state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComputeStatus. @@ -1519,7 +1545,7 @@ func (o ComputeStatus_SdkV2) Type(ctx context.Context) attr.Type { // Create an app deployment type CreateAppDeploymentRequest_SdkV2 struct { - AppDeployment types.List `tfsdk:"app_deployment" tf:"optional,object"` + AppDeployment types.List `tfsdk:"app_deployment"` // The name of the app. AppName types.String `tfsdk:"-"` } @@ -1589,7 +1615,7 @@ func (o *CreateAppDeploymentRequest_SdkV2) SetAppDeployment(ctx context.Context, // Create an app type CreateAppRequest_SdkV2 struct { - App types.List `tfsdk:"app" tf:"optional,object"` + App types.List `tfsdk:"app"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAppRequest. @@ -1770,7 +1796,7 @@ func (o GetAppPermissionLevelsRequest_SdkV2) Type(ctx context.Context) attr.Type type GetAppPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetAppPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetAppPermissionLevelsResponse_SdkV2) { @@ -1779,10 +1805,10 @@ func (newState *GetAppPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *GetAppPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetAppPermissionLevelsResponse_SdkV2) { } -func (c GetAppPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetAppPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetAppPermissionLevelsResponse. @@ -1968,9 +1994,9 @@ func (o ListAppDeploymentsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListAppDeploymentsResponse_SdkV2 struct { // Deployment history of the app. - AppDeployments types.List `tfsdk:"app_deployments" tf:"optional"` + AppDeployments types.List `tfsdk:"app_deployments"` // Pagination token to request the next page of apps. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListAppDeploymentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAppDeploymentsResponse_SdkV2) { @@ -1979,10 +2005,11 @@ func (newState *ListAppDeploymentsResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListAppDeploymentsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAppDeploymentsResponse_SdkV2) { } -func (c ListAppDeploymentsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "app_deployments")...) +func (c ListAppDeploymentsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_deployments"] = attrs["app_deployments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAppDeploymentsResponse. @@ -2091,9 +2118,9 @@ func (o ListAppsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListAppsResponse_SdkV2 struct { - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` // Pagination token to request the next page of apps. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListAppsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAppsResponse_SdkV2) { @@ -2102,10 +2129,11 @@ func (newState *ListAppsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListAppsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAppsResponse_SdkV2) { } -func (c ListAppsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - App_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c ListAppsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAppsResponse. @@ -2182,10 +2210,10 @@ func (newState *StartAppRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *StartAppRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState StartAppRequest_SdkV2) { } -func (c StartAppRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c StartAppRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartAppRequest. @@ -2230,10 +2258,10 @@ func (newState *StopAppRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *StopAppRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState StopAppRequest_SdkV2) { } -func (c StopAppRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c StopAppRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StopAppRequest. @@ -2269,7 +2297,7 @@ func (o StopAppRequest_SdkV2) Type(ctx context.Context) attr.Type { // Update an app type UpdateAppRequest_SdkV2 struct { - App types.List `tfsdk:"app" tf:"optional,object"` + App types.List `tfsdk:"app"` // The name of the app. The name must contain only lowercase alphanumeric // characters and hyphens. It must be unique within the workspace. Name types.String `tfsdk:"-"` diff --git a/internal/service/apps_tf/model.go b/internal/service/apps_tf/model.go index 0b9b048f5..aaa76276e 100755 --- a/internal/service/apps_tf/model.go +++ b/internal/service/apps_tf/model.go @@ -25,41 +25,41 @@ import ( type App struct { // The active deployment of the app. A deployment is considered active when // it has been deployed to the app compute. - ActiveDeployment types.Object `tfsdk:"active_deployment" tf:"computed,object"` + ActiveDeployment types.Object `tfsdk:"active_deployment"` - AppStatus types.Object `tfsdk:"app_status" tf:"computed,object"` + AppStatus types.Object `tfsdk:"app_status"` - ComputeStatus types.Object `tfsdk:"compute_status" tf:"computed,object"` + ComputeStatus types.Object `tfsdk:"compute_status"` // The creation time of the app. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // The email of the user that created the app. - Creator types.String `tfsdk:"creator" tf:"computed"` + Creator types.String `tfsdk:"creator"` // The default workspace file system path of the source code from which app // deployment are created. This field tracks the workspace source code path // of the last active deployment. - DefaultSourceCodePath types.String `tfsdk:"default_source_code_path" tf:"computed"` + DefaultSourceCodePath types.String `tfsdk:"default_source_code_path"` // The description of the app. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The name of the app. The name must contain only lowercase alphanumeric // characters and hyphens. It must be unique within the workspace. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The pending deployment of the app. A deployment is considered pending // when it is being prepared for deployment to the app compute. - PendingDeployment types.Object `tfsdk:"pending_deployment" tf:"computed,object"` + PendingDeployment types.Object `tfsdk:"pending_deployment"` // Resources for the app. - Resources types.List `tfsdk:"resources" tf:"optional"` + Resources types.List `tfsdk:"resources"` - ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id" tf:"computed"` + ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id"` - ServicePrincipalId types.Int64 `tfsdk:"service_principal_id" tf:"computed"` + ServicePrincipalId types.Int64 `tfsdk:"service_principal_id"` - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"computed"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // The update time of the app. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` // The email of the user that last updated the app. - Updater types.String `tfsdk:"updater" tf:"computed"` + Updater types.String `tfsdk:"updater"` // The URL of the app once it is deployed. - Url types.String `tfsdk:"url" tf:"computed"` + Url types.String `tfsdk:"url"` } func (newState *App) SyncEffectiveFieldsDuringCreateOrUpdate(plan App) { @@ -68,28 +68,25 @@ func (newState *App) SyncEffectiveFieldsDuringCreateOrUpdate(plan App) { func (newState *App) SyncEffectiveFieldsDuringRead(existingState App) { } -func (c App) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "active_deployment")...) - AppDeployment{}.ApplySchemaCustomizations(cs, append(path, "active_deployment")...) - cs.SetComputed(append(path, "app_status")...) - ApplicationStatus{}.ApplySchemaCustomizations(cs, append(path, "app_status")...) - cs.SetComputed(append(path, "compute_status")...) - ComputeStatus{}.ApplySchemaCustomizations(cs, append(path, "compute_status")...) - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "creator")...) - cs.SetComputed(append(path, "default_source_code_path")...) - cs.SetRequired(append(path, "name")...) - cs.SetComputed(append(path, "pending_deployment")...) - AppDeployment{}.ApplySchemaCustomizations(cs, append(path, "pending_deployment")...) - AppResource{}.ApplySchemaCustomizations(cs, append(path, "resources")...) - cs.SetComputed(append(path, "service_principal_client_id")...) - cs.SetComputed(append(path, "service_principal_id")...) - cs.SetComputed(append(path, "service_principal_name")...) - cs.SetComputed(append(path, "update_time")...) - cs.SetComputed(append(path, "updater")...) - cs.SetComputed(append(path, "url")...) - - return cs +func (c App) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active_deployment"] = attrs["active_deployment"].SetComputed() + attrs["app_status"] = attrs["app_status"].SetComputed() + attrs["compute_status"] = attrs["compute_status"].SetComputed() + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["creator"] = attrs["creator"].SetComputed() + attrs["default_source_code_path"] = attrs["default_source_code_path"].SetComputed() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["pending_deployment"] = attrs["pending_deployment"].SetComputed() + attrs["resources"] = attrs["resources"].SetOptional() + attrs["service_principal_client_id"] = attrs["service_principal_client_id"].SetComputed() + attrs["service_principal_id"] = attrs["service_principal_id"].SetComputed() + attrs["service_principal_name"] = attrs["service_principal_name"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() + attrs["updater"] = attrs["updater"].SetComputed() + attrs["url"] = attrs["url"].SetComputed() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in App. @@ -301,13 +298,13 @@ func (o *App) SetResources(ctx context.Context, v []AppResource) { type AppAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AppAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppAccessControlRequest) { @@ -316,9 +313,13 @@ func (newState *AppAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AppAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState AppAccessControlRequest) { } -func (c AppAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppAccessControlRequest. @@ -360,15 +361,15 @@ func (o AppAccessControlRequest) Type(ctx context.Context) attr.Type { type AppAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AppAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppAccessControlResponse) { @@ -377,10 +378,14 @@ func (newState *AppAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AppAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState AppAccessControlResponse) { } -func (c AppAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c AppAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppAccessControlResponse. @@ -454,15 +459,15 @@ func (o *AppAccessControlResponse) SetAllPermissions(ctx context.Context, v []Ap type AppDeployment struct { // The creation time of the deployment. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // The email of the user creates the deployment. - Creator types.String `tfsdk:"creator" tf:"computed"` + Creator types.String `tfsdk:"creator"` // The deployment artifacts for an app. - DeploymentArtifacts types.Object `tfsdk:"deployment_artifacts" tf:"computed,object"` + DeploymentArtifacts types.Object `tfsdk:"deployment_artifacts"` // The unique id of the deployment. - DeploymentId types.String `tfsdk:"deployment_id" tf:"optional"` + DeploymentId types.String `tfsdk:"deployment_id"` // The mode of which the deployment will manage the source code. - Mode types.String `tfsdk:"mode" tf:"optional"` + Mode types.String `tfsdk:"mode"` // The workspace file system path of the source code used to create the app // deployment. This is different from // `deployment_artifacts.source_code_path`, which is the path used by the @@ -470,11 +475,11 @@ type AppDeployment struct { // the app in the workspace during deployment creation, whereas the latter // provides a system generated stable snapshotted source code path used by // the deployment. - SourceCodePath types.String `tfsdk:"source_code_path" tf:"optional"` + SourceCodePath types.String `tfsdk:"source_code_path"` // Status and status message of the deployment - Status types.Object `tfsdk:"status" tf:"computed,object"` + Status types.Object `tfsdk:"status"` // The update time of the deployment. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *AppDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeployment) { @@ -483,16 +488,17 @@ func (newState *AppDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppD func (newState *AppDeployment) SyncEffectiveFieldsDuringRead(existingState AppDeployment) { } -func (c AppDeployment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "creator")...) - cs.SetComputed(append(path, "deployment_artifacts")...) - AppDeploymentArtifacts{}.ApplySchemaCustomizations(cs, append(path, "deployment_artifacts")...) - cs.SetComputed(append(path, "status")...) - AppDeploymentStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - cs.SetComputed(append(path, "update_time")...) +func (c AppDeployment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["creator"] = attrs["creator"].SetComputed() + attrs["deployment_artifacts"] = attrs["deployment_artifacts"].SetComputed() + attrs["deployment_id"] = attrs["deployment_id"].SetOptional() + attrs["mode"] = attrs["mode"].SetOptional() + attrs["source_code_path"] = attrs["source_code_path"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppDeployment. @@ -602,7 +608,7 @@ func (o *AppDeployment) SetStatus(ctx context.Context, v AppDeploymentStatus) { type AppDeploymentArtifacts struct { // The snapshotted workspace file system path of the source code loaded by // the deployed app. - SourceCodePath types.String `tfsdk:"source_code_path" tf:"optional"` + SourceCodePath types.String `tfsdk:"source_code_path"` } func (newState *AppDeploymentArtifacts) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeploymentArtifacts) { @@ -611,9 +617,10 @@ func (newState *AppDeploymentArtifacts) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *AppDeploymentArtifacts) SyncEffectiveFieldsDuringRead(existingState AppDeploymentArtifacts) { } -func (c AppDeploymentArtifacts) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppDeploymentArtifacts) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["source_code_path"] = attrs["source_code_path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppDeploymentArtifacts. @@ -649,9 +656,9 @@ func (o AppDeploymentArtifacts) Type(ctx context.Context) attr.Type { type AppDeploymentStatus struct { // Message corresponding with the deployment state. - Message types.String `tfsdk:"message" tf:"computed"` + Message types.String `tfsdk:"message"` // State of the deployment. - State types.String `tfsdk:"state" tf:"computed"` + State types.String `tfsdk:"state"` } func (newState *AppDeploymentStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeploymentStatus) { @@ -660,11 +667,11 @@ func (newState *AppDeploymentStatus) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AppDeploymentStatus) SyncEffectiveFieldsDuringRead(existingState AppDeploymentStatus) { } -func (c AppDeploymentStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "message")...) - cs.SetComputed(append(path, "state")...) +func (c AppDeploymentStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetComputed() + attrs["state"] = attrs["state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppDeploymentStatus. @@ -701,11 +708,11 @@ func (o AppDeploymentStatus) Type(ctx context.Context) attr.Type { } type AppPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *AppPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppPermission) { @@ -714,9 +721,12 @@ func (newState *AppPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppP func (newState *AppPermission) SyncEffectiveFieldsDuringRead(existingState AppPermission) { } -func (c AppPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermission. @@ -785,11 +795,11 @@ func (o *AppPermission) SetInheritedFromObject(ctx context.Context, v []types.St } type AppPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *AppPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppPermissions) { @@ -798,10 +808,12 @@ func (newState *AppPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan App func (newState *AppPermissions) SyncEffectiveFieldsDuringRead(existingState AppPermissions) { } -func (c AppPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c AppPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermissions. @@ -870,9 +882,9 @@ func (o *AppPermissions) SetAccessControlList(ctx context.Context, v []AppAccess } type AppPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *AppPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppPermissionsDescription) { @@ -881,9 +893,11 @@ func (newState *AppPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpda func (newState *AppPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState AppPermissionsDescription) { } -func (c AppPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AppPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermissionsDescription. @@ -920,7 +934,7 @@ func (o AppPermissionsDescription) Type(ctx context.Context) attr.Type { } type AppPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The app for which to get or manage permissions. AppName types.String `tfsdk:"-"` } @@ -931,11 +945,11 @@ func (newState *AppPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AppPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState AppPermissionsRequest) { } -func (c AppPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "app_name")...) +func (c AppPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["app_name"] = attrs["app_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppPermissionsRequest. @@ -1003,17 +1017,17 @@ func (o *AppPermissionsRequest) SetAccessControlList(ctx context.Context, v []Ap type AppResource struct { // Description of the App Resource. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - Job types.Object `tfsdk:"job" tf:"optional,object"` + Job types.Object `tfsdk:"job"` // Name of the App Resource. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - Secret types.Object `tfsdk:"secret" tf:"optional,object"` + Secret types.Object `tfsdk:"secret"` - ServingEndpoint types.Object `tfsdk:"serving_endpoint" tf:"optional,object"` + ServingEndpoint types.Object `tfsdk:"serving_endpoint"` - SqlWarehouse types.Object `tfsdk:"sql_warehouse" tf:"optional,object"` + SqlWarehouse types.Object `tfsdk:"sql_warehouse"` } func (newState *AppResource) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResource) { @@ -1022,14 +1036,15 @@ func (newState *AppResource) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppRes func (newState *AppResource) SyncEffectiveFieldsDuringRead(existingState AppResource) { } -func (c AppResource) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppResourceJob{}.ApplySchemaCustomizations(cs, append(path, "job")...) - cs.SetRequired(append(path, "name")...) - AppResourceSecret{}.ApplySchemaCustomizations(cs, append(path, "secret")...) - AppResourceServingEndpoint{}.ApplySchemaCustomizations(cs, append(path, "serving_endpoint")...) - AppResourceSqlWarehouse{}.ApplySchemaCustomizations(cs, append(path, "sql_warehouse")...) +func (c AppResource) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["job"] = attrs["job"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["secret"] = attrs["secret"].SetOptional() + attrs["serving_endpoint"] = attrs["serving_endpoint"].SetOptional() + attrs["sql_warehouse"] = attrs["sql_warehouse"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResource. @@ -1192,10 +1207,10 @@ func (o *AppResource) SetSqlWarehouse(ctx context.Context, v AppResourceSqlWareh type AppResourceJob struct { // Id of the job to grant permission on. - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", // "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` } func (newState *AppResourceJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceJob) { @@ -1204,11 +1219,11 @@ func (newState *AppResourceJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan App func (newState *AppResourceJob) SyncEffectiveFieldsDuringRead(existingState AppResourceJob) { } -func (c AppResourceJob) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "permission")...) +func (c AppResourceJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceJob. @@ -1246,12 +1261,12 @@ func (o AppResourceJob) Type(ctx context.Context) attr.Type { type AppResourceSecret struct { // Key of the secret to grant permission on. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Permission to grant on the secret scope. For secrets, only one permission // is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` // Scope of the secret to grant permission on. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *AppResourceSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceSecret) { @@ -1260,12 +1275,12 @@ func (newState *AppResourceSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AppResourceSecret) SyncEffectiveFieldsDuringRead(existingState AppResourceSecret) { } -func (c AppResourceSecret) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "permission")...) - cs.SetRequired(append(path, "scope")...) +func (c AppResourceSecret) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceSecret. @@ -1305,10 +1320,10 @@ func (o AppResourceSecret) Type(ctx context.Context) attr.Type { type AppResourceServingEndpoint struct { // Name of the serving endpoint to grant permission on. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Permission to grant on the serving endpoint. Supported permissions are: // "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` } func (newState *AppResourceServingEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceServingEndpoint) { @@ -1317,11 +1332,11 @@ func (newState *AppResourceServingEndpoint) SyncEffectiveFieldsDuringCreateOrUpd func (newState *AppResourceServingEndpoint) SyncEffectiveFieldsDuringRead(existingState AppResourceServingEndpoint) { } -func (c AppResourceServingEndpoint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "permission")...) +func (c AppResourceServingEndpoint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceServingEndpoint. @@ -1359,10 +1374,10 @@ func (o AppResourceServingEndpoint) Type(ctx context.Context) attr.Type { type AppResourceSqlWarehouse struct { // Id of the SQL warehouse to grant permission on. - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Permission to grant on the SQL warehouse. Supported permissions are: // "CAN_MANAGE", "CAN_USE", "IS_OWNER". - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` } func (newState *AppResourceSqlWarehouse) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppResourceSqlWarehouse) { @@ -1371,11 +1386,11 @@ func (newState *AppResourceSqlWarehouse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AppResourceSqlWarehouse) SyncEffectiveFieldsDuringRead(existingState AppResourceSqlWarehouse) { } -func (c AppResourceSqlWarehouse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "permission")...) +func (c AppResourceSqlWarehouse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["permission"] = attrs["permission"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AppResourceSqlWarehouse. @@ -1413,9 +1428,9 @@ func (o AppResourceSqlWarehouse) Type(ctx context.Context) attr.Type { type ApplicationStatus struct { // Application status message - Message types.String `tfsdk:"message" tf:"computed"` + Message types.String `tfsdk:"message"` // State of the application. - State types.String `tfsdk:"state" tf:"computed"` + State types.String `tfsdk:"state"` } func (newState *ApplicationStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ApplicationStatus) { @@ -1424,11 +1439,11 @@ func (newState *ApplicationStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ApplicationStatus) SyncEffectiveFieldsDuringRead(existingState ApplicationStatus) { } -func (c ApplicationStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "message")...) - cs.SetComputed(append(path, "state")...) +func (c ApplicationStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetComputed() + attrs["state"] = attrs["state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ApplicationStatus. @@ -1466,9 +1481,9 @@ func (o ApplicationStatus) Type(ctx context.Context) attr.Type { type ComputeStatus struct { // Compute status message - Message types.String `tfsdk:"message" tf:"computed"` + Message types.String `tfsdk:"message"` // State of the app compute. - State types.String `tfsdk:"state" tf:"computed"` + State types.String `tfsdk:"state"` } func (newState *ComputeStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComputeStatus) { @@ -1477,11 +1492,11 @@ func (newState *ComputeStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan Comp func (newState *ComputeStatus) SyncEffectiveFieldsDuringRead(existingState ComputeStatus) { } -func (c ComputeStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "message")...) - cs.SetComputed(append(path, "state")...) +func (c ComputeStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetComputed() + attrs["state"] = attrs["state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComputeStatus. @@ -1519,7 +1534,7 @@ func (o ComputeStatus) Type(ctx context.Context) attr.Type { // Create an app deployment type CreateAppDeploymentRequest struct { - AppDeployment types.Object `tfsdk:"app_deployment" tf:"optional,object"` + AppDeployment types.Object `tfsdk:"app_deployment"` // The name of the app. AppName types.String `tfsdk:"-"` } @@ -1589,7 +1604,7 @@ func (o *CreateAppDeploymentRequest) SetAppDeployment(ctx context.Context, v App // Create an app type CreateAppRequest struct { - App types.Object `tfsdk:"app" tf:"optional,object"` + App types.Object `tfsdk:"app"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAppRequest. @@ -1770,7 +1785,7 @@ func (o GetAppPermissionLevelsRequest) Type(ctx context.Context) attr.Type { type GetAppPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetAppPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetAppPermissionLevelsResponse) { @@ -1779,10 +1794,10 @@ func (newState *GetAppPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateO func (newState *GetAppPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetAppPermissionLevelsResponse) { } -func (c GetAppPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetAppPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetAppPermissionLevelsResponse. @@ -1968,9 +1983,9 @@ func (o ListAppDeploymentsRequest) Type(ctx context.Context) attr.Type { type ListAppDeploymentsResponse struct { // Deployment history of the app. - AppDeployments types.List `tfsdk:"app_deployments" tf:"optional"` + AppDeployments types.List `tfsdk:"app_deployments"` // Pagination token to request the next page of apps. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListAppDeploymentsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAppDeploymentsResponse) { @@ -1979,10 +1994,11 @@ func (newState *ListAppDeploymentsResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListAppDeploymentsResponse) SyncEffectiveFieldsDuringRead(existingState ListAppDeploymentsResponse) { } -func (c ListAppDeploymentsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AppDeployment{}.ApplySchemaCustomizations(cs, append(path, "app_deployments")...) +func (c ListAppDeploymentsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_deployments"] = attrs["app_deployments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAppDeploymentsResponse. @@ -2091,9 +2107,9 @@ func (o ListAppsRequest) Type(ctx context.Context) attr.Type { } type ListAppsResponse struct { - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` // Pagination token to request the next page of apps. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListAppsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAppsResponse) { @@ -2102,10 +2118,11 @@ func (newState *ListAppsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *ListAppsResponse) SyncEffectiveFieldsDuringRead(existingState ListAppsResponse) { } -func (c ListAppsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - App{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c ListAppsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAppsResponse. @@ -2182,10 +2199,10 @@ func (newState *StartAppRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan St func (newState *StartAppRequest) SyncEffectiveFieldsDuringRead(existingState StartAppRequest) { } -func (c StartAppRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c StartAppRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartAppRequest. @@ -2230,10 +2247,10 @@ func (newState *StopAppRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sto func (newState *StopAppRequest) SyncEffectiveFieldsDuringRead(existingState StopAppRequest) { } -func (c StopAppRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c StopAppRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StopAppRequest. @@ -2269,7 +2286,7 @@ func (o StopAppRequest) Type(ctx context.Context) attr.Type { // Update an app type UpdateAppRequest struct { - App types.Object `tfsdk:"app" tf:"optional,object"` + App types.Object `tfsdk:"app"` // The name of the app. The name must contain only lowercase alphanumeric // characters and hyphens. It must be unique within the workspace. Name types.String `tfsdk:"-"` diff --git a/internal/service/billing_tf/legacy_model.go b/internal/service/billing_tf/legacy_model.go index 91c7d46c4..ca65790f7 100755 --- a/internal/service/billing_tf/legacy_model.go +++ b/internal/service/billing_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -24,11 +25,11 @@ import ( type ActionConfiguration_SdkV2 struct { // Databricks action configuration ID. - ActionConfigurationId types.String `tfsdk:"action_configuration_id" tf:"optional"` + ActionConfigurationId types.String `tfsdk:"action_configuration_id"` // The type of the action. - ActionType types.String `tfsdk:"action_type" tf:"optional"` + ActionType types.String `tfsdk:"action_type"` // Target for the action. For example, an email address. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` } func (newState *ActionConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ActionConfiguration_SdkV2) { @@ -37,9 +38,12 @@ func (newState *ActionConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ActionConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState ActionConfiguration_SdkV2) { } -func (c ActionConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ActionConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_configuration_id"] = attrs["action_configuration_id"].SetOptional() + attrs["action_type"] = attrs["action_type"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ActionConfiguration. @@ -80,20 +84,20 @@ func (o ActionConfiguration_SdkV2) Type(ctx context.Context) attr.Type { type AlertConfiguration_SdkV2 struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. - ActionConfigurations types.List `tfsdk:"action_configurations" tf:"optional"` + ActionConfigurations types.List `tfsdk:"action_configurations"` // Databricks alert configuration ID. - AlertConfigurationId types.String `tfsdk:"alert_configuration_id" tf:"optional"` + AlertConfigurationId types.String `tfsdk:"alert_configuration_id"` // The threshold for the budget alert to determine if it is in a triggered // state. The number is evaluated based on `quantity_type`. - QuantityThreshold types.String `tfsdk:"quantity_threshold" tf:"optional"` + QuantityThreshold types.String `tfsdk:"quantity_threshold"` // The way to calculate cost for this budget alert. This is what // `quantity_threshold` is measured in. - QuantityType types.String `tfsdk:"quantity_type" tf:"optional"` + QuantityType types.String `tfsdk:"quantity_type"` // The time window of usage data for the budget. - TimePeriod types.String `tfsdk:"time_period" tf:"optional"` + TimePeriod types.String `tfsdk:"time_period"` // The evaluation method to determine when this budget alert is in a // triggered state. - TriggerType types.String `tfsdk:"trigger_type" tf:"optional"` + TriggerType types.String `tfsdk:"trigger_type"` } func (newState *AlertConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertConfiguration_SdkV2) { @@ -102,10 +106,15 @@ func (newState *AlertConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AlertConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertConfiguration_SdkV2) { } -func (c AlertConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ActionConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "action_configurations")...) +func (c AlertConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_configurations"] = attrs["action_configurations"].SetOptional() + attrs["alert_configuration_id"] = attrs["alert_configuration_id"].SetOptional() + attrs["quantity_threshold"] = attrs["quantity_threshold"].SetOptional() + attrs["quantity_type"] = attrs["quantity_type"].SetOptional() + attrs["time_period"] = attrs["time_period"].SetOptional() + attrs["trigger_type"] = attrs["trigger_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertConfiguration. @@ -181,23 +190,23 @@ func (o *AlertConfiguration_SdkV2) SetActionConfigurations(ctx context.Context, type BudgetConfiguration_SdkV2 struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations types.List `tfsdk:"alert_configurations" tf:"optional"` + AlertConfigurations types.List `tfsdk:"alert_configurations"` // Databricks budget configuration ID. - BudgetConfigurationId types.String `tfsdk:"budget_configuration_id" tf:"optional"` + BudgetConfigurationId types.String `tfsdk:"budget_configuration_id"` // Creation time of this budget configuration. - CreateTime types.Int64 `tfsdk:"create_time" tf:"optional"` + CreateTime types.Int64 `tfsdk:"create_time"` // Human-readable name of budget configuration. Max Length: 128 - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter types.List `tfsdk:"filter" tf:"optional,object"` + Filter types.List `tfsdk:"filter"` // Update time of this budget configuration. - UpdateTime types.Int64 `tfsdk:"update_time" tf:"optional"` + UpdateTime types.Int64 `tfsdk:"update_time"` } func (newState *BudgetConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfiguration_SdkV2) { @@ -206,11 +215,17 @@ func (newState *BudgetConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *BudgetConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState BudgetConfiguration_SdkV2) { } -func (c BudgetConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert_configurations")...) - BudgetConfigurationFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c BudgetConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["alert_configurations"] = attrs["alert_configurations"].SetOptional() + attrs["budget_configuration_id"] = attrs["budget_configuration_id"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() + attrs["filter"] = attrs["filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfiguration. @@ -319,9 +334,9 @@ type BudgetConfigurationFilter_SdkV2 struct { // A list of tag keys and values that will limit the budget to usage that // includes those specific custom tags. Tags are case-sensitive and should // be entered exactly as they appear in your usage data. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // If provided, usage must match with the provided Databricks workspace IDs. - WorkspaceId types.List `tfsdk:"workspace_id" tf:"optional,object"` + WorkspaceId types.List `tfsdk:"workspace_id"` } func (newState *BudgetConfigurationFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilter_SdkV2) { @@ -330,11 +345,12 @@ func (newState *BudgetConfigurationFilter_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *BudgetConfigurationFilter_SdkV2) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilter_SdkV2) { } -func (c BudgetConfigurationFilter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfigurationFilterTagClause_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - BudgetConfigurationFilterWorkspaceIdClause_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workspace_id")...) +func (c BudgetConfigurationFilter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["tags"] = attrs["tags"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilter. @@ -430,9 +446,9 @@ func (o *BudgetConfigurationFilter_SdkV2) SetWorkspaceId(ctx context.Context, v } type BudgetConfigurationFilterClause_SdkV2 struct { - Operator types.String `tfsdk:"operator" tf:"optional"` + Operator types.String `tfsdk:"operator"` - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *BudgetConfigurationFilterClause_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilterClause_SdkV2) { @@ -441,9 +457,11 @@ func (newState *BudgetConfigurationFilterClause_SdkV2) SyncEffectiveFieldsDuring func (newState *BudgetConfigurationFilterClause_SdkV2) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilterClause_SdkV2) { } -func (c BudgetConfigurationFilterClause_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BudgetConfigurationFilterClause_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["operator"] = attrs["operator"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilterClause. @@ -510,9 +528,9 @@ func (o *BudgetConfigurationFilterClause_SdkV2) SetValues(ctx context.Context, v } type BudgetConfigurationFilterTagClause_SdkV2 struct { - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` - Value types.List `tfsdk:"value" tf:"optional,object"` + Value types.List `tfsdk:"value"` } func (newState *BudgetConfigurationFilterTagClause_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilterTagClause_SdkV2) { @@ -521,10 +539,12 @@ func (newState *BudgetConfigurationFilterTagClause_SdkV2) SyncEffectiveFieldsDur func (newState *BudgetConfigurationFilterTagClause_SdkV2) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilterTagClause_SdkV2) { } -func (c BudgetConfigurationFilterTagClause_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfigurationFilterClause_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c BudgetConfigurationFilterTagClause_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() + attrs["value"] = attrs["value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilterTagClause. @@ -591,9 +611,9 @@ func (o *BudgetConfigurationFilterTagClause_SdkV2) SetValue(ctx context.Context, } type BudgetConfigurationFilterWorkspaceIdClause_SdkV2 struct { - Operator types.String `tfsdk:"operator" tf:"optional"` + Operator types.String `tfsdk:"operator"` - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *BudgetConfigurationFilterWorkspaceIdClause_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilterWorkspaceIdClause_SdkV2) { @@ -602,9 +622,11 @@ func (newState *BudgetConfigurationFilterWorkspaceIdClause_SdkV2) SyncEffectiveF func (newState *BudgetConfigurationFilterWorkspaceIdClause_SdkV2) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilterWorkspaceIdClause_SdkV2) { } -func (c BudgetConfigurationFilterWorkspaceIdClause_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BudgetConfigurationFilterWorkspaceIdClause_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["operator"] = attrs["operator"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilterWorkspaceIdClause. @@ -674,10 +696,10 @@ type CreateBillingUsageDashboardRequest_SdkV2 struct { // Workspace level usage dashboard shows usage data for the specified // workspace ID. Global level usage dashboard shows usage data for all // workspaces in the account. - DashboardType types.String `tfsdk:"dashboard_type" tf:"optional"` + DashboardType types.String `tfsdk:"dashboard_type"` // The workspace ID of the workspace in which the usage dashboard is // created. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *CreateBillingUsageDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBillingUsageDashboardRequest_SdkV2) { @@ -686,9 +708,11 @@ func (newState *CreateBillingUsageDashboardRequest_SdkV2) SyncEffectiveFieldsDur func (newState *CreateBillingUsageDashboardRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBillingUsageDashboardRequest_SdkV2) { } -func (c CreateBillingUsageDashboardRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateBillingUsageDashboardRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_type"] = attrs["dashboard_type"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBillingUsageDashboardRequest. @@ -726,7 +750,7 @@ func (o CreateBillingUsageDashboardRequest_SdkV2) Type(ctx context.Context) attr type CreateBillingUsageDashboardResponse_SdkV2 struct { // The unique id of the usage dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` } func (newState *CreateBillingUsageDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBillingUsageDashboardResponse_SdkV2) { @@ -735,9 +759,10 @@ func (newState *CreateBillingUsageDashboardResponse_SdkV2) SyncEffectiveFieldsDu func (newState *CreateBillingUsageDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBillingUsageDashboardResponse_SdkV2) { } -func (c CreateBillingUsageDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateBillingUsageDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBillingUsageDashboardResponse. @@ -773,17 +798,17 @@ func (o CreateBillingUsageDashboardResponse_SdkV2) Type(ctx context.Context) att type CreateBudgetConfigurationBudget_SdkV2 struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations types.List `tfsdk:"alert_configurations" tf:"optional"` + AlertConfigurations types.List `tfsdk:"alert_configurations"` // Human-readable name of budget configuration. Max Length: 128 - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter types.List `tfsdk:"filter" tf:"optional,object"` + Filter types.List `tfsdk:"filter"` } func (newState *CreateBudgetConfigurationBudget_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationBudget_SdkV2) { @@ -792,11 +817,14 @@ func (newState *CreateBudgetConfigurationBudget_SdkV2) SyncEffectiveFieldsDuring func (newState *CreateBudgetConfigurationBudget_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationBudget_SdkV2) { } -func (c CreateBudgetConfigurationBudget_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert_configurations")...) - BudgetConfigurationFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c CreateBudgetConfigurationBudget_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["alert_configurations"] = attrs["alert_configurations"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() + attrs["filter"] = attrs["filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationBudget. @@ -897,9 +925,9 @@ func (o *CreateBudgetConfigurationBudget_SdkV2) SetFilter(ctx context.Context, v type CreateBudgetConfigurationBudgetActionConfigurations_SdkV2 struct { // The type of the action. - ActionType types.String `tfsdk:"action_type" tf:"optional"` + ActionType types.String `tfsdk:"action_type"` // Target for the action. For example, an email address. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` } func (newState *CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) { @@ -908,9 +936,11 @@ func (newState *CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) SyncE func (newState *CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) { } -func (c CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_type"] = attrs["action_type"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationBudgetActionConfigurations. @@ -949,18 +979,18 @@ func (o CreateBudgetConfigurationBudgetActionConfigurations_SdkV2) Type(ctx cont type CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2 struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. - ActionConfigurations types.List `tfsdk:"action_configurations" tf:"optional"` + ActionConfigurations types.List `tfsdk:"action_configurations"` // The threshold for the budget alert to determine if it is in a triggered // state. The number is evaluated based on `quantity_type`. - QuantityThreshold types.String `tfsdk:"quantity_threshold" tf:"optional"` + QuantityThreshold types.String `tfsdk:"quantity_threshold"` // The way to calculate cost for this budget alert. This is what // `quantity_threshold` is measured in. - QuantityType types.String `tfsdk:"quantity_type" tf:"optional"` + QuantityType types.String `tfsdk:"quantity_type"` // The time window of usage data for the budget. - TimePeriod types.String `tfsdk:"time_period" tf:"optional"` + TimePeriod types.String `tfsdk:"time_period"` // The evaluation method to determine when this budget alert is in a // triggered state. - TriggerType types.String `tfsdk:"trigger_type" tf:"optional"` + TriggerType types.String `tfsdk:"trigger_type"` } func (newState *CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) { @@ -969,10 +999,14 @@ func (newState *CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) SyncEf func (newState *CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) { } -func (c CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateBudgetConfigurationBudgetActionConfigurations_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "action_configurations")...) +func (c CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_configurations"] = attrs["action_configurations"].SetOptional() + attrs["quantity_threshold"] = attrs["quantity_threshold"].SetOptional() + attrs["quantity_type"] = attrs["quantity_type"].SetOptional() + attrs["time_period"] = attrs["time_period"].SetOptional() + attrs["trigger_type"] = attrs["trigger_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationBudgetAlertConfigurations. @@ -1046,7 +1080,7 @@ func (o *CreateBudgetConfigurationBudgetAlertConfigurations_SdkV2) SetActionConf type CreateBudgetConfigurationRequest_SdkV2 struct { // Properties of the new budget configuration. - Budget types.List `tfsdk:"budget" tf:"object"` + Budget types.List `tfsdk:"budget"` } func (newState *CreateBudgetConfigurationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationRequest_SdkV2) { @@ -1055,11 +1089,11 @@ func (newState *CreateBudgetConfigurationRequest_SdkV2) SyncEffectiveFieldsDurin func (newState *CreateBudgetConfigurationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationRequest_SdkV2) { } -func (c CreateBudgetConfigurationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "budget")...) - CreateBudgetConfigurationBudget_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c CreateBudgetConfigurationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetRequired() + attrs["budget"] = attrs["budget"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationRequest. @@ -1125,7 +1159,7 @@ func (o *CreateBudgetConfigurationRequest_SdkV2) SetBudget(ctx context.Context, type CreateBudgetConfigurationResponse_SdkV2 struct { // The created budget configuration. - Budget types.List `tfsdk:"budget" tf:"optional,object"` + Budget types.List `tfsdk:"budget"` } func (newState *CreateBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationResponse_SdkV2) { @@ -1134,10 +1168,11 @@ func (newState *CreateBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *CreateBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationResponse_SdkV2) { } -func (c CreateBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c CreateBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetOptional() + attrs["budget"] = attrs["budget"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationResponse. @@ -1204,23 +1239,23 @@ func (o *CreateBudgetConfigurationResponse_SdkV2) SetBudget(ctx context.Context, type CreateLogDeliveryConfigurationParams_SdkV2 struct { // The optional human-readable name of the log delivery configuration. // Defaults to empty. - ConfigName types.String `tfsdk:"config_name" tf:"optional"` + ConfigName types.String `tfsdk:"config_name"` // The ID for a method:credentials/create that represents the AWS IAM role // with policy and trust relationship as described in the main billable // usage documentation page. See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - CredentialsId types.String `tfsdk:"credentials_id" tf:""` + CredentialsId types.String `tfsdk:"credentials_id"` // The optional delivery path prefix within Amazon S3 storage. Defaults to // empty, which means that logs are delivered to the root of the bucket. // This must be a valid S3 object key. This must not start or end with a // slash character. - DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix" tf:"optional"` + DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix"` // This field applies only if `log_type` is `BILLABLE_USAGE`. This is the // optional start month and year for delivery, specified in `YYYY-MM` // format. Defaults to current year and month. `BILLABLE_USAGE` logs are not // available for usage before March 2019 (`2019-03`). - DeliveryStartTime types.String `tfsdk:"delivery_start_time" tf:"optional"` + DeliveryStartTime types.String `tfsdk:"delivery_start_time"` // Log delivery type. Supported values are: // // * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the @@ -1233,7 +1268,7 @@ type CreateLogDeliveryConfigurationParams_SdkV2 struct { // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - LogType types.String `tfsdk:"log_type" tf:""` + LogType types.String `tfsdk:"log_type"` // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the @@ -1244,19 +1279,19 @@ type CreateLogDeliveryConfigurationParams_SdkV2 struct { // // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html - OutputFormat types.String `tfsdk:"output_format" tf:""` + OutputFormat types.String `tfsdk:"output_format"` // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The ID for a method:storage/create that represents the S3 bucket with // bucket policy as described in the main billable usage documentation page. // See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:""` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // Optional filter that specifies workspace IDs to deliver logs for. By // default the workspace filter is empty and log delivery applies at the // account level, delivering workspace-level logs for all workspaces in your @@ -1270,7 +1305,7 @@ type CreateLogDeliveryConfigurationParams_SdkV2 struct { // delivery won't include account level logs. For some types of Databricks // deployments there is only one workspace per account ID, so this field is // unnecessary. - WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter" tf:"optional"` + WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter"` } func (newState *CreateLogDeliveryConfigurationParams_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateLogDeliveryConfigurationParams_SdkV2) { @@ -1279,13 +1314,18 @@ func (newState *CreateLogDeliveryConfigurationParams_SdkV2) SyncEffectiveFieldsD func (newState *CreateLogDeliveryConfigurationParams_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateLogDeliveryConfigurationParams_SdkV2) { } -func (c CreateLogDeliveryConfigurationParams_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credentials_id")...) - cs.SetRequired(append(path, "log_type")...) - cs.SetRequired(append(path, "output_format")...) - cs.SetRequired(append(path, "storage_configuration_id")...) +func (c CreateLogDeliveryConfigurationParams_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config_name"] = attrs["config_name"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetRequired() + attrs["delivery_path_prefix"] = attrs["delivery_path_prefix"].SetOptional() + attrs["delivery_start_time"] = attrs["delivery_start_time"].SetOptional() + attrs["log_type"] = attrs["log_type"].SetRequired() + attrs["output_format"] = attrs["output_format"].SetRequired() + attrs["status"] = attrs["status"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetRequired() + attrs["workspace_ids_filter"] = attrs["workspace_ids_filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateLogDeliveryConfigurationParams. @@ -1411,9 +1451,9 @@ func (newState *DeleteBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *DeleteBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteBudgetConfigurationResponse_SdkV2) { } -func (c DeleteBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteBudgetConfigurationResponse. @@ -1573,9 +1613,9 @@ func (o GetBillingUsageDashboardRequest_SdkV2) Type(ctx context.Context) attr.Ty type GetBillingUsageDashboardResponse_SdkV2 struct { // The unique id of the usage dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The URL of the usage dashboard. - DashboardUrl types.String `tfsdk:"dashboard_url" tf:"optional"` + DashboardUrl types.String `tfsdk:"dashboard_url"` } func (newState *GetBillingUsageDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetBillingUsageDashboardResponse_SdkV2) { @@ -1584,9 +1624,11 @@ func (newState *GetBillingUsageDashboardResponse_SdkV2) SyncEffectiveFieldsDurin func (newState *GetBillingUsageDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetBillingUsageDashboardResponse_SdkV2) { } -func (c GetBillingUsageDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetBillingUsageDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["dashboard_url"] = attrs["dashboard_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetBillingUsageDashboardResponse. @@ -1660,7 +1702,7 @@ func (o GetBudgetConfigurationRequest_SdkV2) Type(ctx context.Context) attr.Type } type GetBudgetConfigurationResponse_SdkV2 struct { - Budget types.List `tfsdk:"budget" tf:"optional,object"` + Budget types.List `tfsdk:"budget"` } func (newState *GetBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetBudgetConfigurationResponse_SdkV2) { @@ -1669,10 +1711,11 @@ func (newState *GetBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *GetBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetBudgetConfigurationResponse_SdkV2) { } -func (c GetBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c GetBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetOptional() + attrs["budget"] = attrs["budget"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetBudgetConfigurationResponse. @@ -1813,10 +1856,10 @@ func (o ListBudgetConfigurationsRequest_SdkV2) Type(ctx context.Context) attr.Ty } type ListBudgetConfigurationsResponse_SdkV2 struct { - Budgets types.List `tfsdk:"budgets" tf:"optional"` + Budgets types.List `tfsdk:"budgets"` // Token which can be sent as `page_token` to retrieve the next page of // results. If this field is omitted, there are no subsequent budgets. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListBudgetConfigurationsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListBudgetConfigurationsResponse_SdkV2) { @@ -1825,10 +1868,11 @@ func (newState *ListBudgetConfigurationsResponse_SdkV2) SyncEffectiveFieldsDurin func (newState *ListBudgetConfigurationsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListBudgetConfigurationsResponse_SdkV2) { } -func (c ListBudgetConfigurationsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "budgets")...) +func (c ListBudgetConfigurationsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budgets"] = attrs["budgets"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListBudgetConfigurationsResponse. @@ -1941,33 +1985,33 @@ func (o ListLogDeliveryRequest_SdkV2) Type(ctx context.Context) attr.Type { type LogDeliveryConfiguration_SdkV2 struct { // The Databricks account ID that hosts the log delivery configuration. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Databricks log delivery configuration ID. - ConfigId types.String `tfsdk:"config_id" tf:"optional"` + ConfigId types.String `tfsdk:"config_id"` // The optional human-readable name of the log delivery configuration. // Defaults to empty. - ConfigName types.String `tfsdk:"config_name" tf:"optional"` + ConfigName types.String `tfsdk:"config_name"` // Time in epoch milliseconds when the log delivery configuration was // created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // The ID for a method:credentials/create that represents the AWS IAM role // with policy and trust relationship as described in the main billable // usage documentation page. See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The optional delivery path prefix within Amazon S3 storage. Defaults to // empty, which means that logs are delivered to the root of the bucket. // This must be a valid S3 object key. This must not start or end with a // slash character. - DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix" tf:"optional"` + DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix"` // This field applies only if `log_type` is `BILLABLE_USAGE`. This is the // optional start month and year for delivery, specified in `YYYY-MM` // format. Defaults to current year and month. `BILLABLE_USAGE` logs are not // available for usage before March 2019 (`2019-03`). - DeliveryStartTime types.String `tfsdk:"delivery_start_time" tf:"optional"` + DeliveryStartTime types.String `tfsdk:"delivery_start_time"` // Databricks log delivery status. - LogDeliveryStatus types.List `tfsdk:"log_delivery_status" tf:"optional,object"` + LogDeliveryStatus types.List `tfsdk:"log_delivery_status"` // Log delivery type. Supported values are: // // * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the @@ -1980,7 +2024,7 @@ type LogDeliveryConfiguration_SdkV2 struct { // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - LogType types.String `tfsdk:"log_type" tf:"optional"` + LogType types.String `tfsdk:"log_type"` // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the @@ -1991,22 +2035,22 @@ type LogDeliveryConfiguration_SdkV2 struct { // // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html - OutputFormat types.String `tfsdk:"output_format" tf:"optional"` + OutputFormat types.String `tfsdk:"output_format"` // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The ID for a method:storage/create that represents the S3 bucket with // bucket policy as described in the main billable usage documentation page. // See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // Time in epoch milliseconds when the log delivery configuration was // updated. - UpdateTime types.Int64 `tfsdk:"update_time" tf:"optional"` + UpdateTime types.Int64 `tfsdk:"update_time"` // Optional filter that specifies workspace IDs to deliver logs for. By // default the workspace filter is empty and log delivery applies at the // account level, delivering workspace-level logs for all workspaces in your @@ -2020,7 +2064,7 @@ type LogDeliveryConfiguration_SdkV2 struct { // delivery won't include account level logs. For some types of Databricks // deployments there is only one workspace per account ID, so this field is // unnecessary. - WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter" tf:"optional"` + WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter"` } func (newState *LogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogDeliveryConfiguration_SdkV2) { @@ -2029,10 +2073,24 @@ func (newState *LogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *LogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogDeliveryConfiguration_SdkV2) { } -func (c LogDeliveryConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogDeliveryStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_status")...) +func (c LogDeliveryConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["config_id"] = attrs["config_id"].SetOptional() + attrs["config_name"] = attrs["config_name"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["delivery_path_prefix"] = attrs["delivery_path_prefix"].SetOptional() + attrs["delivery_start_time"] = attrs["delivery_start_time"].SetOptional() + attrs["log_delivery_status"] = attrs["log_delivery_status"].SetOptional() + attrs["log_delivery_status"] = attrs["log_delivery_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["log_type"] = attrs["log_type"].SetOptional() + attrs["output_format"] = attrs["output_format"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() + attrs["workspace_ids_filter"] = attrs["workspace_ids_filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogDeliveryConfiguration. @@ -2154,13 +2212,13 @@ func (o *LogDeliveryConfiguration_SdkV2) SetWorkspaceIdsFilter(ctx context.Conte // Databricks log delivery status. type LogDeliveryStatus_SdkV2 struct { // The UTC time for the latest log delivery attempt. - LastAttemptTime types.String `tfsdk:"last_attempt_time" tf:"optional"` + LastAttemptTime types.String `tfsdk:"last_attempt_time"` // The UTC time for the latest successful log delivery. - LastSuccessfulAttemptTime types.String `tfsdk:"last_successful_attempt_time" tf:"optional"` + LastSuccessfulAttemptTime types.String `tfsdk:"last_successful_attempt_time"` // Informative message about the latest log delivery attempt. If the log // delivery fails with USER_FAILURE, error details will be provided for // fixing misconfigurations in cloud permissions. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // The status string for log delivery. Possible values are: * `CREATED`: // There were no log delivery attempts since the config was created. * // `SUCCEEDED`: The latest attempt of log delivery has succeeded completely. @@ -2171,7 +2229,7 @@ type LogDeliveryStatus_SdkV2 struct { // `NOT_FOUND`: The log delivery status as the configuration has been // disabled since the release of this feature or there are no workspaces in // the account. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *LogDeliveryStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogDeliveryStatus_SdkV2) { @@ -2180,9 +2238,13 @@ func (newState *LogDeliveryStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *LogDeliveryStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogDeliveryStatus_SdkV2) { } -func (c LogDeliveryStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogDeliveryStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_attempt_time"] = attrs["last_attempt_time"].SetOptional() + attrs["last_successful_attempt_time"] = attrs["last_successful_attempt_time"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogDeliveryStatus. @@ -2254,19 +2316,19 @@ func (o PatchStatusResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateBudgetConfigurationBudget_SdkV2 struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations types.List `tfsdk:"alert_configurations" tf:"optional"` + AlertConfigurations types.List `tfsdk:"alert_configurations"` // Databricks budget configuration ID. - BudgetConfigurationId types.String `tfsdk:"budget_configuration_id" tf:"optional"` + BudgetConfigurationId types.String `tfsdk:"budget_configuration_id"` // Human-readable name of budget configuration. Max Length: 128 - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter types.List `tfsdk:"filter" tf:"optional,object"` + Filter types.List `tfsdk:"filter"` } func (newState *UpdateBudgetConfigurationBudget_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateBudgetConfigurationBudget_SdkV2) { @@ -2275,11 +2337,15 @@ func (newState *UpdateBudgetConfigurationBudget_SdkV2) SyncEffectiveFieldsDuring func (newState *UpdateBudgetConfigurationBudget_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateBudgetConfigurationBudget_SdkV2) { } -func (c UpdateBudgetConfigurationBudget_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert_configurations")...) - BudgetConfigurationFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c UpdateBudgetConfigurationBudget_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["alert_configurations"] = attrs["alert_configurations"].SetOptional() + attrs["budget_configuration_id"] = attrs["budget_configuration_id"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() + attrs["filter"] = attrs["filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateBudgetConfigurationBudget. @@ -2383,7 +2449,7 @@ func (o *UpdateBudgetConfigurationBudget_SdkV2) SetFilter(ctx context.Context, v type UpdateBudgetConfigurationRequest_SdkV2 struct { // The updated budget. This will overwrite the budget specified by the // budget ID. - Budget types.List `tfsdk:"budget" tf:"object"` + Budget types.List `tfsdk:"budget"` // The Databricks budget configuration ID. BudgetId types.String `tfsdk:"-"` } @@ -2394,12 +2460,12 @@ func (newState *UpdateBudgetConfigurationRequest_SdkV2) SyncEffectiveFieldsDurin func (newState *UpdateBudgetConfigurationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateBudgetConfigurationRequest_SdkV2) { } -func (c UpdateBudgetConfigurationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "budget")...) - UpdateBudgetConfigurationBudget_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "budget")...) - cs.SetRequired(append(path, "budget_id")...) +func (c UpdateBudgetConfigurationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetRequired() + attrs["budget"] = attrs["budget"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["budget_id"] = attrs["budget_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateBudgetConfigurationRequest. @@ -2467,7 +2533,7 @@ func (o *UpdateBudgetConfigurationRequest_SdkV2) SetBudget(ctx context.Context, type UpdateBudgetConfigurationResponse_SdkV2 struct { // The updated budget. - Budget types.List `tfsdk:"budget" tf:"optional,object"` + Budget types.List `tfsdk:"budget"` } func (newState *UpdateBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateBudgetConfigurationResponse_SdkV2) { @@ -2476,10 +2542,11 @@ func (newState *UpdateBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *UpdateBudgetConfigurationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateBudgetConfigurationResponse_SdkV2) { } -func (c UpdateBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c UpdateBudgetConfigurationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetOptional() + attrs["budget"] = attrs["budget"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateBudgetConfigurationResponse. @@ -2551,7 +2618,7 @@ type UpdateLogDeliveryConfigurationStatusRequest_SdkV2 struct { // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` } func (newState *UpdateLogDeliveryConfigurationStatusRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateLogDeliveryConfigurationStatusRequest_SdkV2) { @@ -2560,11 +2627,11 @@ func (newState *UpdateLogDeliveryConfigurationStatusRequest_SdkV2) SyncEffective func (newState *UpdateLogDeliveryConfigurationStatusRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateLogDeliveryConfigurationStatusRequest_SdkV2) { } -func (c UpdateLogDeliveryConfigurationStatusRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "log_delivery_configuration_id")...) - cs.SetRequired(append(path, "status")...) +func (c UpdateLogDeliveryConfigurationStatusRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configuration_id"] = attrs["log_delivery_configuration_id"].SetRequired() + attrs["status"] = attrs["status"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateLogDeliveryConfigurationStatusRequest. @@ -2601,7 +2668,7 @@ func (o UpdateLogDeliveryConfigurationStatusRequest_SdkV2) Type(ctx context.Cont } type WrappedCreateLogDeliveryConfiguration_SdkV2 struct { - LogDeliveryConfiguration types.List `tfsdk:"log_delivery_configuration" tf:"optional,object"` + LogDeliveryConfiguration types.List `tfsdk:"log_delivery_configuration"` } func (newState *WrappedCreateLogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WrappedCreateLogDeliveryConfiguration_SdkV2) { @@ -2610,10 +2677,11 @@ func (newState *WrappedCreateLogDeliveryConfiguration_SdkV2) SyncEffectiveFields func (newState *WrappedCreateLogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState WrappedCreateLogDeliveryConfiguration_SdkV2) { } -func (c WrappedCreateLogDeliveryConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateLogDeliveryConfigurationParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_configuration")...) +func (c WrappedCreateLogDeliveryConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configuration"] = attrs["log_delivery_configuration"].SetOptional() + attrs["log_delivery_configuration"] = attrs["log_delivery_configuration"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WrappedCreateLogDeliveryConfiguration. @@ -2678,7 +2746,7 @@ func (o *WrappedCreateLogDeliveryConfiguration_SdkV2) SetLogDeliveryConfiguratio } type WrappedLogDeliveryConfiguration_SdkV2 struct { - LogDeliveryConfiguration types.List `tfsdk:"log_delivery_configuration" tf:"optional,object"` + LogDeliveryConfiguration types.List `tfsdk:"log_delivery_configuration"` } func (newState *WrappedLogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WrappedLogDeliveryConfiguration_SdkV2) { @@ -2687,10 +2755,11 @@ func (newState *WrappedLogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuring func (newState *WrappedLogDeliveryConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState WrappedLogDeliveryConfiguration_SdkV2) { } -func (c WrappedLogDeliveryConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogDeliveryConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_configuration")...) +func (c WrappedLogDeliveryConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configuration"] = attrs["log_delivery_configuration"].SetOptional() + attrs["log_delivery_configuration"] = attrs["log_delivery_configuration"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WrappedLogDeliveryConfiguration. @@ -2755,7 +2824,7 @@ func (o *WrappedLogDeliveryConfiguration_SdkV2) SetLogDeliveryConfiguration(ctx } type WrappedLogDeliveryConfigurations_SdkV2 struct { - LogDeliveryConfigurations types.List `tfsdk:"log_delivery_configurations" tf:"optional"` + LogDeliveryConfigurations types.List `tfsdk:"log_delivery_configurations"` } func (newState *WrappedLogDeliveryConfigurations_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WrappedLogDeliveryConfigurations_SdkV2) { @@ -2764,10 +2833,10 @@ func (newState *WrappedLogDeliveryConfigurations_SdkV2) SyncEffectiveFieldsDurin func (newState *WrappedLogDeliveryConfigurations_SdkV2) SyncEffectiveFieldsDuringRead(existingState WrappedLogDeliveryConfigurations_SdkV2) { } -func (c WrappedLogDeliveryConfigurations_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogDeliveryConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_configurations")...) +func (c WrappedLogDeliveryConfigurations_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configurations"] = attrs["log_delivery_configurations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WrappedLogDeliveryConfigurations. diff --git a/internal/service/billing_tf/model.go b/internal/service/billing_tf/model.go index f54426d46..73e77cbe8 100755 --- a/internal/service/billing_tf/model.go +++ b/internal/service/billing_tf/model.go @@ -24,11 +24,11 @@ import ( type ActionConfiguration struct { // Databricks action configuration ID. - ActionConfigurationId types.String `tfsdk:"action_configuration_id" tf:"optional"` + ActionConfigurationId types.String `tfsdk:"action_configuration_id"` // The type of the action. - ActionType types.String `tfsdk:"action_type" tf:"optional"` + ActionType types.String `tfsdk:"action_type"` // Target for the action. For example, an email address. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` } func (newState *ActionConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan ActionConfiguration) { @@ -37,9 +37,12 @@ func (newState *ActionConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ActionConfiguration) SyncEffectiveFieldsDuringRead(existingState ActionConfiguration) { } -func (c ActionConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ActionConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_configuration_id"] = attrs["action_configuration_id"].SetOptional() + attrs["action_type"] = attrs["action_type"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ActionConfiguration. @@ -80,20 +83,20 @@ func (o ActionConfiguration) Type(ctx context.Context) attr.Type { type AlertConfiguration struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. - ActionConfigurations types.List `tfsdk:"action_configurations" tf:"optional"` + ActionConfigurations types.List `tfsdk:"action_configurations"` // Databricks alert configuration ID. - AlertConfigurationId types.String `tfsdk:"alert_configuration_id" tf:"optional"` + AlertConfigurationId types.String `tfsdk:"alert_configuration_id"` // The threshold for the budget alert to determine if it is in a triggered // state. The number is evaluated based on `quantity_type`. - QuantityThreshold types.String `tfsdk:"quantity_threshold" tf:"optional"` + QuantityThreshold types.String `tfsdk:"quantity_threshold"` // The way to calculate cost for this budget alert. This is what // `quantity_threshold` is measured in. - QuantityType types.String `tfsdk:"quantity_type" tf:"optional"` + QuantityType types.String `tfsdk:"quantity_type"` // The time window of usage data for the budget. - TimePeriod types.String `tfsdk:"time_period" tf:"optional"` + TimePeriod types.String `tfsdk:"time_period"` // The evaluation method to determine when this budget alert is in a // triggered state. - TriggerType types.String `tfsdk:"trigger_type" tf:"optional"` + TriggerType types.String `tfsdk:"trigger_type"` } func (newState *AlertConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertConfiguration) { @@ -102,10 +105,15 @@ func (newState *AlertConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AlertConfiguration) SyncEffectiveFieldsDuringRead(existingState AlertConfiguration) { } -func (c AlertConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ActionConfiguration{}.ApplySchemaCustomizations(cs, append(path, "action_configurations")...) +func (c AlertConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_configurations"] = attrs["action_configurations"].SetOptional() + attrs["alert_configuration_id"] = attrs["alert_configuration_id"].SetOptional() + attrs["quantity_threshold"] = attrs["quantity_threshold"].SetOptional() + attrs["quantity_type"] = attrs["quantity_type"].SetOptional() + attrs["time_period"] = attrs["time_period"].SetOptional() + attrs["trigger_type"] = attrs["trigger_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertConfiguration. @@ -181,23 +189,23 @@ func (o *AlertConfiguration) SetActionConfigurations(ctx context.Context, v []Ac type BudgetConfiguration struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations types.List `tfsdk:"alert_configurations" tf:"optional"` + AlertConfigurations types.List `tfsdk:"alert_configurations"` // Databricks budget configuration ID. - BudgetConfigurationId types.String `tfsdk:"budget_configuration_id" tf:"optional"` + BudgetConfigurationId types.String `tfsdk:"budget_configuration_id"` // Creation time of this budget configuration. - CreateTime types.Int64 `tfsdk:"create_time" tf:"optional"` + CreateTime types.Int64 `tfsdk:"create_time"` // Human-readable name of budget configuration. Max Length: 128 - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter types.Object `tfsdk:"filter" tf:"optional,object"` + Filter types.Object `tfsdk:"filter"` // Update time of this budget configuration. - UpdateTime types.Int64 `tfsdk:"update_time" tf:"optional"` + UpdateTime types.Int64 `tfsdk:"update_time"` } func (newState *BudgetConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfiguration) { @@ -206,11 +214,16 @@ func (newState *BudgetConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *BudgetConfiguration) SyncEffectiveFieldsDuringRead(existingState BudgetConfiguration) { } -func (c BudgetConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertConfiguration{}.ApplySchemaCustomizations(cs, append(path, "alert_configurations")...) - BudgetConfigurationFilter{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c BudgetConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["alert_configurations"] = attrs["alert_configurations"].SetOptional() + attrs["budget_configuration_id"] = attrs["budget_configuration_id"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfiguration. @@ -319,9 +332,9 @@ type BudgetConfigurationFilter struct { // A list of tag keys and values that will limit the budget to usage that // includes those specific custom tags. Tags are case-sensitive and should // be entered exactly as they appear in your usage data. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // If provided, usage must match with the provided Databricks workspace IDs. - WorkspaceId types.Object `tfsdk:"workspace_id" tf:"optional,object"` + WorkspaceId types.Object `tfsdk:"workspace_id"` } func (newState *BudgetConfigurationFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilter) { @@ -330,11 +343,11 @@ func (newState *BudgetConfigurationFilter) SyncEffectiveFieldsDuringCreateOrUpda func (newState *BudgetConfigurationFilter) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilter) { } -func (c BudgetConfigurationFilter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfigurationFilterTagClause{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - BudgetConfigurationFilterWorkspaceIdClause{}.ApplySchemaCustomizations(cs, append(path, "workspace_id")...) +func (c BudgetConfigurationFilter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["tags"] = attrs["tags"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilter. @@ -430,9 +443,9 @@ func (o *BudgetConfigurationFilter) SetWorkspaceId(ctx context.Context, v Budget } type BudgetConfigurationFilterClause struct { - Operator types.String `tfsdk:"operator" tf:"optional"` + Operator types.String `tfsdk:"operator"` - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *BudgetConfigurationFilterClause) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilterClause) { @@ -441,9 +454,11 @@ func (newState *BudgetConfigurationFilterClause) SyncEffectiveFieldsDuringCreate func (newState *BudgetConfigurationFilterClause) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilterClause) { } -func (c BudgetConfigurationFilterClause) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BudgetConfigurationFilterClause) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["operator"] = attrs["operator"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilterClause. @@ -510,9 +525,9 @@ func (o *BudgetConfigurationFilterClause) SetValues(ctx context.Context, v []typ } type BudgetConfigurationFilterTagClause struct { - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` - Value types.Object `tfsdk:"value" tf:"optional,object"` + Value types.Object `tfsdk:"value"` } func (newState *BudgetConfigurationFilterTagClause) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilterTagClause) { @@ -521,10 +536,11 @@ func (newState *BudgetConfigurationFilterTagClause) SyncEffectiveFieldsDuringCre func (newState *BudgetConfigurationFilterTagClause) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilterTagClause) { } -func (c BudgetConfigurationFilterTagClause) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfigurationFilterClause{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c BudgetConfigurationFilterTagClause) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilterTagClause. @@ -591,9 +607,9 @@ func (o *BudgetConfigurationFilterTagClause) SetValue(ctx context.Context, v Bud } type BudgetConfigurationFilterWorkspaceIdClause struct { - Operator types.String `tfsdk:"operator" tf:"optional"` + Operator types.String `tfsdk:"operator"` - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *BudgetConfigurationFilterWorkspaceIdClause) SyncEffectiveFieldsDuringCreateOrUpdate(plan BudgetConfigurationFilterWorkspaceIdClause) { @@ -602,9 +618,11 @@ func (newState *BudgetConfigurationFilterWorkspaceIdClause) SyncEffectiveFieldsD func (newState *BudgetConfigurationFilterWorkspaceIdClause) SyncEffectiveFieldsDuringRead(existingState BudgetConfigurationFilterWorkspaceIdClause) { } -func (c BudgetConfigurationFilterWorkspaceIdClause) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BudgetConfigurationFilterWorkspaceIdClause) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["operator"] = attrs["operator"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BudgetConfigurationFilterWorkspaceIdClause. @@ -674,10 +692,10 @@ type CreateBillingUsageDashboardRequest struct { // Workspace level usage dashboard shows usage data for the specified // workspace ID. Global level usage dashboard shows usage data for all // workspaces in the account. - DashboardType types.String `tfsdk:"dashboard_type" tf:"optional"` + DashboardType types.String `tfsdk:"dashboard_type"` // The workspace ID of the workspace in which the usage dashboard is // created. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *CreateBillingUsageDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBillingUsageDashboardRequest) { @@ -686,9 +704,11 @@ func (newState *CreateBillingUsageDashboardRequest) SyncEffectiveFieldsDuringCre func (newState *CreateBillingUsageDashboardRequest) SyncEffectiveFieldsDuringRead(existingState CreateBillingUsageDashboardRequest) { } -func (c CreateBillingUsageDashboardRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateBillingUsageDashboardRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_type"] = attrs["dashboard_type"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBillingUsageDashboardRequest. @@ -726,7 +746,7 @@ func (o CreateBillingUsageDashboardRequest) Type(ctx context.Context) attr.Type type CreateBillingUsageDashboardResponse struct { // The unique id of the usage dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` } func (newState *CreateBillingUsageDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBillingUsageDashboardResponse) { @@ -735,9 +755,10 @@ func (newState *CreateBillingUsageDashboardResponse) SyncEffectiveFieldsDuringCr func (newState *CreateBillingUsageDashboardResponse) SyncEffectiveFieldsDuringRead(existingState CreateBillingUsageDashboardResponse) { } -func (c CreateBillingUsageDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateBillingUsageDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBillingUsageDashboardResponse. @@ -773,17 +794,17 @@ func (o CreateBillingUsageDashboardResponse) Type(ctx context.Context) attr.Type type CreateBudgetConfigurationBudget struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations types.List `tfsdk:"alert_configurations" tf:"optional"` + AlertConfigurations types.List `tfsdk:"alert_configurations"` // Human-readable name of budget configuration. Max Length: 128 - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter types.Object `tfsdk:"filter" tf:"optional,object"` + Filter types.Object `tfsdk:"filter"` } func (newState *CreateBudgetConfigurationBudget) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationBudget) { @@ -792,11 +813,13 @@ func (newState *CreateBudgetConfigurationBudget) SyncEffectiveFieldsDuringCreate func (newState *CreateBudgetConfigurationBudget) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationBudget) { } -func (c CreateBudgetConfigurationBudget) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateBudgetConfigurationBudgetAlertConfigurations{}.ApplySchemaCustomizations(cs, append(path, "alert_configurations")...) - BudgetConfigurationFilter{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c CreateBudgetConfigurationBudget) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["alert_configurations"] = attrs["alert_configurations"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationBudget. @@ -897,9 +920,9 @@ func (o *CreateBudgetConfigurationBudget) SetFilter(ctx context.Context, v Budge type CreateBudgetConfigurationBudgetActionConfigurations struct { // The type of the action. - ActionType types.String `tfsdk:"action_type" tf:"optional"` + ActionType types.String `tfsdk:"action_type"` // Target for the action. For example, an email address. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` } func (newState *CreateBudgetConfigurationBudgetActionConfigurations) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationBudgetActionConfigurations) { @@ -908,9 +931,11 @@ func (newState *CreateBudgetConfigurationBudgetActionConfigurations) SyncEffecti func (newState *CreateBudgetConfigurationBudgetActionConfigurations) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationBudgetActionConfigurations) { } -func (c CreateBudgetConfigurationBudgetActionConfigurations) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateBudgetConfigurationBudgetActionConfigurations) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_type"] = attrs["action_type"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationBudgetActionConfigurations. @@ -949,18 +974,18 @@ func (o CreateBudgetConfigurationBudgetActionConfigurations) Type(ctx context.Co type CreateBudgetConfigurationBudgetAlertConfigurations struct { // Configured actions for this alert. These define what happens when an // alert enters a triggered state. - ActionConfigurations types.List `tfsdk:"action_configurations" tf:"optional"` + ActionConfigurations types.List `tfsdk:"action_configurations"` // The threshold for the budget alert to determine if it is in a triggered // state. The number is evaluated based on `quantity_type`. - QuantityThreshold types.String `tfsdk:"quantity_threshold" tf:"optional"` + QuantityThreshold types.String `tfsdk:"quantity_threshold"` // The way to calculate cost for this budget alert. This is what // `quantity_threshold` is measured in. - QuantityType types.String `tfsdk:"quantity_type" tf:"optional"` + QuantityType types.String `tfsdk:"quantity_type"` // The time window of usage data for the budget. - TimePeriod types.String `tfsdk:"time_period" tf:"optional"` + TimePeriod types.String `tfsdk:"time_period"` // The evaluation method to determine when this budget alert is in a // triggered state. - TriggerType types.String `tfsdk:"trigger_type" tf:"optional"` + TriggerType types.String `tfsdk:"trigger_type"` } func (newState *CreateBudgetConfigurationBudgetAlertConfigurations) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationBudgetAlertConfigurations) { @@ -969,10 +994,14 @@ func (newState *CreateBudgetConfigurationBudgetAlertConfigurations) SyncEffectiv func (newState *CreateBudgetConfigurationBudgetAlertConfigurations) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationBudgetAlertConfigurations) { } -func (c CreateBudgetConfigurationBudgetAlertConfigurations) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateBudgetConfigurationBudgetActionConfigurations{}.ApplySchemaCustomizations(cs, append(path, "action_configurations")...) +func (c CreateBudgetConfigurationBudgetAlertConfigurations) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action_configurations"] = attrs["action_configurations"].SetOptional() + attrs["quantity_threshold"] = attrs["quantity_threshold"].SetOptional() + attrs["quantity_type"] = attrs["quantity_type"].SetOptional() + attrs["time_period"] = attrs["time_period"].SetOptional() + attrs["trigger_type"] = attrs["trigger_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationBudgetAlertConfigurations. @@ -1046,7 +1075,7 @@ func (o *CreateBudgetConfigurationBudgetAlertConfigurations) SetActionConfigurat type CreateBudgetConfigurationRequest struct { // Properties of the new budget configuration. - Budget types.Object `tfsdk:"budget" tf:"object"` + Budget types.Object `tfsdk:"budget"` } func (newState *CreateBudgetConfigurationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationRequest) { @@ -1055,11 +1084,10 @@ func (newState *CreateBudgetConfigurationRequest) SyncEffectiveFieldsDuringCreat func (newState *CreateBudgetConfigurationRequest) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationRequest) { } -func (c CreateBudgetConfigurationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "budget")...) - CreateBudgetConfigurationBudget{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c CreateBudgetConfigurationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationRequest. @@ -1125,7 +1153,7 @@ func (o *CreateBudgetConfigurationRequest) SetBudget(ctx context.Context, v Crea type CreateBudgetConfigurationResponse struct { // The created budget configuration. - Budget types.Object `tfsdk:"budget" tf:"optional,object"` + Budget types.Object `tfsdk:"budget"` } func (newState *CreateBudgetConfigurationResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateBudgetConfigurationResponse) { @@ -1134,10 +1162,10 @@ func (newState *CreateBudgetConfigurationResponse) SyncEffectiveFieldsDuringCrea func (newState *CreateBudgetConfigurationResponse) SyncEffectiveFieldsDuringRead(existingState CreateBudgetConfigurationResponse) { } -func (c CreateBudgetConfigurationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c CreateBudgetConfigurationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateBudgetConfigurationResponse. @@ -1204,23 +1232,23 @@ func (o *CreateBudgetConfigurationResponse) SetBudget(ctx context.Context, v Bud type CreateLogDeliveryConfigurationParams struct { // The optional human-readable name of the log delivery configuration. // Defaults to empty. - ConfigName types.String `tfsdk:"config_name" tf:"optional"` + ConfigName types.String `tfsdk:"config_name"` // The ID for a method:credentials/create that represents the AWS IAM role // with policy and trust relationship as described in the main billable // usage documentation page. See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - CredentialsId types.String `tfsdk:"credentials_id" tf:""` + CredentialsId types.String `tfsdk:"credentials_id"` // The optional delivery path prefix within Amazon S3 storage. Defaults to // empty, which means that logs are delivered to the root of the bucket. // This must be a valid S3 object key. This must not start or end with a // slash character. - DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix" tf:"optional"` + DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix"` // This field applies only if `log_type` is `BILLABLE_USAGE`. This is the // optional start month and year for delivery, specified in `YYYY-MM` // format. Defaults to current year and month. `BILLABLE_USAGE` logs are not // available for usage before March 2019 (`2019-03`). - DeliveryStartTime types.String `tfsdk:"delivery_start_time" tf:"optional"` + DeliveryStartTime types.String `tfsdk:"delivery_start_time"` // Log delivery type. Supported values are: // // * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the @@ -1233,7 +1261,7 @@ type CreateLogDeliveryConfigurationParams struct { // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - LogType types.String `tfsdk:"log_type" tf:""` + LogType types.String `tfsdk:"log_type"` // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the @@ -1244,19 +1272,19 @@ type CreateLogDeliveryConfigurationParams struct { // // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html - OutputFormat types.String `tfsdk:"output_format" tf:""` + OutputFormat types.String `tfsdk:"output_format"` // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The ID for a method:storage/create that represents the S3 bucket with // bucket policy as described in the main billable usage documentation page. // See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:""` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // Optional filter that specifies workspace IDs to deliver logs for. By // default the workspace filter is empty and log delivery applies at the // account level, delivering workspace-level logs for all workspaces in your @@ -1270,7 +1298,7 @@ type CreateLogDeliveryConfigurationParams struct { // delivery won't include account level logs. For some types of Databricks // deployments there is only one workspace per account ID, so this field is // unnecessary. - WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter" tf:"optional"` + WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter"` } func (newState *CreateLogDeliveryConfigurationParams) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateLogDeliveryConfigurationParams) { @@ -1279,13 +1307,18 @@ func (newState *CreateLogDeliveryConfigurationParams) SyncEffectiveFieldsDuringC func (newState *CreateLogDeliveryConfigurationParams) SyncEffectiveFieldsDuringRead(existingState CreateLogDeliveryConfigurationParams) { } -func (c CreateLogDeliveryConfigurationParams) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credentials_id")...) - cs.SetRequired(append(path, "log_type")...) - cs.SetRequired(append(path, "output_format")...) - cs.SetRequired(append(path, "storage_configuration_id")...) +func (c CreateLogDeliveryConfigurationParams) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config_name"] = attrs["config_name"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetRequired() + attrs["delivery_path_prefix"] = attrs["delivery_path_prefix"].SetOptional() + attrs["delivery_start_time"] = attrs["delivery_start_time"].SetOptional() + attrs["log_type"] = attrs["log_type"].SetRequired() + attrs["output_format"] = attrs["output_format"].SetRequired() + attrs["status"] = attrs["status"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetRequired() + attrs["workspace_ids_filter"] = attrs["workspace_ids_filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateLogDeliveryConfigurationParams. @@ -1411,9 +1444,9 @@ func (newState *DeleteBudgetConfigurationResponse) SyncEffectiveFieldsDuringCrea func (newState *DeleteBudgetConfigurationResponse) SyncEffectiveFieldsDuringRead(existingState DeleteBudgetConfigurationResponse) { } -func (c DeleteBudgetConfigurationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteBudgetConfigurationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteBudgetConfigurationResponse. @@ -1573,9 +1606,9 @@ func (o GetBillingUsageDashboardRequest) Type(ctx context.Context) attr.Type { type GetBillingUsageDashboardResponse struct { // The unique id of the usage dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The URL of the usage dashboard. - DashboardUrl types.String `tfsdk:"dashboard_url" tf:"optional"` + DashboardUrl types.String `tfsdk:"dashboard_url"` } func (newState *GetBillingUsageDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetBillingUsageDashboardResponse) { @@ -1584,9 +1617,11 @@ func (newState *GetBillingUsageDashboardResponse) SyncEffectiveFieldsDuringCreat func (newState *GetBillingUsageDashboardResponse) SyncEffectiveFieldsDuringRead(existingState GetBillingUsageDashboardResponse) { } -func (c GetBillingUsageDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetBillingUsageDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["dashboard_url"] = attrs["dashboard_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetBillingUsageDashboardResponse. @@ -1660,7 +1695,7 @@ func (o GetBudgetConfigurationRequest) Type(ctx context.Context) attr.Type { } type GetBudgetConfigurationResponse struct { - Budget types.Object `tfsdk:"budget" tf:"optional,object"` + Budget types.Object `tfsdk:"budget"` } func (newState *GetBudgetConfigurationResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetBudgetConfigurationResponse) { @@ -1669,10 +1704,10 @@ func (newState *GetBudgetConfigurationResponse) SyncEffectiveFieldsDuringCreateO func (newState *GetBudgetConfigurationResponse) SyncEffectiveFieldsDuringRead(existingState GetBudgetConfigurationResponse) { } -func (c GetBudgetConfigurationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c GetBudgetConfigurationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetBudgetConfigurationResponse. @@ -1813,10 +1848,10 @@ func (o ListBudgetConfigurationsRequest) Type(ctx context.Context) attr.Type { } type ListBudgetConfigurationsResponse struct { - Budgets types.List `tfsdk:"budgets" tf:"optional"` + Budgets types.List `tfsdk:"budgets"` // Token which can be sent as `page_token` to retrieve the next page of // results. If this field is omitted, there are no subsequent budgets. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListBudgetConfigurationsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListBudgetConfigurationsResponse) { @@ -1825,10 +1860,11 @@ func (newState *ListBudgetConfigurationsResponse) SyncEffectiveFieldsDuringCreat func (newState *ListBudgetConfigurationsResponse) SyncEffectiveFieldsDuringRead(existingState ListBudgetConfigurationsResponse) { } -func (c ListBudgetConfigurationsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration{}.ApplySchemaCustomizations(cs, append(path, "budgets")...) +func (c ListBudgetConfigurationsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budgets"] = attrs["budgets"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListBudgetConfigurationsResponse. @@ -1941,33 +1977,33 @@ func (o ListLogDeliveryRequest) Type(ctx context.Context) attr.Type { type LogDeliveryConfiguration struct { // The Databricks account ID that hosts the log delivery configuration. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Databricks log delivery configuration ID. - ConfigId types.String `tfsdk:"config_id" tf:"optional"` + ConfigId types.String `tfsdk:"config_id"` // The optional human-readable name of the log delivery configuration. // Defaults to empty. - ConfigName types.String `tfsdk:"config_name" tf:"optional"` + ConfigName types.String `tfsdk:"config_name"` // Time in epoch milliseconds when the log delivery configuration was // created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // The ID for a method:credentials/create that represents the AWS IAM role // with policy and trust relationship as described in the main billable // usage documentation page. See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The optional delivery path prefix within Amazon S3 storage. Defaults to // empty, which means that logs are delivered to the root of the bucket. // This must be a valid S3 object key. This must not start or end with a // slash character. - DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix" tf:"optional"` + DeliveryPathPrefix types.String `tfsdk:"delivery_path_prefix"` // This field applies only if `log_type` is `BILLABLE_USAGE`. This is the // optional start month and year for delivery, specified in `YYYY-MM` // format. Defaults to current year and month. `BILLABLE_USAGE` logs are not // available for usage before March 2019 (`2019-03`). - DeliveryStartTime types.String `tfsdk:"delivery_start_time" tf:"optional"` + DeliveryStartTime types.String `tfsdk:"delivery_start_time"` // Databricks log delivery status. - LogDeliveryStatus types.Object `tfsdk:"log_delivery_status" tf:"optional,object"` + LogDeliveryStatus types.Object `tfsdk:"log_delivery_status"` // Log delivery type. Supported values are: // // * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the @@ -1980,7 +2016,7 @@ type LogDeliveryConfiguration struct { // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html // [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - LogType types.String `tfsdk:"log_type" tf:"optional"` + LogType types.String `tfsdk:"log_type"` // The file type of log delivery. // // * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the @@ -1991,22 +2027,22 @@ type LogDeliveryConfiguration struct { // // [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html // [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html - OutputFormat types.String `tfsdk:"output_format" tf:"optional"` + OutputFormat types.String `tfsdk:"output_format"` // Status of log delivery configuration. Set to `ENABLED` (enabled) or // `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The ID for a method:storage/create that represents the S3 bucket with // bucket policy as described in the main billable usage documentation page. // See [Configure billable usage delivery]. // // [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // Time in epoch milliseconds when the log delivery configuration was // updated. - UpdateTime types.Int64 `tfsdk:"update_time" tf:"optional"` + UpdateTime types.Int64 `tfsdk:"update_time"` // Optional filter that specifies workspace IDs to deliver logs for. By // default the workspace filter is empty and log delivery applies at the // account level, delivering workspace-level logs for all workspaces in your @@ -2020,7 +2056,7 @@ type LogDeliveryConfiguration struct { // delivery won't include account level logs. For some types of Databricks // deployments there is only one workspace per account ID, so this field is // unnecessary. - WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter" tf:"optional"` + WorkspaceIdsFilter types.List `tfsdk:"workspace_ids_filter"` } func (newState *LogDeliveryConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogDeliveryConfiguration) { @@ -2029,10 +2065,23 @@ func (newState *LogDeliveryConfiguration) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *LogDeliveryConfiguration) SyncEffectiveFieldsDuringRead(existingState LogDeliveryConfiguration) { } -func (c LogDeliveryConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogDeliveryStatus{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_status")...) +func (c LogDeliveryConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["config_id"] = attrs["config_id"].SetOptional() + attrs["config_name"] = attrs["config_name"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["delivery_path_prefix"] = attrs["delivery_path_prefix"].SetOptional() + attrs["delivery_start_time"] = attrs["delivery_start_time"].SetOptional() + attrs["log_delivery_status"] = attrs["log_delivery_status"].SetOptional() + attrs["log_type"] = attrs["log_type"].SetOptional() + attrs["output_format"] = attrs["output_format"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() + attrs["workspace_ids_filter"] = attrs["workspace_ids_filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogDeliveryConfiguration. @@ -2154,13 +2203,13 @@ func (o *LogDeliveryConfiguration) SetWorkspaceIdsFilter(ctx context.Context, v // Databricks log delivery status. type LogDeliveryStatus struct { // The UTC time for the latest log delivery attempt. - LastAttemptTime types.String `tfsdk:"last_attempt_time" tf:"optional"` + LastAttemptTime types.String `tfsdk:"last_attempt_time"` // The UTC time for the latest successful log delivery. - LastSuccessfulAttemptTime types.String `tfsdk:"last_successful_attempt_time" tf:"optional"` + LastSuccessfulAttemptTime types.String `tfsdk:"last_successful_attempt_time"` // Informative message about the latest log delivery attempt. If the log // delivery fails with USER_FAILURE, error details will be provided for // fixing misconfigurations in cloud permissions. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // The status string for log delivery. Possible values are: * `CREATED`: // There were no log delivery attempts since the config was created. * // `SUCCEEDED`: The latest attempt of log delivery has succeeded completely. @@ -2171,7 +2220,7 @@ type LogDeliveryStatus struct { // `NOT_FOUND`: The log delivery status as the configuration has been // disabled since the release of this feature or there are no workspaces in // the account. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *LogDeliveryStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogDeliveryStatus) { @@ -2180,9 +2229,13 @@ func (newState *LogDeliveryStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *LogDeliveryStatus) SyncEffectiveFieldsDuringRead(existingState LogDeliveryStatus) { } -func (c LogDeliveryStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogDeliveryStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_attempt_time"] = attrs["last_attempt_time"].SetOptional() + attrs["last_successful_attempt_time"] = attrs["last_successful_attempt_time"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogDeliveryStatus. @@ -2254,19 +2307,19 @@ func (o PatchStatusResponse) Type(ctx context.Context) attr.Type { type UpdateBudgetConfigurationBudget struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Alerts to configure when this budget is in a triggered state. Budgets // must have exactly one alert configuration. - AlertConfigurations types.List `tfsdk:"alert_configurations" tf:"optional"` + AlertConfigurations types.List `tfsdk:"alert_configurations"` // Databricks budget configuration ID. - BudgetConfigurationId types.String `tfsdk:"budget_configuration_id" tf:"optional"` + BudgetConfigurationId types.String `tfsdk:"budget_configuration_id"` // Human-readable name of budget configuration. Max Length: 128 - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Configured filters for this budget. These are applied to your account's // usage to limit the scope of what is considered for this budget. Leave // empty to include all usage for this account. All provided filters must be // matched for usage to be included. - Filter types.Object `tfsdk:"filter" tf:"optional,object"` + Filter types.Object `tfsdk:"filter"` } func (newState *UpdateBudgetConfigurationBudget) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateBudgetConfigurationBudget) { @@ -2275,11 +2328,14 @@ func (newState *UpdateBudgetConfigurationBudget) SyncEffectiveFieldsDuringCreate func (newState *UpdateBudgetConfigurationBudget) SyncEffectiveFieldsDuringRead(existingState UpdateBudgetConfigurationBudget) { } -func (c UpdateBudgetConfigurationBudget) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertConfiguration{}.ApplySchemaCustomizations(cs, append(path, "alert_configurations")...) - BudgetConfigurationFilter{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c UpdateBudgetConfigurationBudget) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["alert_configurations"] = attrs["alert_configurations"].SetOptional() + attrs["budget_configuration_id"] = attrs["budget_configuration_id"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateBudgetConfigurationBudget. @@ -2383,7 +2439,7 @@ func (o *UpdateBudgetConfigurationBudget) SetFilter(ctx context.Context, v Budge type UpdateBudgetConfigurationRequest struct { // The updated budget. This will overwrite the budget specified by the // budget ID. - Budget types.Object `tfsdk:"budget" tf:"object"` + Budget types.Object `tfsdk:"budget"` // The Databricks budget configuration ID. BudgetId types.String `tfsdk:"-"` } @@ -2394,12 +2450,11 @@ func (newState *UpdateBudgetConfigurationRequest) SyncEffectiveFieldsDuringCreat func (newState *UpdateBudgetConfigurationRequest) SyncEffectiveFieldsDuringRead(existingState UpdateBudgetConfigurationRequest) { } -func (c UpdateBudgetConfigurationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "budget")...) - UpdateBudgetConfigurationBudget{}.ApplySchemaCustomizations(cs, append(path, "budget")...) - cs.SetRequired(append(path, "budget_id")...) +func (c UpdateBudgetConfigurationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetRequired() + attrs["budget_id"] = attrs["budget_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateBudgetConfigurationRequest. @@ -2467,7 +2522,7 @@ func (o *UpdateBudgetConfigurationRequest) SetBudget(ctx context.Context, v Upda type UpdateBudgetConfigurationResponse struct { // The updated budget. - Budget types.Object `tfsdk:"budget" tf:"optional,object"` + Budget types.Object `tfsdk:"budget"` } func (newState *UpdateBudgetConfigurationResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateBudgetConfigurationResponse) { @@ -2476,10 +2531,10 @@ func (newState *UpdateBudgetConfigurationResponse) SyncEffectiveFieldsDuringCrea func (newState *UpdateBudgetConfigurationResponse) SyncEffectiveFieldsDuringRead(existingState UpdateBudgetConfigurationResponse) { } -func (c UpdateBudgetConfigurationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BudgetConfiguration{}.ApplySchemaCustomizations(cs, append(path, "budget")...) +func (c UpdateBudgetConfigurationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget"] = attrs["budget"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateBudgetConfigurationResponse. @@ -2551,7 +2606,7 @@ type UpdateLogDeliveryConfigurationStatusRequest struct { // the configuration](#operation/patch-log-delivery-config-status) later. // Deletion of a configuration is not supported, so disable a log delivery // configuration that is no longer needed. - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` } func (newState *UpdateLogDeliveryConfigurationStatusRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateLogDeliveryConfigurationStatusRequest) { @@ -2560,11 +2615,11 @@ func (newState *UpdateLogDeliveryConfigurationStatusRequest) SyncEffectiveFields func (newState *UpdateLogDeliveryConfigurationStatusRequest) SyncEffectiveFieldsDuringRead(existingState UpdateLogDeliveryConfigurationStatusRequest) { } -func (c UpdateLogDeliveryConfigurationStatusRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "log_delivery_configuration_id")...) - cs.SetRequired(append(path, "status")...) +func (c UpdateLogDeliveryConfigurationStatusRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configuration_id"] = attrs["log_delivery_configuration_id"].SetRequired() + attrs["status"] = attrs["status"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateLogDeliveryConfigurationStatusRequest. @@ -2601,7 +2656,7 @@ func (o UpdateLogDeliveryConfigurationStatusRequest) Type(ctx context.Context) a } type WrappedCreateLogDeliveryConfiguration struct { - LogDeliveryConfiguration types.Object `tfsdk:"log_delivery_configuration" tf:"optional,object"` + LogDeliveryConfiguration types.Object `tfsdk:"log_delivery_configuration"` } func (newState *WrappedCreateLogDeliveryConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan WrappedCreateLogDeliveryConfiguration) { @@ -2610,10 +2665,10 @@ func (newState *WrappedCreateLogDeliveryConfiguration) SyncEffectiveFieldsDuring func (newState *WrappedCreateLogDeliveryConfiguration) SyncEffectiveFieldsDuringRead(existingState WrappedCreateLogDeliveryConfiguration) { } -func (c WrappedCreateLogDeliveryConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateLogDeliveryConfigurationParams{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_configuration")...) +func (c WrappedCreateLogDeliveryConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configuration"] = attrs["log_delivery_configuration"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WrappedCreateLogDeliveryConfiguration. @@ -2678,7 +2733,7 @@ func (o *WrappedCreateLogDeliveryConfiguration) SetLogDeliveryConfiguration(ctx } type WrappedLogDeliveryConfiguration struct { - LogDeliveryConfiguration types.Object `tfsdk:"log_delivery_configuration" tf:"optional,object"` + LogDeliveryConfiguration types.Object `tfsdk:"log_delivery_configuration"` } func (newState *WrappedLogDeliveryConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan WrappedLogDeliveryConfiguration) { @@ -2687,10 +2742,10 @@ func (newState *WrappedLogDeliveryConfiguration) SyncEffectiveFieldsDuringCreate func (newState *WrappedLogDeliveryConfiguration) SyncEffectiveFieldsDuringRead(existingState WrappedLogDeliveryConfiguration) { } -func (c WrappedLogDeliveryConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogDeliveryConfiguration{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_configuration")...) +func (c WrappedLogDeliveryConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configuration"] = attrs["log_delivery_configuration"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WrappedLogDeliveryConfiguration. @@ -2755,7 +2810,7 @@ func (o *WrappedLogDeliveryConfiguration) SetLogDeliveryConfiguration(ctx contex } type WrappedLogDeliveryConfigurations struct { - LogDeliveryConfigurations types.List `tfsdk:"log_delivery_configurations" tf:"optional"` + LogDeliveryConfigurations types.List `tfsdk:"log_delivery_configurations"` } func (newState *WrappedLogDeliveryConfigurations) SyncEffectiveFieldsDuringCreateOrUpdate(plan WrappedLogDeliveryConfigurations) { @@ -2764,10 +2819,10 @@ func (newState *WrappedLogDeliveryConfigurations) SyncEffectiveFieldsDuringCreat func (newState *WrappedLogDeliveryConfigurations) SyncEffectiveFieldsDuringRead(existingState WrappedLogDeliveryConfigurations) { } -func (c WrappedLogDeliveryConfigurations) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogDeliveryConfiguration{}.ApplySchemaCustomizations(cs, append(path, "log_delivery_configurations")...) +func (c WrappedLogDeliveryConfigurations) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_delivery_configurations"] = attrs["log_delivery_configurations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WrappedLogDeliveryConfigurations. diff --git a/internal/service/catalog_tf/legacy_model.go b/internal/service/catalog_tf/legacy_model.go index 4582cb86f..fddd18088 100755 --- a/internal/service/catalog_tf/legacy_model.go +++ b/internal/service/catalog_tf/legacy_model.go @@ -17,13 +17,14 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) type AccountsCreateMetastore_SdkV2 struct { - MetastoreInfo types.List `tfsdk:"metastore_info" tf:"optional,object"` + MetastoreInfo types.List `tfsdk:"metastore_info"` } func (newState *AccountsCreateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsCreateMetastore_SdkV2) { @@ -32,10 +33,11 @@ func (newState *AccountsCreateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *AccountsCreateMetastore_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsCreateMetastore_SdkV2) { } -func (c AccountsCreateMetastore_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateMetastore_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastore_info")...) +func (c AccountsCreateMetastore_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_info"] = attrs["metastore_info"].SetOptional() + attrs["metastore_info"] = attrs["metastore_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsCreateMetastore. @@ -100,7 +102,7 @@ func (o *AccountsCreateMetastore_SdkV2) SetMetastoreInfo(ctx context.Context, v } type AccountsCreateMetastoreAssignment_SdkV2 struct { - MetastoreAssignment types.List `tfsdk:"metastore_assignment" tf:"optional,object"` + MetastoreAssignment types.List `tfsdk:"metastore_assignment"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` // Workspace ID. @@ -113,12 +115,13 @@ func (newState *AccountsCreateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuri func (newState *AccountsCreateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsCreateMetastoreAssignment_SdkV2) { } -func (c AccountsCreateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateMetastoreAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastore_assignment")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c AccountsCreateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_assignment"] = attrs["metastore_assignment"].SetOptional() + attrs["metastore_assignment"] = attrs["metastore_assignment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsCreateMetastoreAssignment. @@ -187,7 +190,7 @@ func (o *AccountsCreateMetastoreAssignment_SdkV2) SetMetastoreAssignment(ctx con } type AccountsCreateStorageCredential_SdkV2 struct { - CredentialInfo types.List `tfsdk:"credential_info" tf:"optional,object"` + CredentialInfo types.List `tfsdk:"credential_info"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` } @@ -198,11 +201,12 @@ func (newState *AccountsCreateStorageCredential_SdkV2) SyncEffectiveFieldsDuring func (newState *AccountsCreateStorageCredential_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsCreateStorageCredential_SdkV2) { } -func (c AccountsCreateStorageCredential_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateStorageCredential_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "credential_info")...) - cs.SetRequired(append(path, "metastore_id")...) +func (c AccountsCreateStorageCredential_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_info"] = attrs["credential_info"].SetOptional() + attrs["credential_info"] = attrs["credential_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsCreateStorageCredential. @@ -269,7 +273,7 @@ func (o *AccountsCreateStorageCredential_SdkV2) SetCredentialInfo(ctx context.Co } type AccountsMetastoreAssignment_SdkV2 struct { - MetastoreAssignment types.List `tfsdk:"metastore_assignment" tf:"optional,object"` + MetastoreAssignment types.List `tfsdk:"metastore_assignment"` } func (newState *AccountsMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsMetastoreAssignment_SdkV2) { @@ -278,10 +282,11 @@ func (newState *AccountsMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *AccountsMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsMetastoreAssignment_SdkV2) { } -func (c AccountsMetastoreAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MetastoreAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastore_assignment")...) +func (c AccountsMetastoreAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_assignment"] = attrs["metastore_assignment"].SetOptional() + attrs["metastore_assignment"] = attrs["metastore_assignment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsMetastoreAssignment. @@ -346,7 +351,7 @@ func (o *AccountsMetastoreAssignment_SdkV2) SetMetastoreAssignment(ctx context.C } type AccountsMetastoreInfo_SdkV2 struct { - MetastoreInfo types.List `tfsdk:"metastore_info" tf:"optional,object"` + MetastoreInfo types.List `tfsdk:"metastore_info"` } func (newState *AccountsMetastoreInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsMetastoreInfo_SdkV2) { @@ -355,10 +360,11 @@ func (newState *AccountsMetastoreInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *AccountsMetastoreInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsMetastoreInfo_SdkV2) { } -func (c AccountsMetastoreInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MetastoreInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastore_info")...) +func (c AccountsMetastoreInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_info"] = attrs["metastore_info"].SetOptional() + attrs["metastore_info"] = attrs["metastore_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsMetastoreInfo. @@ -423,7 +429,7 @@ func (o *AccountsMetastoreInfo_SdkV2) SetMetastoreInfo(ctx context.Context, v Me } type AccountsStorageCredentialInfo_SdkV2 struct { - CredentialInfo types.List `tfsdk:"credential_info" tf:"optional,object"` + CredentialInfo types.List `tfsdk:"credential_info"` } func (newState *AccountsStorageCredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsStorageCredentialInfo_SdkV2) { @@ -432,10 +438,11 @@ func (newState *AccountsStorageCredentialInfo_SdkV2) SyncEffectiveFieldsDuringCr func (newState *AccountsStorageCredentialInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsStorageCredentialInfo_SdkV2) { } -func (c AccountsStorageCredentialInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StorageCredentialInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "credential_info")...) +func (c AccountsStorageCredentialInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_info"] = attrs["credential_info"].SetOptional() + attrs["credential_info"] = attrs["credential_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsStorageCredentialInfo. @@ -503,7 +510,7 @@ type AccountsUpdateMetastore_SdkV2 struct { // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` - MetastoreInfo types.List `tfsdk:"metastore_info" tf:"optional,object"` + MetastoreInfo types.List `tfsdk:"metastore_info"` } func (newState *AccountsUpdateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsUpdateMetastore_SdkV2) { @@ -512,11 +519,12 @@ func (newState *AccountsUpdateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *AccountsUpdateMetastore_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsUpdateMetastore_SdkV2) { } -func (c AccountsUpdateMetastore_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "metastore_id")...) - UpdateMetastore_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastore_info")...) +func (c AccountsUpdateMetastore_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["metastore_info"] = attrs["metastore_info"].SetOptional() + attrs["metastore_info"] = attrs["metastore_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsUpdateMetastore. @@ -583,7 +591,7 @@ func (o *AccountsUpdateMetastore_SdkV2) SetMetastoreInfo(ctx context.Context, v } type AccountsUpdateMetastoreAssignment_SdkV2 struct { - MetastoreAssignment types.List `tfsdk:"metastore_assignment" tf:"optional,object"` + MetastoreAssignment types.List `tfsdk:"metastore_assignment"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` // Workspace ID. @@ -596,12 +604,13 @@ func (newState *AccountsUpdateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuri func (newState *AccountsUpdateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsUpdateMetastoreAssignment_SdkV2) { } -func (c AccountsUpdateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateMetastoreAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastore_assignment")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c AccountsUpdateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_assignment"] = attrs["metastore_assignment"].SetOptional() + attrs["metastore_assignment"] = attrs["metastore_assignment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsUpdateMetastoreAssignment. @@ -670,7 +679,7 @@ func (o *AccountsUpdateMetastoreAssignment_SdkV2) SetMetastoreAssignment(ctx con } type AccountsUpdateStorageCredential_SdkV2 struct { - CredentialInfo types.List `tfsdk:"credential_info" tf:"optional,object"` + CredentialInfo types.List `tfsdk:"credential_info"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` // Name of the storage credential. @@ -683,12 +692,13 @@ func (newState *AccountsUpdateStorageCredential_SdkV2) SyncEffectiveFieldsDuring func (newState *AccountsUpdateStorageCredential_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccountsUpdateStorageCredential_SdkV2) { } -func (c AccountsUpdateStorageCredential_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateStorageCredential_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "credential_info")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "storage_credential_name")...) +func (c AccountsUpdateStorageCredential_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_info"] = attrs["credential_info"].SetOptional() + attrs["credential_info"] = attrs["credential_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["storage_credential_name"] = attrs["storage_credential_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsUpdateStorageCredential. @@ -758,13 +768,13 @@ func (o *AccountsUpdateStorageCredential_SdkV2) SetCredentialInfo(ctx context.Co type ArtifactAllowlistInfo_SdkV2 struct { // A list of allowed artifact match patterns. - ArtifactMatchers types.List `tfsdk:"artifact_matchers" tf:"optional"` + ArtifactMatchers types.List `tfsdk:"artifact_matchers"` // Time at which this artifact allowlist was set, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of the user who set the artifact allowlist. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` } func (newState *ArtifactAllowlistInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ArtifactAllowlistInfo_SdkV2) { @@ -773,10 +783,13 @@ func (newState *ArtifactAllowlistInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ArtifactAllowlistInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ArtifactAllowlistInfo_SdkV2) { } -func (c ArtifactAllowlistInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ArtifactMatcher_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "artifact_matchers")...) +func (c ArtifactAllowlistInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_matchers"] = attrs["artifact_matchers"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ArtifactAllowlistInfo. @@ -848,9 +861,9 @@ func (o *ArtifactAllowlistInfo_SdkV2) SetArtifactMatchers(ctx context.Context, v type ArtifactMatcher_SdkV2 struct { // The artifact path or maven coordinate - Artifact types.String `tfsdk:"artifact" tf:""` + Artifact types.String `tfsdk:"artifact"` // The pattern matching type of the artifact - MatchType types.String `tfsdk:"match_type" tf:""` + MatchType types.String `tfsdk:"match_type"` } func (newState *ArtifactMatcher_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ArtifactMatcher_SdkV2) { @@ -859,11 +872,11 @@ func (newState *ArtifactMatcher_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ArtifactMatcher_SdkV2) SyncEffectiveFieldsDuringRead(existingState ArtifactMatcher_SdkV2) { } -func (c ArtifactMatcher_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "artifact")...) - cs.SetRequired(append(path, "match_type")...) +func (c ArtifactMatcher_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact"] = attrs["artifact"].SetRequired() + attrs["match_type"] = attrs["match_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ArtifactMatcher. @@ -933,15 +946,15 @@ func (o AssignResponse_SdkV2) Type(ctx context.Context) attr.Type { // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. type AwsCredentials_SdkV2 struct { // The access key ID that identifies the temporary credentials. - AccessKeyId types.String `tfsdk:"access_key_id" tf:"optional"` + AccessKeyId types.String `tfsdk:"access_key_id"` // The Amazon Resource Name (ARN) of the S3 access point for temporary // credentials related the external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // The secret access key that can be used to sign AWS API requests. - SecretAccessKey types.String `tfsdk:"secret_access_key" tf:"optional"` + SecretAccessKey types.String `tfsdk:"secret_access_key"` // The token that users must pass to AWS API to use the temporary // credentials. - SessionToken types.String `tfsdk:"session_token" tf:"optional"` + SessionToken types.String `tfsdk:"session_token"` } func (newState *AwsCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsCredentials_SdkV2) { @@ -950,9 +963,13 @@ func (newState *AwsCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AwsCredentials_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsCredentials_SdkV2) { } -func (c AwsCredentials_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AwsCredentials_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_key_id"] = attrs["access_key_id"].SetOptional() + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["secret_access_key"] = attrs["secret_access_key"].SetOptional() + attrs["session_token"] = attrs["session_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsCredentials. @@ -996,13 +1013,13 @@ func (o AwsCredentials_SdkV2) Type(ctx context.Context) attr.Type { type AwsIamRole_SdkV2 struct { // The external ID used in role assumption to prevent the confused deputy // problem. - ExternalId types.String `tfsdk:"external_id" tf:"computed"` + ExternalId types.String `tfsdk:"external_id"` // The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary // credentials. - RoleArn types.String `tfsdk:"role_arn" tf:"optional"` + RoleArn types.String `tfsdk:"role_arn"` // The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. // This is the identity that is going to assume the AWS IAM role. - UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn" tf:"computed"` + UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn"` } func (newState *AwsIamRole_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRole_SdkV2) { @@ -1011,11 +1028,12 @@ func (newState *AwsIamRole_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan A func (newState *AwsIamRole_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsIamRole_SdkV2) { } -func (c AwsIamRole_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "external_id")...) - cs.SetComputed(append(path, "unity_catalog_iam_arn")...) +func (c AwsIamRole_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_id"] = attrs["external_id"].SetComputed() + attrs["role_arn"] = attrs["role_arn"].SetOptional() + attrs["unity_catalog_iam_arn"] = attrs["unity_catalog_iam_arn"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsIamRole. @@ -1055,7 +1073,7 @@ func (o AwsIamRole_SdkV2) Type(ctx context.Context) attr.Type { type AwsIamRoleRequest_SdkV2 struct { // The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access. - RoleArn types.String `tfsdk:"role_arn" tf:""` + RoleArn types.String `tfsdk:"role_arn"` } func (newState *AwsIamRoleRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRoleRequest_SdkV2) { @@ -1064,10 +1082,10 @@ func (newState *AwsIamRoleRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AwsIamRoleRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsIamRoleRequest_SdkV2) { } -func (c AwsIamRoleRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "role_arn")...) +func (c AwsIamRoleRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["role_arn"] = attrs["role_arn"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsIamRoleRequest. @@ -1104,12 +1122,12 @@ func (o AwsIamRoleRequest_SdkV2) Type(ctx context.Context) attr.Type { type AwsIamRoleResponse_SdkV2 struct { // The external ID used in role assumption to prevent confused deputy // problem.. - ExternalId types.String `tfsdk:"external_id" tf:"optional"` + ExternalId types.String `tfsdk:"external_id"` // The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access. - RoleArn types.String `tfsdk:"role_arn" tf:""` + RoleArn types.String `tfsdk:"role_arn"` // The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. // This is the identity that is going to assume the AWS IAM role. - UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn" tf:"optional"` + UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn"` } func (newState *AwsIamRoleResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRoleResponse_SdkV2) { @@ -1118,10 +1136,12 @@ func (newState *AwsIamRoleResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AwsIamRoleResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsIamRoleResponse_SdkV2) { } -func (c AwsIamRoleResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "role_arn")...) +func (c AwsIamRoleResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_id"] = attrs["external_id"].SetOptional() + attrs["role_arn"] = attrs["role_arn"].SetRequired() + attrs["unity_catalog_iam_arn"] = attrs["unity_catalog_iam_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsIamRoleResponse. @@ -1165,7 +1185,7 @@ func (o AwsIamRoleResponse_SdkV2) Type(ctx context.Context) attr.Type { type AzureActiveDirectoryToken_SdkV2 struct { // Opaque token that contains claims that you can use in Azure Active // Directory to access cloud services. - AadToken types.String `tfsdk:"aad_token" tf:"optional"` + AadToken types.String `tfsdk:"aad_token"` } func (newState *AzureActiveDirectoryToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureActiveDirectoryToken_SdkV2) { @@ -1174,9 +1194,10 @@ func (newState *AzureActiveDirectoryToken_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *AzureActiveDirectoryToken_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureActiveDirectoryToken_SdkV2) { } -func (c AzureActiveDirectoryToken_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AzureActiveDirectoryToken_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aad_token"] = attrs["aad_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureActiveDirectoryToken. @@ -1215,19 +1236,19 @@ type AzureManagedIdentity_SdkV2 struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}`. - AccessConnectorId types.String `tfsdk:"access_connector_id" tf:""` + AccessConnectorId types.String `tfsdk:"access_connector_id"` // The Databricks internal ID that represents this managed identity. This // field is only used to persist the credential_id once it is fetched from // the credentials manager - as we only use the protobuf serializer to store // credentials, this ID gets persisted to the database. . - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The Azure resource ID of the managed identity. Use the format, // `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}` // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // using the system-assigned identity. - ManagedIdentityId types.String `tfsdk:"managed_identity_id" tf:"optional"` + ManagedIdentityId types.String `tfsdk:"managed_identity_id"` } func (newState *AzureManagedIdentity_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureManagedIdentity_SdkV2) { @@ -1236,10 +1257,12 @@ func (newState *AzureManagedIdentity_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *AzureManagedIdentity_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureManagedIdentity_SdkV2) { } -func (c AzureManagedIdentity_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_connector_id")...) +func (c AzureManagedIdentity_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_connector_id"] = attrs["access_connector_id"].SetRequired() + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["managed_identity_id"] = attrs["managed_identity_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureManagedIdentity. @@ -1281,14 +1304,14 @@ type AzureManagedIdentityRequest_SdkV2 struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. - AccessConnectorId types.String `tfsdk:"access_connector_id" tf:""` + AccessConnectorId types.String `tfsdk:"access_connector_id"` // The Azure resource ID of the managed identity. Use the format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // for a system-assigned identity. - ManagedIdentityId types.String `tfsdk:"managed_identity_id" tf:"optional"` + ManagedIdentityId types.String `tfsdk:"managed_identity_id"` } func (newState *AzureManagedIdentityRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureManagedIdentityRequest_SdkV2) { @@ -1297,10 +1320,11 @@ func (newState *AzureManagedIdentityRequest_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *AzureManagedIdentityRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureManagedIdentityRequest_SdkV2) { } -func (c AzureManagedIdentityRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_connector_id")...) +func (c AzureManagedIdentityRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_connector_id"] = attrs["access_connector_id"].SetRequired() + attrs["managed_identity_id"] = attrs["managed_identity_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureManagedIdentityRequest. @@ -1340,16 +1364,16 @@ type AzureManagedIdentityResponse_SdkV2 struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. - AccessConnectorId types.String `tfsdk:"access_connector_id" tf:""` + AccessConnectorId types.String `tfsdk:"access_connector_id"` // The Databricks internal ID that represents this managed identity. - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The Azure resource ID of the managed identity. Use the format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // for a system-assigned identity. - ManagedIdentityId types.String `tfsdk:"managed_identity_id" tf:"optional"` + ManagedIdentityId types.String `tfsdk:"managed_identity_id"` } func (newState *AzureManagedIdentityResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureManagedIdentityResponse_SdkV2) { @@ -1358,10 +1382,12 @@ func (newState *AzureManagedIdentityResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *AzureManagedIdentityResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureManagedIdentityResponse_SdkV2) { } -func (c AzureManagedIdentityResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_connector_id")...) +func (c AzureManagedIdentityResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_connector_id"] = attrs["access_connector_id"].SetRequired() + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["managed_identity_id"] = attrs["managed_identity_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureManagedIdentityResponse. @@ -1404,12 +1430,12 @@ func (o AzureManagedIdentityResponse_SdkV2) Type(ctx context.Context) attr.Type type AzureServicePrincipal_SdkV2 struct { // The application ID of the application registration within the referenced // AAD tenant. - ApplicationId types.String `tfsdk:"application_id" tf:""` + ApplicationId types.String `tfsdk:"application_id"` // The client secret generated for the above app ID in AAD. - ClientSecret types.String `tfsdk:"client_secret" tf:""` + ClientSecret types.String `tfsdk:"client_secret"` // The directory ID corresponding to the Azure Active Directory (AAD) tenant // of the application. - DirectoryId types.String `tfsdk:"directory_id" tf:""` + DirectoryId types.String `tfsdk:"directory_id"` } func (newState *AzureServicePrincipal_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureServicePrincipal_SdkV2) { @@ -1418,12 +1444,12 @@ func (newState *AzureServicePrincipal_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *AzureServicePrincipal_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureServicePrincipal_SdkV2) { } -func (c AzureServicePrincipal_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "application_id")...) - cs.SetRequired(append(path, "client_secret")...) - cs.SetRequired(append(path, "directory_id")...) +func (c AzureServicePrincipal_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["application_id"] = attrs["application_id"].SetRequired() + attrs["client_secret"] = attrs["client_secret"].SetRequired() + attrs["directory_id"] = attrs["directory_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureServicePrincipal. @@ -1465,7 +1491,7 @@ func (o AzureServicePrincipal_SdkV2) Type(ctx context.Context) attr.Type { // https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas type AzureUserDelegationSas_SdkV2 struct { // The signed URI (SAS Token) used to access blob services for a given path - SasToken types.String `tfsdk:"sas_token" tf:"optional"` + SasToken types.String `tfsdk:"sas_token"` } func (newState *AzureUserDelegationSas_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureUserDelegationSas_SdkV2) { @@ -1474,9 +1500,10 @@ func (newState *AzureUserDelegationSas_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *AzureUserDelegationSas_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureUserDelegationSas_SdkV2) { } -func (c AzureUserDelegationSas_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AzureUserDelegationSas_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sas_token"] = attrs["sas_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureUserDelegationSas. @@ -1585,58 +1612,58 @@ type CatalogInfo_SdkV2 struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The type of the catalog. - CatalogType types.String `tfsdk:"catalog_type" tf:"optional"` + CatalogType types.String `tfsdk:"catalog_type"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the connection to an external data source. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Time at which this catalog was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of catalog creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - EffectivePredictiveOptimizationFlag types.List `tfsdk:"effective_predictive_optimization_flag" tf:"optional,object"` + EffectivePredictiveOptimizationFlag types.List `tfsdk:"effective_predictive_optimization_flag"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // The full name of the catalog. Corresponds with the name field. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of catalog. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:"optional"` + Options types.Map `tfsdk:"options"` // Username of current owner of catalog. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // The name of delta sharing provider. // // A Delta Sharing catalog is a catalog that is based on a Delta share on a // remote sharing server. - ProviderName types.String `tfsdk:"provider_name" tf:"optional"` + ProviderName types.String `tfsdk:"provider_name"` // Status of an asynchronously provisioned resource. - ProvisioningInfo types.List `tfsdk:"provisioning_info" tf:"optional,object"` + ProvisioningInfo types.List `tfsdk:"provisioning_info"` // Kind of catalog securable. - SecurableKind types.String `tfsdk:"securable_kind" tf:"optional"` + SecurableKind types.String `tfsdk:"securable_kind"` - SecurableType types.String `tfsdk:"securable_type" tf:"optional"` + SecurableType types.String `tfsdk:"securable_type"` // The name of the share under the share provider. - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` // Storage Location URL (full path) for managed tables within catalog. - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for managed tables within catalog. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Time at which this catalog was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified catalog. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *CatalogInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CatalogInfo_SdkV2) { @@ -1645,11 +1672,35 @@ func (newState *CatalogInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CatalogInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CatalogInfo_SdkV2) { } -func (c CatalogInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePredictiveOptimizationFlag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "effective_predictive_optimization_flag")...) - ProvisioningInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provisioning_info")...) - - return cs +func (c CatalogInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_type"] = attrs["catalog_type"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["provider_name"] = attrs["provider_name"].SetOptional() + attrs["provisioning_info"] = attrs["provisioning_info"].SetOptional() + attrs["provisioning_info"] = attrs["provisioning_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["securable_kind"] = attrs["securable_kind"].SetOptional() + attrs["securable_type"] = attrs["securable_type"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CatalogInfo. @@ -1848,11 +1899,11 @@ func (o *CatalogInfo_SdkV2) SetProvisioningInfo(ctx context.Context, v Provision type CloudflareApiToken_SdkV2 struct { // The Cloudflare access key id of the token. - AccessKeyId types.String `tfsdk:"access_key_id" tf:""` + AccessKeyId types.String `tfsdk:"access_key_id"` // The account id associated with the API token. - AccountId types.String `tfsdk:"account_id" tf:""` + AccountId types.String `tfsdk:"account_id"` // The secret access token generated for the access key id - SecretAccessKey types.String `tfsdk:"secret_access_key" tf:""` + SecretAccessKey types.String `tfsdk:"secret_access_key"` } func (newState *CloudflareApiToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloudflareApiToken_SdkV2) { @@ -1861,12 +1912,12 @@ func (newState *CloudflareApiToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CloudflareApiToken_SdkV2) SyncEffectiveFieldsDuringRead(existingState CloudflareApiToken_SdkV2) { } -func (c CloudflareApiToken_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_key_id")...) - cs.SetRequired(append(path, "account_id")...) - cs.SetRequired(append(path, "secret_access_key")...) +func (c CloudflareApiToken_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_key_id"] = attrs["access_key_id"].SetRequired() + attrs["account_id"] = attrs["account_id"].SetRequired() + attrs["secret_access_key"] = attrs["secret_access_key"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloudflareApiToken. @@ -1906,29 +1957,29 @@ func (o CloudflareApiToken_SdkV2) Type(ctx context.Context) attr.Type { type ColumnInfo_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - Mask types.List `tfsdk:"mask" tf:"optional,object"` + Mask types.List `tfsdk:"mask"` // Name of Column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether field may be Null (default: true). - Nullable types.Bool `tfsdk:"nullable" tf:"optional"` + Nullable types.Bool `tfsdk:"nullable"` // Partition index for column. - PartitionIndex types.Int64 `tfsdk:"partition_index" tf:"optional"` + PartitionIndex types.Int64 `tfsdk:"partition_index"` // Ordinal position of column (starting at position 0). - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // Format of IntervalType. - TypeIntervalType types.String `tfsdk:"type_interval_type" tf:"optional"` + TypeIntervalType types.String `tfsdk:"type_interval_type"` // Full data type specification, JSON-serialized. - TypeJson types.String `tfsdk:"type_json" tf:"optional"` + TypeJson types.String `tfsdk:"type_json"` - TypeName types.String `tfsdk:"type_name" tf:"optional"` + TypeName types.String `tfsdk:"type_name"` // Digits of precision; required for DecimalTypes. - TypePrecision types.Int64 `tfsdk:"type_precision" tf:"optional"` + TypePrecision types.Int64 `tfsdk:"type_precision"` // Digits to right of decimal; Required for DecimalTypes. - TypeScale types.Int64 `tfsdk:"type_scale" tf:"optional"` + TypeScale types.Int64 `tfsdk:"type_scale"` // Full data type specification as SQL/catalogString text. - TypeText types.String `tfsdk:"type_text" tf:"optional"` + TypeText types.String `tfsdk:"type_text"` } func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnInfo_SdkV2) { @@ -1937,10 +1988,22 @@ func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ColumnInfo_SdkV2) { } -func (c ColumnInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnMask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "mask")...) +func (c ColumnInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["mask"] = attrs["mask"].SetOptional() + attrs["mask"] = attrs["mask"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() + attrs["nullable"] = attrs["nullable"].SetOptional() + attrs["partition_index"] = attrs["partition_index"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["type_interval_type"] = attrs["type_interval_type"].SetOptional() + attrs["type_json"] = attrs["type_json"].SetOptional() + attrs["type_name"] = attrs["type_name"].SetOptional() + attrs["type_precision"] = attrs["type_precision"].SetOptional() + attrs["type_scale"] = attrs["type_scale"].SetOptional() + attrs["type_text"] = attrs["type_text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnInfo. @@ -2028,12 +2091,12 @@ func (o *ColumnInfo_SdkV2) SetMask(ctx context.Context, v ColumnMask_SdkV2) { type ColumnMask_SdkV2 struct { // The full name of the column mask SQL UDF. - FunctionName types.String `tfsdk:"function_name" tf:"optional"` + FunctionName types.String `tfsdk:"function_name"` // The list of additional table columns to be passed as input to the column // mask function. The first arg of the mask function should be of the type // of the column being masked and the types of the rest of the args should // match the types of columns in 'using_column_names'. - UsingColumnNames types.List `tfsdk:"using_column_names" tf:"optional"` + UsingColumnNames types.List `tfsdk:"using_column_names"` } func (newState *ColumnMask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnMask_SdkV2) { @@ -2042,9 +2105,11 @@ func (newState *ColumnMask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *ColumnMask_SdkV2) SyncEffectiveFieldsDuringRead(existingState ColumnMask_SdkV2) { } -func (c ColumnMask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ColumnMask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_name"] = attrs["function_name"].SetOptional() + attrs["using_column_names"] = attrs["using_column_names"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnMask. @@ -2112,44 +2177,44 @@ func (o *ColumnMask_SdkV2) SetUsingColumnNames(ctx context.Context, v []types.St type ConnectionInfo_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Unique identifier of the Connection. - ConnectionId types.String `tfsdk:"connection_id" tf:"optional"` + ConnectionId types.String `tfsdk:"connection_id"` // The type of connection. - ConnectionType types.String `tfsdk:"connection_type" tf:"optional"` + ConnectionType types.String `tfsdk:"connection_type"` // Time at which this connection was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of connection creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The type of credential. - CredentialType types.String `tfsdk:"credential_type" tf:"optional"` + CredentialType types.String `tfsdk:"credential_type"` // Full name of connection. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of the connection. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:"optional"` + Options types.Map `tfsdk:"options"` // Username of current owner of the connection. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // An object containing map of key-value properties attached to the // connection. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // Status of an asynchronously provisioned resource. - ProvisioningInfo types.List `tfsdk:"provisioning_info" tf:"optional,object"` + ProvisioningInfo types.List `tfsdk:"provisioning_info"` // If the connection is read only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Kind of connection securable. - SecurableKind types.String `tfsdk:"securable_kind" tf:"optional"` + SecurableKind types.String `tfsdk:"securable_kind"` - SecurableType types.String `tfsdk:"securable_type" tf:"optional"` + SecurableType types.String `tfsdk:"securable_type"` // Time at which this connection was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified connection. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // URL of the remote data source, extracted from options. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ConnectionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ConnectionInfo_SdkV2) { @@ -2158,10 +2223,29 @@ func (newState *ConnectionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ConnectionInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ConnectionInfo_SdkV2) { } -func (c ConnectionInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProvisioningInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provisioning_info")...) - - return cs +func (c ConnectionInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_id"] = attrs["connection_id"].SetOptional() + attrs["connection_type"] = attrs["connection_type"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["credential_type"] = attrs["credential_type"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["provisioning_info"] = attrs["provisioning_info"].SetOptional() + attrs["provisioning_info"] = attrs["provisioning_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["securable_kind"] = attrs["securable_kind"].SetOptional() + attrs["securable_type"] = attrs["securable_type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ConnectionInfo. @@ -2323,14 +2407,14 @@ func (o *ConnectionInfo_SdkV2) SetProvisioningInfo(ctx context.Context, v Provis // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. type ContinuousUpdateStatus_SdkV2 struct { // Progress of the initial data synchronization. - InitialPipelineSyncProgress types.List `tfsdk:"initial_pipeline_sync_progress" tf:"optional,object"` + InitialPipelineSyncProgress types.List `tfsdk:"initial_pipeline_sync_progress"` // The last source table Delta version that was synced to the online table. // Note that this Delta version may not be completely synced to the online // table yet. - LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version" tf:"optional"` + LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version"` // The timestamp of the last time any data was synchronized from the source // table to the online table. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` } func (newState *ContinuousUpdateStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ContinuousUpdateStatus_SdkV2) { @@ -2339,10 +2423,13 @@ func (newState *ContinuousUpdateStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ContinuousUpdateStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState ContinuousUpdateStatus_SdkV2) { } -func (c ContinuousUpdateStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineProgress_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "initial_pipeline_sync_progress")...) +func (c ContinuousUpdateStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["initial_pipeline_sync_progress"] = attrs["initial_pipeline_sync_progress"].SetOptional() + attrs["initial_pipeline_sync_progress"] = attrs["initial_pipeline_sync_progress"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["last_processed_commit_version"] = attrs["last_processed_commit_version"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ContinuousUpdateStatus. @@ -2412,24 +2499,24 @@ func (o *ContinuousUpdateStatus_SdkV2) SetInitialPipelineSyncProgress(ctx contex type CreateCatalog_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the connection to an external data source. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Name of catalog. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:"optional"` + Options types.Map `tfsdk:"options"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // The name of delta sharing provider. // // A Delta Sharing catalog is a catalog that is based on a Delta share on a // remote sharing server. - ProviderName types.String `tfsdk:"provider_name" tf:"optional"` + ProviderName types.String `tfsdk:"provider_name"` // The name of the share under the share provider. - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` // Storage root URL for managed tables within catalog. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateCatalog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCatalog_SdkV2) { @@ -2438,10 +2525,17 @@ func (newState *CreateCatalog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateCatalog_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCatalog_SdkV2) { } -func (c CreateCatalog_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c CreateCatalog_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["provider_name"] = attrs["provider_name"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCatalog. @@ -2550,18 +2644,18 @@ func (o *CreateCatalog_SdkV2) SetProperties(ctx context.Context, v map[string]ty type CreateConnection_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The type of connection. - ConnectionType types.String `tfsdk:"connection_type" tf:""` + ConnectionType types.String `tfsdk:"connection_type"` // Name of the connection. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:""` + Options types.Map `tfsdk:"options"` // An object containing map of key-value properties attached to the // connection. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // If the connection is read only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` } func (newState *CreateConnection_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateConnection_SdkV2) { @@ -2570,12 +2664,15 @@ func (newState *CreateConnection_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateConnection_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateConnection_SdkV2) { } -func (c CreateConnection_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "connection_type")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) +func (c CreateConnection_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_type"] = attrs["connection_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateConnection. @@ -2680,28 +2777,28 @@ func (o *CreateConnection_SdkV2) SetProperties(ctx context.Context, v map[string type CreateCredentialRequest_SdkV2 struct { // The AWS IAM role configuration - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // The credential name. The name must be unique among storage and service // credentials within the metastore. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Indicates the purpose of the credential. - Purpose types.String `tfsdk:"purpose" tf:"optional"` + Purpose types.String `tfsdk:"purpose"` // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Optional. Supplying true to this argument skips validation of the created // set of credentials. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *CreateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialRequest_SdkV2) { @@ -2710,14 +2807,22 @@ func (newState *CreateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCredentialRequest_SdkV2) { } -func (c CreateCredentialRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - DatabricksGcpServiceAccount_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name")...) +func (c CreateCredentialRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["purpose"] = attrs["purpose"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialRequest. @@ -2886,26 +2991,26 @@ func (o *CreateCredentialRequest_SdkV2) SetDatabricksGcpServiceAccount(ctx conte type CreateExternalLocation_SdkV2 struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the storage credential used with this location. - CredentialName types.String `tfsdk:"credential_name" tf:""` + CredentialName types.String `tfsdk:"credential_name"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.List `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.List `tfsdk:"encryption_details"` // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback types.Bool `tfsdk:"fallback" tf:"optional"` + Fallback types.Bool `tfsdk:"fallback"` // Name of the external location. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Indicates whether the external location is read-only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Skips validation of the storage credential associated with the external // location. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` // Path URL of the external location. - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` } func (newState *CreateExternalLocation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExternalLocation_SdkV2) { @@ -2914,13 +3019,19 @@ func (newState *CreateExternalLocation_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateExternalLocation_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExternalLocation_SdkV2) { } -func (c CreateExternalLocation_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_name")...) - EncryptionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "url")...) +func (c CreateExternalLocation_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetRequired() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["fallback"] = attrs["fallback"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExternalLocation. @@ -3002,51 +3113,51 @@ func (o *CreateExternalLocation_SdkV2) SetEncryptionDetails(ctx context.Context, type CreateFunction_SdkV2 struct { // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Scalar function return data type. - DataType types.String `tfsdk:"data_type" tf:""` + DataType types.String `tfsdk:"data_type"` // External function language. - ExternalLanguage types.String `tfsdk:"external_language" tf:"optional"` + ExternalLanguage types.String `tfsdk:"external_language"` // External function name. - ExternalName types.String `tfsdk:"external_name" tf:"optional"` + ExternalName types.String `tfsdk:"external_name"` // Pretty printed function data type. - FullDataType types.String `tfsdk:"full_data_type" tf:""` + FullDataType types.String `tfsdk:"full_data_type"` - InputParams types.List `tfsdk:"input_params" tf:"object"` + InputParams types.List `tfsdk:"input_params"` // Whether the function is deterministic. - IsDeterministic types.Bool `tfsdk:"is_deterministic" tf:""` + IsDeterministic types.Bool `tfsdk:"is_deterministic"` // Function null call. - IsNullCall types.Bool `tfsdk:"is_null_call" tf:""` + IsNullCall types.Bool `tfsdk:"is_null_call"` // Name of function, relative to parent schema. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Function parameter style. **S** is the value for SQL. - ParameterStyle types.String `tfsdk:"parameter_style" tf:""` + ParameterStyle types.String `tfsdk:"parameter_style"` // JSON-serialized key-value pair map, encoded (escaped) as a string. - Properties types.String `tfsdk:"properties" tf:"optional"` + Properties types.String `tfsdk:"properties"` // Table function return parameters. - ReturnParams types.List `tfsdk:"return_params" tf:"optional,object"` + ReturnParams types.List `tfsdk:"return_params"` // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return // type is not supported), and the __sql_data_access__ field must be // **NO_SQL**. - RoutineBody types.String `tfsdk:"routine_body" tf:""` + RoutineBody types.String `tfsdk:"routine_body"` // Function body. - RoutineDefinition types.String `tfsdk:"routine_definition" tf:""` + RoutineDefinition types.String `tfsdk:"routine_definition"` // Function dependencies. - RoutineDependencies types.List `tfsdk:"routine_dependencies" tf:"optional,object"` + RoutineDependencies types.List `tfsdk:"routine_dependencies"` // Name of parent schema relative to its parent catalog. - SchemaName types.String `tfsdk:"schema_name" tf:""` + SchemaName types.String `tfsdk:"schema_name"` // Function security type. - SecurityType types.String `tfsdk:"security_type" tf:""` + SecurityType types.String `tfsdk:"security_type"` // Specific name of the function; Reserved for future use. - SpecificName types.String `tfsdk:"specific_name" tf:""` + SpecificName types.String `tfsdk:"specific_name"` // Function SQL data access. - SqlDataAccess types.String `tfsdk:"sql_data_access" tf:""` + SqlDataAccess types.String `tfsdk:"sql_data_access"` // List of schemes whose objects can be referenced without qualification. - SqlPath types.String `tfsdk:"sql_path" tf:"optional"` + SqlPath types.String `tfsdk:"sql_path"` } func (newState *CreateFunction_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFunction_SdkV2) { @@ -3055,26 +3166,33 @@ func (newState *CreateFunction_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateFunction_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateFunction_SdkV2) { } -func (c CreateFunction_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "data_type")...) - cs.SetRequired(append(path, "full_data_type")...) - cs.SetRequired(append(path, "input_params")...) - FunctionParameterInfos_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "input_params")...) - cs.SetRequired(append(path, "is_deterministic")...) - cs.SetRequired(append(path, "is_null_call")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "parameter_style")...) - FunctionParameterInfos_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "return_params")...) - cs.SetRequired(append(path, "routine_body")...) - cs.SetRequired(append(path, "routine_definition")...) - DependencyList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "routine_dependencies")...) - cs.SetRequired(append(path, "schema_name")...) - cs.SetRequired(append(path, "security_type")...) - cs.SetRequired(append(path, "specific_name")...) - cs.SetRequired(append(path, "sql_data_access")...) - - return cs +func (c CreateFunction_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["data_type"] = attrs["data_type"].SetRequired() + attrs["external_language"] = attrs["external_language"].SetOptional() + attrs["external_name"] = attrs["external_name"].SetOptional() + attrs["full_data_type"] = attrs["full_data_type"].SetRequired() + attrs["input_params"] = attrs["input_params"].SetRequired() + attrs["input_params"] = attrs["input_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["is_deterministic"] = attrs["is_deterministic"].SetRequired() + attrs["is_null_call"] = attrs["is_null_call"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["parameter_style"] = attrs["parameter_style"].SetRequired() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["return_params"] = attrs["return_params"].SetOptional() + attrs["return_params"] = attrs["return_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["routine_body"] = attrs["routine_body"].SetRequired() + attrs["routine_definition"] = attrs["routine_definition"].SetRequired() + attrs["routine_dependencies"] = attrs["routine_dependencies"].SetOptional() + attrs["routine_dependencies"] = attrs["routine_dependencies"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["security_type"] = attrs["security_type"].SetRequired() + attrs["specific_name"] = attrs["specific_name"].SetRequired() + attrs["sql_data_access"] = attrs["sql_data_access"].SetRequired() + attrs["sql_path"] = attrs["sql_path"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFunction. @@ -3238,7 +3356,7 @@ func (o *CreateFunction_SdkV2) SetRoutineDependencies(ctx context.Context, v Dep type CreateFunctionRequest_SdkV2 struct { // Partial __FunctionInfo__ specifying the function to be created. - FunctionInfo types.List `tfsdk:"function_info" tf:"object"` + FunctionInfo types.List `tfsdk:"function_info"` } func (newState *CreateFunctionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFunctionRequest_SdkV2) { @@ -3247,11 +3365,11 @@ func (newState *CreateFunctionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateFunctionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateFunctionRequest_SdkV2) { } -func (c CreateFunctionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "function_info")...) - CreateFunction_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "function_info")...) +func (c CreateFunctionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_info"] = attrs["function_info"].SetRequired() + attrs["function_info"] = attrs["function_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFunctionRequest. @@ -3317,14 +3435,14 @@ func (o *CreateFunctionRequest_SdkV2) SetFunctionInfo(ctx context.Context, v Cre type CreateMetastore_SdkV2 struct { // The user-specified name of the metastore. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). // The field can be omitted in the __workspace-level__ __API__ but not in // the __account-level__ __API__. If this field is omitted, the region of // the workspace receiving the request will be used. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The storage root URL for metastore - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateMetastore_SdkV2) { @@ -3333,10 +3451,12 @@ func (newState *CreateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateMetastore_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateMetastore_SdkV2) { } -func (c CreateMetastore_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c CreateMetastore_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["region"] = attrs["region"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateMetastore. @@ -3378,9 +3498,9 @@ type CreateMetastoreAssignment_SdkV2 struct { // The name of the default catalog in the metastore. This field is // depracted. Please use "Default Namespace API" to configure the default // catalog for a Databricks workspace. - DefaultCatalogName types.String `tfsdk:"default_catalog_name" tf:""` + DefaultCatalogName types.String `tfsdk:"default_catalog_name"` // The unique ID of the metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:""` + MetastoreId types.String `tfsdk:"metastore_id"` // A workspace ID. WorkspaceId types.Int64 `tfsdk:"-"` } @@ -3391,12 +3511,12 @@ func (newState *CreateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *CreateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateMetastoreAssignment_SdkV2) { } -func (c CreateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "default_catalog_name")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c CreateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_catalog_name"] = attrs["default_catalog_name"].SetRequired() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateMetastoreAssignment. @@ -3436,43 +3556,43 @@ func (o CreateMetastoreAssignment_SdkV2) Type(ctx context.Context) attr.Type { type CreateMonitor_SdkV2 struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). - AssetsDir types.String `tfsdk:"assets_dir" tf:""` + AssetsDir types.String `tfsdk:"assets_dir"` // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName types.String `tfsdk:"baseline_table_name" tf:"optional"` + BaselineTableName types.String `tfsdk:"baseline_table_name"` // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics types.List `tfsdk:"custom_metrics" tf:"optional"` + CustomMetrics types.List `tfsdk:"custom_metrics"` // The data classification config for the monitor. - DataClassificationConfig types.List `tfsdk:"data_classification_config" tf:"optional,object"` + DataClassificationConfig types.List `tfsdk:"data_classification_config"` // Configuration for monitoring inference logs. - InferenceLog types.List `tfsdk:"inference_log" tf:"optional,object"` + InferenceLog types.List `tfsdk:"inference_log"` // The notification settings for the monitor. - Notifications types.List `tfsdk:"notifications" tf:"optional,object"` + Notifications types.List `tfsdk:"notifications"` // Schema where output metric tables are created. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:""` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // The schedule for automatically updating and refreshing metric tables. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // Whether to skip creating a default dashboard summarizing data quality // metrics. - SkipBuiltinDashboard types.Bool `tfsdk:"skip_builtin_dashboard" tf:"optional"` + SkipBuiltinDashboard types.Bool `tfsdk:"skip_builtin_dashboard"` // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs types.List `tfsdk:"slicing_exprs" tf:"optional"` + SlicingExprs types.List `tfsdk:"slicing_exprs"` // Configuration for monitoring snapshot tables. - Snapshot types.List `tfsdk:"snapshot" tf:"optional,object"` + Snapshot types.List `tfsdk:"snapshot"` // Full name of the table. TableName types.String `tfsdk:"-"` // Configuration for monitoring time series tables. - TimeSeries types.List `tfsdk:"time_series" tf:"optional,object"` + TimeSeries types.List `tfsdk:"time_series"` // Optional argument to specify the warehouse for dashboard creation. If not // specified, the first running warehouse will be used. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *CreateMonitor_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateMonitor_SdkV2) { @@ -3481,19 +3601,29 @@ func (newState *CreateMonitor_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateMonitor_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateMonitor_SdkV2) { } -func (c CreateMonitor_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "assets_dir")...) - MonitorMetric_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "custom_metrics")...) - MonitorDataClassificationConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_classification_config")...) - MonitorInferenceLog_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "inference_log")...) - MonitorNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - cs.SetRequired(append(path, "output_schema_name")...) - MonitorCronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - MonitorSnapshot_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "snapshot")...) - cs.SetRequired(append(path, "table_name")...) - MonitorTimeSeries_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "time_series")...) - - return cs +func (c CreateMonitor_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets_dir"] = attrs["assets_dir"].SetRequired() + attrs["baseline_table_name"] = attrs["baseline_table_name"].SetOptional() + attrs["custom_metrics"] = attrs["custom_metrics"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["inference_log"] = attrs["inference_log"].SetOptional() + attrs["inference_log"] = attrs["inference_log"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["notifications"] = attrs["notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["output_schema_name"] = attrs["output_schema_name"].SetRequired() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["skip_builtin_dashboard"] = attrs["skip_builtin_dashboard"].SetOptional() + attrs["slicing_exprs"] = attrs["slicing_exprs"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["time_series"] = attrs["time_series"].SetOptional() + attrs["time_series"] = attrs["time_series"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateMonitor. @@ -3789,7 +3919,7 @@ func (o *CreateMonitor_SdkV2) SetTimeSeries(ctx context.Context, v MonitorTimeSe // Create an Online Table type CreateOnlineTableRequest_SdkV2 struct { // Online Table information. - Table types.List `tfsdk:"table" tf:"optional,object"` + Table types.List `tfsdk:"table"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateOnlineTableRequest. @@ -3855,16 +3985,16 @@ func (o *CreateOnlineTableRequest_SdkV2) SetTable(ctx context.Context, v OnlineT type CreateRegisteredModelRequest_SdkV2 struct { // The name of the catalog where the schema and the registered model reside - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the registered model - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the registered model - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The name of the schema where the registered model resides - SchemaName types.String `tfsdk:"schema_name" tf:""` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud under which model version data files // are stored - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` } func (newState *CreateRegisteredModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRegisteredModelRequest_SdkV2) { @@ -3873,12 +4003,14 @@ func (newState *CreateRegisteredModelRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *CreateRegisteredModelRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRegisteredModelRequest_SdkV2) { } -func (c CreateRegisteredModelRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "schema_name")...) +func (c CreateRegisteredModelRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["storage_location"] = attrs["storage_location"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRegisteredModelRequest. @@ -3952,15 +4084,15 @@ func (o CreateResponse_SdkV2) Type(ctx context.Context) attr.Type { type CreateSchema_SdkV2 struct { // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of schema, relative to parent catalog. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // Storage root URL for managed tables within schema. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateSchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateSchema_SdkV2) { @@ -3969,11 +4101,14 @@ func (newState *CreateSchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateSchema_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateSchema_SdkV2) { } -func (c CreateSchema_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "name")...) +func (c CreateSchema_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateSchema. @@ -4047,24 +4182,24 @@ func (o *CreateSchema_SdkV2) SetProperties(ctx context.Context, v map[string]typ type CreateStorageCredential_SdkV2 struct { // The AWS IAM role configuration. - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.List `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.List `tfsdk:"cloudflare_api_token"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // The credential name. The name must be unique within the metastore. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Supplying true to this argument skips validation of the created // credential. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *CreateStorageCredential_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateStorageCredential_SdkV2) { @@ -4073,15 +4208,23 @@ func (newState *CreateStorageCredential_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateStorageCredential_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateStorageCredential_SdkV2) { } -func (c CreateStorageCredential_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name")...) +func (c CreateStorageCredential_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateStorageCredential. @@ -4281,9 +4424,9 @@ type CreateTableConstraint_SdkV2 struct { // A table constraint, as defined by *one* of the following fields being // set: __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. - Constraint types.List `tfsdk:"constraint" tf:"object"` + Constraint types.List `tfsdk:"constraint"` // The full name of the table referenced by the constraint. - FullNameArg types.String `tfsdk:"full_name_arg" tf:""` + FullNameArg types.String `tfsdk:"full_name_arg"` } func (newState *CreateTableConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTableConstraint_SdkV2) { @@ -4292,12 +4435,12 @@ func (newState *CreateTableConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateTableConstraint_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateTableConstraint_SdkV2) { } -func (c CreateTableConstraint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "constraint")...) - TableConstraint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "constraint")...) - cs.SetRequired(append(path, "full_name_arg")...) +func (c CreateTableConstraint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["constraint"] = attrs["constraint"].SetRequired() + attrs["constraint"] = attrs["constraint"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["full_name_arg"] = attrs["full_name_arg"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTableConstraint. @@ -4365,17 +4508,17 @@ func (o *CreateTableConstraint_SdkV2) SetConstraint(ctx context.Context, v Table type CreateVolumeRequestContent_SdkV2 struct { // The name of the catalog where the schema and the volume are - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the volume - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the volume - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The name of the schema where the volume is - SchemaName types.String `tfsdk:"schema_name" tf:""` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` - VolumeType types.String `tfsdk:"volume_type" tf:""` + VolumeType types.String `tfsdk:"volume_type"` } func (newState *CreateVolumeRequestContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVolumeRequestContent_SdkV2) { @@ -4384,13 +4527,15 @@ func (newState *CreateVolumeRequestContent_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CreateVolumeRequestContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateVolumeRequestContent_SdkV2) { } -func (c CreateVolumeRequestContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "schema_name")...) - cs.SetRequired(append(path, "volume_type")...) +func (c CreateVolumeRequestContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["volume_type"] = attrs["volume_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVolumeRequestContent. @@ -4436,47 +4581,47 @@ func (o CreateVolumeRequestContent_SdkV2) Type(ctx context.Context) attr.Type { type CredentialInfo_SdkV2 struct { // The AWS IAM role configuration - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this credential was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of credential creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // The full name of the credential. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the credential. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of the parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The credential name. The name must be unique among storage and service // credentials within the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Indicates the purpose of the credential. - Purpose types.String `tfsdk:"purpose" tf:"optional"` + Purpose types.String `tfsdk:"purpose"` // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Time at which this credential was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the credential. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Whether this credential is the current metastore's root storage // credential. Only applicable when purpose is **STORAGE**. - UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage" tf:"optional"` + UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage"` } func (newState *CredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CredentialInfo_SdkV2) { @@ -4485,13 +4630,31 @@ func (newState *CredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CredentialInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CredentialInfo_SdkV2) { } -func (c CredentialInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - DatabricksGcpServiceAccount_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - - return cs +func (c CredentialInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["purpose"] = attrs["purpose"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["used_for_managed_storage"] = attrs["used_for_managed_storage"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CredentialInfo. @@ -4678,9 +4841,9 @@ func (o *CredentialInfo_SdkV2) SetDatabricksGcpServiceAccount(ctx context.Contex type CredentialValidationResult_SdkV2 struct { // Error message would exist when the result does not equal to **PASS**. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // The results of the tested operation. - Result types.String `tfsdk:"result" tf:"optional"` + Result types.String `tfsdk:"result"` } func (newState *CredentialValidationResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CredentialValidationResult_SdkV2) { @@ -4689,9 +4852,11 @@ func (newState *CredentialValidationResult_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CredentialValidationResult_SdkV2) SyncEffectiveFieldsDuringRead(existingState CredentialValidationResult_SdkV2) { } -func (c CredentialValidationResult_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CredentialValidationResult_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CredentialValidationResult. @@ -4730,7 +4895,7 @@ func (o CredentialValidationResult_SdkV2) Type(ctx context.Context) attr.Type { // Currently assigned workspaces type CurrentWorkspaceBindings_SdkV2 struct { // A list of workspace IDs. - Workspaces types.List `tfsdk:"workspaces" tf:"optional"` + Workspaces types.List `tfsdk:"workspaces"` } func (newState *CurrentWorkspaceBindings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CurrentWorkspaceBindings_SdkV2) { @@ -4739,9 +4904,10 @@ func (newState *CurrentWorkspaceBindings_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *CurrentWorkspaceBindings_SdkV2) SyncEffectiveFieldsDuringRead(existingState CurrentWorkspaceBindings_SdkV2) { } -func (c CurrentWorkspaceBindings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CurrentWorkspaceBindings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["workspaces"] = attrs["workspaces"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CurrentWorkspaceBindings. @@ -4812,11 +4978,11 @@ type DatabricksGcpServiceAccount_SdkV2 struct { // field is only used to persist the credential_id once it is fetched from // the credentials manager - as we only use the protobuf serializer to store // credentials, this ID gets persisted to the database - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The email of the service account. - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` // The ID that represents the private key for this Service Account - PrivateKeyId types.String `tfsdk:"private_key_id" tf:"optional"` + PrivateKeyId types.String `tfsdk:"private_key_id"` } func (newState *DatabricksGcpServiceAccount_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatabricksGcpServiceAccount_SdkV2) { @@ -4825,9 +4991,12 @@ func (newState *DatabricksGcpServiceAccount_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *DatabricksGcpServiceAccount_SdkV2) SyncEffectiveFieldsDuringRead(existingState DatabricksGcpServiceAccount_SdkV2) { } -func (c DatabricksGcpServiceAccount_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DatabricksGcpServiceAccount_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["email"] = attrs["email"].SetOptional() + attrs["private_key_id"] = attrs["private_key_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksGcpServiceAccount. @@ -4874,9 +5043,9 @@ func (newState *DatabricksGcpServiceAccountRequest_SdkV2) SyncEffectiveFieldsDur func (newState *DatabricksGcpServiceAccountRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState DatabricksGcpServiceAccountRequest_SdkV2) { } -func (c DatabricksGcpServiceAccountRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DatabricksGcpServiceAccountRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksGcpServiceAccountRequest. @@ -4909,9 +5078,9 @@ func (o DatabricksGcpServiceAccountRequest_SdkV2) Type(ctx context.Context) attr type DatabricksGcpServiceAccountResponse_SdkV2 struct { // The Databricks internal ID that represents this service account. This is // an output-only field. - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The email of the service account. This is an output-only field. - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` } func (newState *DatabricksGcpServiceAccountResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatabricksGcpServiceAccountResponse_SdkV2) { @@ -4920,9 +5089,11 @@ func (newState *DatabricksGcpServiceAccountResponse_SdkV2) SyncEffectiveFieldsDu func (newState *DatabricksGcpServiceAccountResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DatabricksGcpServiceAccountResponse_SdkV2) { } -func (c DatabricksGcpServiceAccountResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DatabricksGcpServiceAccountResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["email"] = attrs["email"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksGcpServiceAccountResponse. @@ -5287,9 +5458,9 @@ func (newState *DeleteCredentialResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *DeleteCredentialResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteCredentialResponse_SdkV2) { } -func (c DeleteCredentialResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCredentialResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCredentialResponse. @@ -5834,7 +6005,7 @@ func (o DeleteVolumeRequest_SdkV2) Type(ctx context.Context) attr.Type { // __TableInfo.properties__. type DeltaRuntimePropertiesKvPairs_SdkV2 struct { // A map of key-value properties attached to the securable. - DeltaRuntimeProperties types.Map `tfsdk:"delta_runtime_properties" tf:""` + DeltaRuntimeProperties types.Map `tfsdk:"delta_runtime_properties"` } func (newState *DeltaRuntimePropertiesKvPairs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeltaRuntimePropertiesKvPairs_SdkV2) { @@ -5843,10 +6014,10 @@ func (newState *DeltaRuntimePropertiesKvPairs_SdkV2) SyncEffectiveFieldsDuringCr func (newState *DeltaRuntimePropertiesKvPairs_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeltaRuntimePropertiesKvPairs_SdkV2) { } -func (c DeltaRuntimePropertiesKvPairs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "delta_runtime_properties")...) +func (c DeltaRuntimePropertiesKvPairs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["delta_runtime_properties"] = attrs["delta_runtime_properties"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeltaRuntimePropertiesKvPairs. @@ -5914,9 +6085,9 @@ func (o *DeltaRuntimePropertiesKvPairs_SdkV2) SetDeltaRuntimeProperties(ctx cont // field must be defined. type Dependency_SdkV2 struct { // A function that is dependent on a SQL object. - Function types.List `tfsdk:"function" tf:"optional,object"` + Function types.List `tfsdk:"function"` // A table that is dependent on a SQL object. - Table types.List `tfsdk:"table" tf:"optional,object"` + Table types.List `tfsdk:"table"` } func (newState *Dependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dependency_SdkV2) { @@ -5925,11 +6096,13 @@ func (newState *Dependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan D func (newState *Dependency_SdkV2) SyncEffectiveFieldsDuringRead(existingState Dependency_SdkV2) { } -func (c Dependency_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionDependency_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "function")...) - TableDependency_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table")...) +func (c Dependency_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function"] = attrs["function"].SetOptional() + attrs["function"] = attrs["function"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table"] = attrs["table"].SetOptional() + attrs["table"] = attrs["table"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dependency. @@ -6027,7 +6200,7 @@ func (o *Dependency_SdkV2) SetTable(ctx context.Context, v TableDependency_SdkV2 // A list of dependencies. type DependencyList_SdkV2 struct { // Array of dependencies. - Dependencies types.List `tfsdk:"dependencies" tf:"optional"` + Dependencies types.List `tfsdk:"dependencies"` } func (newState *DependencyList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DependencyList_SdkV2) { @@ -6036,10 +6209,10 @@ func (newState *DependencyList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DependencyList_SdkV2) SyncEffectiveFieldsDuringRead(existingState DependencyList_SdkV2) { } -func (c DependencyList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Dependency_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dependencies")...) +func (c DependencyList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dependencies"] = attrs["dependencies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DependencyList. @@ -6177,7 +6350,7 @@ func (o DisableResponse_SdkV2) Type(ctx context.Context) attr.Type { type EffectivePermissionsList_SdkV2 struct { // The privileges conveyed to each principal (either directly or via // inheritance) - PrivilegeAssignments types.List `tfsdk:"privilege_assignments" tf:"optional"` + PrivilegeAssignments types.List `tfsdk:"privilege_assignments"` } func (newState *EffectivePermissionsList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePermissionsList_SdkV2) { @@ -6186,10 +6359,10 @@ func (newState *EffectivePermissionsList_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *EffectivePermissionsList_SdkV2) SyncEffectiveFieldsDuringRead(existingState EffectivePermissionsList_SdkV2) { } -func (c EffectivePermissionsList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePrivilegeAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "privilege_assignments")...) +func (c EffectivePermissionsList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["privilege_assignments"] = attrs["privilege_assignments"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePermissionsList. @@ -6256,13 +6429,13 @@ func (o *EffectivePermissionsList_SdkV2) SetPrivilegeAssignments(ctx context.Con type EffectivePredictiveOptimizationFlag_SdkV2 struct { // The name of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. - InheritedFromName types.String `tfsdk:"inherited_from_name" tf:"optional"` + InheritedFromName types.String `tfsdk:"inherited_from_name"` // The type of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. - InheritedFromType types.String `tfsdk:"inherited_from_type" tf:"optional"` + InheritedFromType types.String `tfsdk:"inherited_from_type"` // Whether predictive optimization should be enabled for this object and // objects under it. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *EffectivePredictiveOptimizationFlag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePredictiveOptimizationFlag_SdkV2) { @@ -6271,10 +6444,12 @@ func (newState *EffectivePredictiveOptimizationFlag_SdkV2) SyncEffectiveFieldsDu func (newState *EffectivePredictiveOptimizationFlag_SdkV2) SyncEffectiveFieldsDuringRead(existingState EffectivePredictiveOptimizationFlag_SdkV2) { } -func (c EffectivePredictiveOptimizationFlag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "value")...) +func (c EffectivePredictiveOptimizationFlag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited_from_name"] = attrs["inherited_from_name"].SetOptional() + attrs["inherited_from_type"] = attrs["inherited_from_type"].SetOptional() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePredictiveOptimizationFlag. @@ -6316,13 +6491,13 @@ type EffectivePrivilege_SdkV2 struct { // The full name of the object that conveys this privilege via inheritance. // This field is omitted when privilege is not inherited (it's assigned to // the securable itself). - InheritedFromName types.String `tfsdk:"inherited_from_name" tf:"optional"` + InheritedFromName types.String `tfsdk:"inherited_from_name"` // The type of the object that conveys this privilege via inheritance. This // field is omitted when privilege is not inherited (it's assigned to the // securable itself). - InheritedFromType types.String `tfsdk:"inherited_from_type" tf:"optional"` + InheritedFromType types.String `tfsdk:"inherited_from_type"` // The privilege assigned to the principal. - Privilege types.String `tfsdk:"privilege" tf:"optional"` + Privilege types.String `tfsdk:"privilege"` } func (newState *EffectivePrivilege_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePrivilege_SdkV2) { @@ -6331,9 +6506,12 @@ func (newState *EffectivePrivilege_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *EffectivePrivilege_SdkV2) SyncEffectiveFieldsDuringRead(existingState EffectivePrivilege_SdkV2) { } -func (c EffectivePrivilege_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EffectivePrivilege_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited_from_name"] = attrs["inherited_from_name"].SetOptional() + attrs["inherited_from_type"] = attrs["inherited_from_type"].SetOptional() + attrs["privilege"] = attrs["privilege"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePrivilege. @@ -6373,10 +6551,10 @@ func (o EffectivePrivilege_SdkV2) Type(ctx context.Context) attr.Type { type EffectivePrivilegeAssignment_SdkV2 struct { // The principal (user email address or group name). - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The privileges conveyed to the principal (either directly or via // inheritance). - Privileges types.List `tfsdk:"privileges" tf:"optional"` + Privileges types.List `tfsdk:"privileges"` } func (newState *EffectivePrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePrivilegeAssignment_SdkV2) { @@ -6385,10 +6563,11 @@ func (newState *EffectivePrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCre func (newState *EffectivePrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState EffectivePrivilegeAssignment_SdkV2) { } -func (c EffectivePrivilegeAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePrivilege_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "privileges")...) +func (c EffectivePrivilegeAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetOptional() + attrs["privileges"] = attrs["privileges"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePrivilegeAssignment. @@ -6528,7 +6707,7 @@ func (o EnableResponse_SdkV2) Type(ctx context.Context) attr.Type { // Encryption options that apply to clients connecting to cloud storage. type EncryptionDetails_SdkV2 struct { // Server-Side Encryption properties for clients communicating with AWS s3. - SseEncryptionDetails types.List `tfsdk:"sse_encryption_details" tf:"optional,object"` + SseEncryptionDetails types.List `tfsdk:"sse_encryption_details"` } func (newState *EncryptionDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EncryptionDetails_SdkV2) { @@ -6537,10 +6716,11 @@ func (newState *EncryptionDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *EncryptionDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState EncryptionDetails_SdkV2) { } -func (c EncryptionDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SseEncryptionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sse_encryption_details")...) +func (c EncryptionDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sse_encryption_details"] = attrs["sse_encryption_details"].SetOptional() + attrs["sse_encryption_details"] = attrs["sse_encryption_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EncryptionDetails. @@ -6643,44 +6823,44 @@ func (o ExistsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ExternalLocationInfo_SdkV2 struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this external location was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of external location creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique ID of the location's storage credential. - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // Name of the storage credential used with this location. - CredentialName types.String `tfsdk:"credential_name" tf:"optional"` + CredentialName types.String `tfsdk:"credential_name"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.List `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.List `tfsdk:"encryption_details"` // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback types.Bool `tfsdk:"fallback" tf:"optional"` + Fallback types.Bool `tfsdk:"fallback"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of metastore hosting the external location. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of the external location. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The owner of the external location. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Indicates whether the external location is read-only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Time at which external location this was last modified, in epoch // milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the external location. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Path URL of the external location. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ExternalLocationInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalLocationInfo_SdkV2) { @@ -6689,10 +6869,27 @@ func (newState *ExternalLocationInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ExternalLocationInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExternalLocationInfo_SdkV2) { } -func (c ExternalLocationInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EncryptionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - - return cs +func (c ExternalLocationInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["fallback"] = attrs["fallback"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalLocationInfo. @@ -6795,11 +6992,11 @@ type FailedStatus_SdkV2 struct { // Note that this Delta version may only be partially synced to the online // table. Only populated if the table is still online and available for // serving. - LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version" tf:"optional"` + LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version"` // The timestamp of the last time any data was synchronized from the source // table to the online table. Only populated if the table is still online // and available for serving. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` } func (newState *FailedStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FailedStatus_SdkV2) { @@ -6808,9 +7005,11 @@ func (newState *FailedStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *FailedStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState FailedStatus_SdkV2) { } -func (c FailedStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FailedStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_processed_commit_version"] = attrs["last_processed_commit_version"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FailedStatus. @@ -6848,13 +7047,13 @@ func (o FailedStatus_SdkV2) Type(ctx context.Context) attr.Type { type ForeignKeyConstraint_SdkV2 struct { // Column names for this constraint. - ChildColumns types.List `tfsdk:"child_columns" tf:""` + ChildColumns types.List `tfsdk:"child_columns"` // The name of the constraint. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Column names for this constraint. - ParentColumns types.List `tfsdk:"parent_columns" tf:""` + ParentColumns types.List `tfsdk:"parent_columns"` // The full name of the parent constraint. - ParentTable types.String `tfsdk:"parent_table" tf:""` + ParentTable types.String `tfsdk:"parent_table"` } func (newState *ForeignKeyConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForeignKeyConstraint_SdkV2) { @@ -6863,13 +7062,13 @@ func (newState *ForeignKeyConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ForeignKeyConstraint_SdkV2) SyncEffectiveFieldsDuringRead(existingState ForeignKeyConstraint_SdkV2) { } -func (c ForeignKeyConstraint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "child_columns")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "parent_columns")...) - cs.SetRequired(append(path, "parent_table")...) +func (c ForeignKeyConstraint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["child_columns"] = attrs["child_columns"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["parent_columns"] = attrs["parent_columns"].SetRequired() + attrs["parent_table"] = attrs["parent_table"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForeignKeyConstraint. @@ -6972,7 +7171,7 @@ func (o *ForeignKeyConstraint_SdkV2) SetParentColumns(ctx context.Context, v []t type FunctionDependency_SdkV2 struct { // Full name of the dependent function, in the form of // __catalog_name__.__schema_name__.__function_name__. - FunctionFullName types.String `tfsdk:"function_full_name" tf:""` + FunctionFullName types.String `tfsdk:"function_full_name"` } func (newState *FunctionDependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionDependency_SdkV2) { @@ -6981,10 +7180,10 @@ func (newState *FunctionDependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *FunctionDependency_SdkV2) SyncEffectiveFieldsDuringRead(existingState FunctionDependency_SdkV2) { } -func (c FunctionDependency_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "function_full_name")...) +func (c FunctionDependency_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_full_name"] = attrs["function_full_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionDependency. @@ -7022,70 +7221,70 @@ type FunctionInfo_SdkV2 struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this function was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of function creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Scalar function return data type. - DataType types.String `tfsdk:"data_type" tf:"optional"` + DataType types.String `tfsdk:"data_type"` // External function language. - ExternalLanguage types.String `tfsdk:"external_language" tf:"optional"` + ExternalLanguage types.String `tfsdk:"external_language"` // External function name. - ExternalName types.String `tfsdk:"external_name" tf:"optional"` + ExternalName types.String `tfsdk:"external_name"` // Pretty printed function data type. - FullDataType types.String `tfsdk:"full_data_type" tf:"optional"` + FullDataType types.String `tfsdk:"full_data_type"` // Full name of function, in form of // __catalog_name__.__schema_name__.__function__name__ - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Id of Function, relative to parent schema. - FunctionId types.String `tfsdk:"function_id" tf:"optional"` + FunctionId types.String `tfsdk:"function_id"` - InputParams types.List `tfsdk:"input_params" tf:"optional,object"` + InputParams types.List `tfsdk:"input_params"` // Whether the function is deterministic. - IsDeterministic types.Bool `tfsdk:"is_deterministic" tf:"optional"` + IsDeterministic types.Bool `tfsdk:"is_deterministic"` // Function null call. - IsNullCall types.Bool `tfsdk:"is_null_call" tf:"optional"` + IsNullCall types.Bool `tfsdk:"is_null_call"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of function, relative to parent schema. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of function. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Function parameter style. **S** is the value for SQL. - ParameterStyle types.String `tfsdk:"parameter_style" tf:"optional"` + ParameterStyle types.String `tfsdk:"parameter_style"` // JSON-serialized key-value pair map, encoded (escaped) as a string. - Properties types.String `tfsdk:"properties" tf:"optional"` + Properties types.String `tfsdk:"properties"` // Table function return parameters. - ReturnParams types.List `tfsdk:"return_params" tf:"optional,object"` + ReturnParams types.List `tfsdk:"return_params"` // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return // type is not supported), and the __sql_data_access__ field must be // **NO_SQL**. - RoutineBody types.String `tfsdk:"routine_body" tf:"optional"` + RoutineBody types.String `tfsdk:"routine_body"` // Function body. - RoutineDefinition types.String `tfsdk:"routine_definition" tf:"optional"` + RoutineDefinition types.String `tfsdk:"routine_definition"` // Function dependencies. - RoutineDependencies types.List `tfsdk:"routine_dependencies" tf:"optional,object"` + RoutineDependencies types.List `tfsdk:"routine_dependencies"` // Name of parent schema relative to its parent catalog. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // Function security type. - SecurityType types.String `tfsdk:"security_type" tf:"optional"` + SecurityType types.String `tfsdk:"security_type"` // Specific name of the function; Reserved for future use. - SpecificName types.String `tfsdk:"specific_name" tf:"optional"` + SpecificName types.String `tfsdk:"specific_name"` // Function SQL data access. - SqlDataAccess types.String `tfsdk:"sql_data_access" tf:"optional"` + SqlDataAccess types.String `tfsdk:"sql_data_access"` // List of schemes whose objects can be referenced without qualification. - SqlPath types.String `tfsdk:"sql_path" tf:"optional"` + SqlPath types.String `tfsdk:"sql_path"` // Time at which this function was created, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified function. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *FunctionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionInfo_SdkV2) { @@ -7094,12 +7293,42 @@ func (newState *FunctionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *FunctionInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState FunctionInfo_SdkV2) { } -func (c FunctionInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionParameterInfos_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "input_params")...) - FunctionParameterInfos_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "return_params")...) - DependencyList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "routine_dependencies")...) - - return cs +func (c FunctionInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_type"] = attrs["data_type"].SetOptional() + attrs["external_language"] = attrs["external_language"].SetOptional() + attrs["external_name"] = attrs["external_name"].SetOptional() + attrs["full_data_type"] = attrs["full_data_type"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["function_id"] = attrs["function_id"].SetOptional() + attrs["input_params"] = attrs["input_params"].SetOptional() + attrs["input_params"] = attrs["input_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["is_deterministic"] = attrs["is_deterministic"].SetOptional() + attrs["is_null_call"] = attrs["is_null_call"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["parameter_style"] = attrs["parameter_style"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["return_params"] = attrs["return_params"].SetOptional() + attrs["return_params"] = attrs["return_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["routine_body"] = attrs["routine_body"].SetOptional() + attrs["routine_definition"] = attrs["routine_definition"].SetOptional() + attrs["routine_dependencies"] = attrs["routine_dependencies"].SetOptional() + attrs["routine_dependencies"] = attrs["routine_dependencies"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["security_type"] = attrs["security_type"].SetOptional() + attrs["specific_name"] = attrs["specific_name"].SetOptional() + attrs["sql_data_access"] = attrs["sql_data_access"].SetOptional() + attrs["sql_path"] = attrs["sql_path"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionInfo. @@ -7281,29 +7510,29 @@ func (o *FunctionInfo_SdkV2) SetRoutineDependencies(ctx context.Context, v Depen type FunctionParameterInfo_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of parameter. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Default value of the parameter. - ParameterDefault types.String `tfsdk:"parameter_default" tf:"optional"` + ParameterDefault types.String `tfsdk:"parameter_default"` // The mode of the function parameter. - ParameterMode types.String `tfsdk:"parameter_mode" tf:"optional"` + ParameterMode types.String `tfsdk:"parameter_mode"` // The type of function parameter. - ParameterType types.String `tfsdk:"parameter_type" tf:"optional"` + ParameterType types.String `tfsdk:"parameter_type"` // Ordinal position of column (starting at position 0). - Position types.Int64 `tfsdk:"position" tf:""` + Position types.Int64 `tfsdk:"position"` // Format of IntervalType. - TypeIntervalType types.String `tfsdk:"type_interval_type" tf:"optional"` + TypeIntervalType types.String `tfsdk:"type_interval_type"` // Full data type spec, JSON-serialized. - TypeJson types.String `tfsdk:"type_json" tf:"optional"` + TypeJson types.String `tfsdk:"type_json"` - TypeName types.String `tfsdk:"type_name" tf:""` + TypeName types.String `tfsdk:"type_name"` // Digits of precision; required on Create for DecimalTypes. - TypePrecision types.Int64 `tfsdk:"type_precision" tf:"optional"` + TypePrecision types.Int64 `tfsdk:"type_precision"` // Digits to right of decimal; Required on Create for DecimalTypes. - TypeScale types.Int64 `tfsdk:"type_scale" tf:"optional"` + TypeScale types.Int64 `tfsdk:"type_scale"` // Full data type spec, SQL/catalogString text. - TypeText types.String `tfsdk:"type_text" tf:""` + TypeText types.String `tfsdk:"type_text"` } func (newState *FunctionParameterInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionParameterInfo_SdkV2) { @@ -7312,13 +7541,21 @@ func (newState *FunctionParameterInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *FunctionParameterInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState FunctionParameterInfo_SdkV2) { } -func (c FunctionParameterInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "position")...) - cs.SetRequired(append(path, "type_name")...) - cs.SetRequired(append(path, "type_text")...) +func (c FunctionParameterInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["parameter_default"] = attrs["parameter_default"].SetOptional() + attrs["parameter_mode"] = attrs["parameter_mode"].SetOptional() + attrs["parameter_type"] = attrs["parameter_type"].SetOptional() + attrs["position"] = attrs["position"].SetRequired() + attrs["type_interval_type"] = attrs["type_interval_type"].SetOptional() + attrs["type_json"] = attrs["type_json"].SetOptional() + attrs["type_name"] = attrs["type_name"].SetRequired() + attrs["type_precision"] = attrs["type_precision"].SetOptional() + attrs["type_scale"] = attrs["type_scale"].SetOptional() + attrs["type_text"] = attrs["type_text"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionParameterInfo. @@ -7377,7 +7614,7 @@ func (o FunctionParameterInfo_SdkV2) Type(ctx context.Context) attr.Type { type FunctionParameterInfos_SdkV2 struct { // The array of __FunctionParameterInfo__ definitions of the function's // parameters. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *FunctionParameterInfos_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionParameterInfos_SdkV2) { @@ -7386,10 +7623,10 @@ func (newState *FunctionParameterInfos_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *FunctionParameterInfos_SdkV2) SyncEffectiveFieldsDuringRead(existingState FunctionParameterInfos_SdkV2) { } -func (c FunctionParameterInfos_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionParameterInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c FunctionParameterInfos_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionParameterInfos. @@ -7456,7 +7693,7 @@ func (o *FunctionParameterInfos_SdkV2) SetParameters(ctx context.Context, v []Fu // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account type GcpOauthToken_SdkV2 struct { - OauthToken types.String `tfsdk:"oauth_token" tf:"optional"` + OauthToken types.String `tfsdk:"oauth_token"` } func (newState *GcpOauthToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpOauthToken_SdkV2) { @@ -7465,9 +7702,10 @@ func (newState *GcpOauthToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *GcpOauthToken_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcpOauthToken_SdkV2) { } -func (c GcpOauthToken_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GcpOauthToken_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["oauth_token"] = attrs["oauth_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpOauthToken. @@ -7506,7 +7744,7 @@ type GenerateTemporaryServiceCredentialAzureOptions_SdkV2 struct { // The resources to which the temporary Azure credential should apply. These // resources are the scopes that are passed to the token provider (see // https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential?view=azure-python) - Resources types.List `tfsdk:"resources" tf:"optional"` + Resources types.List `tfsdk:"resources"` } func (newState *GenerateTemporaryServiceCredentialAzureOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryServiceCredentialAzureOptions_SdkV2) { @@ -7515,9 +7753,10 @@ func (newState *GenerateTemporaryServiceCredentialAzureOptions_SdkV2) SyncEffect func (newState *GenerateTemporaryServiceCredentialAzureOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryServiceCredentialAzureOptions_SdkV2) { } -func (c GenerateTemporaryServiceCredentialAzureOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenerateTemporaryServiceCredentialAzureOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["resources"] = attrs["resources"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryServiceCredentialAzureOptions. @@ -7586,7 +7825,7 @@ type GenerateTemporaryServiceCredentialGcpOptions_SdkV2 struct { // The scopes to which the temporary GCP credential should apply. These // resources are the scopes that are passed to the token provider (see // https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.credentials.Credentials) - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` } func (newState *GenerateTemporaryServiceCredentialGcpOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryServiceCredentialGcpOptions_SdkV2) { @@ -7595,9 +7834,10 @@ func (newState *GenerateTemporaryServiceCredentialGcpOptions_SdkV2) SyncEffectiv func (newState *GenerateTemporaryServiceCredentialGcpOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryServiceCredentialGcpOptions_SdkV2) { } -func (c GenerateTemporaryServiceCredentialGcpOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenerateTemporaryServiceCredentialGcpOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scopes"] = attrs["scopes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryServiceCredentialGcpOptions. @@ -7663,12 +7903,12 @@ func (o *GenerateTemporaryServiceCredentialGcpOptions_SdkV2) SetScopes(ctx conte type GenerateTemporaryServiceCredentialRequest_SdkV2 struct { // The Azure cloud options to customize the requested temporary credential - AzureOptions types.List `tfsdk:"azure_options" tf:"optional,object"` + AzureOptions types.List `tfsdk:"azure_options"` // The name of the service credential used to generate a temporary // credential - CredentialName types.String `tfsdk:"credential_name" tf:""` + CredentialName types.String `tfsdk:"credential_name"` // The GCP cloud options to customize the requested temporary credential - GcpOptions types.List `tfsdk:"gcp_options" tf:"optional,object"` + GcpOptions types.List `tfsdk:"gcp_options"` } func (newState *GenerateTemporaryServiceCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryServiceCredentialRequest_SdkV2) { @@ -7677,12 +7917,14 @@ func (newState *GenerateTemporaryServiceCredentialRequest_SdkV2) SyncEffectiveFi func (newState *GenerateTemporaryServiceCredentialRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryServiceCredentialRequest_SdkV2) { } -func (c GenerateTemporaryServiceCredentialRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GenerateTemporaryServiceCredentialAzureOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_options")...) - cs.SetRequired(append(path, "credential_name")...) - GenerateTemporaryServiceCredentialGcpOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_options")...) +func (c GenerateTemporaryServiceCredentialRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["azure_options"] = attrs["azure_options"].SetOptional() + attrs["azure_options"] = attrs["azure_options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["credential_name"] = attrs["credential_name"].SetRequired() + attrs["gcp_options"] = attrs["gcp_options"].SetOptional() + attrs["gcp_options"] = attrs["gcp_options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryServiceCredentialRequest. @@ -7783,9 +8025,9 @@ type GenerateTemporaryTableCredentialRequest_SdkV2 struct { // The operation performed against the table data, either READ or // READ_WRITE. If READ_WRITE is specified, the credentials returned will // have write permissions, otherwise, it will be read only. - Operation types.String `tfsdk:"operation" tf:"optional"` + Operation types.String `tfsdk:"operation"` // UUID of the table to read or write. - TableId types.String `tfsdk:"table_id" tf:"optional"` + TableId types.String `tfsdk:"table_id"` } func (newState *GenerateTemporaryTableCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryTableCredentialRequest_SdkV2) { @@ -7794,9 +8036,11 @@ func (newState *GenerateTemporaryTableCredentialRequest_SdkV2) SyncEffectiveFiel func (newState *GenerateTemporaryTableCredentialRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryTableCredentialRequest_SdkV2) { } -func (c GenerateTemporaryTableCredentialRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenerateTemporaryTableCredentialRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["operation"] = attrs["operation"].SetOptional() + attrs["table_id"] = attrs["table_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryTableCredentialRequest. @@ -7835,25 +8079,25 @@ func (o GenerateTemporaryTableCredentialRequest_SdkV2) Type(ctx context.Context) type GenerateTemporaryTableCredentialResponse_SdkV2 struct { // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. - AwsTempCredentials types.List `tfsdk:"aws_temp_credentials" tf:"optional,object"` + AwsTempCredentials types.List `tfsdk:"aws_temp_credentials"` // Azure Active Directory token, essentially the Oauth token for Azure // Service Principal or Managed Identity. Read more at // https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token - AzureAad types.List `tfsdk:"azure_aad" tf:"optional,object"` + AzureAad types.List `tfsdk:"azure_aad"` // Azure temporary credentials for API authentication. Read more at // https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas - AzureUserDelegationSas types.List `tfsdk:"azure_user_delegation_sas" tf:"optional,object"` + AzureUserDelegationSas types.List `tfsdk:"azure_user_delegation_sas"` // Server time when the credential will expire, in epoch milliseconds. The // API client is advised to cache the credential given this expiration time. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account - GcpOauthToken types.List `tfsdk:"gcp_oauth_token" tf:"optional,object"` + GcpOauthToken types.List `tfsdk:"gcp_oauth_token"` // R2 temporary credentials for API authentication. Read more at // https://developers.cloudflare.com/r2/api/s3/tokens/. - R2TempCredentials types.List `tfsdk:"r2_temp_credentials" tf:"optional,object"` + R2TempCredentials types.List `tfsdk:"r2_temp_credentials"` // The URL of the storage path accessible by the temporary credential. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *GenerateTemporaryTableCredentialResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryTableCredentialResponse_SdkV2) { @@ -7862,14 +8106,21 @@ func (newState *GenerateTemporaryTableCredentialResponse_SdkV2) SyncEffectiveFie func (newState *GenerateTemporaryTableCredentialResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryTableCredentialResponse_SdkV2) { } -func (c GenerateTemporaryTableCredentialResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsCredentials_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_temp_credentials")...) - AzureActiveDirectoryToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_aad")...) - AzureUserDelegationSas_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_user_delegation_sas")...) - GcpOauthToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_oauth_token")...) - R2Credentials_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "r2_temp_credentials")...) +func (c GenerateTemporaryTableCredentialResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_temp_credentials"] = attrs["aws_temp_credentials"].SetOptional() + attrs["aws_temp_credentials"] = attrs["aws_temp_credentials"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_aad"] = attrs["azure_aad"].SetOptional() + attrs["azure_aad"] = attrs["azure_aad"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_user_delegation_sas"] = attrs["azure_user_delegation_sas"].SetOptional() + attrs["azure_user_delegation_sas"] = attrs["azure_user_delegation_sas"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["gcp_oauth_token"] = attrs["gcp_oauth_token"].SetOptional() + attrs["gcp_oauth_token"] = attrs["gcp_oauth_token"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["r2_temp_credentials"] = attrs["r2_temp_credentials"].SetOptional() + attrs["r2_temp_credentials"] = attrs["r2_temp_credentials"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryTableCredentialResponse. @@ -8645,47 +8896,47 @@ func (o GetMetastoreRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetMetastoreSummaryResponse_SdkV2 struct { // Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Time at which this metastore was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of metastore creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique identifier of the metastore's (Default) Data Access Configuration. - DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id" tf:"optional"` + DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id"` // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name" tf:"optional"` + DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name"` // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds" tf:"optional"` + DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds"` // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope types.String `tfsdk:"delta_sharing_scope" tf:"optional"` + DeltaSharingScope types.String `tfsdk:"delta_sharing_scope"` // Whether to allow non-DBR clients to directly access entities under the // metastore. - ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled" tf:"optional"` + ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled"` // Globally unique metastore ID across clouds and regions, of the form // `cloud:region:metastore_id`. - GlobalMetastoreId types.String `tfsdk:"global_metastore_id" tf:"optional"` + GlobalMetastoreId types.String `tfsdk:"global_metastore_id"` // Unique identifier of metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The user-specified name of the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The owner of the metastore. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion types.String `tfsdk:"privilege_model_version" tf:"optional"` + PrivilegeModelVersion types.String `tfsdk:"privilege_model_version"` // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The storage root URL for metastore - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id" tf:"optional"` + StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id"` // Name of the storage credential to access the metastore storage_root. - StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name" tf:"optional"` + StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name"` // Time at which the metastore was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the metastore. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *GetMetastoreSummaryResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetMetastoreSummaryResponse_SdkV2) { @@ -8694,9 +8945,28 @@ func (newState *GetMetastoreSummaryResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *GetMetastoreSummaryResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetMetastoreSummaryResponse_SdkV2) { } -func (c GetMetastoreSummaryResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c GetMetastoreSummaryResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["default_data_access_config_id"] = attrs["default_data_access_config_id"].SetOptional() + attrs["delta_sharing_organization_name"] = attrs["delta_sharing_organization_name"].SetOptional() + attrs["delta_sharing_recipient_token_lifetime_in_seconds"] = attrs["delta_sharing_recipient_token_lifetime_in_seconds"].SetOptional() + attrs["delta_sharing_scope"] = attrs["delta_sharing_scope"].SetOptional() + attrs["external_access_enabled"] = attrs["external_access_enabled"].SetOptional() + attrs["global_metastore_id"] = attrs["global_metastore_id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["privilege_model_version"] = attrs["privilege_model_version"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["storage_root_credential_id"] = attrs["storage_root_credential_id"].SetOptional() + attrs["storage_root_credential_name"] = attrs["storage_root_credential_name"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetMetastoreSummaryResponse. @@ -8940,7 +9210,7 @@ func (o GetQuotaRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetQuotaResponse_SdkV2 struct { // The returned QuotaInfo. - QuotaInfo types.List `tfsdk:"quota_info" tf:"optional,object"` + QuotaInfo types.List `tfsdk:"quota_info"` } func (newState *GetQuotaResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetQuotaResponse_SdkV2) { @@ -8949,10 +9219,11 @@ func (newState *GetQuotaResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *GetQuotaResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetQuotaResponse_SdkV2) { } -func (c GetQuotaResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuotaInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "quota_info")...) +func (c GetQuotaResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["quota_info"] = attrs["quota_info"].SetOptional() + attrs["quota_info"] = attrs["quota_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetQuotaResponse. @@ -9308,7 +9579,7 @@ func (o ListAccountMetastoreAssignmentsRequest_SdkV2) Type(ctx context.Context) // The list of workspaces to which the given metastore is assigned. type ListAccountMetastoreAssignmentsResponse_SdkV2 struct { - WorkspaceIds types.List `tfsdk:"workspace_ids" tf:"optional"` + WorkspaceIds types.List `tfsdk:"workspace_ids"` } func (newState *ListAccountMetastoreAssignmentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAccountMetastoreAssignmentsResponse_SdkV2) { @@ -9317,9 +9588,10 @@ func (newState *ListAccountMetastoreAssignmentsResponse_SdkV2) SyncEffectiveFiel func (newState *ListAccountMetastoreAssignmentsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAccountMetastoreAssignmentsResponse_SdkV2) { } -func (c ListAccountMetastoreAssignmentsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListAccountMetastoreAssignmentsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["workspace_ids"] = attrs["workspace_ids"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAccountMetastoreAssignmentsResponse. @@ -9422,7 +9694,7 @@ func (o ListAccountStorageCredentialsRequest_SdkV2) Type(ctx context.Context) at type ListAccountStorageCredentialsResponse_SdkV2 struct { // An array of metastore storage credentials. - StorageCredentials types.List `tfsdk:"storage_credentials" tf:"optional"` + StorageCredentials types.List `tfsdk:"storage_credentials"` } func (newState *ListAccountStorageCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAccountStorageCredentialsResponse_SdkV2) { @@ -9431,10 +9703,10 @@ func (newState *ListAccountStorageCredentialsResponse_SdkV2) SyncEffectiveFields func (newState *ListAccountStorageCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAccountStorageCredentialsResponse_SdkV2) { } -func (c ListAccountStorageCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StorageCredentialInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "storage_credentials")...) +func (c ListAccountStorageCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["storage_credentials"] = attrs["storage_credentials"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAccountStorageCredentialsResponse. @@ -9554,11 +9826,11 @@ func (o ListCatalogsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListCatalogsResponse_SdkV2 struct { // An array of catalog information objects. - Catalogs types.List `tfsdk:"catalogs" tf:"optional"` + Catalogs types.List `tfsdk:"catalogs"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCatalogsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCatalogsResponse_SdkV2) { @@ -9567,10 +9839,11 @@ func (newState *ListCatalogsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListCatalogsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCatalogsResponse_SdkV2) { } -func (c ListCatalogsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CatalogInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "catalogs")...) +func (c ListCatalogsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalogs"] = attrs["catalogs"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCatalogsResponse. @@ -9684,11 +9957,11 @@ func (o ListConnectionsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListConnectionsResponse_SdkV2 struct { // An array of connection information objects. - Connections types.List `tfsdk:"connections" tf:"optional"` + Connections types.List `tfsdk:"connections"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListConnectionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListConnectionsResponse_SdkV2) { @@ -9697,10 +9970,11 @@ func (newState *ListConnectionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ListConnectionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListConnectionsResponse_SdkV2) { } -func (c ListConnectionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ConnectionInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "connections")...) +func (c ListConnectionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connections"] = attrs["connections"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListConnectionsResponse. @@ -9816,11 +10090,11 @@ func (o ListCredentialsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListCredentialsResponse_SdkV2 struct { - Credentials types.List `tfsdk:"credentials" tf:"optional"` + Credentials types.List `tfsdk:"credentials"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCredentialsResponse_SdkV2) { @@ -9829,10 +10103,11 @@ func (newState *ListCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ListCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCredentialsResponse_SdkV2) { } -func (c ListCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CredentialInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "credentials")...) +func (c ListCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credentials"] = attrs["credentials"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCredentialsResponse. @@ -9951,11 +10226,11 @@ func (o ListExternalLocationsRequest_SdkV2) Type(ctx context.Context) attr.Type type ListExternalLocationsResponse_SdkV2 struct { // An array of external locations. - ExternalLocations types.List `tfsdk:"external_locations" tf:"optional"` + ExternalLocations types.List `tfsdk:"external_locations"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExternalLocationsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExternalLocationsResponse_SdkV2) { @@ -9964,10 +10239,11 @@ func (newState *ListExternalLocationsResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *ListExternalLocationsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListExternalLocationsResponse_SdkV2) { } -func (c ListExternalLocationsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalLocationInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "external_locations")...) +func (c ListExternalLocationsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_locations"] = attrs["external_locations"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExternalLocationsResponse. @@ -10094,11 +10370,11 @@ func (o ListFunctionsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListFunctionsResponse_SdkV2 struct { // An array of function information objects. - Functions types.List `tfsdk:"functions" tf:"optional"` + Functions types.List `tfsdk:"functions"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListFunctionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFunctionsResponse_SdkV2) { @@ -10107,10 +10383,11 @@ func (newState *ListFunctionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListFunctionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListFunctionsResponse_SdkV2) { } -func (c ListFunctionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "functions")...) +func (c ListFunctionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["functions"] = attrs["functions"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFunctionsResponse. @@ -10178,7 +10455,7 @@ func (o *ListFunctionsResponse_SdkV2) SetFunctions(ctx context.Context, v []Func type ListMetastoresResponse_SdkV2 struct { // An array of metastore information objects. - Metastores types.List `tfsdk:"metastores" tf:"optional"` + Metastores types.List `tfsdk:"metastores"` } func (newState *ListMetastoresResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListMetastoresResponse_SdkV2) { @@ -10187,10 +10464,10 @@ func (newState *ListMetastoresResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ListMetastoresResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListMetastoresResponse_SdkV2) { } -func (c ListMetastoresResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MetastoreInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metastores")...) +func (c ListMetastoresResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastores"] = attrs["metastores"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListMetastoresResponse. @@ -10312,11 +10589,11 @@ func (o ListModelVersionsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListModelVersionsResponse_SdkV2 struct { - ModelVersions types.List `tfsdk:"model_versions" tf:"optional"` + ModelVersions types.List `tfsdk:"model_versions"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListModelVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListModelVersionsResponse_SdkV2) { @@ -10325,10 +10602,11 @@ func (newState *ListModelVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ListModelVersionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListModelVersionsResponse_SdkV2) { } -func (c ListModelVersionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersionInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "model_versions")...) +func (c ListModelVersionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_versions"] = attrs["model_versions"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListModelVersionsResponse. @@ -10439,9 +10717,9 @@ type ListQuotasResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of returned QuotaInfos. - Quotas types.List `tfsdk:"quotas" tf:"optional"` + Quotas types.List `tfsdk:"quotas"` } func (newState *ListQuotasResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQuotasResponse_SdkV2) { @@ -10450,10 +10728,11 @@ func (newState *ListQuotasResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListQuotasResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListQuotasResponse_SdkV2) { } -func (c ListQuotasResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuotaInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "quotas")...) +func (c ListQuotasResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["quotas"] = attrs["quotas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQuotasResponse. @@ -10631,9 +10910,9 @@ func (o ListRegisteredModelsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListRegisteredModelsResponse_SdkV2 struct { // Opaque token for pagination. Omitted if there are no more results. // page_token should be set to this value for fetching the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - RegisteredModels types.List `tfsdk:"registered_models" tf:"optional"` + RegisteredModels types.List `tfsdk:"registered_models"` } func (newState *ListRegisteredModelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRegisteredModelsResponse_SdkV2) { @@ -10642,10 +10921,11 @@ func (newState *ListRegisteredModelsResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ListRegisteredModelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListRegisteredModelsResponse_SdkV2) { } -func (c ListRegisteredModelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "registered_models")...) +func (c ListRegisteredModelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["registered_models"] = attrs["registered_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRegisteredModelsResponse. @@ -10770,9 +11050,9 @@ type ListSchemasResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of schema information objects. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *ListSchemasResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSchemasResponse_SdkV2) { @@ -10781,10 +11061,11 @@ func (newState *ListSchemasResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListSchemasResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListSchemasResponse_SdkV2) { } -func (c ListSchemasResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SchemaInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schemas")...) +func (c ListSchemasResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSchemasResponse. @@ -10900,9 +11181,9 @@ type ListStorageCredentialsResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - StorageCredentials types.List `tfsdk:"storage_credentials" tf:"optional"` + StorageCredentials types.List `tfsdk:"storage_credentials"` } func (newState *ListStorageCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListStorageCredentialsResponse_SdkV2) { @@ -10911,10 +11192,11 @@ func (newState *ListStorageCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *ListStorageCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListStorageCredentialsResponse_SdkV2) { } -func (c ListStorageCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StorageCredentialInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "storage_credentials")...) +func (c ListStorageCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["storage_credentials"] = attrs["storage_credentials"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListStorageCredentialsResponse. @@ -11099,9 +11381,9 @@ type ListSystemSchemasResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of system schema information objects. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *ListSystemSchemasResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSystemSchemasResponse_SdkV2) { @@ -11110,10 +11392,11 @@ func (newState *ListSystemSchemasResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ListSystemSchemasResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListSystemSchemasResponse_SdkV2) { } -func (c ListSystemSchemasResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SystemSchemaInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schemas")...) +func (c ListSystemSchemasResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSystemSchemasResponse. @@ -11183,9 +11466,9 @@ type ListTableSummariesResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of table summaries. - Tables types.List `tfsdk:"tables" tf:"optional"` + Tables types.List `tfsdk:"tables"` } func (newState *ListTableSummariesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListTableSummariesResponse_SdkV2) { @@ -11194,10 +11477,11 @@ func (newState *ListTableSummariesResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListTableSummariesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListTableSummariesResponse_SdkV2) { } -func (c ListTableSummariesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSummary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tables")...) +func (c ListTableSummariesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["tables"] = attrs["tables"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTableSummariesResponse. @@ -11347,9 +11631,9 @@ type ListTablesResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of table information objects. - Tables types.List `tfsdk:"tables" tf:"optional"` + Tables types.List `tfsdk:"tables"` } func (newState *ListTablesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListTablesResponse_SdkV2) { @@ -11358,10 +11642,11 @@ func (newState *ListTablesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListTablesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListTablesResponse_SdkV2) { } -func (c ListTablesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tables")...) +func (c ListTablesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["tables"] = attrs["tables"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTablesResponse. @@ -11497,9 +11782,9 @@ type ListVolumesResponseContent_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request to retrieve the next page of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Volumes types.List `tfsdk:"volumes" tf:"optional"` + Volumes types.List `tfsdk:"volumes"` } func (newState *ListVolumesResponseContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListVolumesResponseContent_SdkV2) { @@ -11508,10 +11793,11 @@ func (newState *ListVolumesResponseContent_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListVolumesResponseContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListVolumesResponseContent_SdkV2) { } -func (c ListVolumesResponseContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - VolumeInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "volumes")...) +func (c ListVolumesResponseContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["volumes"] = attrs["volumes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListVolumesResponseContent. @@ -11579,11 +11865,11 @@ func (o *ListVolumesResponseContent_SdkV2) SetVolumes(ctx context.Context, v []V type MetastoreAssignment_SdkV2 struct { // The name of the default catalog in the metastore. - DefaultCatalogName types.String `tfsdk:"default_catalog_name" tf:"optional"` + DefaultCatalogName types.String `tfsdk:"default_catalog_name"` // The unique ID of the metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:""` + MetastoreId types.String `tfsdk:"metastore_id"` // The unique ID of the Databricks workspace. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:""` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *MetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MetastoreAssignment_SdkV2) { @@ -11592,11 +11878,12 @@ func (newState *MetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *MetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState MetastoreAssignment_SdkV2) { } -func (c MetastoreAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c MetastoreAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_catalog_name"] = attrs["default_catalog_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MetastoreAssignment. @@ -11636,47 +11923,47 @@ func (o MetastoreAssignment_SdkV2) Type(ctx context.Context) attr.Type { type MetastoreInfo_SdkV2 struct { // Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Time at which this metastore was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of metastore creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique identifier of the metastore's (Default) Data Access Configuration. - DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id" tf:"optional"` + DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id"` // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name" tf:"optional"` + DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name"` // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds" tf:"optional"` + DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds"` // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope types.String `tfsdk:"delta_sharing_scope" tf:"optional"` + DeltaSharingScope types.String `tfsdk:"delta_sharing_scope"` // Whether to allow non-DBR clients to directly access entities under the // metastore. - ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled" tf:"optional"` + ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled"` // Globally unique metastore ID across clouds and regions, of the form // `cloud:region:metastore_id`. - GlobalMetastoreId types.String `tfsdk:"global_metastore_id" tf:"optional"` + GlobalMetastoreId types.String `tfsdk:"global_metastore_id"` // Unique identifier of metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The user-specified name of the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The owner of the metastore. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion types.String `tfsdk:"privilege_model_version" tf:"optional"` + PrivilegeModelVersion types.String `tfsdk:"privilege_model_version"` // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The storage root URL for metastore - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id" tf:"optional"` + StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id"` // Name of the storage credential to access the metastore storage_root. - StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name" tf:"optional"` + StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name"` // Time at which the metastore was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the metastore. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *MetastoreInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MetastoreInfo_SdkV2) { @@ -11685,9 +11972,28 @@ func (newState *MetastoreInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *MetastoreInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState MetastoreInfo_SdkV2) { } -func (c MetastoreInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c MetastoreInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["default_data_access_config_id"] = attrs["default_data_access_config_id"].SetOptional() + attrs["delta_sharing_organization_name"] = attrs["delta_sharing_organization_name"].SetOptional() + attrs["delta_sharing_recipient_token_lifetime_in_seconds"] = attrs["delta_sharing_recipient_token_lifetime_in_seconds"].SetOptional() + attrs["delta_sharing_scope"] = attrs["delta_sharing_scope"].SetOptional() + attrs["external_access_enabled"] = attrs["external_access_enabled"].SetOptional() + attrs["global_metastore_id"] = attrs["global_metastore_id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["privilege_model_version"] = attrs["privilege_model_version"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["storage_root_credential_id"] = attrs["storage_root_credential_id"].SetOptional() + attrs["storage_root_credential_name"] = attrs["storage_root_credential_name"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MetastoreInfo. @@ -11759,55 +12065,55 @@ func (o MetastoreInfo_SdkV2) Type(ctx context.Context) attr.Type { type ModelVersionInfo_SdkV2 struct { // List of aliases associated with the model version - Aliases types.List `tfsdk:"aliases" tf:"optional"` + Aliases types.List `tfsdk:"aliases"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The name of the catalog containing the model version - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the model version - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The identifier of the user who created the model version - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The unique identifier of the model version - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The unique identifier of the metastore containing the model version - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the parent registered model of the model version, relative to // parent schema - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // Model version dependencies, for feature-store packaged models - ModelVersionDependencies types.List `tfsdk:"model_version_dependencies" tf:"optional,object"` + ModelVersionDependencies types.List `tfsdk:"model_version_dependencies"` // MLflow run ID used when creating the model version, if ``source`` was // generated by an experiment run stored in an MLflow tracking server - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // ID of the Databricks workspace containing the MLflow run that generated // this model version, if applicable - RunWorkspaceId types.Int64 `tfsdk:"run_workspace_id" tf:"optional"` + RunWorkspaceId types.Int64 `tfsdk:"run_workspace_id"` // The name of the schema containing the model version, relative to parent // catalog - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // URI indicating the location of the source artifacts (files) for the model // version - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Current status of the model version. Newly created model versions start // in PENDING_REGISTRATION status, then move to READY status once the model // version files are uploaded and the model version is finalized. Only model // versions in READY status can be loaded for inference or served. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The storage location on the cloud under which model version data files // are stored - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The identifier of the user who updated the model version last time - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Integer model version number, used to reference the model version in API // requests. - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *ModelVersionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersionInfo_SdkV2) { @@ -11816,11 +12122,29 @@ func (newState *ModelVersionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ModelVersionInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelVersionInfo_SdkV2) { } -func (c ModelVersionInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAlias_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aliases")...) - DependencyList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "model_version_dependencies")...) - - return cs +func (c ModelVersionInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aliases"] = attrs["aliases"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["model_version_dependencies"] = attrs["model_version_dependencies"].SetOptional() + attrs["model_version_dependencies"] = attrs["model_version_dependencies"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_workspace_id"] = attrs["run_workspace_id"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["version"] = attrs["version"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersionInfo. @@ -11951,14 +12275,14 @@ func (o *ModelVersionInfo_SdkV2) SetModelVersionDependencies(ctx context.Context type MonitorCronSchedule_SdkV2 struct { // Read only field that indicates whether a schedule is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // The expression that determines when to run the monitor. See [examples]. // // [examples]: https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression types.String `tfsdk:"quartz_cron_expression" tf:""` + QuartzCronExpression types.String `tfsdk:"quartz_cron_expression"` // The timezone id (e.g., ``"PST"``) in which to evaluate the quartz // expression. - TimezoneId types.String `tfsdk:"timezone_id" tf:""` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *MonitorCronSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorCronSchedule_SdkV2) { @@ -11967,11 +12291,12 @@ func (newState *MonitorCronSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *MonitorCronSchedule_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorCronSchedule_SdkV2) { } -func (c MonitorCronSchedule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "quartz_cron_expression")...) - cs.SetRequired(append(path, "timezone_id")...) +func (c MonitorCronSchedule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["quartz_cron_expression"] = attrs["quartz_cron_expression"].SetRequired() + attrs["timezone_id"] = attrs["timezone_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorCronSchedule. @@ -12011,7 +12336,7 @@ func (o MonitorCronSchedule_SdkV2) Type(ctx context.Context) attr.Type { type MonitorDataClassificationConfig_SdkV2 struct { // Whether data classification is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` } func (newState *MonitorDataClassificationConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorDataClassificationConfig_SdkV2) { @@ -12020,9 +12345,10 @@ func (newState *MonitorDataClassificationConfig_SdkV2) SyncEffectiveFieldsDuring func (newState *MonitorDataClassificationConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorDataClassificationConfig_SdkV2) { } -func (c MonitorDataClassificationConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MonitorDataClassificationConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorDataClassificationConfig. @@ -12059,7 +12385,7 @@ func (o MonitorDataClassificationConfig_SdkV2) Type(ctx context.Context) attr.Ty type MonitorDestination_SdkV2 struct { // The list of email addresses to send the notification to. A maximum of 5 // email addresses is supported. - EmailAddresses types.List `tfsdk:"email_addresses" tf:"optional"` + EmailAddresses types.List `tfsdk:"email_addresses"` } func (newState *MonitorDestination_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorDestination_SdkV2) { @@ -12068,9 +12394,10 @@ func (newState *MonitorDestination_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *MonitorDestination_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorDestination_SdkV2) { } -func (c MonitorDestination_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MonitorDestination_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["email_addresses"] = attrs["email_addresses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorDestination. @@ -12139,30 +12466,30 @@ type MonitorInferenceLog_SdkV2 struct { // timestamp. Currently the following static granularities are supported: // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" // week(s)"``, ``"1 month"``, ``"1 year"``}. - Granularities types.List `tfsdk:"granularities" tf:""` + Granularities types.List `tfsdk:"granularities"` // Optional column that contains the ground truth for the prediction. - LabelCol types.String `tfsdk:"label_col" tf:"optional"` + LabelCol types.String `tfsdk:"label_col"` // Column that contains the id of the model generating the predictions. // Metrics will be computed per model id by default, and also across all // model ids. - ModelIdCol types.String `tfsdk:"model_id_col" tf:""` + ModelIdCol types.String `tfsdk:"model_id_col"` // Column that contains the output/prediction from the model. - PredictionCol types.String `tfsdk:"prediction_col" tf:""` + PredictionCol types.String `tfsdk:"prediction_col"` // Optional column that contains the prediction probabilities for each class // in a classification problem type. The values in this column should be a // map, mapping each class label to the prediction probability for a given // sample. The map should be of PySpark MapType(). - PredictionProbaCol types.String `tfsdk:"prediction_proba_col" tf:"optional"` + PredictionProbaCol types.String `tfsdk:"prediction_proba_col"` // Problem type the model aims to solve. Determines the type of // model-quality metrics that will be computed. - ProblemType types.String `tfsdk:"problem_type" tf:""` + ProblemType types.String `tfsdk:"problem_type"` // Column that contains the timestamps of requests. The column must be one // of the following: - A ``TimestampType`` column - A column whose values // can be converted to timestamps through the pyspark ``to_timestamp`` // [function]. // // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html - TimestampCol types.String `tfsdk:"timestamp_col" tf:""` + TimestampCol types.String `tfsdk:"timestamp_col"` } func (newState *MonitorInferenceLog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorInferenceLog_SdkV2) { @@ -12171,14 +12498,16 @@ func (newState *MonitorInferenceLog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *MonitorInferenceLog_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorInferenceLog_SdkV2) { } -func (c MonitorInferenceLog_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "granularities")...) - cs.SetRequired(append(path, "model_id_col")...) - cs.SetRequired(append(path, "prediction_col")...) - cs.SetRequired(append(path, "problem_type")...) - cs.SetRequired(append(path, "timestamp_col")...) +func (c MonitorInferenceLog_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["granularities"] = attrs["granularities"].SetRequired() + attrs["label_col"] = attrs["label_col"].SetOptional() + attrs["model_id_col"] = attrs["model_id_col"].SetRequired() + attrs["prediction_col"] = attrs["prediction_col"].SetRequired() + attrs["prediction_proba_col"] = attrs["prediction_proba_col"].SetOptional() + attrs["problem_type"] = attrs["problem_type"].SetRequired() + attrs["timestamp_col"] = attrs["timestamp_col"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorInferenceLog. @@ -12256,54 +12585,54 @@ func (o *MonitorInferenceLog_SdkV2) SetGranularities(ctx context.Context, v []ty type MonitorInfo_SdkV2 struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). - AssetsDir types.String `tfsdk:"assets_dir" tf:"optional"` + AssetsDir types.String `tfsdk:"assets_dir"` // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName types.String `tfsdk:"baseline_table_name" tf:"optional"` + BaselineTableName types.String `tfsdk:"baseline_table_name"` // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics types.List `tfsdk:"custom_metrics" tf:"optional"` + CustomMetrics types.List `tfsdk:"custom_metrics"` // Id of dashboard that visualizes the computed metrics. This can be empty // if the monitor is in PENDING state. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The data classification config for the monitor. - DataClassificationConfig types.List `tfsdk:"data_classification_config" tf:"optional,object"` + DataClassificationConfig types.List `tfsdk:"data_classification_config"` // The full name of the drift metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - DriftMetricsTableName types.String `tfsdk:"drift_metrics_table_name" tf:""` + DriftMetricsTableName types.String `tfsdk:"drift_metrics_table_name"` // Configuration for monitoring inference logs. - InferenceLog types.List `tfsdk:"inference_log" tf:"optional,object"` + InferenceLog types.List `tfsdk:"inference_log"` // The latest failure message of the monitor (if any). - LatestMonitorFailureMsg types.String `tfsdk:"latest_monitor_failure_msg" tf:"optional"` + LatestMonitorFailureMsg types.String `tfsdk:"latest_monitor_failure_msg"` // The version of the monitor config (e.g. 1,2,3). If negative, the monitor // may be corrupted. - MonitorVersion types.String `tfsdk:"monitor_version" tf:""` + MonitorVersion types.String `tfsdk:"monitor_version"` // The notification settings for the monitor. - Notifications types.List `tfsdk:"notifications" tf:"optional,object"` + Notifications types.List `tfsdk:"notifications"` // Schema where output metric tables are created. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:"optional"` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // The full name of the profile metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - ProfileMetricsTableName types.String `tfsdk:"profile_metrics_table_name" tf:""` + ProfileMetricsTableName types.String `tfsdk:"profile_metrics_table_name"` // The schedule for automatically updating and refreshing metric tables. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs types.List `tfsdk:"slicing_exprs" tf:"optional"` + SlicingExprs types.List `tfsdk:"slicing_exprs"` // Configuration for monitoring snapshot tables. - Snapshot types.List `tfsdk:"snapshot" tf:"optional,object"` + Snapshot types.List `tfsdk:"snapshot"` // The status of the monitor. - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` // The full name of the table to monitor. Format: // __catalog_name__.__schema_name__.__table_name__. - TableName types.String `tfsdk:"table_name" tf:""` + TableName types.String `tfsdk:"table_name"` // Configuration for monitoring time series tables. - TimeSeries types.List `tfsdk:"time_series" tf:"optional,object"` + TimeSeries types.List `tfsdk:"time_series"` } func (newState *MonitorInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorInfo_SdkV2) { @@ -12312,21 +12641,33 @@ func (newState *MonitorInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MonitorInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorInfo_SdkV2) { } -func (c MonitorInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorMetric_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "custom_metrics")...) - MonitorDataClassificationConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_classification_config")...) - cs.SetRequired(append(path, "drift_metrics_table_name")...) - MonitorInferenceLog_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "inference_log")...) - cs.SetRequired(append(path, "monitor_version")...) - MonitorNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - cs.SetRequired(append(path, "profile_metrics_table_name")...) - MonitorCronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - MonitorSnapshot_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "snapshot")...) - cs.SetRequired(append(path, "status")...) - cs.SetRequired(append(path, "table_name")...) - MonitorTimeSeries_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "time_series")...) - - return cs +func (c MonitorInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets_dir"] = attrs["assets_dir"].SetOptional() + attrs["baseline_table_name"] = attrs["baseline_table_name"].SetOptional() + attrs["custom_metrics"] = attrs["custom_metrics"].SetOptional() + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["drift_metrics_table_name"] = attrs["drift_metrics_table_name"].SetRequired() + attrs["inference_log"] = attrs["inference_log"].SetOptional() + attrs["inference_log"] = attrs["inference_log"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["latest_monitor_failure_msg"] = attrs["latest_monitor_failure_msg"].SetOptional() + attrs["monitor_version"] = attrs["monitor_version"].SetRequired() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["notifications"] = attrs["notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["output_schema_name"] = attrs["output_schema_name"].SetOptional() + attrs["profile_metrics_table_name"] = attrs["profile_metrics_table_name"].SetRequired() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["slicing_exprs"] = attrs["slicing_exprs"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetRequired() + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["time_series"] = attrs["time_series"].SetOptional() + attrs["time_series"] = attrs["time_series"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorInfo. @@ -12632,15 +12973,15 @@ type MonitorMetric_SdkV2 struct { // metric. See [create metric definition]. // // [create metric definition]: https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition - Definition types.String `tfsdk:"definition" tf:""` + Definition types.String `tfsdk:"definition"` // A list of column names in the input table the metric should be computed // for. Can use ``":table"`` to indicate that the metric needs information // from multiple columns. - InputColumns types.List `tfsdk:"input_columns" tf:""` + InputColumns types.List `tfsdk:"input_columns"` // Name of the metric in the output tables. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The output type of the custom metric. - OutputDataType types.String `tfsdk:"output_data_type" tf:""` + OutputDataType types.String `tfsdk:"output_data_type"` // Can only be one of ``"CUSTOM_METRIC_TYPE_AGGREGATE"``, // ``"CUSTOM_METRIC_TYPE_DERIVED"``, or ``"CUSTOM_METRIC_TYPE_DRIFT"``. The // ``"CUSTOM_METRIC_TYPE_AGGREGATE"`` and ``"CUSTOM_METRIC_TYPE_DERIVED"`` @@ -12651,7 +12992,7 @@ type MonitorMetric_SdkV2 struct { // table - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed // aggregate metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously // computed aggregate or derived metrics - Type_ types.String `tfsdk:"type" tf:""` + Type_ types.String `tfsdk:"type"` } func (newState *MonitorMetric_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorMetric_SdkV2) { @@ -12660,14 +13001,14 @@ func (newState *MonitorMetric_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *MonitorMetric_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorMetric_SdkV2) { } -func (c MonitorMetric_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "definition")...) - cs.SetRequired(append(path, "input_columns")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "output_data_type")...) - cs.SetRequired(append(path, "type")...) +func (c MonitorMetric_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetRequired() + attrs["input_columns"] = attrs["input_columns"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["output_data_type"] = attrs["output_data_type"].SetRequired() + attrs["type"] = attrs["type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorMetric. @@ -12741,10 +13082,10 @@ func (o *MonitorMetric_SdkV2) SetInputColumns(ctx context.Context, v []types.Str type MonitorNotifications_SdkV2 struct { // Who to send notifications to on monitor failure. - OnFailure types.List `tfsdk:"on_failure" tf:"optional,object"` + OnFailure types.List `tfsdk:"on_failure"` // Who to send notifications to when new data classification tags are // detected. - OnNewClassificationTagDetected types.List `tfsdk:"on_new_classification_tag_detected" tf:"optional,object"` + OnNewClassificationTagDetected types.List `tfsdk:"on_new_classification_tag_detected"` } func (newState *MonitorNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorNotifications_SdkV2) { @@ -12753,11 +13094,13 @@ func (newState *MonitorNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *MonitorNotifications_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorNotifications_SdkV2) { } -func (c MonitorNotifications_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorDestination_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_failure")...) - MonitorDestination_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_new_classification_tag_detected")...) +func (c MonitorNotifications_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["on_new_classification_tag_detected"] = attrs["on_new_classification_tag_detected"].SetOptional() + attrs["on_new_classification_tag_detected"] = attrs["on_new_classification_tag_detected"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorNotifications. @@ -12855,19 +13198,19 @@ func (o *MonitorNotifications_SdkV2) SetOnNewClassificationTagDetected(ctx conte type MonitorRefreshInfo_SdkV2 struct { // Time at which refresh operation completed (milliseconds since 1/1/1970 // UTC). - EndTimeMs types.Int64 `tfsdk:"end_time_ms" tf:"optional"` + EndTimeMs types.Int64 `tfsdk:"end_time_ms"` // An optional message to give insight into the current state of the job // (e.g. FAILURE messages). - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Unique id of the refresh operation. - RefreshId types.Int64 `tfsdk:"refresh_id" tf:""` + RefreshId types.Int64 `tfsdk:"refresh_id"` // Time at which refresh operation was initiated (milliseconds since // 1/1/1970 UTC). - StartTimeMs types.Int64 `tfsdk:"start_time_ms" tf:""` + StartTimeMs types.Int64 `tfsdk:"start_time_ms"` // The current state of the refresh. - State types.String `tfsdk:"state" tf:""` + State types.String `tfsdk:"state"` // The method by which the refresh was triggered. - Trigger types.String `tfsdk:"trigger" tf:"optional"` + Trigger types.String `tfsdk:"trigger"` } func (newState *MonitorRefreshInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorRefreshInfo_SdkV2) { @@ -12876,12 +13219,15 @@ func (newState *MonitorRefreshInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *MonitorRefreshInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorRefreshInfo_SdkV2) { } -func (c MonitorRefreshInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "refresh_id")...) - cs.SetRequired(append(path, "start_time_ms")...) - cs.SetRequired(append(path, "state")...) +func (c MonitorRefreshInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time_ms"] = attrs["end_time_ms"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["refresh_id"] = attrs["refresh_id"].SetRequired() + attrs["start_time_ms"] = attrs["start_time_ms"].SetRequired() + attrs["state"] = attrs["state"].SetRequired() + attrs["trigger"] = attrs["trigger"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorRefreshInfo. @@ -12927,7 +13273,7 @@ func (o MonitorRefreshInfo_SdkV2) Type(ctx context.Context) attr.Type { type MonitorRefreshListResponse_SdkV2 struct { // List of refreshes. - Refreshes types.List `tfsdk:"refreshes" tf:"optional"` + Refreshes types.List `tfsdk:"refreshes"` } func (newState *MonitorRefreshListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorRefreshListResponse_SdkV2) { @@ -12936,10 +13282,10 @@ func (newState *MonitorRefreshListResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *MonitorRefreshListResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorRefreshListResponse_SdkV2) { } -func (c MonitorRefreshListResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorRefreshInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "refreshes")...) +func (c MonitorRefreshListResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["refreshes"] = attrs["refreshes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorRefreshListResponse. @@ -13012,9 +13358,9 @@ func (newState *MonitorSnapshot_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *MonitorSnapshot_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorSnapshot_SdkV2) { } -func (c MonitorSnapshot_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MonitorSnapshot_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorSnapshot. @@ -13049,14 +13395,14 @@ type MonitorTimeSeries_SdkV2 struct { // timestamp. Currently the following static granularities are supported: // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" // week(s)"``, ``"1 month"``, ``"1 year"``}. - Granularities types.List `tfsdk:"granularities" tf:""` + Granularities types.List `tfsdk:"granularities"` // Column that contains the timestamps of requests. The column must be one // of the following: - A ``TimestampType`` column - A column whose values // can be converted to timestamps through the pyspark ``to_timestamp`` // [function]. // // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html - TimestampCol types.String `tfsdk:"timestamp_col" tf:""` + TimestampCol types.String `tfsdk:"timestamp_col"` } func (newState *MonitorTimeSeries_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorTimeSeries_SdkV2) { @@ -13065,11 +13411,11 @@ func (newState *MonitorTimeSeries_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *MonitorTimeSeries_SdkV2) SyncEffectiveFieldsDuringRead(existingState MonitorTimeSeries_SdkV2) { } -func (c MonitorTimeSeries_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "granularities")...) - cs.SetRequired(append(path, "timestamp_col")...) +func (c MonitorTimeSeries_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["granularities"] = attrs["granularities"].SetRequired() + attrs["timestamp_col"] = attrs["timestamp_col"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorTimeSeries. @@ -13137,7 +13483,7 @@ func (o *MonitorTimeSeries_SdkV2) SetGranularities(ctx context.Context, v []type type NamedTableConstraint_SdkV2 struct { // The name of the constraint. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *NamedTableConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NamedTableConstraint_SdkV2) { @@ -13146,10 +13492,10 @@ func (newState *NamedTableConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *NamedTableConstraint_SdkV2) SyncEffectiveFieldsDuringRead(existingState NamedTableConstraint_SdkV2) { } -func (c NamedTableConstraint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c NamedTableConstraint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NamedTableConstraint. @@ -13186,18 +13532,18 @@ func (o NamedTableConstraint_SdkV2) Type(ctx context.Context) attr.Type { // Online Table information. type OnlineTable_SdkV2 struct { // Full three-part (catalog, schema, table) name of the table. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Specification of the online table. - Spec types.List `tfsdk:"spec" tf:"optional,object"` + Spec types.List `tfsdk:"spec"` // Online Table data synchronization status - Status types.List `tfsdk:"status" tf:"computed,object"` + Status types.List `tfsdk:"status"` // Data serving REST API URL for this table - TableServingUrl types.String `tfsdk:"table_serving_url" tf:"computed"` + TableServingUrl types.String `tfsdk:"table_serving_url"` // The provisioning state of the online table entity in Unity Catalog. This // is distinct from the state of the data synchronization pipeline (i.e. the // table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it // runs asynchronously). - UnityCatalogProvisioningState types.String `tfsdk:"unity_catalog_provisioning_state" tf:"computed"` + UnityCatalogProvisioningState types.String `tfsdk:"unity_catalog_provisioning_state"` } func (newState *OnlineTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTable_SdkV2) { @@ -13206,14 +13552,16 @@ func (newState *OnlineTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *OnlineTable_SdkV2) SyncEffectiveFieldsDuringRead(existingState OnlineTable_SdkV2) { } -func (c OnlineTable_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - OnlineTableSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spec")...) - cs.SetComputed(append(path, "status")...) - OnlineTableStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - cs.SetComputed(append(path, "table_serving_url")...) - cs.SetComputed(append(path, "unity_catalog_provisioning_state")...) +func (c OnlineTable_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["spec"] = attrs["spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetComputed() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table_serving_url"] = attrs["table_serving_url"].SetComputed() + attrs["unity_catalog_provisioning_state"] = attrs["unity_catalog_provisioning_state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTable. @@ -13323,22 +13671,22 @@ type OnlineTableSpec_SdkV2 struct { // the source table and there are no incremental updates. This mode is // useful for syncing views or tables without CDFs to online tables. Note // that the full-copy pipeline only supports "triggered" scheduling policy. - PerformFullCopy types.Bool `tfsdk:"perform_full_copy" tf:"optional"` + PerformFullCopy types.Bool `tfsdk:"perform_full_copy"` // ID of the associated pipeline. Generated by the server - cannot be set by // the caller. - PipelineId types.String `tfsdk:"pipeline_id" tf:"computed"` + PipelineId types.String `tfsdk:"pipeline_id"` // Primary Key columns to be used for data insert/update in the destination. - PrimaryKeyColumns types.List `tfsdk:"primary_key_columns" tf:"optional"` + PrimaryKeyColumns types.List `tfsdk:"primary_key_columns"` // Pipeline runs continuously after generating the initial data. - RunContinuously types.List `tfsdk:"run_continuously" tf:"optional,object"` + RunContinuously types.List `tfsdk:"run_continuously"` // Pipeline stops after generating the initial data and can be triggered // later (manually, through a cron job or through data triggers) - RunTriggered types.List `tfsdk:"run_triggered" tf:"optional,object"` + RunTriggered types.List `tfsdk:"run_triggered"` // Three-part (catalog, schema, table) name of the source Delta table. - SourceTableFullName types.String `tfsdk:"source_table_full_name" tf:"optional"` + SourceTableFullName types.String `tfsdk:"source_table_full_name"` // Time series key to deduplicate (tie-break) rows with the same primary // key. - TimeseriesKey types.String `tfsdk:"timeseries_key" tf:"optional"` + TimeseriesKey types.String `tfsdk:"timeseries_key"` } func (newState *OnlineTableSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTableSpec_SdkV2) { @@ -13347,12 +13695,18 @@ func (newState *OnlineTableSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *OnlineTableSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpec_SdkV2) { } -func (c OnlineTableSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "pipeline_id")...) - OnlineTableSpecContinuousSchedulingPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_continuously")...) - OnlineTableSpecTriggeredSchedulingPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_triggered")...) +func (c OnlineTableSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["perform_full_copy"] = attrs["perform_full_copy"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetComputed() + attrs["primary_key_columns"] = attrs["primary_key_columns"].SetOptional() + attrs["run_continuously"] = attrs["run_continuously"].SetOptional() + attrs["run_continuously"] = attrs["run_continuously"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_triggered"] = attrs["run_triggered"].SetOptional() + attrs["run_triggered"] = attrs["run_triggered"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["source_table_full_name"] = attrs["source_table_full_name"].SetOptional() + attrs["timeseries_key"] = attrs["timeseries_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableSpec. @@ -13495,9 +13849,9 @@ func (newState *OnlineTableSpecContinuousSchedulingPolicy_SdkV2) SyncEffectiveFi func (newState *OnlineTableSpecContinuousSchedulingPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpecContinuousSchedulingPolicy_SdkV2) { } -func (c OnlineTableSpecContinuousSchedulingPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OnlineTableSpecContinuousSchedulingPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableSpecContinuousSchedulingPolicy. @@ -13536,9 +13890,9 @@ func (newState *OnlineTableSpecTriggeredSchedulingPolicy_SdkV2) SyncEffectiveFie func (newState *OnlineTableSpecTriggeredSchedulingPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpecTriggeredSchedulingPolicy_SdkV2) { } -func (c OnlineTableSpecTriggeredSchedulingPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OnlineTableSpecTriggeredSchedulingPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableSpecTriggeredSchedulingPolicy. @@ -13572,21 +13926,21 @@ func (o OnlineTableSpecTriggeredSchedulingPolicy_SdkV2) Type(ctx context.Context type OnlineTableStatus_SdkV2 struct { // Detailed status of an online table. Shown if the online table is in the // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. - ContinuousUpdateStatus types.List `tfsdk:"continuous_update_status" tf:"optional,object"` + ContinuousUpdateStatus types.List `tfsdk:"continuous_update_status"` // The state of the online table. - DetailedState types.String `tfsdk:"detailed_state" tf:"optional"` + DetailedState types.String `tfsdk:"detailed_state"` // Detailed status of an online table. Shown if the online table is in the // OFFLINE_FAILED or the ONLINE_PIPELINE_FAILED state. - FailedStatus types.List `tfsdk:"failed_status" tf:"optional,object"` + FailedStatus types.List `tfsdk:"failed_status"` // A text description of the current state of the online table. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Detailed status of an online table. Shown if the online table is in the // PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT // state. - ProvisioningStatus types.List `tfsdk:"provisioning_status" tf:"optional,object"` + ProvisioningStatus types.List `tfsdk:"provisioning_status"` // Detailed status of an online table. Shown if the online table is in the // ONLINE_TRIGGERED_UPDATE or the ONLINE_NO_PENDING_UPDATE state. - TriggeredUpdateStatus types.List `tfsdk:"triggered_update_status" tf:"optional,object"` + TriggeredUpdateStatus types.List `tfsdk:"triggered_update_status"` } func (newState *OnlineTableStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTableStatus_SdkV2) { @@ -13595,13 +13949,19 @@ func (newState *OnlineTableStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *OnlineTableStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState OnlineTableStatus_SdkV2) { } -func (c OnlineTableStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ContinuousUpdateStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "continuous_update_status")...) - FailedStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "failed_status")...) - ProvisioningStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provisioning_status")...) - TriggeredUpdateStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "triggered_update_status")...) +func (c OnlineTableStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["continuous_update_status"] = attrs["continuous_update_status"].SetOptional() + attrs["continuous_update_status"] = attrs["continuous_update_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["detailed_state"] = attrs["detailed_state"].SetOptional() + attrs["failed_status"] = attrs["failed_status"].SetOptional() + attrs["failed_status"] = attrs["failed_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["message"] = attrs["message"].SetOptional() + attrs["provisioning_status"] = attrs["provisioning_status"].SetOptional() + attrs["provisioning_status"] = attrs["provisioning_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["triggered_update_status"] = attrs["triggered_update_status"].SetOptional() + attrs["triggered_update_status"] = attrs["triggered_update_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableStatus. @@ -13764,11 +14124,11 @@ func (o *OnlineTableStatus_SdkV2) SetTriggeredUpdateStatus(ctx context.Context, type PermissionsChange_SdkV2 struct { // The set of privileges to add. - Add types.List `tfsdk:"add" tf:"optional"` + Add types.List `tfsdk:"add"` // The principal whose privileges we are changing. - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The set of privileges to remove. - Remove types.List `tfsdk:"remove" tf:"optional"` + Remove types.List `tfsdk:"remove"` } func (newState *PermissionsChange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionsChange_SdkV2) { @@ -13777,9 +14137,12 @@ func (newState *PermissionsChange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *PermissionsChange_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionsChange_SdkV2) { } -func (c PermissionsChange_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermissionsChange_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["add"] = attrs["add"].SetOptional() + attrs["principal"] = attrs["principal"].SetOptional() + attrs["remove"] = attrs["remove"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsChange. @@ -13878,7 +14241,7 @@ func (o *PermissionsChange_SdkV2) SetRemove(ctx context.Context, v []types.Strin type PermissionsList_SdkV2 struct { // The privileges assigned to each principal - PrivilegeAssignments types.List `tfsdk:"privilege_assignments" tf:"optional"` + PrivilegeAssignments types.List `tfsdk:"privilege_assignments"` } func (newState *PermissionsList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionsList_SdkV2) { @@ -13887,10 +14250,10 @@ func (newState *PermissionsList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PermissionsList_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionsList_SdkV2) { } -func (c PermissionsList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PrivilegeAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "privilege_assignments")...) +func (c PermissionsList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["privilege_assignments"] = attrs["privilege_assignments"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsList. @@ -13957,17 +14320,17 @@ func (o *PermissionsList_SdkV2) SetPrivilegeAssignments(ctx context.Context, v [ // Progress information of the Online Table data synchronization pipeline. type PipelineProgress_SdkV2 struct { // The estimated time remaining to complete this update in seconds. - EstimatedCompletionTimeSeconds types.Float64 `tfsdk:"estimated_completion_time_seconds" tf:"optional"` + EstimatedCompletionTimeSeconds types.Float64 `tfsdk:"estimated_completion_time_seconds"` // The source table Delta version that was last processed by the pipeline. // The pipeline may not have completely processed this version yet. - LatestVersionCurrentlyProcessing types.Int64 `tfsdk:"latest_version_currently_processing" tf:"optional"` + LatestVersionCurrentlyProcessing types.Int64 `tfsdk:"latest_version_currently_processing"` // The completion ratio of this update. This is a number between 0 and 1. - SyncProgressCompletion types.Float64 `tfsdk:"sync_progress_completion" tf:"optional"` + SyncProgressCompletion types.Float64 `tfsdk:"sync_progress_completion"` // The number of rows that have been synced in this update. - SyncedRowCount types.Int64 `tfsdk:"synced_row_count" tf:"optional"` + SyncedRowCount types.Int64 `tfsdk:"synced_row_count"` // The total number of rows that need to be synced in this update. This // number may be an estimate. - TotalRowCount types.Int64 `tfsdk:"total_row_count" tf:"optional"` + TotalRowCount types.Int64 `tfsdk:"total_row_count"` } func (newState *PipelineProgress_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineProgress_SdkV2) { @@ -13976,9 +14339,14 @@ func (newState *PipelineProgress_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PipelineProgress_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineProgress_SdkV2) { } -func (c PipelineProgress_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineProgress_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["estimated_completion_time_seconds"] = attrs["estimated_completion_time_seconds"].SetOptional() + attrs["latest_version_currently_processing"] = attrs["latest_version_currently_processing"].SetOptional() + attrs["sync_progress_completion"] = attrs["sync_progress_completion"].SetOptional() + attrs["synced_row_count"] = attrs["synced_row_count"].SetOptional() + attrs["total_row_count"] = attrs["total_row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineProgress. @@ -14022,9 +14390,9 @@ func (o PipelineProgress_SdkV2) Type(ctx context.Context) attr.Type { type PrimaryKeyConstraint_SdkV2 struct { // Column names for this constraint. - ChildColumns types.List `tfsdk:"child_columns" tf:""` + ChildColumns types.List `tfsdk:"child_columns"` // The name of the constraint. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *PrimaryKeyConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrimaryKeyConstraint_SdkV2) { @@ -14033,11 +14401,11 @@ func (newState *PrimaryKeyConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *PrimaryKeyConstraint_SdkV2) SyncEffectiveFieldsDuringRead(existingState PrimaryKeyConstraint_SdkV2) { } -func (c PrimaryKeyConstraint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "child_columns")...) - cs.SetRequired(append(path, "name")...) +func (c PrimaryKeyConstraint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["child_columns"] = attrs["child_columns"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrimaryKeyConstraint. @@ -14105,9 +14473,9 @@ func (o *PrimaryKeyConstraint_SdkV2) SetChildColumns(ctx context.Context, v []ty type PrivilegeAssignment_SdkV2 struct { // The principal (user email address or group name). - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The privileges assigned to the principal. - Privileges types.List `tfsdk:"privileges" tf:"optional"` + Privileges types.List `tfsdk:"privileges"` } func (newState *PrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrivilegeAssignment_SdkV2) { @@ -14116,9 +14484,11 @@ func (newState *PrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *PrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState PrivilegeAssignment_SdkV2) { } -func (c PrivilegeAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrivilegeAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetOptional() + attrs["privileges"] = attrs["privileges"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrivilegeAssignment. @@ -14186,7 +14556,7 @@ func (o *PrivilegeAssignment_SdkV2) SetPrivileges(ctx context.Context, v []types // Status of an asynchronously provisioned resource. type ProvisioningInfo_SdkV2 struct { - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *ProvisioningInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProvisioningInfo_SdkV2) { @@ -14195,9 +14565,10 @@ func (newState *ProvisioningInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ProvisioningInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ProvisioningInfo_SdkV2) { } -func (c ProvisioningInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ProvisioningInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProvisioningInfo. @@ -14236,7 +14607,7 @@ func (o ProvisioningInfo_SdkV2) Type(ctx context.Context) attr.Type { type ProvisioningStatus_SdkV2 struct { // Details about initial data synchronization. Only populated when in the // PROVISIONING_INITIAL_SNAPSHOT state. - InitialPipelineSyncProgress types.List `tfsdk:"initial_pipeline_sync_progress" tf:"optional,object"` + InitialPipelineSyncProgress types.List `tfsdk:"initial_pipeline_sync_progress"` } func (newState *ProvisioningStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProvisioningStatus_SdkV2) { @@ -14245,10 +14616,11 @@ func (newState *ProvisioningStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ProvisioningStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState ProvisioningStatus_SdkV2) { } -func (c ProvisioningStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineProgress_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "initial_pipeline_sync_progress")...) +func (c ProvisioningStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["initial_pipeline_sync_progress"] = attrs["initial_pipeline_sync_progress"].SetOptional() + attrs["initial_pipeline_sync_progress"] = attrs["initial_pipeline_sync_progress"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProvisioningStatus. @@ -14314,18 +14686,18 @@ func (o *ProvisioningStatus_SdkV2) SetInitialPipelineSyncProgress(ctx context.Co type QuotaInfo_SdkV2 struct { // The timestamp that indicates when the quota count was last updated. - LastRefreshedAt types.Int64 `tfsdk:"last_refreshed_at" tf:"optional"` + LastRefreshedAt types.Int64 `tfsdk:"last_refreshed_at"` // Name of the parent resource. Returns metastore ID if the parent is a // metastore. - ParentFullName types.String `tfsdk:"parent_full_name" tf:"optional"` + ParentFullName types.String `tfsdk:"parent_full_name"` // The quota parent securable type. - ParentSecurableType types.String `tfsdk:"parent_securable_type" tf:"optional"` + ParentSecurableType types.String `tfsdk:"parent_securable_type"` // The current usage of the resource quota. - QuotaCount types.Int64 `tfsdk:"quota_count" tf:"optional"` + QuotaCount types.Int64 `tfsdk:"quota_count"` // The current limit of the resource quota. - QuotaLimit types.Int64 `tfsdk:"quota_limit" tf:"optional"` + QuotaLimit types.Int64 `tfsdk:"quota_limit"` // The name of the quota. - QuotaName types.String `tfsdk:"quota_name" tf:"optional"` + QuotaName types.String `tfsdk:"quota_name"` } func (newState *QuotaInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuotaInfo_SdkV2) { @@ -14334,9 +14706,15 @@ func (newState *QuotaInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Qu func (newState *QuotaInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState QuotaInfo_SdkV2) { } -func (c QuotaInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c QuotaInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_refreshed_at"] = attrs["last_refreshed_at"].SetOptional() + attrs["parent_full_name"] = attrs["parent_full_name"].SetOptional() + attrs["parent_securable_type"] = attrs["parent_securable_type"].SetOptional() + attrs["quota_count"] = attrs["quota_count"].SetOptional() + attrs["quota_limit"] = attrs["quota_limit"].SetOptional() + attrs["quota_name"] = attrs["quota_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QuotaInfo. @@ -14384,11 +14762,11 @@ func (o QuotaInfo_SdkV2) Type(ctx context.Context) attr.Type { // https://developers.cloudflare.com/r2/api/s3/tokens/. type R2Credentials_SdkV2 struct { // The access key ID that identifies the temporary credentials. - AccessKeyId types.String `tfsdk:"access_key_id" tf:"optional"` + AccessKeyId types.String `tfsdk:"access_key_id"` // The secret access key associated with the access key. - SecretAccessKey types.String `tfsdk:"secret_access_key" tf:"optional"` + SecretAccessKey types.String `tfsdk:"secret_access_key"` // The generated JWT that users must pass to use the temporary credentials. - SessionToken types.String `tfsdk:"session_token" tf:"optional"` + SessionToken types.String `tfsdk:"session_token"` } func (newState *R2Credentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R2Credentials_SdkV2) { @@ -14397,9 +14775,12 @@ func (newState *R2Credentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *R2Credentials_SdkV2) SyncEffectiveFieldsDuringRead(existingState R2Credentials_SdkV2) { } -func (c R2Credentials_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c R2Credentials_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_key_id"] = attrs["access_key_id"].SetOptional() + attrs["secret_access_key"] = attrs["secret_access_key"].SetOptional() + attrs["session_token"] = attrs["session_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in R2Credentials. @@ -14484,7 +14865,7 @@ type RegenerateDashboardRequest_SdkV2 struct { TableName types.String `tfsdk:"-"` // Optional argument to specify the warehouse for dashboard regeneration. If // not specified, the first running warehouse will be used. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *RegenerateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegenerateDashboardRequest_SdkV2) { @@ -14493,10 +14874,11 @@ func (newState *RegenerateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *RegenerateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegenerateDashboardRequest_SdkV2) { } -func (c RegenerateDashboardRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "table_name")...) +func (c RegenerateDashboardRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegenerateDashboardRequest. @@ -14534,9 +14916,9 @@ func (o RegenerateDashboardRequest_SdkV2) Type(ctx context.Context) attr.Type { type RegenerateDashboardResponse_SdkV2 struct { // Id of the regenerated monitoring dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The directory where the regenerated dashboard is stored. - ParentFolder types.String `tfsdk:"parent_folder" tf:"optional"` + ParentFolder types.String `tfsdk:"parent_folder"` } func (newState *RegenerateDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegenerateDashboardResponse_SdkV2) { @@ -14545,9 +14927,11 @@ func (newState *RegenerateDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *RegenerateDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegenerateDashboardResponse_SdkV2) { } -func (c RegenerateDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegenerateDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["parent_folder"] = attrs["parent_folder"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegenerateDashboardResponse. @@ -14586,9 +14970,9 @@ func (o RegenerateDashboardResponse_SdkV2) Type(ctx context.Context) attr.Type { // Registered model alias. type RegisteredModelAlias_SdkV2 struct { // Name of the alias, e.g. 'champion' or 'latest_stable' - AliasName types.String `tfsdk:"alias_name" tf:"optional"` + AliasName types.String `tfsdk:"alias_name"` // Integer version number of the model version to which this alias points. - VersionNum types.Int64 `tfsdk:"version_num" tf:"optional"` + VersionNum types.Int64 `tfsdk:"version_num"` } func (newState *RegisteredModelAlias_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelAlias_SdkV2) { @@ -14597,9 +14981,11 @@ func (newState *RegisteredModelAlias_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *RegisteredModelAlias_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelAlias_SdkV2) { } -func (c RegisteredModelAlias_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelAlias_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alias_name"] = attrs["alias_name"].SetOptional() + attrs["version_num"] = attrs["version_num"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelAlias. @@ -14637,38 +15023,38 @@ func (o RegisteredModelAlias_SdkV2) Type(ctx context.Context) attr.Type { type RegisteredModelInfo_SdkV2 struct { // List of aliases associated with the registered model - Aliases types.List `tfsdk:"aliases" tf:"optional"` + Aliases types.List `tfsdk:"aliases"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The name of the catalog where the schema and the registered model reside - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the registered model - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation timestamp of the registered model in milliseconds since the Unix // epoch - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The identifier of the user who created the registered model - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The three-level (fully qualified) name of the registered model - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the metastore - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the registered model - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The identifier of the user who owns the registered model - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The name of the schema where the registered model resides - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud under which model version data files // are stored - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Last-update timestamp of the registered model in milliseconds since the // Unix epoch - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The identifier of the user who updated the registered model last time - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *RegisteredModelInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelInfo_SdkV2) { @@ -14677,10 +15063,23 @@ func (newState *RegisteredModelInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RegisteredModelInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelInfo_SdkV2) { } -func (c RegisteredModelInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAlias_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aliases")...) +func (c RegisteredModelInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aliases"] = attrs["aliases"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelInfo. @@ -14811,42 +15210,42 @@ type SchemaInfo_SdkV2 struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The type of the parent catalog. - CatalogType types.String `tfsdk:"catalog_type" tf:"optional"` + CatalogType types.String `tfsdk:"catalog_type"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this schema was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of schema creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - EffectivePredictiveOptimizationFlag types.List `tfsdk:"effective_predictive_optimization_flag" tf:"optional,object"` + EffectivePredictiveOptimizationFlag types.List `tfsdk:"effective_predictive_optimization_flag"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Full name of schema, in form of __catalog_name__.__schema_name__. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of schema, relative to parent catalog. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of schema. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // The unique identifier of the schema. - SchemaId types.String `tfsdk:"schema_id" tf:"optional"` + SchemaId types.String `tfsdk:"schema_id"` // Storage location for managed tables within schema. - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for managed tables within schema. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Time at which this schema was created, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified schema. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *SchemaInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SchemaInfo_SdkV2) { @@ -14855,10 +15254,28 @@ func (newState *SchemaInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SchemaInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState SchemaInfo_SdkV2) { } -func (c SchemaInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePredictiveOptimizationFlag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "effective_predictive_optimization_flag")...) - - return cs +func (c SchemaInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["catalog_type"] = attrs["catalog_type"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["schema_id"] = attrs["schema_id"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SchemaInfo. @@ -14987,7 +15404,7 @@ func (o *SchemaInfo_SdkV2) SetProperties(ctx context.Context, v map[string]types type SetArtifactAllowlist_SdkV2 struct { // A list of allowed artifact match patterns. - ArtifactMatchers types.List `tfsdk:"artifact_matchers" tf:""` + ArtifactMatchers types.List `tfsdk:"artifact_matchers"` // The artifact type of the allowlist. ArtifactType types.String `tfsdk:"-"` } @@ -14998,12 +15415,11 @@ func (newState *SetArtifactAllowlist_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SetArtifactAllowlist_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetArtifactAllowlist_SdkV2) { } -func (c SetArtifactAllowlist_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "artifact_matchers")...) - ArtifactMatcher_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "artifact_matchers")...) - cs.SetRequired(append(path, "artifact_type")...) +func (c SetArtifactAllowlist_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_matchers"] = attrs["artifact_matchers"].SetRequired() + attrs["artifact_type"] = attrs["artifact_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetArtifactAllowlist. @@ -15071,11 +15487,11 @@ func (o *SetArtifactAllowlist_SdkV2) SetArtifactMatchers(ctx context.Context, v type SetRegisteredModelAliasRequest_SdkV2 struct { // The name of the alias - Alias types.String `tfsdk:"alias" tf:""` + Alias types.String `tfsdk:"alias"` // Full name of the registered model - FullName types.String `tfsdk:"full_name" tf:""` + FullName types.String `tfsdk:"full_name"` // The version number of the model version to which the alias points - VersionNum types.Int64 `tfsdk:"version_num" tf:""` + VersionNum types.Int64 `tfsdk:"version_num"` } func (newState *SetRegisteredModelAliasRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetRegisteredModelAliasRequest_SdkV2) { @@ -15084,12 +15500,12 @@ func (newState *SetRegisteredModelAliasRequest_SdkV2) SyncEffectiveFieldsDuringC func (newState *SetRegisteredModelAliasRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetRegisteredModelAliasRequest_SdkV2) { } -func (c SetRegisteredModelAliasRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "alias")...) - cs.SetRequired(append(path, "full_name")...) - cs.SetRequired(append(path, "version_num")...) +func (c SetRegisteredModelAliasRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alias"] = attrs["alias"].SetRequired() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["version_num"] = attrs["version_num"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetRegisteredModelAliasRequest. @@ -15130,10 +15546,10 @@ func (o SetRegisteredModelAliasRequest_SdkV2) Type(ctx context.Context) attr.Typ // Server-Side Encryption properties for clients communicating with AWS s3. type SseEncryptionDetails_SdkV2 struct { // The type of key encryption to use (affects headers from s3 client). - Algorithm types.String `tfsdk:"algorithm" tf:"optional"` + Algorithm types.String `tfsdk:"algorithm"` // When algorithm is **AWS_SSE_KMS** this field specifies the ARN of the SSE // key to use. - AwsKmsKeyArn types.String `tfsdk:"aws_kms_key_arn" tf:"optional"` + AwsKmsKeyArn types.String `tfsdk:"aws_kms_key_arn"` } func (newState *SseEncryptionDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SseEncryptionDetails_SdkV2) { @@ -15142,9 +15558,11 @@ func (newState *SseEncryptionDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SseEncryptionDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState SseEncryptionDetails_SdkV2) { } -func (c SseEncryptionDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SseEncryptionDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["algorithm"] = attrs["algorithm"].SetOptional() + attrs["aws_kms_key_arn"] = attrs["aws_kms_key_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SseEncryptionDetails. @@ -15182,42 +15600,42 @@ func (o SseEncryptionDetails_SdkV2) Type(ctx context.Context) attr.Type { type StorageCredentialInfo_SdkV2 struct { // The AWS IAM role configuration. - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.List `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.List `tfsdk:"cloudflare_api_token"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this Credential was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of credential creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // The full name of the credential. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the credential. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The credential name. The name must be unique within the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Time at which this credential was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the credential. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Whether this credential is the current metastore's root storage // credential. - UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage" tf:"optional"` + UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage"` } func (newState *StorageCredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StorageCredentialInfo_SdkV2) { @@ -15226,14 +15644,32 @@ func (newState *StorageCredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *StorageCredentialInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState StorageCredentialInfo_SdkV2) { } -func (c StorageCredentialInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - - return cs +func (c StorageCredentialInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["used_for_managed_storage"] = attrs["used_for_managed_storage"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StorageCredentialInfo. @@ -15449,10 +15885,10 @@ func (o *StorageCredentialInfo_SdkV2) SetDatabricksGcpServiceAccount(ctx context type SystemSchemaInfo_SdkV2 struct { // Name of the system schema. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // The current state of enablement for the system schema. An empty string // means the system schema is available and ready for opt-in. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *SystemSchemaInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SystemSchemaInfo_SdkV2) { @@ -15461,9 +15897,11 @@ func (newState *SystemSchemaInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SystemSchemaInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState SystemSchemaInfo_SdkV2) { } -func (c SystemSchemaInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SystemSchemaInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["schema"] = attrs["schema"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SystemSchemaInfo. @@ -15503,11 +15941,11 @@ func (o SystemSchemaInfo_SdkV2) Type(ctx context.Context) attr.Type { // __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. type TableConstraint_SdkV2 struct { - ForeignKeyConstraint types.List `tfsdk:"foreign_key_constraint" tf:"optional,object"` + ForeignKeyConstraint types.List `tfsdk:"foreign_key_constraint"` - NamedTableConstraint types.List `tfsdk:"named_table_constraint" tf:"optional,object"` + NamedTableConstraint types.List `tfsdk:"named_table_constraint"` - PrimaryKeyConstraint types.List `tfsdk:"primary_key_constraint" tf:"optional,object"` + PrimaryKeyConstraint types.List `tfsdk:"primary_key_constraint"` } func (newState *TableConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableConstraint_SdkV2) { @@ -15516,12 +15954,15 @@ func (newState *TableConstraint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *TableConstraint_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableConstraint_SdkV2) { } -func (c TableConstraint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ForeignKeyConstraint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "foreign_key_constraint")...) - NamedTableConstraint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "named_table_constraint")...) - PrimaryKeyConstraint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "primary_key_constraint")...) +func (c TableConstraint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["foreign_key_constraint"] = attrs["foreign_key_constraint"].SetOptional() + attrs["foreign_key_constraint"] = attrs["foreign_key_constraint"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["named_table_constraint"] = attrs["named_table_constraint"].SetOptional() + attrs["named_table_constraint"] = attrs["named_table_constraint"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["primary_key_constraint"] = attrs["primary_key_constraint"].SetOptional() + attrs["primary_key_constraint"] = attrs["primary_key_constraint"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableConstraint. @@ -15651,7 +16092,7 @@ func (o *TableConstraint_SdkV2) SetPrimaryKeyConstraint(ctx context.Context, v P type TableDependency_SdkV2 struct { // Full name of the dependent table, in the form of // __catalog_name__.__schema_name__.__table_name__. - TableFullName types.String `tfsdk:"table_full_name" tf:""` + TableFullName types.String `tfsdk:"table_full_name"` } func (newState *TableDependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableDependency_SdkV2) { @@ -15660,10 +16101,10 @@ func (newState *TableDependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *TableDependency_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableDependency_SdkV2) { } -func (c TableDependency_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "table_full_name")...) +func (c TableDependency_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["table_full_name"] = attrs["table_full_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableDependency. @@ -15699,7 +16140,7 @@ func (o TableDependency_SdkV2) Type(ctx context.Context) attr.Type { type TableExistsResponse_SdkV2 struct { // Whether the table exists or not. - TableExists types.Bool `tfsdk:"table_exists" tf:"optional"` + TableExists types.Bool `tfsdk:"table_exists"` } func (newState *TableExistsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableExistsResponse_SdkV2) { @@ -15708,9 +16149,10 @@ func (newState *TableExistsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *TableExistsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableExistsResponse_SdkV2) { } -func (c TableExistsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableExistsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["table_exists"] = attrs["table_exists"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableExistsResponse. @@ -15746,82 +16188,82 @@ func (o TableExistsResponse_SdkV2) Type(ctx context.Context) attr.Type { type TableInfo_SdkV2 struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The array of __ColumnInfo__ definitions of the table's columns. - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this table was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of table creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique ID of the Data Access Configuration to use with the table data. - DataAccessConfigurationId types.String `tfsdk:"data_access_configuration_id" tf:"optional"` + DataAccessConfigurationId types.String `tfsdk:"data_access_configuration_id"` // Data source format - DataSourceFormat types.String `tfsdk:"data_source_format" tf:"optional"` + DataSourceFormat types.String `tfsdk:"data_source_format"` // Time at which this table was deleted, in epoch milliseconds. Field is // omitted if table is not deleted. - DeletedAt types.Int64 `tfsdk:"deleted_at" tf:"optional"` + DeletedAt types.Int64 `tfsdk:"deleted_at"` // Information pertaining to current state of the delta table. - DeltaRuntimePropertiesKvpairs types.List `tfsdk:"delta_runtime_properties_kvpairs" tf:"optional,object"` + DeltaRuntimePropertiesKvpairs types.List `tfsdk:"delta_runtime_properties_kvpairs"` - EffectivePredictiveOptimizationFlag types.List `tfsdk:"effective_predictive_optimization_flag" tf:"optional,object"` + EffectivePredictiveOptimizationFlag types.List `tfsdk:"effective_predictive_optimization_flag"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.List `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.List `tfsdk:"encryption_details"` // Full name of table, in form of // __catalog_name__.__schema_name__.__table_name__ - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of table, relative to parent schema. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of table. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The pipeline ID of the table. Applicable for tables created by pipelines // (Materialized View, Streaming Table, etc.). - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` - RowFilter types.List `tfsdk:"row_filter" tf:"optional,object"` + RowFilter types.List `tfsdk:"row_filter"` // Name of parent schema relative to its parent catalog. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // List of schemes whose objects can be referenced without qualification. - SqlPath types.String `tfsdk:"sql_path" tf:"optional"` + SqlPath types.String `tfsdk:"sql_path"` // Name of the storage credential, when a storage credential is configured // for use with this table. - StorageCredentialName types.String `tfsdk:"storage_credential_name" tf:"optional"` + StorageCredentialName types.String `tfsdk:"storage_credential_name"` // Storage root URL for table (for **MANAGED**, **EXTERNAL** tables) - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // List of table constraints. Note: this field is not set in the output of // the __listTables__ API. - TableConstraints types.List `tfsdk:"table_constraints" tf:"optional"` + TableConstraints types.List `tfsdk:"table_constraints"` // The unique identifier of the table. - TableId types.String `tfsdk:"table_id" tf:"optional"` + TableId types.String `tfsdk:"table_id"` - TableType types.String `tfsdk:"table_type" tf:"optional"` + TableType types.String `tfsdk:"table_type"` // Time at which this table was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the table. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // View definition SQL (when __table_type__ is **VIEW**, // **MATERIALIZED_VIEW**, or **STREAMING_TABLE**) - ViewDefinition types.String `tfsdk:"view_definition" tf:"optional"` + ViewDefinition types.String `tfsdk:"view_definition"` // View dependencies (when table_type == **VIEW** or **MATERIALIZED_VIEW**, // **STREAMING_TABLE**) - when DependencyList is None, the dependency is not // provided; - when DependencyList is an empty list, the dependency is // provided but is empty; - when DependencyList is not an empty list, // dependencies are provided and recorded. - ViewDependencies types.List `tfsdk:"view_dependencies" tf:"optional,object"` + ViewDependencies types.List `tfsdk:"view_dependencies"` } func (newState *TableInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableInfo_SdkV2) { @@ -15830,16 +16272,46 @@ func (newState *TableInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ta func (newState *TableInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableInfo_SdkV2) { } -func (c TableInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "columns")...) - DeltaRuntimePropertiesKvPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "delta_runtime_properties_kvpairs")...) - EffectivePredictiveOptimizationFlag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "effective_predictive_optimization_flag")...) - EncryptionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - TableRowFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "row_filter")...) - TableConstraint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_constraints")...) - DependencyList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "view_dependencies")...) - - return cs +func (c TableInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["columns"] = attrs["columns"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_access_configuration_id"] = attrs["data_access_configuration_id"].SetOptional() + attrs["data_source_format"] = attrs["data_source_format"].SetOptional() + attrs["deleted_at"] = attrs["deleted_at"].SetOptional() + attrs["delta_runtime_properties_kvpairs"] = attrs["delta_runtime_properties_kvpairs"].SetOptional() + attrs["delta_runtime_properties_kvpairs"] = attrs["delta_runtime_properties_kvpairs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["row_filter"] = attrs["row_filter"].SetOptional() + attrs["row_filter"] = attrs["row_filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["sql_path"] = attrs["sql_path"].SetOptional() + attrs["storage_credential_name"] = attrs["storage_credential_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["table_constraints"] = attrs["table_constraints"].SetOptional() + attrs["table_id"] = attrs["table_id"].SetOptional() + attrs["table_type"] = attrs["table_type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["view_definition"] = attrs["view_definition"].SetOptional() + attrs["view_dependencies"] = attrs["view_dependencies"].SetOptional() + attrs["view_dependencies"] = attrs["view_dependencies"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableInfo. @@ -16170,11 +16642,11 @@ func (o *TableInfo_SdkV2) SetViewDependencies(ctx context.Context, v DependencyL type TableRowFilter_SdkV2 struct { // The full name of the row filter SQL UDF. - FunctionName types.String `tfsdk:"function_name" tf:""` + FunctionName types.String `tfsdk:"function_name"` // The list of table columns to be passed as input to the row filter // function. The column types should match the types of the filter function // arguments. - InputColumnNames types.List `tfsdk:"input_column_names" tf:""` + InputColumnNames types.List `tfsdk:"input_column_names"` } func (newState *TableRowFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableRowFilter_SdkV2) { @@ -16183,11 +16655,11 @@ func (newState *TableRowFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *TableRowFilter_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableRowFilter_SdkV2) { } -func (c TableRowFilter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "function_name")...) - cs.SetRequired(append(path, "input_column_names")...) +func (c TableRowFilter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_name"] = attrs["function_name"].SetRequired() + attrs["input_column_names"] = attrs["input_column_names"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableRowFilter. @@ -16255,9 +16727,9 @@ func (o *TableRowFilter_SdkV2) SetInputColumnNames(ctx context.Context, v []type type TableSummary_SdkV2 struct { // The full name of the table. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` - TableType types.String `tfsdk:"table_type" tf:"optional"` + TableType types.String `tfsdk:"table_type"` } func (newState *TableSummary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSummary_SdkV2) { @@ -16266,9 +16738,11 @@ func (newState *TableSummary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TableSummary_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableSummary_SdkV2) { } -func (c TableSummary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableSummary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["table_type"] = attrs["table_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableSummary. @@ -16307,14 +16781,14 @@ func (o TableSummary_SdkV2) Type(ctx context.Context) attr.Type { type TemporaryCredentials_SdkV2 struct { // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. - AwsTempCredentials types.List `tfsdk:"aws_temp_credentials" tf:"optional,object"` + AwsTempCredentials types.List `tfsdk:"aws_temp_credentials"` // Azure Active Directory token, essentially the Oauth token for Azure // Service Principal or Managed Identity. Read more at // https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token - AzureAad types.List `tfsdk:"azure_aad" tf:"optional,object"` + AzureAad types.List `tfsdk:"azure_aad"` // Server time when the credential will expire, in epoch milliseconds. The // API client is advised to cache the credential given this expiration time. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` } func (newState *TemporaryCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TemporaryCredentials_SdkV2) { @@ -16323,11 +16797,14 @@ func (newState *TemporaryCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *TemporaryCredentials_SdkV2) SyncEffectiveFieldsDuringRead(existingState TemporaryCredentials_SdkV2) { } -func (c TemporaryCredentials_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsCredentials_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_temp_credentials")...) - AzureActiveDirectoryToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_aad")...) +func (c TemporaryCredentials_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_temp_credentials"] = attrs["aws_temp_credentials"].SetOptional() + attrs["aws_temp_credentials"] = attrs["aws_temp_credentials"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_aad"] = attrs["azure_aad"].SetOptional() + attrs["azure_aad"] = attrs["azure_aad"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TemporaryCredentials. @@ -16430,12 +16907,12 @@ type TriggeredUpdateStatus_SdkV2 struct { // The last source table Delta version that was synced to the online table. // Note that this Delta version may not be completely synced to the online // table yet. - LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version" tf:"optional"` + LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version"` // The timestamp of the last time any data was synchronized from the source // table to the online table. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` // Progress of the active data synchronization pipeline. - TriggeredUpdateProgress types.List `tfsdk:"triggered_update_progress" tf:"optional,object"` + TriggeredUpdateProgress types.List `tfsdk:"triggered_update_progress"` } func (newState *TriggeredUpdateStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TriggeredUpdateStatus_SdkV2) { @@ -16444,10 +16921,13 @@ func (newState *TriggeredUpdateStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *TriggeredUpdateStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState TriggeredUpdateStatus_SdkV2) { } -func (c TriggeredUpdateStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineProgress_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "triggered_update_progress")...) +func (c TriggeredUpdateStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_processed_commit_version"] = attrs["last_processed_commit_version"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() + attrs["triggered_update_progress"] = attrs["triggered_update_progress"].SetOptional() + attrs["triggered_update_progress"] = attrs["triggered_update_progress"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TriggeredUpdateStatus. @@ -16618,21 +17098,21 @@ func (o UpdateAssignmentResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateCatalog_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // The name of the catalog. Name types.String `tfsdk:"-"` // New name for the catalog. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of catalog. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` } func (newState *UpdateCatalog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCatalog_SdkV2) { @@ -16641,10 +17121,16 @@ func (newState *UpdateCatalog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *UpdateCatalog_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCatalog_SdkV2) { } -func (c UpdateCatalog_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateCatalog_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCatalog. @@ -16724,11 +17210,11 @@ type UpdateConnection_SdkV2 struct { // Name of the connection. Name types.String `tfsdk:"-"` // New name for the connection. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:""` + Options types.Map `tfsdk:"options"` // Username of current owner of the connection. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateConnection_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateConnection_SdkV2) { @@ -16737,11 +17223,13 @@ func (newState *UpdateConnection_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateConnection_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateConnection_SdkV2) { } -func (c UpdateConnection_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) +func (c UpdateConnection_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["options"] = attrs["options"].SetRequired() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateConnection. @@ -16813,36 +17301,36 @@ func (o *UpdateConnection_SdkV2) SetOptions(ctx context.Context, v map[string]ty type UpdateCredentialRequest_SdkV2 struct { // The AWS IAM role configuration - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // Force an update even if there are dependent services (when purpose is // **SERVICE**) or dependent external locations and external tables (when // purpose is **STORAGE**). - Force types.Bool `tfsdk:"force" tf:"optional"` + Force types.Bool `tfsdk:"force"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Name of the credential. NameArg types.String `tfsdk:"-"` // New name of credential. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Supply true to this argument to skip validation of the updated // credential. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *UpdateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCredentialRequest_SdkV2) { @@ -16851,14 +17339,25 @@ func (newState *UpdateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *UpdateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCredentialRequest_SdkV2) { } -func (c UpdateCredentialRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - DatabricksGcpServiceAccount_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name_arg")...) +func (c UpdateCredentialRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["force"] = attrs["force"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name_arg"] = attrs["name_arg"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCredentialRequest. @@ -17033,35 +17532,35 @@ func (o *UpdateCredentialRequest_SdkV2) SetDatabricksGcpServiceAccount(ctx conte type UpdateExternalLocation_SdkV2 struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the storage credential used with this location. - CredentialName types.String `tfsdk:"credential_name" tf:"optional"` + CredentialName types.String `tfsdk:"credential_name"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.List `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.List `tfsdk:"encryption_details"` // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback types.Bool `tfsdk:"fallback" tf:"optional"` + Fallback types.Bool `tfsdk:"fallback"` // Force update even if changing url invalidates dependent external tables // or mounts. - Force types.Bool `tfsdk:"force" tf:"optional"` + Force types.Bool `tfsdk:"force"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Name of the external location. Name types.String `tfsdk:"-"` // New name for the external location. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The owner of the external location. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Indicates whether the external location is read-only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Skips validation of the storage credential associated with the external // location. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` // Path URL of the external location. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *UpdateExternalLocation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExternalLocation_SdkV2) { @@ -17070,11 +17569,23 @@ func (newState *UpdateExternalLocation_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateExternalLocation_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExternalLocation_SdkV2) { } -func (c UpdateExternalLocation_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EncryptionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - cs.SetRequired(append(path, "name")...) +func (c UpdateExternalLocation_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["fallback"] = attrs["fallback"].SetOptional() + attrs["force"] = attrs["force"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExternalLocation. @@ -17167,7 +17678,7 @@ type UpdateFunction_SdkV2 struct { // __catalog_name__.__schema_name__.__function__name__). Name types.String `tfsdk:"-"` // Username of current owner of function. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateFunction_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateFunction_SdkV2) { @@ -17176,10 +17687,11 @@ func (newState *UpdateFunction_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *UpdateFunction_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateFunction_SdkV2) { } -func (c UpdateFunction_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateFunction_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateFunction. @@ -17218,22 +17730,22 @@ func (o UpdateFunction_SdkV2) Type(ctx context.Context) attr.Type { type UpdateMetastore_SdkV2 struct { // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name" tf:"optional"` + DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name"` // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds" tf:"optional"` + DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds"` // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope types.String `tfsdk:"delta_sharing_scope" tf:"optional"` + DeltaSharingScope types.String `tfsdk:"delta_sharing_scope"` // Unique ID of the metastore. Id types.String `tfsdk:"-"` // New name for the metastore. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The owner of the metastore. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion types.String `tfsdk:"privilege_model_version" tf:"optional"` + PrivilegeModelVersion types.String `tfsdk:"privilege_model_version"` // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id" tf:"optional"` + StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id"` } func (newState *UpdateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateMetastore_SdkV2) { @@ -17242,10 +17754,17 @@ func (newState *UpdateMetastore_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateMetastore_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateMetastore_SdkV2) { } -func (c UpdateMetastore_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c UpdateMetastore_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["delta_sharing_organization_name"] = attrs["delta_sharing_organization_name"].SetOptional() + attrs["delta_sharing_recipient_token_lifetime_in_seconds"] = attrs["delta_sharing_recipient_token_lifetime_in_seconds"].SetOptional() + attrs["delta_sharing_scope"] = attrs["delta_sharing_scope"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["privilege_model_version"] = attrs["privilege_model_version"].SetOptional() + attrs["storage_root_credential_id"] = attrs["storage_root_credential_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateMetastore. @@ -17297,9 +17816,9 @@ type UpdateMetastoreAssignment_SdkV2 struct { // The name of the default catalog in the metastore. This field is // depracted. Please use "Default Namespace API" to configure the default // catalog for a Databricks workspace. - DefaultCatalogName types.String `tfsdk:"default_catalog_name" tf:"optional"` + DefaultCatalogName types.String `tfsdk:"default_catalog_name"` // The unique ID of the metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // A workspace ID. WorkspaceId types.Int64 `tfsdk:"-"` } @@ -17310,10 +17829,12 @@ func (newState *UpdateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *UpdateMetastoreAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateMetastoreAssignment_SdkV2) { } -func (c UpdateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "workspace_id")...) +func (c UpdateMetastoreAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_catalog_name"] = attrs["default_catalog_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateMetastoreAssignment. @@ -17353,7 +17874,7 @@ func (o UpdateMetastoreAssignment_SdkV2) Type(ctx context.Context) attr.Type { type UpdateModelVersionRequest_SdkV2 struct { // The comment attached to the model version - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The three-level (fully qualified) name of the model version FullName types.String `tfsdk:"-"` // The integer version number of the model version @@ -17366,11 +17887,12 @@ func (newState *UpdateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *UpdateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateModelVersionRequest_SdkV2) { } -func (c UpdateModelVersionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "full_name")...) - cs.SetRequired(append(path, "version")...) +func (c UpdateModelVersionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateModelVersionRequest. @@ -17412,36 +17934,36 @@ type UpdateMonitor_SdkV2 struct { // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName types.String `tfsdk:"baseline_table_name" tf:"optional"` + BaselineTableName types.String `tfsdk:"baseline_table_name"` // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics types.List `tfsdk:"custom_metrics" tf:"optional"` + CustomMetrics types.List `tfsdk:"custom_metrics"` // Id of dashboard that visualizes the computed metrics. This can be empty // if the monitor is in PENDING state. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The data classification config for the monitor. - DataClassificationConfig types.List `tfsdk:"data_classification_config" tf:"optional,object"` + DataClassificationConfig types.List `tfsdk:"data_classification_config"` // Configuration for monitoring inference logs. - InferenceLog types.List `tfsdk:"inference_log" tf:"optional,object"` + InferenceLog types.List `tfsdk:"inference_log"` // The notification settings for the monitor. - Notifications types.List `tfsdk:"notifications" tf:"optional,object"` + Notifications types.List `tfsdk:"notifications"` // Schema where output metric tables are created. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:""` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // The schedule for automatically updating and refreshing metric tables. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs types.List `tfsdk:"slicing_exprs" tf:"optional"` + SlicingExprs types.List `tfsdk:"slicing_exprs"` // Configuration for monitoring snapshot tables. - Snapshot types.List `tfsdk:"snapshot" tf:"optional,object"` + Snapshot types.List `tfsdk:"snapshot"` // Full name of the table. TableName types.String `tfsdk:"-"` // Configuration for monitoring time series tables. - TimeSeries types.List `tfsdk:"time_series" tf:"optional,object"` + TimeSeries types.List `tfsdk:"time_series"` } func (newState *UpdateMonitor_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateMonitor_SdkV2) { @@ -17450,18 +17972,27 @@ func (newState *UpdateMonitor_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *UpdateMonitor_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateMonitor_SdkV2) { } -func (c UpdateMonitor_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorMetric_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "custom_metrics")...) - MonitorDataClassificationConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_classification_config")...) - MonitorInferenceLog_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "inference_log")...) - MonitorNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - cs.SetRequired(append(path, "output_schema_name")...) - MonitorCronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - MonitorSnapshot_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "snapshot")...) - cs.SetRequired(append(path, "table_name")...) - MonitorTimeSeries_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "time_series")...) - - return cs +func (c UpdateMonitor_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["baseline_table_name"] = attrs["baseline_table_name"].SetOptional() + attrs["custom_metrics"] = attrs["custom_metrics"].SetOptional() + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["inference_log"] = attrs["inference_log"].SetOptional() + attrs["inference_log"] = attrs["inference_log"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["notifications"] = attrs["notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["output_schema_name"] = attrs["output_schema_name"].SetRequired() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["slicing_exprs"] = attrs["slicing_exprs"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["time_series"] = attrs["time_series"].SetOptional() + attrs["time_series"] = attrs["time_series"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateMonitor. @@ -17752,7 +18283,7 @@ func (o *UpdateMonitor_SdkV2) SetTimeSeries(ctx context.Context, v MonitorTimeSe type UpdatePermissions_SdkV2 struct { // Array of permissions change objects. - Changes types.List `tfsdk:"changes" tf:"optional"` + Changes types.List `tfsdk:"changes"` // Full name of securable. FullName types.String `tfsdk:"-"` // Type of securable. @@ -17765,12 +18296,12 @@ func (newState *UpdatePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdatePermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdatePermissions_SdkV2) { } -func (c UpdatePermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionsChange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "changes")...) - cs.SetRequired(append(path, "full_name")...) - cs.SetRequired(append(path, "securable_type")...) +func (c UpdatePermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["changes"] = attrs["changes"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["securable_type"] = attrs["securable_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePermissions. @@ -17840,13 +18371,13 @@ func (o *UpdatePermissions_SdkV2) SetChanges(ctx context.Context, v []Permission type UpdateRegisteredModelRequest_SdkV2 struct { // The comment attached to the registered model - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The three-level (fully qualified) name of the registered model FullName types.String `tfsdk:"-"` // New name for the registered model. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The identifier of the user who owns the registered model - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateRegisteredModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRegisteredModelRequest_SdkV2) { @@ -17855,10 +18386,13 @@ func (newState *UpdateRegisteredModelRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *UpdateRegisteredModelRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRegisteredModelRequest_SdkV2) { } -func (c UpdateRegisteredModelRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "full_name")...) +func (c UpdateRegisteredModelRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRegisteredModelRequest. @@ -17930,18 +18464,18 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateSchema_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Full name of the schema. FullName types.String `tfsdk:"-"` // New name for the schema. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of schema. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` } func (newState *UpdateSchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateSchema_SdkV2) { @@ -17950,10 +18484,15 @@ func (newState *UpdateSchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateSchema_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateSchema_SdkV2) { } -func (c UpdateSchema_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "full_name")...) +func (c UpdateSchema_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateSchema. @@ -18029,33 +18568,33 @@ func (o *UpdateSchema_SdkV2) SetProperties(ctx context.Context, v map[string]typ type UpdateStorageCredential_SdkV2 struct { // The AWS IAM role configuration. - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.List `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.List `tfsdk:"cloudflare_api_token"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // Force update even if there are dependent external locations or external // tables. - Force types.Bool `tfsdk:"force" tf:"optional"` + Force types.Bool `tfsdk:"force"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Name of the storage credential. Name types.String `tfsdk:"-"` // New name for the storage credential. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Supplying true to this argument skips validation of the updated // credential. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *UpdateStorageCredential_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateStorageCredential_SdkV2) { @@ -18064,15 +18603,27 @@ func (newState *UpdateStorageCredential_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *UpdateStorageCredential_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateStorageCredential_SdkV2) { } -func (c UpdateStorageCredential_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name")...) - - return cs +func (c UpdateStorageCredential_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["force"] = attrs["force"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateStorageCredential. @@ -18281,7 +18832,7 @@ type UpdateTableRequest_SdkV2 struct { // Full name of the table. FullName types.String `tfsdk:"-"` - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateTableRequest. @@ -18319,13 +18870,13 @@ func (o UpdateTableRequest_SdkV2) Type(ctx context.Context) attr.Type { type UpdateVolumeRequestContent_SdkV2 struct { // The comment attached to the volume - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The three-level (fully qualified) name of the volume Name types.String `tfsdk:"-"` // New name for the volume. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The identifier of the user who owns the volume - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateVolumeRequestContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateVolumeRequestContent_SdkV2) { @@ -18334,10 +18885,13 @@ func (newState *UpdateVolumeRequestContent_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UpdateVolumeRequestContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateVolumeRequestContent_SdkV2) { } -func (c UpdateVolumeRequestContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateVolumeRequestContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateVolumeRequestContent. @@ -18379,11 +18933,11 @@ func (o UpdateVolumeRequestContent_SdkV2) Type(ctx context.Context) attr.Type { type UpdateWorkspaceBindings_SdkV2 struct { // A list of workspace IDs. - AssignWorkspaces types.List `tfsdk:"assign_workspaces" tf:"optional"` + AssignWorkspaces types.List `tfsdk:"assign_workspaces"` // The name of the catalog. Name types.String `tfsdk:"-"` // A list of workspace IDs. - UnassignWorkspaces types.List `tfsdk:"unassign_workspaces" tf:"optional"` + UnassignWorkspaces types.List `tfsdk:"unassign_workspaces"` } func (newState *UpdateWorkspaceBindings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateWorkspaceBindings_SdkV2) { @@ -18392,10 +18946,12 @@ func (newState *UpdateWorkspaceBindings_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *UpdateWorkspaceBindings_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceBindings_SdkV2) { } -func (c UpdateWorkspaceBindings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateWorkspaceBindings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assign_workspaces"] = attrs["assign_workspaces"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["unassign_workspaces"] = attrs["unassign_workspaces"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceBindings. @@ -18494,9 +19050,9 @@ func (o *UpdateWorkspaceBindings_SdkV2) SetUnassignWorkspaces(ctx context.Contex type UpdateWorkspaceBindingsParameters_SdkV2 struct { // List of workspace bindings - Add types.List `tfsdk:"add" tf:"optional"` + Add types.List `tfsdk:"add"` // List of workspace bindings - Remove types.List `tfsdk:"remove" tf:"optional"` + Remove types.List `tfsdk:"remove"` // The name of the securable. SecurableName types.String `tfsdk:"-"` // The type of the securable to bind to a workspace. @@ -18509,13 +19065,13 @@ func (newState *UpdateWorkspaceBindingsParameters_SdkV2) SyncEffectiveFieldsDuri func (newState *UpdateWorkspaceBindingsParameters_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceBindingsParameters_SdkV2) { } -func (c UpdateWorkspaceBindingsParameters_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceBinding_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "add")...) - WorkspaceBinding_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "remove")...) - cs.SetRequired(append(path, "securable_name")...) - cs.SetRequired(append(path, "securable_type")...) +func (c UpdateWorkspaceBindingsParameters_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["add"] = attrs["add"].SetOptional() + attrs["remove"] = attrs["remove"].SetOptional() + attrs["securable_name"] = attrs["securable_name"].SetRequired() + attrs["securable_type"] = attrs["securable_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceBindingsParameters. @@ -18616,24 +19172,24 @@ func (o *UpdateWorkspaceBindingsParameters_SdkV2) SetRemove(ctx context.Context, type ValidateCredentialRequest_SdkV2 struct { // The AWS IAM role configuration - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // Required. The name of an existing credential or long-lived cloud // credential to validate. - CredentialName types.String `tfsdk:"credential_name" tf:"optional"` + CredentialName types.String `tfsdk:"credential_name"` // The name of an existing external location to validate. Only applicable // for storage credentials (purpose is **STORAGE**.) - ExternalLocationName types.String `tfsdk:"external_location_name" tf:"optional"` + ExternalLocationName types.String `tfsdk:"external_location_name"` // The purpose of the credential. This should only be used when the // credential is specified. - Purpose types.String `tfsdk:"purpose" tf:"optional"` + Purpose types.String `tfsdk:"purpose"` // Whether the credential is only usable for read operations. Only // applicable for storage credentials (purpose is **STORAGE**.) - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // The external location url to validate. Only applicable when purpose is // **STORAGE**. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ValidateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateCredentialRequest_SdkV2) { @@ -18642,11 +19198,18 @@ func (newState *ValidateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ValidateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ValidateCredentialRequest_SdkV2) { } -func (c ValidateCredentialRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) +func (c ValidateCredentialRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["credential_name"] = attrs["credential_name"].SetOptional() + attrs["external_location_name"] = attrs["external_location_name"].SetOptional() + attrs["purpose"] = attrs["purpose"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateCredentialRequest. @@ -18754,9 +19317,9 @@ func (o *ValidateCredentialRequest_SdkV2) SetAzureManagedIdentity(ctx context.Co type ValidateCredentialResponse_SdkV2 struct { // Whether the tested location is a directory in cloud storage. Only // applicable for when purpose is **STORAGE**. - IsDir types.Bool `tfsdk:"isDir" tf:"optional"` + IsDir types.Bool `tfsdk:"isDir"` // The results of the validation check. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ValidateCredentialResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateCredentialResponse_SdkV2) { @@ -18765,10 +19328,11 @@ func (newState *ValidateCredentialResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ValidateCredentialResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ValidateCredentialResponse_SdkV2) { } -func (c ValidateCredentialResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CredentialValidationResult_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ValidateCredentialResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["isDir"] = attrs["isDir"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateCredentialResponse. @@ -18836,23 +19400,23 @@ func (o *ValidateCredentialResponse_SdkV2) SetResults(ctx context.Context, v []C type ValidateStorageCredential_SdkV2 struct { // The AWS IAM role configuration. - AwsIamRole types.List `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.List `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.List `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.List `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.List `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.List `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.List `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.List `tfsdk:"cloudflare_api_token"` // The Databricks created GCP service account configuration. - DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.List `tfsdk:"databricks_gcp_service_account"` // The name of an existing external location to validate. - ExternalLocationName types.String `tfsdk:"external_location_name" tf:"optional"` + ExternalLocationName types.String `tfsdk:"external_location_name"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // The name of the storage credential to validate. - StorageCredentialName types.String `tfsdk:"storage_credential_name" tf:"optional"` + StorageCredentialName types.String `tfsdk:"storage_credential_name"` // The external location url to validate. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ValidateStorageCredential_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateStorageCredential_SdkV2) { @@ -18861,14 +19425,23 @@ func (newState *ValidateStorageCredential_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ValidateStorageCredential_SdkV2) SyncEffectiveFieldsDuringRead(existingState ValidateStorageCredential_SdkV2) { } -func (c ValidateStorageCredential_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) +func (c ValidateStorageCredential_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["aws_iam_role"] = attrs["aws_iam_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["external_location_name"] = attrs["external_location_name"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["storage_credential_name"] = attrs["storage_credential_name"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateStorageCredential. @@ -19066,9 +19639,9 @@ func (o *ValidateStorageCredential_SdkV2) SetDatabricksGcpServiceAccount(ctx con type ValidateStorageCredentialResponse_SdkV2 struct { // Whether the tested location is a directory in cloud storage. - IsDir types.Bool `tfsdk:"isDir" tf:"optional"` + IsDir types.Bool `tfsdk:"isDir"` // The results of the validation check. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ValidateStorageCredentialResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateStorageCredentialResponse_SdkV2) { @@ -19077,10 +19650,11 @@ func (newState *ValidateStorageCredentialResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *ValidateStorageCredentialResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ValidateStorageCredentialResponse_SdkV2) { } -func (c ValidateStorageCredentialResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ValidationResult_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ValidateStorageCredentialResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["isDir"] = attrs["isDir"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateStorageCredentialResponse. @@ -19148,11 +19722,11 @@ func (o *ValidateStorageCredentialResponse_SdkV2) SetResults(ctx context.Context type ValidationResult_SdkV2 struct { // Error message would exist when the result does not equal to **PASS**. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // The operation tested. - Operation types.String `tfsdk:"operation" tf:"optional"` + Operation types.String `tfsdk:"operation"` // The results of the tested operation. - Result types.String `tfsdk:"result" tf:"optional"` + Result types.String `tfsdk:"result"` } func (newState *ValidationResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidationResult_SdkV2) { @@ -19161,9 +19735,12 @@ func (newState *ValidationResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ValidationResult_SdkV2) SyncEffectiveFieldsDuringRead(existingState ValidationResult_SdkV2) { } -func (c ValidationResult_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ValidationResult_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() + attrs["operation"] = attrs["operation"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidationResult. @@ -19203,41 +19780,41 @@ func (o ValidationResult_SdkV2) Type(ctx context.Context) attr.Type { type VolumeInfo_SdkV2 struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The name of the catalog where the schema and the volume are - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the volume - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The identifier of the user who created the volume - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.List `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.List `tfsdk:"encryption_details"` // The three-level (fully qualified) name of the volume - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the metastore - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the volume - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The identifier of the user who owns the volume - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The name of the schema where the volume is - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The identifier of the user who updated the volume last time - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // The unique identifier of the volume - VolumeId types.String `tfsdk:"volume_id" tf:"optional"` + VolumeId types.String `tfsdk:"volume_id"` - VolumeType types.String `tfsdk:"volume_type" tf:"optional"` + VolumeType types.String `tfsdk:"volume_type"` } func (newState *VolumeInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan VolumeInfo_SdkV2) { @@ -19246,10 +19823,27 @@ func (newState *VolumeInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan V func (newState *VolumeInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState VolumeInfo_SdkV2) { } -func (c VolumeInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EncryptionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - - return cs +func (c VolumeInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["volume_id"] = attrs["volume_id"].SetOptional() + attrs["volume_type"] = attrs["volume_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VolumeInfo. @@ -19346,9 +19940,9 @@ func (o *VolumeInfo_SdkV2) SetEncryptionDetails(ctx context.Context, v Encryptio } type WorkspaceBinding_SdkV2 struct { - BindingType types.String `tfsdk:"binding_type" tf:"optional"` + BindingType types.String `tfsdk:"binding_type"` - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *WorkspaceBinding_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceBinding_SdkV2) { @@ -19357,9 +19951,11 @@ func (newState *WorkspaceBinding_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *WorkspaceBinding_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceBinding_SdkV2) { } -func (c WorkspaceBinding_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceBinding_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["binding_type"] = attrs["binding_type"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceBinding. @@ -19398,11 +19994,11 @@ func (o WorkspaceBinding_SdkV2) Type(ctx context.Context) attr.Type { // Currently assigned workspace bindings type WorkspaceBindingsResponse_SdkV2 struct { // List of workspace bindings - Bindings types.List `tfsdk:"bindings" tf:"optional"` + Bindings types.List `tfsdk:"bindings"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *WorkspaceBindingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceBindingsResponse_SdkV2) { @@ -19411,10 +20007,11 @@ func (newState *WorkspaceBindingsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *WorkspaceBindingsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceBindingsResponse_SdkV2) { } -func (c WorkspaceBindingsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceBinding_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "bindings")...) +func (c WorkspaceBindingsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bindings"] = attrs["bindings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceBindingsResponse. diff --git a/internal/service/catalog_tf/model.go b/internal/service/catalog_tf/model.go index ef0d14450..b55661dda 100755 --- a/internal/service/catalog_tf/model.go +++ b/internal/service/catalog_tf/model.go @@ -23,7 +23,7 @@ import ( ) type AccountsCreateMetastore struct { - MetastoreInfo types.Object `tfsdk:"metastore_info" tf:"optional,object"` + MetastoreInfo types.Object `tfsdk:"metastore_info"` } func (newState *AccountsCreateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsCreateMetastore) { @@ -32,10 +32,10 @@ func (newState *AccountsCreateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AccountsCreateMetastore) SyncEffectiveFieldsDuringRead(existingState AccountsCreateMetastore) { } -func (c AccountsCreateMetastore) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateMetastore{}.ApplySchemaCustomizations(cs, append(path, "metastore_info")...) +func (c AccountsCreateMetastore) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_info"] = attrs["metastore_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsCreateMetastore. @@ -100,7 +100,7 @@ func (o *AccountsCreateMetastore) SetMetastoreInfo(ctx context.Context, v Create } type AccountsCreateMetastoreAssignment struct { - MetastoreAssignment types.Object `tfsdk:"metastore_assignment" tf:"optional,object"` + MetastoreAssignment types.Object `tfsdk:"metastore_assignment"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` // Workspace ID. @@ -113,12 +113,12 @@ func (newState *AccountsCreateMetastoreAssignment) SyncEffectiveFieldsDuringCrea func (newState *AccountsCreateMetastoreAssignment) SyncEffectiveFieldsDuringRead(existingState AccountsCreateMetastoreAssignment) { } -func (c AccountsCreateMetastoreAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateMetastoreAssignment{}.ApplySchemaCustomizations(cs, append(path, "metastore_assignment")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c AccountsCreateMetastoreAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_assignment"] = attrs["metastore_assignment"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsCreateMetastoreAssignment. @@ -187,7 +187,7 @@ func (o *AccountsCreateMetastoreAssignment) SetMetastoreAssignment(ctx context.C } type AccountsCreateStorageCredential struct { - CredentialInfo types.Object `tfsdk:"credential_info" tf:"optional,object"` + CredentialInfo types.Object `tfsdk:"credential_info"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` } @@ -198,11 +198,11 @@ func (newState *AccountsCreateStorageCredential) SyncEffectiveFieldsDuringCreate func (newState *AccountsCreateStorageCredential) SyncEffectiveFieldsDuringRead(existingState AccountsCreateStorageCredential) { } -func (c AccountsCreateStorageCredential) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateStorageCredential{}.ApplySchemaCustomizations(cs, append(path, "credential_info")...) - cs.SetRequired(append(path, "metastore_id")...) +func (c AccountsCreateStorageCredential) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_info"] = attrs["credential_info"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsCreateStorageCredential. @@ -269,7 +269,7 @@ func (o *AccountsCreateStorageCredential) SetCredentialInfo(ctx context.Context, } type AccountsMetastoreAssignment struct { - MetastoreAssignment types.Object `tfsdk:"metastore_assignment" tf:"optional,object"` + MetastoreAssignment types.Object `tfsdk:"metastore_assignment"` } func (newState *AccountsMetastoreAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsMetastoreAssignment) { @@ -278,10 +278,10 @@ func (newState *AccountsMetastoreAssignment) SyncEffectiveFieldsDuringCreateOrUp func (newState *AccountsMetastoreAssignment) SyncEffectiveFieldsDuringRead(existingState AccountsMetastoreAssignment) { } -func (c AccountsMetastoreAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MetastoreAssignment{}.ApplySchemaCustomizations(cs, append(path, "metastore_assignment")...) +func (c AccountsMetastoreAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_assignment"] = attrs["metastore_assignment"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsMetastoreAssignment. @@ -346,7 +346,7 @@ func (o *AccountsMetastoreAssignment) SetMetastoreAssignment(ctx context.Context } type AccountsMetastoreInfo struct { - MetastoreInfo types.Object `tfsdk:"metastore_info" tf:"optional,object"` + MetastoreInfo types.Object `tfsdk:"metastore_info"` } func (newState *AccountsMetastoreInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsMetastoreInfo) { @@ -355,10 +355,10 @@ func (newState *AccountsMetastoreInfo) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AccountsMetastoreInfo) SyncEffectiveFieldsDuringRead(existingState AccountsMetastoreInfo) { } -func (c AccountsMetastoreInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MetastoreInfo{}.ApplySchemaCustomizations(cs, append(path, "metastore_info")...) +func (c AccountsMetastoreInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_info"] = attrs["metastore_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsMetastoreInfo. @@ -423,7 +423,7 @@ func (o *AccountsMetastoreInfo) SetMetastoreInfo(ctx context.Context, v Metastor } type AccountsStorageCredentialInfo struct { - CredentialInfo types.Object `tfsdk:"credential_info" tf:"optional,object"` + CredentialInfo types.Object `tfsdk:"credential_info"` } func (newState *AccountsStorageCredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsStorageCredentialInfo) { @@ -432,10 +432,10 @@ func (newState *AccountsStorageCredentialInfo) SyncEffectiveFieldsDuringCreateOr func (newState *AccountsStorageCredentialInfo) SyncEffectiveFieldsDuringRead(existingState AccountsStorageCredentialInfo) { } -func (c AccountsStorageCredentialInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StorageCredentialInfo{}.ApplySchemaCustomizations(cs, append(path, "credential_info")...) +func (c AccountsStorageCredentialInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_info"] = attrs["credential_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsStorageCredentialInfo. @@ -503,7 +503,7 @@ type AccountsUpdateMetastore struct { // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` - MetastoreInfo types.Object `tfsdk:"metastore_info" tf:"optional,object"` + MetastoreInfo types.Object `tfsdk:"metastore_info"` } func (newState *AccountsUpdateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccountsUpdateMetastore) { @@ -512,11 +512,11 @@ func (newState *AccountsUpdateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AccountsUpdateMetastore) SyncEffectiveFieldsDuringRead(existingState AccountsUpdateMetastore) { } -func (c AccountsUpdateMetastore) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "metastore_id")...) - UpdateMetastore{}.ApplySchemaCustomizations(cs, append(path, "metastore_info")...) +func (c AccountsUpdateMetastore) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["metastore_info"] = attrs["metastore_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsUpdateMetastore. @@ -583,7 +583,7 @@ func (o *AccountsUpdateMetastore) SetMetastoreInfo(ctx context.Context, v Update } type AccountsUpdateMetastoreAssignment struct { - MetastoreAssignment types.Object `tfsdk:"metastore_assignment" tf:"optional,object"` + MetastoreAssignment types.Object `tfsdk:"metastore_assignment"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` // Workspace ID. @@ -596,12 +596,12 @@ func (newState *AccountsUpdateMetastoreAssignment) SyncEffectiveFieldsDuringCrea func (newState *AccountsUpdateMetastoreAssignment) SyncEffectiveFieldsDuringRead(existingState AccountsUpdateMetastoreAssignment) { } -func (c AccountsUpdateMetastoreAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateMetastoreAssignment{}.ApplySchemaCustomizations(cs, append(path, "metastore_assignment")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c AccountsUpdateMetastoreAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastore_assignment"] = attrs["metastore_assignment"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsUpdateMetastoreAssignment. @@ -670,7 +670,7 @@ func (o *AccountsUpdateMetastoreAssignment) SetMetastoreAssignment(ctx context.C } type AccountsUpdateStorageCredential struct { - CredentialInfo types.Object `tfsdk:"credential_info" tf:"optional,object"` + CredentialInfo types.Object `tfsdk:"credential_info"` // Unity Catalog metastore ID MetastoreId types.String `tfsdk:"-"` // Name of the storage credential. @@ -683,12 +683,12 @@ func (newState *AccountsUpdateStorageCredential) SyncEffectiveFieldsDuringCreate func (newState *AccountsUpdateStorageCredential) SyncEffectiveFieldsDuringRead(existingState AccountsUpdateStorageCredential) { } -func (c AccountsUpdateStorageCredential) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateStorageCredential{}.ApplySchemaCustomizations(cs, append(path, "credential_info")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "storage_credential_name")...) +func (c AccountsUpdateStorageCredential) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_info"] = attrs["credential_info"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["storage_credential_name"] = attrs["storage_credential_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccountsUpdateStorageCredential. @@ -758,13 +758,13 @@ func (o *AccountsUpdateStorageCredential) SetCredentialInfo(ctx context.Context, type ArtifactAllowlistInfo struct { // A list of allowed artifact match patterns. - ArtifactMatchers types.List `tfsdk:"artifact_matchers" tf:"optional"` + ArtifactMatchers types.List `tfsdk:"artifact_matchers"` // Time at which this artifact allowlist was set, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of the user who set the artifact allowlist. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` } func (newState *ArtifactAllowlistInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ArtifactAllowlistInfo) { @@ -773,10 +773,13 @@ func (newState *ArtifactAllowlistInfo) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ArtifactAllowlistInfo) SyncEffectiveFieldsDuringRead(existingState ArtifactAllowlistInfo) { } -func (c ArtifactAllowlistInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ArtifactMatcher{}.ApplySchemaCustomizations(cs, append(path, "artifact_matchers")...) +func (c ArtifactAllowlistInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_matchers"] = attrs["artifact_matchers"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ArtifactAllowlistInfo. @@ -848,9 +851,9 @@ func (o *ArtifactAllowlistInfo) SetArtifactMatchers(ctx context.Context, v []Art type ArtifactMatcher struct { // The artifact path or maven coordinate - Artifact types.String `tfsdk:"artifact" tf:""` + Artifact types.String `tfsdk:"artifact"` // The pattern matching type of the artifact - MatchType types.String `tfsdk:"match_type" tf:""` + MatchType types.String `tfsdk:"match_type"` } func (newState *ArtifactMatcher) SyncEffectiveFieldsDuringCreateOrUpdate(plan ArtifactMatcher) { @@ -859,11 +862,11 @@ func (newState *ArtifactMatcher) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ar func (newState *ArtifactMatcher) SyncEffectiveFieldsDuringRead(existingState ArtifactMatcher) { } -func (c ArtifactMatcher) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "artifact")...) - cs.SetRequired(append(path, "match_type")...) +func (c ArtifactMatcher) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact"] = attrs["artifact"].SetRequired() + attrs["match_type"] = attrs["match_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ArtifactMatcher. @@ -933,15 +936,15 @@ func (o AssignResponse) Type(ctx context.Context) attr.Type { // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. type AwsCredentials struct { // The access key ID that identifies the temporary credentials. - AccessKeyId types.String `tfsdk:"access_key_id" tf:"optional"` + AccessKeyId types.String `tfsdk:"access_key_id"` // The Amazon Resource Name (ARN) of the S3 access point for temporary // credentials related the external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // The secret access key that can be used to sign AWS API requests. - SecretAccessKey types.String `tfsdk:"secret_access_key" tf:"optional"` + SecretAccessKey types.String `tfsdk:"secret_access_key"` // The token that users must pass to AWS API to use the temporary // credentials. - SessionToken types.String `tfsdk:"session_token" tf:"optional"` + SessionToken types.String `tfsdk:"session_token"` } func (newState *AwsCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsCredentials) { @@ -950,9 +953,13 @@ func (newState *AwsCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan Aws func (newState *AwsCredentials) SyncEffectiveFieldsDuringRead(existingState AwsCredentials) { } -func (c AwsCredentials) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AwsCredentials) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_key_id"] = attrs["access_key_id"].SetOptional() + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["secret_access_key"] = attrs["secret_access_key"].SetOptional() + attrs["session_token"] = attrs["session_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsCredentials. @@ -996,13 +1003,13 @@ func (o AwsCredentials) Type(ctx context.Context) attr.Type { type AwsIamRole struct { // The external ID used in role assumption to prevent the confused deputy // problem. - ExternalId types.String `tfsdk:"external_id" tf:"computed"` + ExternalId types.String `tfsdk:"external_id"` // The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary // credentials. - RoleArn types.String `tfsdk:"role_arn" tf:"optional"` + RoleArn types.String `tfsdk:"role_arn"` // The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. // This is the identity that is going to assume the AWS IAM role. - UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn" tf:"computed"` + UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn"` } func (newState *AwsIamRole) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRole) { @@ -1011,11 +1018,12 @@ func (newState *AwsIamRole) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamR func (newState *AwsIamRole) SyncEffectiveFieldsDuringRead(existingState AwsIamRole) { } -func (c AwsIamRole) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "external_id")...) - cs.SetComputed(append(path, "unity_catalog_iam_arn")...) +func (c AwsIamRole) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_id"] = attrs["external_id"].SetComputed() + attrs["role_arn"] = attrs["role_arn"].SetOptional() + attrs["unity_catalog_iam_arn"] = attrs["unity_catalog_iam_arn"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsIamRole. @@ -1055,7 +1063,7 @@ func (o AwsIamRole) Type(ctx context.Context) attr.Type { type AwsIamRoleRequest struct { // The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access. - RoleArn types.String `tfsdk:"role_arn" tf:""` + RoleArn types.String `tfsdk:"role_arn"` } func (newState *AwsIamRoleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRoleRequest) { @@ -1064,10 +1072,10 @@ func (newState *AwsIamRoleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AwsIamRoleRequest) SyncEffectiveFieldsDuringRead(existingState AwsIamRoleRequest) { } -func (c AwsIamRoleRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "role_arn")...) +func (c AwsIamRoleRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["role_arn"] = attrs["role_arn"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsIamRoleRequest. @@ -1104,12 +1112,12 @@ func (o AwsIamRoleRequest) Type(ctx context.Context) attr.Type { type AwsIamRoleResponse struct { // The external ID used in role assumption to prevent confused deputy // problem.. - ExternalId types.String `tfsdk:"external_id" tf:"optional"` + ExternalId types.String `tfsdk:"external_id"` // The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access. - RoleArn types.String `tfsdk:"role_arn" tf:""` + RoleArn types.String `tfsdk:"role_arn"` // The Amazon Resource Name (ARN) of the AWS IAM user managed by Databricks. // This is the identity that is going to assume the AWS IAM role. - UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn" tf:"optional"` + UnityCatalogIamArn types.String `tfsdk:"unity_catalog_iam_arn"` } func (newState *AwsIamRoleResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRoleResponse) { @@ -1118,10 +1126,12 @@ func (newState *AwsIamRoleResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AwsIamRoleResponse) SyncEffectiveFieldsDuringRead(existingState AwsIamRoleResponse) { } -func (c AwsIamRoleResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "role_arn")...) +func (c AwsIamRoleResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_id"] = attrs["external_id"].SetOptional() + attrs["role_arn"] = attrs["role_arn"].SetRequired() + attrs["unity_catalog_iam_arn"] = attrs["unity_catalog_iam_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsIamRoleResponse. @@ -1165,7 +1175,7 @@ func (o AwsIamRoleResponse) Type(ctx context.Context) attr.Type { type AzureActiveDirectoryToken struct { // Opaque token that contains claims that you can use in Azure Active // Directory to access cloud services. - AadToken types.String `tfsdk:"aad_token" tf:"optional"` + AadToken types.String `tfsdk:"aad_token"` } func (newState *AzureActiveDirectoryToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureActiveDirectoryToken) { @@ -1174,9 +1184,10 @@ func (newState *AzureActiveDirectoryToken) SyncEffectiveFieldsDuringCreateOrUpda func (newState *AzureActiveDirectoryToken) SyncEffectiveFieldsDuringRead(existingState AzureActiveDirectoryToken) { } -func (c AzureActiveDirectoryToken) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AzureActiveDirectoryToken) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aad_token"] = attrs["aad_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureActiveDirectoryToken. @@ -1215,19 +1226,19 @@ type AzureManagedIdentity struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}`. - AccessConnectorId types.String `tfsdk:"access_connector_id" tf:""` + AccessConnectorId types.String `tfsdk:"access_connector_id"` // The Databricks internal ID that represents this managed identity. This // field is only used to persist the credential_id once it is fetched from // the credentials manager - as we only use the protobuf serializer to store // credentials, this ID gets persisted to the database. . - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The Azure resource ID of the managed identity. Use the format, // `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}` // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // using the system-assigned identity. - ManagedIdentityId types.String `tfsdk:"managed_identity_id" tf:"optional"` + ManagedIdentityId types.String `tfsdk:"managed_identity_id"` } func (newState *AzureManagedIdentity) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureManagedIdentity) { @@ -1236,10 +1247,12 @@ func (newState *AzureManagedIdentity) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AzureManagedIdentity) SyncEffectiveFieldsDuringRead(existingState AzureManagedIdentity) { } -func (c AzureManagedIdentity) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_connector_id")...) +func (c AzureManagedIdentity) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_connector_id"] = attrs["access_connector_id"].SetRequired() + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["managed_identity_id"] = attrs["managed_identity_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureManagedIdentity. @@ -1281,14 +1294,14 @@ type AzureManagedIdentityRequest struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. - AccessConnectorId types.String `tfsdk:"access_connector_id" tf:""` + AccessConnectorId types.String `tfsdk:"access_connector_id"` // The Azure resource ID of the managed identity. Use the format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // for a system-assigned identity. - ManagedIdentityId types.String `tfsdk:"managed_identity_id" tf:"optional"` + ManagedIdentityId types.String `tfsdk:"managed_identity_id"` } func (newState *AzureManagedIdentityRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureManagedIdentityRequest) { @@ -1297,10 +1310,11 @@ func (newState *AzureManagedIdentityRequest) SyncEffectiveFieldsDuringCreateOrUp func (newState *AzureManagedIdentityRequest) SyncEffectiveFieldsDuringRead(existingState AzureManagedIdentityRequest) { } -func (c AzureManagedIdentityRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_connector_id")...) +func (c AzureManagedIdentityRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_connector_id"] = attrs["access_connector_id"].SetRequired() + attrs["managed_identity_id"] = attrs["managed_identity_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureManagedIdentityRequest. @@ -1340,16 +1354,16 @@ type AzureManagedIdentityResponse struct { // The Azure resource ID of the Azure Databricks Access Connector. Use the // format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}. - AccessConnectorId types.String `tfsdk:"access_connector_id" tf:""` + AccessConnectorId types.String `tfsdk:"access_connector_id"` // The Databricks internal ID that represents this managed identity. - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The Azure resource ID of the managed identity. Use the format // /subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}. // This is only available for user-assgined identities. For system-assigned // identities, the access_connector_id is used to identify the identity. If // this field is not provided, then we assume the AzureManagedIdentity is // for a system-assigned identity. - ManagedIdentityId types.String `tfsdk:"managed_identity_id" tf:"optional"` + ManagedIdentityId types.String `tfsdk:"managed_identity_id"` } func (newState *AzureManagedIdentityResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureManagedIdentityResponse) { @@ -1358,10 +1372,12 @@ func (newState *AzureManagedIdentityResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *AzureManagedIdentityResponse) SyncEffectiveFieldsDuringRead(existingState AzureManagedIdentityResponse) { } -func (c AzureManagedIdentityResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_connector_id")...) +func (c AzureManagedIdentityResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_connector_id"] = attrs["access_connector_id"].SetRequired() + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["managed_identity_id"] = attrs["managed_identity_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureManagedIdentityResponse. @@ -1404,12 +1420,12 @@ func (o AzureManagedIdentityResponse) Type(ctx context.Context) attr.Type { type AzureServicePrincipal struct { // The application ID of the application registration within the referenced // AAD tenant. - ApplicationId types.String `tfsdk:"application_id" tf:""` + ApplicationId types.String `tfsdk:"application_id"` // The client secret generated for the above app ID in AAD. - ClientSecret types.String `tfsdk:"client_secret" tf:""` + ClientSecret types.String `tfsdk:"client_secret"` // The directory ID corresponding to the Azure Active Directory (AAD) tenant // of the application. - DirectoryId types.String `tfsdk:"directory_id" tf:""` + DirectoryId types.String `tfsdk:"directory_id"` } func (newState *AzureServicePrincipal) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureServicePrincipal) { @@ -1418,12 +1434,12 @@ func (newState *AzureServicePrincipal) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AzureServicePrincipal) SyncEffectiveFieldsDuringRead(existingState AzureServicePrincipal) { } -func (c AzureServicePrincipal) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "application_id")...) - cs.SetRequired(append(path, "client_secret")...) - cs.SetRequired(append(path, "directory_id")...) +func (c AzureServicePrincipal) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["application_id"] = attrs["application_id"].SetRequired() + attrs["client_secret"] = attrs["client_secret"].SetRequired() + attrs["directory_id"] = attrs["directory_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureServicePrincipal. @@ -1465,7 +1481,7 @@ func (o AzureServicePrincipal) Type(ctx context.Context) attr.Type { // https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas type AzureUserDelegationSas struct { // The signed URI (SAS Token) used to access blob services for a given path - SasToken types.String `tfsdk:"sas_token" tf:"optional"` + SasToken types.String `tfsdk:"sas_token"` } func (newState *AzureUserDelegationSas) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureUserDelegationSas) { @@ -1474,9 +1490,10 @@ func (newState *AzureUserDelegationSas) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *AzureUserDelegationSas) SyncEffectiveFieldsDuringRead(existingState AzureUserDelegationSas) { } -func (c AzureUserDelegationSas) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AzureUserDelegationSas) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sas_token"] = attrs["sas_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureUserDelegationSas. @@ -1585,58 +1602,58 @@ type CatalogInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The type of the catalog. - CatalogType types.String `tfsdk:"catalog_type" tf:"optional"` + CatalogType types.String `tfsdk:"catalog_type"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the connection to an external data source. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Time at which this catalog was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of catalog creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - EffectivePredictiveOptimizationFlag types.Object `tfsdk:"effective_predictive_optimization_flag" tf:"optional,object"` + EffectivePredictiveOptimizationFlag types.Object `tfsdk:"effective_predictive_optimization_flag"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // The full name of the catalog. Corresponds with the name field. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of catalog. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:"optional"` + Options types.Map `tfsdk:"options"` // Username of current owner of catalog. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // The name of delta sharing provider. // // A Delta Sharing catalog is a catalog that is based on a Delta share on a // remote sharing server. - ProviderName types.String `tfsdk:"provider_name" tf:"optional"` + ProviderName types.String `tfsdk:"provider_name"` // Status of an asynchronously provisioned resource. - ProvisioningInfo types.Object `tfsdk:"provisioning_info" tf:"optional,object"` + ProvisioningInfo types.Object `tfsdk:"provisioning_info"` // Kind of catalog securable. - SecurableKind types.String `tfsdk:"securable_kind" tf:"optional"` + SecurableKind types.String `tfsdk:"securable_kind"` - SecurableType types.String `tfsdk:"securable_type" tf:"optional"` + SecurableType types.String `tfsdk:"securable_type"` // The name of the share under the share provider. - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` // Storage Location URL (full path) for managed tables within catalog. - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for managed tables within catalog. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Time at which this catalog was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified catalog. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *CatalogInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CatalogInfo) { @@ -1645,11 +1662,33 @@ func (newState *CatalogInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Catalo func (newState *CatalogInfo) SyncEffectiveFieldsDuringRead(existingState CatalogInfo) { } -func (c CatalogInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePredictiveOptimizationFlag{}.ApplySchemaCustomizations(cs, append(path, "effective_predictive_optimization_flag")...) - ProvisioningInfo{}.ApplySchemaCustomizations(cs, append(path, "provisioning_info")...) - - return cs +func (c CatalogInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_type"] = attrs["catalog_type"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["provider_name"] = attrs["provider_name"].SetOptional() + attrs["provisioning_info"] = attrs["provisioning_info"].SetOptional() + attrs["securable_kind"] = attrs["securable_kind"].SetOptional() + attrs["securable_type"] = attrs["securable_type"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CatalogInfo. @@ -1848,11 +1887,11 @@ func (o *CatalogInfo) SetProvisioningInfo(ctx context.Context, v ProvisioningInf type CloudflareApiToken struct { // The Cloudflare access key id of the token. - AccessKeyId types.String `tfsdk:"access_key_id" tf:""` + AccessKeyId types.String `tfsdk:"access_key_id"` // The account id associated with the API token. - AccountId types.String `tfsdk:"account_id" tf:""` + AccountId types.String `tfsdk:"account_id"` // The secret access token generated for the access key id - SecretAccessKey types.String `tfsdk:"secret_access_key" tf:""` + SecretAccessKey types.String `tfsdk:"secret_access_key"` } func (newState *CloudflareApiToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloudflareApiToken) { @@ -1861,12 +1900,12 @@ func (newState *CloudflareApiToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CloudflareApiToken) SyncEffectiveFieldsDuringRead(existingState CloudflareApiToken) { } -func (c CloudflareApiToken) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_key_id")...) - cs.SetRequired(append(path, "account_id")...) - cs.SetRequired(append(path, "secret_access_key")...) +func (c CloudflareApiToken) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_key_id"] = attrs["access_key_id"].SetRequired() + attrs["account_id"] = attrs["account_id"].SetRequired() + attrs["secret_access_key"] = attrs["secret_access_key"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloudflareApiToken. @@ -1906,29 +1945,29 @@ func (o CloudflareApiToken) Type(ctx context.Context) attr.Type { type ColumnInfo struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - Mask types.Object `tfsdk:"mask" tf:"optional,object"` + Mask types.Object `tfsdk:"mask"` // Name of Column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether field may be Null (default: true). - Nullable types.Bool `tfsdk:"nullable" tf:"optional"` + Nullable types.Bool `tfsdk:"nullable"` // Partition index for column. - PartitionIndex types.Int64 `tfsdk:"partition_index" tf:"optional"` + PartitionIndex types.Int64 `tfsdk:"partition_index"` // Ordinal position of column (starting at position 0). - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // Format of IntervalType. - TypeIntervalType types.String `tfsdk:"type_interval_type" tf:"optional"` + TypeIntervalType types.String `tfsdk:"type_interval_type"` // Full data type specification, JSON-serialized. - TypeJson types.String `tfsdk:"type_json" tf:"optional"` + TypeJson types.String `tfsdk:"type_json"` - TypeName types.String `tfsdk:"type_name" tf:"optional"` + TypeName types.String `tfsdk:"type_name"` // Digits of precision; required for DecimalTypes. - TypePrecision types.Int64 `tfsdk:"type_precision" tf:"optional"` + TypePrecision types.Int64 `tfsdk:"type_precision"` // Digits to right of decimal; Required for DecimalTypes. - TypeScale types.Int64 `tfsdk:"type_scale" tf:"optional"` + TypeScale types.Int64 `tfsdk:"type_scale"` // Full data type specification as SQL/catalogString text. - TypeText types.String `tfsdk:"type_text" tf:"optional"` + TypeText types.String `tfsdk:"type_text"` } func (newState *ColumnInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnInfo) { @@ -1937,10 +1976,21 @@ func (newState *ColumnInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnI func (newState *ColumnInfo) SyncEffectiveFieldsDuringRead(existingState ColumnInfo) { } -func (c ColumnInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnMask{}.ApplySchemaCustomizations(cs, append(path, "mask")...) +func (c ColumnInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["mask"] = attrs["mask"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["nullable"] = attrs["nullable"].SetOptional() + attrs["partition_index"] = attrs["partition_index"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["type_interval_type"] = attrs["type_interval_type"].SetOptional() + attrs["type_json"] = attrs["type_json"].SetOptional() + attrs["type_name"] = attrs["type_name"].SetOptional() + attrs["type_precision"] = attrs["type_precision"].SetOptional() + attrs["type_scale"] = attrs["type_scale"].SetOptional() + attrs["type_text"] = attrs["type_text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnInfo. @@ -2028,12 +2078,12 @@ func (o *ColumnInfo) SetMask(ctx context.Context, v ColumnMask) { type ColumnMask struct { // The full name of the column mask SQL UDF. - FunctionName types.String `tfsdk:"function_name" tf:"optional"` + FunctionName types.String `tfsdk:"function_name"` // The list of additional table columns to be passed as input to the column // mask function. The first arg of the mask function should be of the type // of the column being masked and the types of the rest of the args should // match the types of columns in 'using_column_names'. - UsingColumnNames types.List `tfsdk:"using_column_names" tf:"optional"` + UsingColumnNames types.List `tfsdk:"using_column_names"` } func (newState *ColumnMask) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnMask) { @@ -2042,9 +2092,11 @@ func (newState *ColumnMask) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnM func (newState *ColumnMask) SyncEffectiveFieldsDuringRead(existingState ColumnMask) { } -func (c ColumnMask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ColumnMask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_name"] = attrs["function_name"].SetOptional() + attrs["using_column_names"] = attrs["using_column_names"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnMask. @@ -2112,44 +2164,44 @@ func (o *ColumnMask) SetUsingColumnNames(ctx context.Context, v []types.String) type ConnectionInfo struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Unique identifier of the Connection. - ConnectionId types.String `tfsdk:"connection_id" tf:"optional"` + ConnectionId types.String `tfsdk:"connection_id"` // The type of connection. - ConnectionType types.String `tfsdk:"connection_type" tf:"optional"` + ConnectionType types.String `tfsdk:"connection_type"` // Time at which this connection was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of connection creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The type of credential. - CredentialType types.String `tfsdk:"credential_type" tf:"optional"` + CredentialType types.String `tfsdk:"credential_type"` // Full name of connection. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of the connection. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:"optional"` + Options types.Map `tfsdk:"options"` // Username of current owner of the connection. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // An object containing map of key-value properties attached to the // connection. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // Status of an asynchronously provisioned resource. - ProvisioningInfo types.Object `tfsdk:"provisioning_info" tf:"optional,object"` + ProvisioningInfo types.Object `tfsdk:"provisioning_info"` // If the connection is read only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Kind of connection securable. - SecurableKind types.String `tfsdk:"securable_kind" tf:"optional"` + SecurableKind types.String `tfsdk:"securable_kind"` - SecurableType types.String `tfsdk:"securable_type" tf:"optional"` + SecurableType types.String `tfsdk:"securable_type"` // Time at which this connection was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified connection. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // URL of the remote data source, extracted from options. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ConnectionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ConnectionInfo) { @@ -2158,10 +2210,28 @@ func (newState *ConnectionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Con func (newState *ConnectionInfo) SyncEffectiveFieldsDuringRead(existingState ConnectionInfo) { } -func (c ConnectionInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProvisioningInfo{}.ApplySchemaCustomizations(cs, append(path, "provisioning_info")...) - - return cs +func (c ConnectionInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_id"] = attrs["connection_id"].SetOptional() + attrs["connection_type"] = attrs["connection_type"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["credential_type"] = attrs["credential_type"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["provisioning_info"] = attrs["provisioning_info"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["securable_kind"] = attrs["securable_kind"].SetOptional() + attrs["securable_type"] = attrs["securable_type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ConnectionInfo. @@ -2323,14 +2393,14 @@ func (o *ConnectionInfo) SetProvisioningInfo(ctx context.Context, v Provisioning // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. type ContinuousUpdateStatus struct { // Progress of the initial data synchronization. - InitialPipelineSyncProgress types.Object `tfsdk:"initial_pipeline_sync_progress" tf:"optional,object"` + InitialPipelineSyncProgress types.Object `tfsdk:"initial_pipeline_sync_progress"` // The last source table Delta version that was synced to the online table. // Note that this Delta version may not be completely synced to the online // table yet. - LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version" tf:"optional"` + LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version"` // The timestamp of the last time any data was synchronized from the source // table to the online table. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` } func (newState *ContinuousUpdateStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ContinuousUpdateStatus) { @@ -2339,10 +2409,12 @@ func (newState *ContinuousUpdateStatus) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ContinuousUpdateStatus) SyncEffectiveFieldsDuringRead(existingState ContinuousUpdateStatus) { } -func (c ContinuousUpdateStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineProgress{}.ApplySchemaCustomizations(cs, append(path, "initial_pipeline_sync_progress")...) +func (c ContinuousUpdateStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["initial_pipeline_sync_progress"] = attrs["initial_pipeline_sync_progress"].SetOptional() + attrs["last_processed_commit_version"] = attrs["last_processed_commit_version"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ContinuousUpdateStatus. @@ -2412,24 +2484,24 @@ func (o *ContinuousUpdateStatus) SetInitialPipelineSyncProgress(ctx context.Cont type CreateCatalog struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the connection to an external data source. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Name of catalog. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:"optional"` + Options types.Map `tfsdk:"options"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // The name of delta sharing provider. // // A Delta Sharing catalog is a catalog that is based on a Delta share on a // remote sharing server. - ProviderName types.String `tfsdk:"provider_name" tf:"optional"` + ProviderName types.String `tfsdk:"provider_name"` // The name of the share under the share provider. - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` // Storage root URL for managed tables within catalog. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateCatalog) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCatalog) { @@ -2438,10 +2510,17 @@ func (newState *CreateCatalog) SyncEffectiveFieldsDuringCreateOrUpdate(plan Crea func (newState *CreateCatalog) SyncEffectiveFieldsDuringRead(existingState CreateCatalog) { } -func (c CreateCatalog) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c CreateCatalog) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["provider_name"] = attrs["provider_name"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCatalog. @@ -2550,18 +2629,18 @@ func (o *CreateCatalog) SetProperties(ctx context.Context, v map[string]types.St type CreateConnection struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The type of connection. - ConnectionType types.String `tfsdk:"connection_type" tf:""` + ConnectionType types.String `tfsdk:"connection_type"` // Name of the connection. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:""` + Options types.Map `tfsdk:"options"` // An object containing map of key-value properties attached to the // connection. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // If the connection is read only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` } func (newState *CreateConnection) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateConnection) { @@ -2570,12 +2649,15 @@ func (newState *CreateConnection) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *CreateConnection) SyncEffectiveFieldsDuringRead(existingState CreateConnection) { } -func (c CreateConnection) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "connection_type")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) +func (c CreateConnection) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["connection_type"] = attrs["connection_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateConnection. @@ -2680,28 +2762,28 @@ func (o *CreateConnection) SetProperties(ctx context.Context, v map[string]types type CreateCredentialRequest struct { // The AWS IAM role configuration - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // The credential name. The name must be unique among storage and service // credentials within the metastore. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Indicates the purpose of the credential. - Purpose types.String `tfsdk:"purpose" tf:"optional"` + Purpose types.String `tfsdk:"purpose"` // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Optional. Supplying true to this argument skips validation of the created // set of credentials. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *CreateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialRequest) { @@ -2710,14 +2792,18 @@ func (newState *CreateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateCredentialRequest) SyncEffectiveFieldsDuringRead(existingState CreateCredentialRequest) { } -func (c CreateCredentialRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - DatabricksGcpServiceAccount{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name")...) +func (c CreateCredentialRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["purpose"] = attrs["purpose"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialRequest. @@ -2886,26 +2972,26 @@ func (o *CreateCredentialRequest) SetDatabricksGcpServiceAccount(ctx context.Con type CreateExternalLocation struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the storage credential used with this location. - CredentialName types.String `tfsdk:"credential_name" tf:""` + CredentialName types.String `tfsdk:"credential_name"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.Object `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.Object `tfsdk:"encryption_details"` // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback types.Bool `tfsdk:"fallback" tf:"optional"` + Fallback types.Bool `tfsdk:"fallback"` // Name of the external location. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Indicates whether the external location is read-only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Skips validation of the storage credential associated with the external // location. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` // Path URL of the external location. - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` } func (newState *CreateExternalLocation) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExternalLocation) { @@ -2914,13 +3000,18 @@ func (newState *CreateExternalLocation) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateExternalLocation) SyncEffectiveFieldsDuringRead(existingState CreateExternalLocation) { } -func (c CreateExternalLocation) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_name")...) - EncryptionDetails{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "url")...) +func (c CreateExternalLocation) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetRequired() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["fallback"] = attrs["fallback"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExternalLocation. @@ -3002,51 +3093,51 @@ func (o *CreateExternalLocation) SetEncryptionDetails(ctx context.Context, v Enc type CreateFunction struct { // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Scalar function return data type. - DataType types.String `tfsdk:"data_type" tf:""` + DataType types.String `tfsdk:"data_type"` // External function language. - ExternalLanguage types.String `tfsdk:"external_language" tf:"optional"` + ExternalLanguage types.String `tfsdk:"external_language"` // External function name. - ExternalName types.String `tfsdk:"external_name" tf:"optional"` + ExternalName types.String `tfsdk:"external_name"` // Pretty printed function data type. - FullDataType types.String `tfsdk:"full_data_type" tf:""` + FullDataType types.String `tfsdk:"full_data_type"` - InputParams types.Object `tfsdk:"input_params" tf:"object"` + InputParams types.Object `tfsdk:"input_params"` // Whether the function is deterministic. - IsDeterministic types.Bool `tfsdk:"is_deterministic" tf:""` + IsDeterministic types.Bool `tfsdk:"is_deterministic"` // Function null call. - IsNullCall types.Bool `tfsdk:"is_null_call" tf:""` + IsNullCall types.Bool `tfsdk:"is_null_call"` // Name of function, relative to parent schema. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Function parameter style. **S** is the value for SQL. - ParameterStyle types.String `tfsdk:"parameter_style" tf:""` + ParameterStyle types.String `tfsdk:"parameter_style"` // JSON-serialized key-value pair map, encoded (escaped) as a string. - Properties types.String `tfsdk:"properties" tf:"optional"` + Properties types.String `tfsdk:"properties"` // Table function return parameters. - ReturnParams types.Object `tfsdk:"return_params" tf:"optional,object"` + ReturnParams types.Object `tfsdk:"return_params"` // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return // type is not supported), and the __sql_data_access__ field must be // **NO_SQL**. - RoutineBody types.String `tfsdk:"routine_body" tf:""` + RoutineBody types.String `tfsdk:"routine_body"` // Function body. - RoutineDefinition types.String `tfsdk:"routine_definition" tf:""` + RoutineDefinition types.String `tfsdk:"routine_definition"` // Function dependencies. - RoutineDependencies types.Object `tfsdk:"routine_dependencies" tf:"optional,object"` + RoutineDependencies types.Object `tfsdk:"routine_dependencies"` // Name of parent schema relative to its parent catalog. - SchemaName types.String `tfsdk:"schema_name" tf:""` + SchemaName types.String `tfsdk:"schema_name"` // Function security type. - SecurityType types.String `tfsdk:"security_type" tf:""` + SecurityType types.String `tfsdk:"security_type"` // Specific name of the function; Reserved for future use. - SpecificName types.String `tfsdk:"specific_name" tf:""` + SpecificName types.String `tfsdk:"specific_name"` // Function SQL data access. - SqlDataAccess types.String `tfsdk:"sql_data_access" tf:""` + SqlDataAccess types.String `tfsdk:"sql_data_access"` // List of schemes whose objects can be referenced without qualification. - SqlPath types.String `tfsdk:"sql_path" tf:"optional"` + SqlPath types.String `tfsdk:"sql_path"` } func (newState *CreateFunction) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFunction) { @@ -3055,26 +3146,30 @@ func (newState *CreateFunction) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CreateFunction) SyncEffectiveFieldsDuringRead(existingState CreateFunction) { } -func (c CreateFunction) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "data_type")...) - cs.SetRequired(append(path, "full_data_type")...) - cs.SetRequired(append(path, "input_params")...) - FunctionParameterInfos{}.ApplySchemaCustomizations(cs, append(path, "input_params")...) - cs.SetRequired(append(path, "is_deterministic")...) - cs.SetRequired(append(path, "is_null_call")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "parameter_style")...) - FunctionParameterInfos{}.ApplySchemaCustomizations(cs, append(path, "return_params")...) - cs.SetRequired(append(path, "routine_body")...) - cs.SetRequired(append(path, "routine_definition")...) - DependencyList{}.ApplySchemaCustomizations(cs, append(path, "routine_dependencies")...) - cs.SetRequired(append(path, "schema_name")...) - cs.SetRequired(append(path, "security_type")...) - cs.SetRequired(append(path, "specific_name")...) - cs.SetRequired(append(path, "sql_data_access")...) - - return cs +func (c CreateFunction) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["data_type"] = attrs["data_type"].SetRequired() + attrs["external_language"] = attrs["external_language"].SetOptional() + attrs["external_name"] = attrs["external_name"].SetOptional() + attrs["full_data_type"] = attrs["full_data_type"].SetRequired() + attrs["input_params"] = attrs["input_params"].SetRequired() + attrs["is_deterministic"] = attrs["is_deterministic"].SetRequired() + attrs["is_null_call"] = attrs["is_null_call"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["parameter_style"] = attrs["parameter_style"].SetRequired() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["return_params"] = attrs["return_params"].SetOptional() + attrs["routine_body"] = attrs["routine_body"].SetRequired() + attrs["routine_definition"] = attrs["routine_definition"].SetRequired() + attrs["routine_dependencies"] = attrs["routine_dependencies"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["security_type"] = attrs["security_type"].SetRequired() + attrs["specific_name"] = attrs["specific_name"].SetRequired() + attrs["sql_data_access"] = attrs["sql_data_access"].SetRequired() + attrs["sql_path"] = attrs["sql_path"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFunction. @@ -3238,7 +3333,7 @@ func (o *CreateFunction) SetRoutineDependencies(ctx context.Context, v Dependenc type CreateFunctionRequest struct { // Partial __FunctionInfo__ specifying the function to be created. - FunctionInfo types.Object `tfsdk:"function_info" tf:"object"` + FunctionInfo types.Object `tfsdk:"function_info"` } func (newState *CreateFunctionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFunctionRequest) { @@ -3247,11 +3342,10 @@ func (newState *CreateFunctionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateFunctionRequest) SyncEffectiveFieldsDuringRead(existingState CreateFunctionRequest) { } -func (c CreateFunctionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "function_info")...) - CreateFunction{}.ApplySchemaCustomizations(cs, append(path, "function_info")...) +func (c CreateFunctionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_info"] = attrs["function_info"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFunctionRequest. @@ -3317,14 +3411,14 @@ func (o *CreateFunctionRequest) SetFunctionInfo(ctx context.Context, v CreateFun type CreateMetastore struct { // The user-specified name of the metastore. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). // The field can be omitted in the __workspace-level__ __API__ but not in // the __account-level__ __API__. If this field is omitted, the region of // the workspace receiving the request will be used. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The storage root URL for metastore - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateMetastore) { @@ -3333,10 +3427,12 @@ func (newState *CreateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cr func (newState *CreateMetastore) SyncEffectiveFieldsDuringRead(existingState CreateMetastore) { } -func (c CreateMetastore) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c CreateMetastore) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["region"] = attrs["region"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateMetastore. @@ -3378,9 +3474,9 @@ type CreateMetastoreAssignment struct { // The name of the default catalog in the metastore. This field is // depracted. Please use "Default Namespace API" to configure the default // catalog for a Databricks workspace. - DefaultCatalogName types.String `tfsdk:"default_catalog_name" tf:""` + DefaultCatalogName types.String `tfsdk:"default_catalog_name"` // The unique ID of the metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:""` + MetastoreId types.String `tfsdk:"metastore_id"` // A workspace ID. WorkspaceId types.Int64 `tfsdk:"-"` } @@ -3391,12 +3487,12 @@ func (newState *CreateMetastoreAssignment) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateMetastoreAssignment) SyncEffectiveFieldsDuringRead(existingState CreateMetastoreAssignment) { } -func (c CreateMetastoreAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "default_catalog_name")...) - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c CreateMetastoreAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_catalog_name"] = attrs["default_catalog_name"].SetRequired() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateMetastoreAssignment. @@ -3436,43 +3532,43 @@ func (o CreateMetastoreAssignment) Type(ctx context.Context) attr.Type { type CreateMonitor struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). - AssetsDir types.String `tfsdk:"assets_dir" tf:""` + AssetsDir types.String `tfsdk:"assets_dir"` // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName types.String `tfsdk:"baseline_table_name" tf:"optional"` + BaselineTableName types.String `tfsdk:"baseline_table_name"` // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics types.List `tfsdk:"custom_metrics" tf:"optional"` + CustomMetrics types.List `tfsdk:"custom_metrics"` // The data classification config for the monitor. - DataClassificationConfig types.Object `tfsdk:"data_classification_config" tf:"optional,object"` + DataClassificationConfig types.Object `tfsdk:"data_classification_config"` // Configuration for monitoring inference logs. - InferenceLog types.Object `tfsdk:"inference_log" tf:"optional,object"` + InferenceLog types.Object `tfsdk:"inference_log"` // The notification settings for the monitor. - Notifications types.Object `tfsdk:"notifications" tf:"optional,object"` + Notifications types.Object `tfsdk:"notifications"` // Schema where output metric tables are created. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:""` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // The schedule for automatically updating and refreshing metric tables. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // Whether to skip creating a default dashboard summarizing data quality // metrics. - SkipBuiltinDashboard types.Bool `tfsdk:"skip_builtin_dashboard" tf:"optional"` + SkipBuiltinDashboard types.Bool `tfsdk:"skip_builtin_dashboard"` // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs types.List `tfsdk:"slicing_exprs" tf:"optional"` + SlicingExprs types.List `tfsdk:"slicing_exprs"` // Configuration for monitoring snapshot tables. - Snapshot types.Object `tfsdk:"snapshot" tf:"optional,object"` + Snapshot types.Object `tfsdk:"snapshot"` // Full name of the table. TableName types.String `tfsdk:"-"` // Configuration for monitoring time series tables. - TimeSeries types.Object `tfsdk:"time_series" tf:"optional,object"` + TimeSeries types.Object `tfsdk:"time_series"` // Optional argument to specify the warehouse for dashboard creation. If not // specified, the first running warehouse will be used. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *CreateMonitor) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateMonitor) { @@ -3481,19 +3577,23 @@ func (newState *CreateMonitor) SyncEffectiveFieldsDuringCreateOrUpdate(plan Crea func (newState *CreateMonitor) SyncEffectiveFieldsDuringRead(existingState CreateMonitor) { } -func (c CreateMonitor) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "assets_dir")...) - MonitorMetric{}.ApplySchemaCustomizations(cs, append(path, "custom_metrics")...) - MonitorDataClassificationConfig{}.ApplySchemaCustomizations(cs, append(path, "data_classification_config")...) - MonitorInferenceLog{}.ApplySchemaCustomizations(cs, append(path, "inference_log")...) - MonitorNotifications{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - cs.SetRequired(append(path, "output_schema_name")...) - MonitorCronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - MonitorSnapshot{}.ApplySchemaCustomizations(cs, append(path, "snapshot")...) - cs.SetRequired(append(path, "table_name")...) - MonitorTimeSeries{}.ApplySchemaCustomizations(cs, append(path, "time_series")...) +func (c CreateMonitor) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets_dir"] = attrs["assets_dir"].SetRequired() + attrs["baseline_table_name"] = attrs["baseline_table_name"].SetOptional() + attrs["custom_metrics"] = attrs["custom_metrics"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].SetOptional() + attrs["inference_log"] = attrs["inference_log"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["output_schema_name"] = attrs["output_schema_name"].SetRequired() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["skip_builtin_dashboard"] = attrs["skip_builtin_dashboard"].SetOptional() + attrs["slicing_exprs"] = attrs["slicing_exprs"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].SetOptional() + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["time_series"] = attrs["time_series"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateMonitor. @@ -3789,7 +3889,7 @@ func (o *CreateMonitor) SetTimeSeries(ctx context.Context, v MonitorTimeSeries) // Create an Online Table type CreateOnlineTableRequest struct { // Online Table information. - Table types.Object `tfsdk:"table" tf:"optional,object"` + Table types.Object `tfsdk:"table"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateOnlineTableRequest. @@ -3855,16 +3955,16 @@ func (o *CreateOnlineTableRequest) SetTable(ctx context.Context, v OnlineTable) type CreateRegisteredModelRequest struct { // The name of the catalog where the schema and the registered model reside - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the registered model - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the registered model - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The name of the schema where the registered model resides - SchemaName types.String `tfsdk:"schema_name" tf:""` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud under which model version data files // are stored - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` } func (newState *CreateRegisteredModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRegisteredModelRequest) { @@ -3873,12 +3973,14 @@ func (newState *CreateRegisteredModelRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateRegisteredModelRequest) SyncEffectiveFieldsDuringRead(existingState CreateRegisteredModelRequest) { } -func (c CreateRegisteredModelRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "schema_name")...) +func (c CreateRegisteredModelRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["storage_location"] = attrs["storage_location"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRegisteredModelRequest. @@ -3952,15 +4054,15 @@ func (o CreateResponse) Type(ctx context.Context) attr.Type { type CreateSchema struct { // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of schema, relative to parent catalog. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // Storage root URL for managed tables within schema. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateSchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateSchema) { @@ -3969,11 +4071,14 @@ func (newState *CreateSchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan Creat func (newState *CreateSchema) SyncEffectiveFieldsDuringRead(existingState CreateSchema) { } -func (c CreateSchema) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "name")...) +func (c CreateSchema) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateSchema. @@ -4047,24 +4152,24 @@ func (o *CreateSchema) SetProperties(ctx context.Context, v map[string]types.Str type CreateStorageCredential struct { // The AWS IAM role configuration. - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // The credential name. The name must be unique within the metastore. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Supplying true to this argument skips validation of the created // credential. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *CreateStorageCredential) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateStorageCredential) { @@ -4073,15 +4178,18 @@ func (newState *CreateStorageCredential) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateStorageCredential) SyncEffectiveFieldsDuringRead(existingState CreateStorageCredential) { } -func (c CreateStorageCredential) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleRequest{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityRequest{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountRequest{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name")...) +func (c CreateStorageCredential) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateStorageCredential. @@ -4281,9 +4389,9 @@ type CreateTableConstraint struct { // A table constraint, as defined by *one* of the following fields being // set: __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. - Constraint types.Object `tfsdk:"constraint" tf:"object"` + Constraint types.Object `tfsdk:"constraint"` // The full name of the table referenced by the constraint. - FullNameArg types.String `tfsdk:"full_name_arg" tf:""` + FullNameArg types.String `tfsdk:"full_name_arg"` } func (newState *CreateTableConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTableConstraint) { @@ -4292,12 +4400,11 @@ func (newState *CreateTableConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateTableConstraint) SyncEffectiveFieldsDuringRead(existingState CreateTableConstraint) { } -func (c CreateTableConstraint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "constraint")...) - TableConstraint{}.ApplySchemaCustomizations(cs, append(path, "constraint")...) - cs.SetRequired(append(path, "full_name_arg")...) +func (c CreateTableConstraint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["constraint"] = attrs["constraint"].SetRequired() + attrs["full_name_arg"] = attrs["full_name_arg"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTableConstraint. @@ -4365,17 +4472,17 @@ func (o *CreateTableConstraint) SetConstraint(ctx context.Context, v TableConstr type CreateVolumeRequestContent struct { // The name of the catalog where the schema and the volume are - CatalogName types.String `tfsdk:"catalog_name" tf:""` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the volume - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the volume - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The name of the schema where the volume is - SchemaName types.String `tfsdk:"schema_name" tf:""` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` - VolumeType types.String `tfsdk:"volume_type" tf:""` + VolumeType types.String `tfsdk:"volume_type"` } func (newState *CreateVolumeRequestContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVolumeRequestContent) { @@ -4384,13 +4491,15 @@ func (newState *CreateVolumeRequestContent) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateVolumeRequestContent) SyncEffectiveFieldsDuringRead(existingState CreateVolumeRequestContent) { } -func (c CreateVolumeRequestContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "catalog_name")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "schema_name")...) - cs.SetRequired(append(path, "volume_type")...) +func (c CreateVolumeRequestContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["volume_type"] = attrs["volume_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVolumeRequestContent. @@ -4436,47 +4545,47 @@ func (o CreateVolumeRequestContent) Type(ctx context.Context) attr.Type { type CredentialInfo struct { // The AWS IAM role configuration - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this credential was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of credential creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // The full name of the credential. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the credential. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of the parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The credential name. The name must be unique among storage and service // credentials within the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Indicates the purpose of the credential. - Purpose types.String `tfsdk:"purpose" tf:"optional"` + Purpose types.String `tfsdk:"purpose"` // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Time at which this credential was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the credential. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Whether this credential is the current metastore's root storage // credential. Only applicable when purpose is **STORAGE**. - UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage" tf:"optional"` + UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage"` } func (newState *CredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CredentialInfo) { @@ -4485,13 +4594,27 @@ func (newState *CredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CredentialInfo) SyncEffectiveFieldsDuringRead(existingState CredentialInfo) { } -func (c CredentialInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - DatabricksGcpServiceAccount{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - - return cs +func (c CredentialInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["purpose"] = attrs["purpose"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["used_for_managed_storage"] = attrs["used_for_managed_storage"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CredentialInfo. @@ -4678,9 +4801,9 @@ func (o *CredentialInfo) SetDatabricksGcpServiceAccount(ctx context.Context, v D type CredentialValidationResult struct { // Error message would exist when the result does not equal to **PASS**. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // The results of the tested operation. - Result types.String `tfsdk:"result" tf:"optional"` + Result types.String `tfsdk:"result"` } func (newState *CredentialValidationResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan CredentialValidationResult) { @@ -4689,9 +4812,11 @@ func (newState *CredentialValidationResult) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CredentialValidationResult) SyncEffectiveFieldsDuringRead(existingState CredentialValidationResult) { } -func (c CredentialValidationResult) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CredentialValidationResult) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CredentialValidationResult. @@ -4730,7 +4855,7 @@ func (o CredentialValidationResult) Type(ctx context.Context) attr.Type { // Currently assigned workspaces type CurrentWorkspaceBindings struct { // A list of workspace IDs. - Workspaces types.List `tfsdk:"workspaces" tf:"optional"` + Workspaces types.List `tfsdk:"workspaces"` } func (newState *CurrentWorkspaceBindings) SyncEffectiveFieldsDuringCreateOrUpdate(plan CurrentWorkspaceBindings) { @@ -4739,9 +4864,10 @@ func (newState *CurrentWorkspaceBindings) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CurrentWorkspaceBindings) SyncEffectiveFieldsDuringRead(existingState CurrentWorkspaceBindings) { } -func (c CurrentWorkspaceBindings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CurrentWorkspaceBindings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["workspaces"] = attrs["workspaces"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CurrentWorkspaceBindings. @@ -4812,11 +4938,11 @@ type DatabricksGcpServiceAccount struct { // field is only used to persist the credential_id once it is fetched from // the credentials manager - as we only use the protobuf serializer to store // credentials, this ID gets persisted to the database - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The email of the service account. - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` // The ID that represents the private key for this Service Account - PrivateKeyId types.String `tfsdk:"private_key_id" tf:"optional"` + PrivateKeyId types.String `tfsdk:"private_key_id"` } func (newState *DatabricksGcpServiceAccount) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatabricksGcpServiceAccount) { @@ -4825,9 +4951,12 @@ func (newState *DatabricksGcpServiceAccount) SyncEffectiveFieldsDuringCreateOrUp func (newState *DatabricksGcpServiceAccount) SyncEffectiveFieldsDuringRead(existingState DatabricksGcpServiceAccount) { } -func (c DatabricksGcpServiceAccount) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DatabricksGcpServiceAccount) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["email"] = attrs["email"].SetOptional() + attrs["private_key_id"] = attrs["private_key_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksGcpServiceAccount. @@ -4874,9 +5003,9 @@ func (newState *DatabricksGcpServiceAccountRequest) SyncEffectiveFieldsDuringCre func (newState *DatabricksGcpServiceAccountRequest) SyncEffectiveFieldsDuringRead(existingState DatabricksGcpServiceAccountRequest) { } -func (c DatabricksGcpServiceAccountRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DatabricksGcpServiceAccountRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksGcpServiceAccountRequest. @@ -4909,9 +5038,9 @@ func (o DatabricksGcpServiceAccountRequest) Type(ctx context.Context) attr.Type type DatabricksGcpServiceAccountResponse struct { // The Databricks internal ID that represents this service account. This is // an output-only field. - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // The email of the service account. This is an output-only field. - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` } func (newState *DatabricksGcpServiceAccountResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatabricksGcpServiceAccountResponse) { @@ -4920,9 +5049,11 @@ func (newState *DatabricksGcpServiceAccountResponse) SyncEffectiveFieldsDuringCr func (newState *DatabricksGcpServiceAccountResponse) SyncEffectiveFieldsDuringRead(existingState DatabricksGcpServiceAccountResponse) { } -func (c DatabricksGcpServiceAccountResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DatabricksGcpServiceAccountResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["email"] = attrs["email"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksGcpServiceAccountResponse. @@ -5287,9 +5418,9 @@ func (newState *DeleteCredentialResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *DeleteCredentialResponse) SyncEffectiveFieldsDuringRead(existingState DeleteCredentialResponse) { } -func (c DeleteCredentialResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCredentialResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCredentialResponse. @@ -5834,7 +5965,7 @@ func (o DeleteVolumeRequest) Type(ctx context.Context) attr.Type { // __TableInfo.properties__. type DeltaRuntimePropertiesKvPairs struct { // A map of key-value properties attached to the securable. - DeltaRuntimeProperties types.Map `tfsdk:"delta_runtime_properties" tf:""` + DeltaRuntimeProperties types.Map `tfsdk:"delta_runtime_properties"` } func (newState *DeltaRuntimePropertiesKvPairs) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeltaRuntimePropertiesKvPairs) { @@ -5843,10 +5974,10 @@ func (newState *DeltaRuntimePropertiesKvPairs) SyncEffectiveFieldsDuringCreateOr func (newState *DeltaRuntimePropertiesKvPairs) SyncEffectiveFieldsDuringRead(existingState DeltaRuntimePropertiesKvPairs) { } -func (c DeltaRuntimePropertiesKvPairs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "delta_runtime_properties")...) +func (c DeltaRuntimePropertiesKvPairs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["delta_runtime_properties"] = attrs["delta_runtime_properties"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeltaRuntimePropertiesKvPairs. @@ -5914,9 +6045,9 @@ func (o *DeltaRuntimePropertiesKvPairs) SetDeltaRuntimeProperties(ctx context.Co // field must be defined. type Dependency struct { // A function that is dependent on a SQL object. - Function types.Object `tfsdk:"function" tf:"optional,object"` + Function types.Object `tfsdk:"function"` // A table that is dependent on a SQL object. - Table types.Object `tfsdk:"table" tf:"optional,object"` + Table types.Object `tfsdk:"table"` } func (newState *Dependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dependency) { @@ -5925,11 +6056,11 @@ func (newState *Dependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan Depende func (newState *Dependency) SyncEffectiveFieldsDuringRead(existingState Dependency) { } -func (c Dependency) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionDependency{}.ApplySchemaCustomizations(cs, append(path, "function")...) - TableDependency{}.ApplySchemaCustomizations(cs, append(path, "table")...) +func (c Dependency) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function"] = attrs["function"].SetOptional() + attrs["table"] = attrs["table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dependency. @@ -6027,7 +6158,7 @@ func (o *Dependency) SetTable(ctx context.Context, v TableDependency) { // A list of dependencies. type DependencyList struct { // Array of dependencies. - Dependencies types.List `tfsdk:"dependencies" tf:"optional"` + Dependencies types.List `tfsdk:"dependencies"` } func (newState *DependencyList) SyncEffectiveFieldsDuringCreateOrUpdate(plan DependencyList) { @@ -6036,10 +6167,10 @@ func (newState *DependencyList) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dep func (newState *DependencyList) SyncEffectiveFieldsDuringRead(existingState DependencyList) { } -func (c DependencyList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Dependency{}.ApplySchemaCustomizations(cs, append(path, "dependencies")...) +func (c DependencyList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dependencies"] = attrs["dependencies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DependencyList. @@ -6177,7 +6308,7 @@ func (o DisableResponse) Type(ctx context.Context) attr.Type { type EffectivePermissionsList struct { // The privileges conveyed to each principal (either directly or via // inheritance) - PrivilegeAssignments types.List `tfsdk:"privilege_assignments" tf:"optional"` + PrivilegeAssignments types.List `tfsdk:"privilege_assignments"` } func (newState *EffectivePermissionsList) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePermissionsList) { @@ -6186,10 +6317,10 @@ func (newState *EffectivePermissionsList) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *EffectivePermissionsList) SyncEffectiveFieldsDuringRead(existingState EffectivePermissionsList) { } -func (c EffectivePermissionsList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePrivilegeAssignment{}.ApplySchemaCustomizations(cs, append(path, "privilege_assignments")...) +func (c EffectivePermissionsList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["privilege_assignments"] = attrs["privilege_assignments"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePermissionsList. @@ -6256,13 +6387,13 @@ func (o *EffectivePermissionsList) SetPrivilegeAssignments(ctx context.Context, type EffectivePredictiveOptimizationFlag struct { // The name of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. - InheritedFromName types.String `tfsdk:"inherited_from_name" tf:"optional"` + InheritedFromName types.String `tfsdk:"inherited_from_name"` // The type of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. - InheritedFromType types.String `tfsdk:"inherited_from_type" tf:"optional"` + InheritedFromType types.String `tfsdk:"inherited_from_type"` // Whether predictive optimization should be enabled for this object and // objects under it. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *EffectivePredictiveOptimizationFlag) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePredictiveOptimizationFlag) { @@ -6271,10 +6402,12 @@ func (newState *EffectivePredictiveOptimizationFlag) SyncEffectiveFieldsDuringCr func (newState *EffectivePredictiveOptimizationFlag) SyncEffectiveFieldsDuringRead(existingState EffectivePredictiveOptimizationFlag) { } -func (c EffectivePredictiveOptimizationFlag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "value")...) +func (c EffectivePredictiveOptimizationFlag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited_from_name"] = attrs["inherited_from_name"].SetOptional() + attrs["inherited_from_type"] = attrs["inherited_from_type"].SetOptional() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePredictiveOptimizationFlag. @@ -6316,13 +6449,13 @@ type EffectivePrivilege struct { // The full name of the object that conveys this privilege via inheritance. // This field is omitted when privilege is not inherited (it's assigned to // the securable itself). - InheritedFromName types.String `tfsdk:"inherited_from_name" tf:"optional"` + InheritedFromName types.String `tfsdk:"inherited_from_name"` // The type of the object that conveys this privilege via inheritance. This // field is omitted when privilege is not inherited (it's assigned to the // securable itself). - InheritedFromType types.String `tfsdk:"inherited_from_type" tf:"optional"` + InheritedFromType types.String `tfsdk:"inherited_from_type"` // The privilege assigned to the principal. - Privilege types.String `tfsdk:"privilege" tf:"optional"` + Privilege types.String `tfsdk:"privilege"` } func (newState *EffectivePrivilege) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePrivilege) { @@ -6331,9 +6464,12 @@ func (newState *EffectivePrivilege) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EffectivePrivilege) SyncEffectiveFieldsDuringRead(existingState EffectivePrivilege) { } -func (c EffectivePrivilege) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EffectivePrivilege) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited_from_name"] = attrs["inherited_from_name"].SetOptional() + attrs["inherited_from_type"] = attrs["inherited_from_type"].SetOptional() + attrs["privilege"] = attrs["privilege"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePrivilege. @@ -6373,10 +6509,10 @@ func (o EffectivePrivilege) Type(ctx context.Context) attr.Type { type EffectivePrivilegeAssignment struct { // The principal (user email address or group name). - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The privileges conveyed to the principal (either directly or via // inheritance). - Privileges types.List `tfsdk:"privileges" tf:"optional"` + Privileges types.List `tfsdk:"privileges"` } func (newState *EffectivePrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan EffectivePrivilegeAssignment) { @@ -6385,10 +6521,11 @@ func (newState *EffectivePrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrU func (newState *EffectivePrivilegeAssignment) SyncEffectiveFieldsDuringRead(existingState EffectivePrivilegeAssignment) { } -func (c EffectivePrivilegeAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePrivilege{}.ApplySchemaCustomizations(cs, append(path, "privileges")...) +func (c EffectivePrivilegeAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetOptional() + attrs["privileges"] = attrs["privileges"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EffectivePrivilegeAssignment. @@ -6528,7 +6665,7 @@ func (o EnableResponse) Type(ctx context.Context) attr.Type { // Encryption options that apply to clients connecting to cloud storage. type EncryptionDetails struct { // Server-Side Encryption properties for clients communicating with AWS s3. - SseEncryptionDetails types.Object `tfsdk:"sse_encryption_details" tf:"optional,object"` + SseEncryptionDetails types.Object `tfsdk:"sse_encryption_details"` } func (newState *EncryptionDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan EncryptionDetails) { @@ -6537,10 +6674,10 @@ func (newState *EncryptionDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EncryptionDetails) SyncEffectiveFieldsDuringRead(existingState EncryptionDetails) { } -func (c EncryptionDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SseEncryptionDetails{}.ApplySchemaCustomizations(cs, append(path, "sse_encryption_details")...) +func (c EncryptionDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sse_encryption_details"] = attrs["sse_encryption_details"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EncryptionDetails. @@ -6643,44 +6780,44 @@ func (o ExistsRequest) Type(ctx context.Context) attr.Type { type ExternalLocationInfo struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this external location was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of external location creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique ID of the location's storage credential. - CredentialId types.String `tfsdk:"credential_id" tf:"optional"` + CredentialId types.String `tfsdk:"credential_id"` // Name of the storage credential used with this location. - CredentialName types.String `tfsdk:"credential_name" tf:"optional"` + CredentialName types.String `tfsdk:"credential_name"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.Object `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.Object `tfsdk:"encryption_details"` // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback types.Bool `tfsdk:"fallback" tf:"optional"` + Fallback types.Bool `tfsdk:"fallback"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of metastore hosting the external location. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of the external location. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The owner of the external location. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Indicates whether the external location is read-only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Time at which external location this was last modified, in epoch // milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the external location. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Path URL of the external location. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ExternalLocationInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalLocationInfo) { @@ -6689,10 +6826,26 @@ func (newState *ExternalLocationInfo) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ExternalLocationInfo) SyncEffectiveFieldsDuringRead(existingState ExternalLocationInfo) { } -func (c ExternalLocationInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EncryptionDetails{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - - return cs +func (c ExternalLocationInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["credential_id"] = attrs["credential_id"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["fallback"] = attrs["fallback"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalLocationInfo. @@ -6795,11 +6948,11 @@ type FailedStatus struct { // Note that this Delta version may only be partially synced to the online // table. Only populated if the table is still online and available for // serving. - LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version" tf:"optional"` + LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version"` // The timestamp of the last time any data was synchronized from the source // table to the online table. Only populated if the table is still online // and available for serving. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` } func (newState *FailedStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan FailedStatus) { @@ -6808,9 +6961,11 @@ func (newState *FailedStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan Faile func (newState *FailedStatus) SyncEffectiveFieldsDuringRead(existingState FailedStatus) { } -func (c FailedStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FailedStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_processed_commit_version"] = attrs["last_processed_commit_version"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FailedStatus. @@ -6848,13 +7003,13 @@ func (o FailedStatus) Type(ctx context.Context) attr.Type { type ForeignKeyConstraint struct { // Column names for this constraint. - ChildColumns types.List `tfsdk:"child_columns" tf:""` + ChildColumns types.List `tfsdk:"child_columns"` // The name of the constraint. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Column names for this constraint. - ParentColumns types.List `tfsdk:"parent_columns" tf:""` + ParentColumns types.List `tfsdk:"parent_columns"` // The full name of the parent constraint. - ParentTable types.String `tfsdk:"parent_table" tf:""` + ParentTable types.String `tfsdk:"parent_table"` } func (newState *ForeignKeyConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForeignKeyConstraint) { @@ -6863,13 +7018,13 @@ func (newState *ForeignKeyConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ForeignKeyConstraint) SyncEffectiveFieldsDuringRead(existingState ForeignKeyConstraint) { } -func (c ForeignKeyConstraint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "child_columns")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "parent_columns")...) - cs.SetRequired(append(path, "parent_table")...) +func (c ForeignKeyConstraint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["child_columns"] = attrs["child_columns"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["parent_columns"] = attrs["parent_columns"].SetRequired() + attrs["parent_table"] = attrs["parent_table"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForeignKeyConstraint. @@ -6972,7 +7127,7 @@ func (o *ForeignKeyConstraint) SetParentColumns(ctx context.Context, v []types.S type FunctionDependency struct { // Full name of the dependent function, in the form of // __catalog_name__.__schema_name__.__function_name__. - FunctionFullName types.String `tfsdk:"function_full_name" tf:""` + FunctionFullName types.String `tfsdk:"function_full_name"` } func (newState *FunctionDependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionDependency) { @@ -6981,10 +7136,10 @@ func (newState *FunctionDependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *FunctionDependency) SyncEffectiveFieldsDuringRead(existingState FunctionDependency) { } -func (c FunctionDependency) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "function_full_name")...) +func (c FunctionDependency) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_full_name"] = attrs["function_full_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionDependency. @@ -7022,70 +7177,70 @@ type FunctionInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this function was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of function creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Scalar function return data type. - DataType types.String `tfsdk:"data_type" tf:"optional"` + DataType types.String `tfsdk:"data_type"` // External function language. - ExternalLanguage types.String `tfsdk:"external_language" tf:"optional"` + ExternalLanguage types.String `tfsdk:"external_language"` // External function name. - ExternalName types.String `tfsdk:"external_name" tf:"optional"` + ExternalName types.String `tfsdk:"external_name"` // Pretty printed function data type. - FullDataType types.String `tfsdk:"full_data_type" tf:"optional"` + FullDataType types.String `tfsdk:"full_data_type"` // Full name of function, in form of // __catalog_name__.__schema_name__.__function__name__ - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Id of Function, relative to parent schema. - FunctionId types.String `tfsdk:"function_id" tf:"optional"` + FunctionId types.String `tfsdk:"function_id"` - InputParams types.Object `tfsdk:"input_params" tf:"optional,object"` + InputParams types.Object `tfsdk:"input_params"` // Whether the function is deterministic. - IsDeterministic types.Bool `tfsdk:"is_deterministic" tf:"optional"` + IsDeterministic types.Bool `tfsdk:"is_deterministic"` // Function null call. - IsNullCall types.Bool `tfsdk:"is_null_call" tf:"optional"` + IsNullCall types.Bool `tfsdk:"is_null_call"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of function, relative to parent schema. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of function. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Function parameter style. **S** is the value for SQL. - ParameterStyle types.String `tfsdk:"parameter_style" tf:"optional"` + ParameterStyle types.String `tfsdk:"parameter_style"` // JSON-serialized key-value pair map, encoded (escaped) as a string. - Properties types.String `tfsdk:"properties" tf:"optional"` + Properties types.String `tfsdk:"properties"` // Table function return parameters. - ReturnParams types.Object `tfsdk:"return_params" tf:"optional,object"` + ReturnParams types.Object `tfsdk:"return_params"` // Function language. When **EXTERNAL** is used, the language of the routine // function should be specified in the __external_language__ field, and the // __return_params__ of the function cannot be used (as **TABLE** return // type is not supported), and the __sql_data_access__ field must be // **NO_SQL**. - RoutineBody types.String `tfsdk:"routine_body" tf:"optional"` + RoutineBody types.String `tfsdk:"routine_body"` // Function body. - RoutineDefinition types.String `tfsdk:"routine_definition" tf:"optional"` + RoutineDefinition types.String `tfsdk:"routine_definition"` // Function dependencies. - RoutineDependencies types.Object `tfsdk:"routine_dependencies" tf:"optional,object"` + RoutineDependencies types.Object `tfsdk:"routine_dependencies"` // Name of parent schema relative to its parent catalog. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // Function security type. - SecurityType types.String `tfsdk:"security_type" tf:"optional"` + SecurityType types.String `tfsdk:"security_type"` // Specific name of the function; Reserved for future use. - SpecificName types.String `tfsdk:"specific_name" tf:"optional"` + SpecificName types.String `tfsdk:"specific_name"` // Function SQL data access. - SqlDataAccess types.String `tfsdk:"sql_data_access" tf:"optional"` + SqlDataAccess types.String `tfsdk:"sql_data_access"` // List of schemes whose objects can be referenced without qualification. - SqlPath types.String `tfsdk:"sql_path" tf:"optional"` + SqlPath types.String `tfsdk:"sql_path"` // Time at which this function was created, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified function. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *FunctionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionInfo) { @@ -7094,12 +7249,39 @@ func (newState *FunctionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Funct func (newState *FunctionInfo) SyncEffectiveFieldsDuringRead(existingState FunctionInfo) { } -func (c FunctionInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionParameterInfos{}.ApplySchemaCustomizations(cs, append(path, "input_params")...) - FunctionParameterInfos{}.ApplySchemaCustomizations(cs, append(path, "return_params")...) - DependencyList{}.ApplySchemaCustomizations(cs, append(path, "routine_dependencies")...) - - return cs +func (c FunctionInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_type"] = attrs["data_type"].SetOptional() + attrs["external_language"] = attrs["external_language"].SetOptional() + attrs["external_name"] = attrs["external_name"].SetOptional() + attrs["full_data_type"] = attrs["full_data_type"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["function_id"] = attrs["function_id"].SetOptional() + attrs["input_params"] = attrs["input_params"].SetOptional() + attrs["is_deterministic"] = attrs["is_deterministic"].SetOptional() + attrs["is_null_call"] = attrs["is_null_call"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["parameter_style"] = attrs["parameter_style"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["return_params"] = attrs["return_params"].SetOptional() + attrs["routine_body"] = attrs["routine_body"].SetOptional() + attrs["routine_definition"] = attrs["routine_definition"].SetOptional() + attrs["routine_dependencies"] = attrs["routine_dependencies"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["security_type"] = attrs["security_type"].SetOptional() + attrs["specific_name"] = attrs["specific_name"].SetOptional() + attrs["sql_data_access"] = attrs["sql_data_access"].SetOptional() + attrs["sql_path"] = attrs["sql_path"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionInfo. @@ -7281,29 +7463,29 @@ func (o *FunctionInfo) SetRoutineDependencies(ctx context.Context, v DependencyL type FunctionParameterInfo struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of parameter. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Default value of the parameter. - ParameterDefault types.String `tfsdk:"parameter_default" tf:"optional"` + ParameterDefault types.String `tfsdk:"parameter_default"` // The mode of the function parameter. - ParameterMode types.String `tfsdk:"parameter_mode" tf:"optional"` + ParameterMode types.String `tfsdk:"parameter_mode"` // The type of function parameter. - ParameterType types.String `tfsdk:"parameter_type" tf:"optional"` + ParameterType types.String `tfsdk:"parameter_type"` // Ordinal position of column (starting at position 0). - Position types.Int64 `tfsdk:"position" tf:""` + Position types.Int64 `tfsdk:"position"` // Format of IntervalType. - TypeIntervalType types.String `tfsdk:"type_interval_type" tf:"optional"` + TypeIntervalType types.String `tfsdk:"type_interval_type"` // Full data type spec, JSON-serialized. - TypeJson types.String `tfsdk:"type_json" tf:"optional"` + TypeJson types.String `tfsdk:"type_json"` - TypeName types.String `tfsdk:"type_name" tf:""` + TypeName types.String `tfsdk:"type_name"` // Digits of precision; required on Create for DecimalTypes. - TypePrecision types.Int64 `tfsdk:"type_precision" tf:"optional"` + TypePrecision types.Int64 `tfsdk:"type_precision"` // Digits to right of decimal; Required on Create for DecimalTypes. - TypeScale types.Int64 `tfsdk:"type_scale" tf:"optional"` + TypeScale types.Int64 `tfsdk:"type_scale"` // Full data type spec, SQL/catalogString text. - TypeText types.String `tfsdk:"type_text" tf:""` + TypeText types.String `tfsdk:"type_text"` } func (newState *FunctionParameterInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionParameterInfo) { @@ -7312,13 +7494,21 @@ func (newState *FunctionParameterInfo) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *FunctionParameterInfo) SyncEffectiveFieldsDuringRead(existingState FunctionParameterInfo) { } -func (c FunctionParameterInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "position")...) - cs.SetRequired(append(path, "type_name")...) - cs.SetRequired(append(path, "type_text")...) +func (c FunctionParameterInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["parameter_default"] = attrs["parameter_default"].SetOptional() + attrs["parameter_mode"] = attrs["parameter_mode"].SetOptional() + attrs["parameter_type"] = attrs["parameter_type"].SetOptional() + attrs["position"] = attrs["position"].SetRequired() + attrs["type_interval_type"] = attrs["type_interval_type"].SetOptional() + attrs["type_json"] = attrs["type_json"].SetOptional() + attrs["type_name"] = attrs["type_name"].SetRequired() + attrs["type_precision"] = attrs["type_precision"].SetOptional() + attrs["type_scale"] = attrs["type_scale"].SetOptional() + attrs["type_text"] = attrs["type_text"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionParameterInfo. @@ -7377,7 +7567,7 @@ func (o FunctionParameterInfo) Type(ctx context.Context) attr.Type { type FunctionParameterInfos struct { // The array of __FunctionParameterInfo__ definitions of the function's // parameters. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *FunctionParameterInfos) SyncEffectiveFieldsDuringCreateOrUpdate(plan FunctionParameterInfos) { @@ -7386,10 +7576,10 @@ func (newState *FunctionParameterInfos) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *FunctionParameterInfos) SyncEffectiveFieldsDuringRead(existingState FunctionParameterInfos) { } -func (c FunctionParameterInfos) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionParameterInfo{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c FunctionParameterInfos) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FunctionParameterInfos. @@ -7456,7 +7646,7 @@ func (o *FunctionParameterInfos) SetParameters(ctx context.Context, v []Function // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account type GcpOauthToken struct { - OauthToken types.String `tfsdk:"oauth_token" tf:"optional"` + OauthToken types.String `tfsdk:"oauth_token"` } func (newState *GcpOauthToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpOauthToken) { @@ -7465,9 +7655,10 @@ func (newState *GcpOauthToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpO func (newState *GcpOauthToken) SyncEffectiveFieldsDuringRead(existingState GcpOauthToken) { } -func (c GcpOauthToken) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GcpOauthToken) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["oauth_token"] = attrs["oauth_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpOauthToken. @@ -7506,7 +7697,7 @@ type GenerateTemporaryServiceCredentialAzureOptions struct { // The resources to which the temporary Azure credential should apply. These // resources are the scopes that are passed to the token provider (see // https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential?view=azure-python) - Resources types.List `tfsdk:"resources" tf:"optional"` + Resources types.List `tfsdk:"resources"` } func (newState *GenerateTemporaryServiceCredentialAzureOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryServiceCredentialAzureOptions) { @@ -7515,9 +7706,10 @@ func (newState *GenerateTemporaryServiceCredentialAzureOptions) SyncEffectiveFie func (newState *GenerateTemporaryServiceCredentialAzureOptions) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryServiceCredentialAzureOptions) { } -func (c GenerateTemporaryServiceCredentialAzureOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenerateTemporaryServiceCredentialAzureOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["resources"] = attrs["resources"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryServiceCredentialAzureOptions. @@ -7586,7 +7778,7 @@ type GenerateTemporaryServiceCredentialGcpOptions struct { // The scopes to which the temporary GCP credential should apply. These // resources are the scopes that are passed to the token provider (see // https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.credentials.Credentials) - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` } func (newState *GenerateTemporaryServiceCredentialGcpOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryServiceCredentialGcpOptions) { @@ -7595,9 +7787,10 @@ func (newState *GenerateTemporaryServiceCredentialGcpOptions) SyncEffectiveField func (newState *GenerateTemporaryServiceCredentialGcpOptions) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryServiceCredentialGcpOptions) { } -func (c GenerateTemporaryServiceCredentialGcpOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenerateTemporaryServiceCredentialGcpOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scopes"] = attrs["scopes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryServiceCredentialGcpOptions. @@ -7663,12 +7856,12 @@ func (o *GenerateTemporaryServiceCredentialGcpOptions) SetScopes(ctx context.Con type GenerateTemporaryServiceCredentialRequest struct { // The Azure cloud options to customize the requested temporary credential - AzureOptions types.Object `tfsdk:"azure_options" tf:"optional,object"` + AzureOptions types.Object `tfsdk:"azure_options"` // The name of the service credential used to generate a temporary // credential - CredentialName types.String `tfsdk:"credential_name" tf:""` + CredentialName types.String `tfsdk:"credential_name"` // The GCP cloud options to customize the requested temporary credential - GcpOptions types.Object `tfsdk:"gcp_options" tf:"optional,object"` + GcpOptions types.Object `tfsdk:"gcp_options"` } func (newState *GenerateTemporaryServiceCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryServiceCredentialRequest) { @@ -7677,12 +7870,12 @@ func (newState *GenerateTemporaryServiceCredentialRequest) SyncEffectiveFieldsDu func (newState *GenerateTemporaryServiceCredentialRequest) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryServiceCredentialRequest) { } -func (c GenerateTemporaryServiceCredentialRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GenerateTemporaryServiceCredentialAzureOptions{}.ApplySchemaCustomizations(cs, append(path, "azure_options")...) - cs.SetRequired(append(path, "credential_name")...) - GenerateTemporaryServiceCredentialGcpOptions{}.ApplySchemaCustomizations(cs, append(path, "gcp_options")...) +func (c GenerateTemporaryServiceCredentialRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["azure_options"] = attrs["azure_options"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetRequired() + attrs["gcp_options"] = attrs["gcp_options"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryServiceCredentialRequest. @@ -7783,9 +7976,9 @@ type GenerateTemporaryTableCredentialRequest struct { // The operation performed against the table data, either READ or // READ_WRITE. If READ_WRITE is specified, the credentials returned will // have write permissions, otherwise, it will be read only. - Operation types.String `tfsdk:"operation" tf:"optional"` + Operation types.String `tfsdk:"operation"` // UUID of the table to read or write. - TableId types.String `tfsdk:"table_id" tf:"optional"` + TableId types.String `tfsdk:"table_id"` } func (newState *GenerateTemporaryTableCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryTableCredentialRequest) { @@ -7794,9 +7987,11 @@ func (newState *GenerateTemporaryTableCredentialRequest) SyncEffectiveFieldsDuri func (newState *GenerateTemporaryTableCredentialRequest) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryTableCredentialRequest) { } -func (c GenerateTemporaryTableCredentialRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenerateTemporaryTableCredentialRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["operation"] = attrs["operation"].SetOptional() + attrs["table_id"] = attrs["table_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryTableCredentialRequest. @@ -7835,25 +8030,25 @@ func (o GenerateTemporaryTableCredentialRequest) Type(ctx context.Context) attr. type GenerateTemporaryTableCredentialResponse struct { // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. - AwsTempCredentials types.Object `tfsdk:"aws_temp_credentials" tf:"optional,object"` + AwsTempCredentials types.Object `tfsdk:"aws_temp_credentials"` // Azure Active Directory token, essentially the Oauth token for Azure // Service Principal or Managed Identity. Read more at // https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token - AzureAad types.Object `tfsdk:"azure_aad" tf:"optional,object"` + AzureAad types.Object `tfsdk:"azure_aad"` // Azure temporary credentials for API authentication. Read more at // https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas - AzureUserDelegationSas types.Object `tfsdk:"azure_user_delegation_sas" tf:"optional,object"` + AzureUserDelegationSas types.Object `tfsdk:"azure_user_delegation_sas"` // Server time when the credential will expire, in epoch milliseconds. The // API client is advised to cache the credential given this expiration time. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // GCP temporary credentials for API authentication. Read more at // https://developers.google.com/identity/protocols/oauth2/service-account - GcpOauthToken types.Object `tfsdk:"gcp_oauth_token" tf:"optional,object"` + GcpOauthToken types.Object `tfsdk:"gcp_oauth_token"` // R2 temporary credentials for API authentication. Read more at // https://developers.cloudflare.com/r2/api/s3/tokens/. - R2TempCredentials types.Object `tfsdk:"r2_temp_credentials" tf:"optional,object"` + R2TempCredentials types.Object `tfsdk:"r2_temp_credentials"` // The URL of the storage path accessible by the temporary credential. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *GenerateTemporaryTableCredentialResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenerateTemporaryTableCredentialResponse) { @@ -7862,14 +8057,16 @@ func (newState *GenerateTemporaryTableCredentialResponse) SyncEffectiveFieldsDur func (newState *GenerateTemporaryTableCredentialResponse) SyncEffectiveFieldsDuringRead(existingState GenerateTemporaryTableCredentialResponse) { } -func (c GenerateTemporaryTableCredentialResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsCredentials{}.ApplySchemaCustomizations(cs, append(path, "aws_temp_credentials")...) - AzureActiveDirectoryToken{}.ApplySchemaCustomizations(cs, append(path, "azure_aad")...) - AzureUserDelegationSas{}.ApplySchemaCustomizations(cs, append(path, "azure_user_delegation_sas")...) - GcpOauthToken{}.ApplySchemaCustomizations(cs, append(path, "gcp_oauth_token")...) - R2Credentials{}.ApplySchemaCustomizations(cs, append(path, "r2_temp_credentials")...) +func (c GenerateTemporaryTableCredentialResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_temp_credentials"] = attrs["aws_temp_credentials"].SetOptional() + attrs["azure_aad"] = attrs["azure_aad"].SetOptional() + attrs["azure_user_delegation_sas"] = attrs["azure_user_delegation_sas"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["gcp_oauth_token"] = attrs["gcp_oauth_token"].SetOptional() + attrs["r2_temp_credentials"] = attrs["r2_temp_credentials"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenerateTemporaryTableCredentialResponse. @@ -8645,47 +8842,47 @@ func (o GetMetastoreRequest) Type(ctx context.Context) attr.Type { type GetMetastoreSummaryResponse struct { // Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Time at which this metastore was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of metastore creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique identifier of the metastore's (Default) Data Access Configuration. - DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id" tf:"optional"` + DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id"` // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name" tf:"optional"` + DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name"` // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds" tf:"optional"` + DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds"` // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope types.String `tfsdk:"delta_sharing_scope" tf:"optional"` + DeltaSharingScope types.String `tfsdk:"delta_sharing_scope"` // Whether to allow non-DBR clients to directly access entities under the // metastore. - ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled" tf:"optional"` + ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled"` // Globally unique metastore ID across clouds and regions, of the form // `cloud:region:metastore_id`. - GlobalMetastoreId types.String `tfsdk:"global_metastore_id" tf:"optional"` + GlobalMetastoreId types.String `tfsdk:"global_metastore_id"` // Unique identifier of metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The user-specified name of the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The owner of the metastore. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion types.String `tfsdk:"privilege_model_version" tf:"optional"` + PrivilegeModelVersion types.String `tfsdk:"privilege_model_version"` // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The storage root URL for metastore - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id" tf:"optional"` + StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id"` // Name of the storage credential to access the metastore storage_root. - StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name" tf:"optional"` + StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name"` // Time at which the metastore was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the metastore. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *GetMetastoreSummaryResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetMetastoreSummaryResponse) { @@ -8694,9 +8891,28 @@ func (newState *GetMetastoreSummaryResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *GetMetastoreSummaryResponse) SyncEffectiveFieldsDuringRead(existingState GetMetastoreSummaryResponse) { } -func (c GetMetastoreSummaryResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c GetMetastoreSummaryResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["default_data_access_config_id"] = attrs["default_data_access_config_id"].SetOptional() + attrs["delta_sharing_organization_name"] = attrs["delta_sharing_organization_name"].SetOptional() + attrs["delta_sharing_recipient_token_lifetime_in_seconds"] = attrs["delta_sharing_recipient_token_lifetime_in_seconds"].SetOptional() + attrs["delta_sharing_scope"] = attrs["delta_sharing_scope"].SetOptional() + attrs["external_access_enabled"] = attrs["external_access_enabled"].SetOptional() + attrs["global_metastore_id"] = attrs["global_metastore_id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["privilege_model_version"] = attrs["privilege_model_version"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["storage_root_credential_id"] = attrs["storage_root_credential_id"].SetOptional() + attrs["storage_root_credential_name"] = attrs["storage_root_credential_name"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetMetastoreSummaryResponse. @@ -8940,7 +9156,7 @@ func (o GetQuotaRequest) Type(ctx context.Context) attr.Type { type GetQuotaResponse struct { // The returned QuotaInfo. - QuotaInfo types.Object `tfsdk:"quota_info" tf:"optional,object"` + QuotaInfo types.Object `tfsdk:"quota_info"` } func (newState *GetQuotaResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetQuotaResponse) { @@ -8949,10 +9165,10 @@ func (newState *GetQuotaResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan G func (newState *GetQuotaResponse) SyncEffectiveFieldsDuringRead(existingState GetQuotaResponse) { } -func (c GetQuotaResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuotaInfo{}.ApplySchemaCustomizations(cs, append(path, "quota_info")...) +func (c GetQuotaResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["quota_info"] = attrs["quota_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetQuotaResponse. @@ -9308,7 +9524,7 @@ func (o ListAccountMetastoreAssignmentsRequest) Type(ctx context.Context) attr.T // The list of workspaces to which the given metastore is assigned. type ListAccountMetastoreAssignmentsResponse struct { - WorkspaceIds types.List `tfsdk:"workspace_ids" tf:"optional"` + WorkspaceIds types.List `tfsdk:"workspace_ids"` } func (newState *ListAccountMetastoreAssignmentsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAccountMetastoreAssignmentsResponse) { @@ -9317,9 +9533,10 @@ func (newState *ListAccountMetastoreAssignmentsResponse) SyncEffectiveFieldsDuri func (newState *ListAccountMetastoreAssignmentsResponse) SyncEffectiveFieldsDuringRead(existingState ListAccountMetastoreAssignmentsResponse) { } -func (c ListAccountMetastoreAssignmentsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListAccountMetastoreAssignmentsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["workspace_ids"] = attrs["workspace_ids"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAccountMetastoreAssignmentsResponse. @@ -9422,7 +9639,7 @@ func (o ListAccountStorageCredentialsRequest) Type(ctx context.Context) attr.Typ type ListAccountStorageCredentialsResponse struct { // An array of metastore storage credentials. - StorageCredentials types.List `tfsdk:"storage_credentials" tf:"optional"` + StorageCredentials types.List `tfsdk:"storage_credentials"` } func (newState *ListAccountStorageCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAccountStorageCredentialsResponse) { @@ -9431,10 +9648,10 @@ func (newState *ListAccountStorageCredentialsResponse) SyncEffectiveFieldsDuring func (newState *ListAccountStorageCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState ListAccountStorageCredentialsResponse) { } -func (c ListAccountStorageCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StorageCredentialInfo{}.ApplySchemaCustomizations(cs, append(path, "storage_credentials")...) +func (c ListAccountStorageCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["storage_credentials"] = attrs["storage_credentials"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAccountStorageCredentialsResponse. @@ -9554,11 +9771,11 @@ func (o ListCatalogsRequest) Type(ctx context.Context) attr.Type { type ListCatalogsResponse struct { // An array of catalog information objects. - Catalogs types.List `tfsdk:"catalogs" tf:"optional"` + Catalogs types.List `tfsdk:"catalogs"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCatalogsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCatalogsResponse) { @@ -9567,10 +9784,11 @@ func (newState *ListCatalogsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListCatalogsResponse) SyncEffectiveFieldsDuringRead(existingState ListCatalogsResponse) { } -func (c ListCatalogsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CatalogInfo{}.ApplySchemaCustomizations(cs, append(path, "catalogs")...) +func (c ListCatalogsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalogs"] = attrs["catalogs"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCatalogsResponse. @@ -9684,11 +9902,11 @@ func (o ListConnectionsRequest) Type(ctx context.Context) attr.Type { type ListConnectionsResponse struct { // An array of connection information objects. - Connections types.List `tfsdk:"connections" tf:"optional"` + Connections types.List `tfsdk:"connections"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListConnectionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListConnectionsResponse) { @@ -9697,10 +9915,11 @@ func (newState *ListConnectionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListConnectionsResponse) SyncEffectiveFieldsDuringRead(existingState ListConnectionsResponse) { } -func (c ListConnectionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ConnectionInfo{}.ApplySchemaCustomizations(cs, append(path, "connections")...) +func (c ListConnectionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connections"] = attrs["connections"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListConnectionsResponse. @@ -9816,11 +10035,11 @@ func (o ListCredentialsRequest) Type(ctx context.Context) attr.Type { } type ListCredentialsResponse struct { - Credentials types.List `tfsdk:"credentials" tf:"optional"` + Credentials types.List `tfsdk:"credentials"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCredentialsResponse) { @@ -9829,10 +10048,11 @@ func (newState *ListCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState ListCredentialsResponse) { } -func (c ListCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CredentialInfo{}.ApplySchemaCustomizations(cs, append(path, "credentials")...) +func (c ListCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credentials"] = attrs["credentials"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCredentialsResponse. @@ -9951,11 +10171,11 @@ func (o ListExternalLocationsRequest) Type(ctx context.Context) attr.Type { type ListExternalLocationsResponse struct { // An array of external locations. - ExternalLocations types.List `tfsdk:"external_locations" tf:"optional"` + ExternalLocations types.List `tfsdk:"external_locations"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExternalLocationsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExternalLocationsResponse) { @@ -9964,10 +10184,11 @@ func (newState *ListExternalLocationsResponse) SyncEffectiveFieldsDuringCreateOr func (newState *ListExternalLocationsResponse) SyncEffectiveFieldsDuringRead(existingState ListExternalLocationsResponse) { } -func (c ListExternalLocationsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalLocationInfo{}.ApplySchemaCustomizations(cs, append(path, "external_locations")...) +func (c ListExternalLocationsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_locations"] = attrs["external_locations"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExternalLocationsResponse. @@ -10094,11 +10315,11 @@ func (o ListFunctionsRequest) Type(ctx context.Context) attr.Type { type ListFunctionsResponse struct { // An array of function information objects. - Functions types.List `tfsdk:"functions" tf:"optional"` + Functions types.List `tfsdk:"functions"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListFunctionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFunctionsResponse) { @@ -10107,10 +10328,11 @@ func (newState *ListFunctionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListFunctionsResponse) SyncEffectiveFieldsDuringRead(existingState ListFunctionsResponse) { } -func (c ListFunctionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FunctionInfo{}.ApplySchemaCustomizations(cs, append(path, "functions")...) +func (c ListFunctionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["functions"] = attrs["functions"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFunctionsResponse. @@ -10178,7 +10400,7 @@ func (o *ListFunctionsResponse) SetFunctions(ctx context.Context, v []FunctionIn type ListMetastoresResponse struct { // An array of metastore information objects. - Metastores types.List `tfsdk:"metastores" tf:"optional"` + Metastores types.List `tfsdk:"metastores"` } func (newState *ListMetastoresResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListMetastoresResponse) { @@ -10187,10 +10409,10 @@ func (newState *ListMetastoresResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListMetastoresResponse) SyncEffectiveFieldsDuringRead(existingState ListMetastoresResponse) { } -func (c ListMetastoresResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MetastoreInfo{}.ApplySchemaCustomizations(cs, append(path, "metastores")...) +func (c ListMetastoresResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metastores"] = attrs["metastores"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListMetastoresResponse. @@ -10312,11 +10534,11 @@ func (o ListModelVersionsRequest) Type(ctx context.Context) attr.Type { } type ListModelVersionsResponse struct { - ModelVersions types.List `tfsdk:"model_versions" tf:"optional"` + ModelVersions types.List `tfsdk:"model_versions"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListModelVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListModelVersionsResponse) { @@ -10325,10 +10547,11 @@ func (newState *ListModelVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListModelVersionsResponse) SyncEffectiveFieldsDuringRead(existingState ListModelVersionsResponse) { } -func (c ListModelVersionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersionInfo{}.ApplySchemaCustomizations(cs, append(path, "model_versions")...) +func (c ListModelVersionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_versions"] = attrs["model_versions"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListModelVersionsResponse. @@ -10439,9 +10662,9 @@ type ListQuotasResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of returned QuotaInfos. - Quotas types.List `tfsdk:"quotas" tf:"optional"` + Quotas types.List `tfsdk:"quotas"` } func (newState *ListQuotasResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQuotasResponse) { @@ -10450,10 +10673,11 @@ func (newState *ListQuotasResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListQuotasResponse) SyncEffectiveFieldsDuringRead(existingState ListQuotasResponse) { } -func (c ListQuotasResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuotaInfo{}.ApplySchemaCustomizations(cs, append(path, "quotas")...) +func (c ListQuotasResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["quotas"] = attrs["quotas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQuotasResponse. @@ -10631,9 +10855,9 @@ func (o ListRegisteredModelsRequest) Type(ctx context.Context) attr.Type { type ListRegisteredModelsResponse struct { // Opaque token for pagination. Omitted if there are no more results. // page_token should be set to this value for fetching the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - RegisteredModels types.List `tfsdk:"registered_models" tf:"optional"` + RegisteredModels types.List `tfsdk:"registered_models"` } func (newState *ListRegisteredModelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRegisteredModelsResponse) { @@ -10642,10 +10866,11 @@ func (newState *ListRegisteredModelsResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *ListRegisteredModelsResponse) SyncEffectiveFieldsDuringRead(existingState ListRegisteredModelsResponse) { } -func (c ListRegisteredModelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelInfo{}.ApplySchemaCustomizations(cs, append(path, "registered_models")...) +func (c ListRegisteredModelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["registered_models"] = attrs["registered_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRegisteredModelsResponse. @@ -10770,9 +10995,9 @@ type ListSchemasResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of schema information objects. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *ListSchemasResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSchemasResponse) { @@ -10781,10 +11006,11 @@ func (newState *ListSchemasResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ListSchemasResponse) SyncEffectiveFieldsDuringRead(existingState ListSchemasResponse) { } -func (c ListSchemasResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SchemaInfo{}.ApplySchemaCustomizations(cs, append(path, "schemas")...) +func (c ListSchemasResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSchemasResponse. @@ -10900,9 +11126,9 @@ type ListStorageCredentialsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - StorageCredentials types.List `tfsdk:"storage_credentials" tf:"optional"` + StorageCredentials types.List `tfsdk:"storage_credentials"` } func (newState *ListStorageCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListStorageCredentialsResponse) { @@ -10911,10 +11137,11 @@ func (newState *ListStorageCredentialsResponse) SyncEffectiveFieldsDuringCreateO func (newState *ListStorageCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState ListStorageCredentialsResponse) { } -func (c ListStorageCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StorageCredentialInfo{}.ApplySchemaCustomizations(cs, append(path, "storage_credentials")...) +func (c ListStorageCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["storage_credentials"] = attrs["storage_credentials"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListStorageCredentialsResponse. @@ -11099,9 +11326,9 @@ type ListSystemSchemasResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of system schema information objects. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *ListSystemSchemasResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSystemSchemasResponse) { @@ -11110,10 +11337,11 @@ func (newState *ListSystemSchemasResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListSystemSchemasResponse) SyncEffectiveFieldsDuringRead(existingState ListSystemSchemasResponse) { } -func (c ListSystemSchemasResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SystemSchemaInfo{}.ApplySchemaCustomizations(cs, append(path, "schemas")...) +func (c ListSystemSchemasResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSystemSchemasResponse. @@ -11183,9 +11411,9 @@ type ListTableSummariesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of table summaries. - Tables types.List `tfsdk:"tables" tf:"optional"` + Tables types.List `tfsdk:"tables"` } func (newState *ListTableSummariesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListTableSummariesResponse) { @@ -11194,10 +11422,11 @@ func (newState *ListTableSummariesResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListTableSummariesResponse) SyncEffectiveFieldsDuringRead(existingState ListTableSummariesResponse) { } -func (c ListTableSummariesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSummary{}.ApplySchemaCustomizations(cs, append(path, "tables")...) +func (c ListTableSummariesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["tables"] = attrs["tables"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTableSummariesResponse. @@ -11347,9 +11576,9 @@ type ListTablesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of table information objects. - Tables types.List `tfsdk:"tables" tf:"optional"` + Tables types.List `tfsdk:"tables"` } func (newState *ListTablesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListTablesResponse) { @@ -11358,10 +11587,11 @@ func (newState *ListTablesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListTablesResponse) SyncEffectiveFieldsDuringRead(existingState ListTablesResponse) { } -func (c ListTablesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableInfo{}.ApplySchemaCustomizations(cs, append(path, "tables")...) +func (c ListTablesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["tables"] = attrs["tables"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTablesResponse. @@ -11497,9 +11727,9 @@ type ListVolumesResponseContent struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request to retrieve the next page of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Volumes types.List `tfsdk:"volumes" tf:"optional"` + Volumes types.List `tfsdk:"volumes"` } func (newState *ListVolumesResponseContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListVolumesResponseContent) { @@ -11508,10 +11738,11 @@ func (newState *ListVolumesResponseContent) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListVolumesResponseContent) SyncEffectiveFieldsDuringRead(existingState ListVolumesResponseContent) { } -func (c ListVolumesResponseContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - VolumeInfo{}.ApplySchemaCustomizations(cs, append(path, "volumes")...) +func (c ListVolumesResponseContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["volumes"] = attrs["volumes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListVolumesResponseContent. @@ -11579,11 +11810,11 @@ func (o *ListVolumesResponseContent) SetVolumes(ctx context.Context, v []VolumeI type MetastoreAssignment struct { // The name of the default catalog in the metastore. - DefaultCatalogName types.String `tfsdk:"default_catalog_name" tf:"optional"` + DefaultCatalogName types.String `tfsdk:"default_catalog_name"` // The unique ID of the metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:""` + MetastoreId types.String `tfsdk:"metastore_id"` // The unique ID of the Databricks workspace. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:""` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *MetastoreAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan MetastoreAssignment) { @@ -11592,11 +11823,12 @@ func (newState *MetastoreAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *MetastoreAssignment) SyncEffectiveFieldsDuringRead(existingState MetastoreAssignment) { } -func (c MetastoreAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "metastore_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c MetastoreAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_catalog_name"] = attrs["default_catalog_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MetastoreAssignment. @@ -11636,47 +11868,47 @@ func (o MetastoreAssignment) Type(ctx context.Context) attr.Type { type MetastoreInfo struct { // Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Time at which this metastore was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of metastore creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique identifier of the metastore's (Default) Data Access Configuration. - DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id" tf:"optional"` + DefaultDataAccessConfigId types.String `tfsdk:"default_data_access_config_id"` // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name" tf:"optional"` + DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name"` // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds" tf:"optional"` + DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds"` // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope types.String `tfsdk:"delta_sharing_scope" tf:"optional"` + DeltaSharingScope types.String `tfsdk:"delta_sharing_scope"` // Whether to allow non-DBR clients to directly access entities under the // metastore. - ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled" tf:"optional"` + ExternalAccessEnabled types.Bool `tfsdk:"external_access_enabled"` // Globally unique metastore ID across clouds and regions, of the form // `cloud:region:metastore_id`. - GlobalMetastoreId types.String `tfsdk:"global_metastore_id" tf:"optional"` + GlobalMetastoreId types.String `tfsdk:"global_metastore_id"` // Unique identifier of metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The user-specified name of the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The owner of the metastore. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion types.String `tfsdk:"privilege_model_version" tf:"optional"` + PrivilegeModelVersion types.String `tfsdk:"privilege_model_version"` // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The storage root URL for metastore - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id" tf:"optional"` + StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id"` // Name of the storage credential to access the metastore storage_root. - StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name" tf:"optional"` + StorageRootCredentialName types.String `tfsdk:"storage_root_credential_name"` // Time at which the metastore was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the metastore. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *MetastoreInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan MetastoreInfo) { @@ -11685,9 +11917,28 @@ func (newState *MetastoreInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Meta func (newState *MetastoreInfo) SyncEffectiveFieldsDuringRead(existingState MetastoreInfo) { } -func (c MetastoreInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c MetastoreInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["default_data_access_config_id"] = attrs["default_data_access_config_id"].SetOptional() + attrs["delta_sharing_organization_name"] = attrs["delta_sharing_organization_name"].SetOptional() + attrs["delta_sharing_recipient_token_lifetime_in_seconds"] = attrs["delta_sharing_recipient_token_lifetime_in_seconds"].SetOptional() + attrs["delta_sharing_scope"] = attrs["delta_sharing_scope"].SetOptional() + attrs["external_access_enabled"] = attrs["external_access_enabled"].SetOptional() + attrs["global_metastore_id"] = attrs["global_metastore_id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["privilege_model_version"] = attrs["privilege_model_version"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["storage_root_credential_id"] = attrs["storage_root_credential_id"].SetOptional() + attrs["storage_root_credential_name"] = attrs["storage_root_credential_name"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MetastoreInfo. @@ -11759,55 +12010,55 @@ func (o MetastoreInfo) Type(ctx context.Context) attr.Type { type ModelVersionInfo struct { // List of aliases associated with the model version - Aliases types.List `tfsdk:"aliases" tf:"optional"` + Aliases types.List `tfsdk:"aliases"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The name of the catalog containing the model version - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the model version - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The identifier of the user who created the model version - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The unique identifier of the model version - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The unique identifier of the metastore containing the model version - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the parent registered model of the model version, relative to // parent schema - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // Model version dependencies, for feature-store packaged models - ModelVersionDependencies types.Object `tfsdk:"model_version_dependencies" tf:"optional,object"` + ModelVersionDependencies types.Object `tfsdk:"model_version_dependencies"` // MLflow run ID used when creating the model version, if ``source`` was // generated by an experiment run stored in an MLflow tracking server - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // ID of the Databricks workspace containing the MLflow run that generated // this model version, if applicable - RunWorkspaceId types.Int64 `tfsdk:"run_workspace_id" tf:"optional"` + RunWorkspaceId types.Int64 `tfsdk:"run_workspace_id"` // The name of the schema containing the model version, relative to parent // catalog - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // URI indicating the location of the source artifacts (files) for the model // version - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Current status of the model version. Newly created model versions start // in PENDING_REGISTRATION status, then move to READY status once the model // version files are uploaded and the model version is finalized. Only model // versions in READY status can be loaded for inference or served. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The storage location on the cloud under which model version data files // are stored - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The identifier of the user who updated the model version last time - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Integer model version number, used to reference the model version in API // requests. - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *ModelVersionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersionInfo) { @@ -11816,11 +12067,28 @@ func (newState *ModelVersionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan M func (newState *ModelVersionInfo) SyncEffectiveFieldsDuringRead(existingState ModelVersionInfo) { } -func (c ModelVersionInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAlias{}.ApplySchemaCustomizations(cs, append(path, "aliases")...) - DependencyList{}.ApplySchemaCustomizations(cs, append(path, "model_version_dependencies")...) - - return cs +func (c ModelVersionInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aliases"] = attrs["aliases"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["model_version_dependencies"] = attrs["model_version_dependencies"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_workspace_id"] = attrs["run_workspace_id"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["version"] = attrs["version"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersionInfo. @@ -11951,14 +12219,14 @@ func (o *ModelVersionInfo) SetModelVersionDependencies(ctx context.Context, v De type MonitorCronSchedule struct { // Read only field that indicates whether a schedule is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // The expression that determines when to run the monitor. See [examples]. // // [examples]: https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression types.String `tfsdk:"quartz_cron_expression" tf:""` + QuartzCronExpression types.String `tfsdk:"quartz_cron_expression"` // The timezone id (e.g., ``"PST"``) in which to evaluate the quartz // expression. - TimezoneId types.String `tfsdk:"timezone_id" tf:""` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *MonitorCronSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorCronSchedule) { @@ -11967,11 +12235,12 @@ func (newState *MonitorCronSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *MonitorCronSchedule) SyncEffectiveFieldsDuringRead(existingState MonitorCronSchedule) { } -func (c MonitorCronSchedule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "quartz_cron_expression")...) - cs.SetRequired(append(path, "timezone_id")...) +func (c MonitorCronSchedule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["quartz_cron_expression"] = attrs["quartz_cron_expression"].SetRequired() + attrs["timezone_id"] = attrs["timezone_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorCronSchedule. @@ -12011,7 +12280,7 @@ func (o MonitorCronSchedule) Type(ctx context.Context) attr.Type { type MonitorDataClassificationConfig struct { // Whether data classification is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` } func (newState *MonitorDataClassificationConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorDataClassificationConfig) { @@ -12020,9 +12289,10 @@ func (newState *MonitorDataClassificationConfig) SyncEffectiveFieldsDuringCreate func (newState *MonitorDataClassificationConfig) SyncEffectiveFieldsDuringRead(existingState MonitorDataClassificationConfig) { } -func (c MonitorDataClassificationConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MonitorDataClassificationConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorDataClassificationConfig. @@ -12059,7 +12329,7 @@ func (o MonitorDataClassificationConfig) Type(ctx context.Context) attr.Type { type MonitorDestination struct { // The list of email addresses to send the notification to. A maximum of 5 // email addresses is supported. - EmailAddresses types.List `tfsdk:"email_addresses" tf:"optional"` + EmailAddresses types.List `tfsdk:"email_addresses"` } func (newState *MonitorDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorDestination) { @@ -12068,9 +12338,10 @@ func (newState *MonitorDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MonitorDestination) SyncEffectiveFieldsDuringRead(existingState MonitorDestination) { } -func (c MonitorDestination) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MonitorDestination) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["email_addresses"] = attrs["email_addresses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorDestination. @@ -12139,30 +12410,30 @@ type MonitorInferenceLog struct { // timestamp. Currently the following static granularities are supported: // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" // week(s)"``, ``"1 month"``, ``"1 year"``}. - Granularities types.List `tfsdk:"granularities" tf:""` + Granularities types.List `tfsdk:"granularities"` // Optional column that contains the ground truth for the prediction. - LabelCol types.String `tfsdk:"label_col" tf:"optional"` + LabelCol types.String `tfsdk:"label_col"` // Column that contains the id of the model generating the predictions. // Metrics will be computed per model id by default, and also across all // model ids. - ModelIdCol types.String `tfsdk:"model_id_col" tf:""` + ModelIdCol types.String `tfsdk:"model_id_col"` // Column that contains the output/prediction from the model. - PredictionCol types.String `tfsdk:"prediction_col" tf:""` + PredictionCol types.String `tfsdk:"prediction_col"` // Optional column that contains the prediction probabilities for each class // in a classification problem type. The values in this column should be a // map, mapping each class label to the prediction probability for a given // sample. The map should be of PySpark MapType(). - PredictionProbaCol types.String `tfsdk:"prediction_proba_col" tf:"optional"` + PredictionProbaCol types.String `tfsdk:"prediction_proba_col"` // Problem type the model aims to solve. Determines the type of // model-quality metrics that will be computed. - ProblemType types.String `tfsdk:"problem_type" tf:""` + ProblemType types.String `tfsdk:"problem_type"` // Column that contains the timestamps of requests. The column must be one // of the following: - A ``TimestampType`` column - A column whose values // can be converted to timestamps through the pyspark ``to_timestamp`` // [function]. // // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html - TimestampCol types.String `tfsdk:"timestamp_col" tf:""` + TimestampCol types.String `tfsdk:"timestamp_col"` } func (newState *MonitorInferenceLog) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorInferenceLog) { @@ -12171,14 +12442,16 @@ func (newState *MonitorInferenceLog) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *MonitorInferenceLog) SyncEffectiveFieldsDuringRead(existingState MonitorInferenceLog) { } -func (c MonitorInferenceLog) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "granularities")...) - cs.SetRequired(append(path, "model_id_col")...) - cs.SetRequired(append(path, "prediction_col")...) - cs.SetRequired(append(path, "problem_type")...) - cs.SetRequired(append(path, "timestamp_col")...) +func (c MonitorInferenceLog) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["granularities"] = attrs["granularities"].SetRequired() + attrs["label_col"] = attrs["label_col"].SetOptional() + attrs["model_id_col"] = attrs["model_id_col"].SetRequired() + attrs["prediction_col"] = attrs["prediction_col"].SetRequired() + attrs["prediction_proba_col"] = attrs["prediction_proba_col"].SetOptional() + attrs["problem_type"] = attrs["problem_type"].SetRequired() + attrs["timestamp_col"] = attrs["timestamp_col"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorInferenceLog. @@ -12256,54 +12529,54 @@ func (o *MonitorInferenceLog) SetGranularities(ctx context.Context, v []types.St type MonitorInfo struct { // The directory to store monitoring assets (e.g. dashboard, metric tables). - AssetsDir types.String `tfsdk:"assets_dir" tf:"optional"` + AssetsDir types.String `tfsdk:"assets_dir"` // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName types.String `tfsdk:"baseline_table_name" tf:"optional"` + BaselineTableName types.String `tfsdk:"baseline_table_name"` // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics types.List `tfsdk:"custom_metrics" tf:"optional"` + CustomMetrics types.List `tfsdk:"custom_metrics"` // Id of dashboard that visualizes the computed metrics. This can be empty // if the monitor is in PENDING state. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The data classification config for the monitor. - DataClassificationConfig types.Object `tfsdk:"data_classification_config" tf:"optional,object"` + DataClassificationConfig types.Object `tfsdk:"data_classification_config"` // The full name of the drift metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - DriftMetricsTableName types.String `tfsdk:"drift_metrics_table_name" tf:""` + DriftMetricsTableName types.String `tfsdk:"drift_metrics_table_name"` // Configuration for monitoring inference logs. - InferenceLog types.Object `tfsdk:"inference_log" tf:"optional,object"` + InferenceLog types.Object `tfsdk:"inference_log"` // The latest failure message of the monitor (if any). - LatestMonitorFailureMsg types.String `tfsdk:"latest_monitor_failure_msg" tf:"optional"` + LatestMonitorFailureMsg types.String `tfsdk:"latest_monitor_failure_msg"` // The version of the monitor config (e.g. 1,2,3). If negative, the monitor // may be corrupted. - MonitorVersion types.String `tfsdk:"monitor_version" tf:""` + MonitorVersion types.String `tfsdk:"monitor_version"` // The notification settings for the monitor. - Notifications types.Object `tfsdk:"notifications" tf:"optional,object"` + Notifications types.Object `tfsdk:"notifications"` // Schema where output metric tables are created. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:"optional"` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // The full name of the profile metrics table. Format: // __catalog_name__.__schema_name__.__table_name__. - ProfileMetricsTableName types.String `tfsdk:"profile_metrics_table_name" tf:""` + ProfileMetricsTableName types.String `tfsdk:"profile_metrics_table_name"` // The schedule for automatically updating and refreshing metric tables. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs types.List `tfsdk:"slicing_exprs" tf:"optional"` + SlicingExprs types.List `tfsdk:"slicing_exprs"` // Configuration for monitoring snapshot tables. - Snapshot types.Object `tfsdk:"snapshot" tf:"optional,object"` + Snapshot types.Object `tfsdk:"snapshot"` // The status of the monitor. - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` // The full name of the table to monitor. Format: // __catalog_name__.__schema_name__.__table_name__. - TableName types.String `tfsdk:"table_name" tf:""` + TableName types.String `tfsdk:"table_name"` // Configuration for monitoring time series tables. - TimeSeries types.Object `tfsdk:"time_series" tf:"optional,object"` + TimeSeries types.Object `tfsdk:"time_series"` } func (newState *MonitorInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorInfo) { @@ -12312,21 +12585,27 @@ func (newState *MonitorInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Monito func (newState *MonitorInfo) SyncEffectiveFieldsDuringRead(existingState MonitorInfo) { } -func (c MonitorInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorMetric{}.ApplySchemaCustomizations(cs, append(path, "custom_metrics")...) - MonitorDataClassificationConfig{}.ApplySchemaCustomizations(cs, append(path, "data_classification_config")...) - cs.SetRequired(append(path, "drift_metrics_table_name")...) - MonitorInferenceLog{}.ApplySchemaCustomizations(cs, append(path, "inference_log")...) - cs.SetRequired(append(path, "monitor_version")...) - MonitorNotifications{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - cs.SetRequired(append(path, "profile_metrics_table_name")...) - MonitorCronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - MonitorSnapshot{}.ApplySchemaCustomizations(cs, append(path, "snapshot")...) - cs.SetRequired(append(path, "status")...) - cs.SetRequired(append(path, "table_name")...) - MonitorTimeSeries{}.ApplySchemaCustomizations(cs, append(path, "time_series")...) - - return cs +func (c MonitorInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets_dir"] = attrs["assets_dir"].SetOptional() + attrs["baseline_table_name"] = attrs["baseline_table_name"].SetOptional() + attrs["custom_metrics"] = attrs["custom_metrics"].SetOptional() + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].SetOptional() + attrs["drift_metrics_table_name"] = attrs["drift_metrics_table_name"].SetRequired() + attrs["inference_log"] = attrs["inference_log"].SetOptional() + attrs["latest_monitor_failure_msg"] = attrs["latest_monitor_failure_msg"].SetOptional() + attrs["monitor_version"] = attrs["monitor_version"].SetRequired() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["output_schema_name"] = attrs["output_schema_name"].SetOptional() + attrs["profile_metrics_table_name"] = attrs["profile_metrics_table_name"].SetRequired() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["slicing_exprs"] = attrs["slicing_exprs"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].SetOptional() + attrs["status"] = attrs["status"].SetRequired() + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["time_series"] = attrs["time_series"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorInfo. @@ -12632,15 +12911,15 @@ type MonitorMetric struct { // metric. See [create metric definition]. // // [create metric definition]: https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition - Definition types.String `tfsdk:"definition" tf:""` + Definition types.String `tfsdk:"definition"` // A list of column names in the input table the metric should be computed // for. Can use ``":table"`` to indicate that the metric needs information // from multiple columns. - InputColumns types.List `tfsdk:"input_columns" tf:""` + InputColumns types.List `tfsdk:"input_columns"` // Name of the metric in the output tables. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The output type of the custom metric. - OutputDataType types.String `tfsdk:"output_data_type" tf:""` + OutputDataType types.String `tfsdk:"output_data_type"` // Can only be one of ``"CUSTOM_METRIC_TYPE_AGGREGATE"``, // ``"CUSTOM_METRIC_TYPE_DERIVED"``, or ``"CUSTOM_METRIC_TYPE_DRIFT"``. The // ``"CUSTOM_METRIC_TYPE_AGGREGATE"`` and ``"CUSTOM_METRIC_TYPE_DERIVED"`` @@ -12651,7 +12930,7 @@ type MonitorMetric struct { // table - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed // aggregate metrics - CUSTOM_METRIC_TYPE_DRIFT: depend on previously // computed aggregate or derived metrics - Type_ types.String `tfsdk:"type" tf:""` + Type_ types.String `tfsdk:"type"` } func (newState *MonitorMetric) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorMetric) { @@ -12660,14 +12939,14 @@ func (newState *MonitorMetric) SyncEffectiveFieldsDuringCreateOrUpdate(plan Moni func (newState *MonitorMetric) SyncEffectiveFieldsDuringRead(existingState MonitorMetric) { } -func (c MonitorMetric) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "definition")...) - cs.SetRequired(append(path, "input_columns")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "output_data_type")...) - cs.SetRequired(append(path, "type")...) +func (c MonitorMetric) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetRequired() + attrs["input_columns"] = attrs["input_columns"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["output_data_type"] = attrs["output_data_type"].SetRequired() + attrs["type"] = attrs["type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorMetric. @@ -12741,10 +13020,10 @@ func (o *MonitorMetric) SetInputColumns(ctx context.Context, v []types.String) { type MonitorNotifications struct { // Who to send notifications to on monitor failure. - OnFailure types.Object `tfsdk:"on_failure" tf:"optional,object"` + OnFailure types.Object `tfsdk:"on_failure"` // Who to send notifications to when new data classification tags are // detected. - OnNewClassificationTagDetected types.Object `tfsdk:"on_new_classification_tag_detected" tf:"optional,object"` + OnNewClassificationTagDetected types.Object `tfsdk:"on_new_classification_tag_detected"` } func (newState *MonitorNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorNotifications) { @@ -12753,11 +13032,11 @@ func (newState *MonitorNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *MonitorNotifications) SyncEffectiveFieldsDuringRead(existingState MonitorNotifications) { } -func (c MonitorNotifications) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorDestination{}.ApplySchemaCustomizations(cs, append(path, "on_failure")...) - MonitorDestination{}.ApplySchemaCustomizations(cs, append(path, "on_new_classification_tag_detected")...) +func (c MonitorNotifications) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_new_classification_tag_detected"] = attrs["on_new_classification_tag_detected"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorNotifications. @@ -12855,19 +13134,19 @@ func (o *MonitorNotifications) SetOnNewClassificationTagDetected(ctx context.Con type MonitorRefreshInfo struct { // Time at which refresh operation completed (milliseconds since 1/1/1970 // UTC). - EndTimeMs types.Int64 `tfsdk:"end_time_ms" tf:"optional"` + EndTimeMs types.Int64 `tfsdk:"end_time_ms"` // An optional message to give insight into the current state of the job // (e.g. FAILURE messages). - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Unique id of the refresh operation. - RefreshId types.Int64 `tfsdk:"refresh_id" tf:""` + RefreshId types.Int64 `tfsdk:"refresh_id"` // Time at which refresh operation was initiated (milliseconds since // 1/1/1970 UTC). - StartTimeMs types.Int64 `tfsdk:"start_time_ms" tf:""` + StartTimeMs types.Int64 `tfsdk:"start_time_ms"` // The current state of the refresh. - State types.String `tfsdk:"state" tf:""` + State types.String `tfsdk:"state"` // The method by which the refresh was triggered. - Trigger types.String `tfsdk:"trigger" tf:"optional"` + Trigger types.String `tfsdk:"trigger"` } func (newState *MonitorRefreshInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorRefreshInfo) { @@ -12876,12 +13155,15 @@ func (newState *MonitorRefreshInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MonitorRefreshInfo) SyncEffectiveFieldsDuringRead(existingState MonitorRefreshInfo) { } -func (c MonitorRefreshInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "refresh_id")...) - cs.SetRequired(append(path, "start_time_ms")...) - cs.SetRequired(append(path, "state")...) +func (c MonitorRefreshInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time_ms"] = attrs["end_time_ms"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["refresh_id"] = attrs["refresh_id"].SetRequired() + attrs["start_time_ms"] = attrs["start_time_ms"].SetRequired() + attrs["state"] = attrs["state"].SetRequired() + attrs["trigger"] = attrs["trigger"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorRefreshInfo. @@ -12927,7 +13209,7 @@ func (o MonitorRefreshInfo) Type(ctx context.Context) attr.Type { type MonitorRefreshListResponse struct { // List of refreshes. - Refreshes types.List `tfsdk:"refreshes" tf:"optional"` + Refreshes types.List `tfsdk:"refreshes"` } func (newState *MonitorRefreshListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorRefreshListResponse) { @@ -12936,10 +13218,10 @@ func (newState *MonitorRefreshListResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *MonitorRefreshListResponse) SyncEffectiveFieldsDuringRead(existingState MonitorRefreshListResponse) { } -func (c MonitorRefreshListResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorRefreshInfo{}.ApplySchemaCustomizations(cs, append(path, "refreshes")...) +func (c MonitorRefreshListResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["refreshes"] = attrs["refreshes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorRefreshListResponse. @@ -13012,9 +13294,9 @@ func (newState *MonitorSnapshot) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mo func (newState *MonitorSnapshot) SyncEffectiveFieldsDuringRead(existingState MonitorSnapshot) { } -func (c MonitorSnapshot) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MonitorSnapshot) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorSnapshot. @@ -13049,14 +13331,14 @@ type MonitorTimeSeries struct { // timestamp. Currently the following static granularities are supported: // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" // week(s)"``, ``"1 month"``, ``"1 year"``}. - Granularities types.List `tfsdk:"granularities" tf:""` + Granularities types.List `tfsdk:"granularities"` // Column that contains the timestamps of requests. The column must be one // of the following: - A ``TimestampType`` column - A column whose values // can be converted to timestamps through the pyspark ``to_timestamp`` // [function]. // // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html - TimestampCol types.String `tfsdk:"timestamp_col" tf:""` + TimestampCol types.String `tfsdk:"timestamp_col"` } func (newState *MonitorTimeSeries) SyncEffectiveFieldsDuringCreateOrUpdate(plan MonitorTimeSeries) { @@ -13065,11 +13347,11 @@ func (newState *MonitorTimeSeries) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MonitorTimeSeries) SyncEffectiveFieldsDuringRead(existingState MonitorTimeSeries) { } -func (c MonitorTimeSeries) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "granularities")...) - cs.SetRequired(append(path, "timestamp_col")...) +func (c MonitorTimeSeries) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["granularities"] = attrs["granularities"].SetRequired() + attrs["timestamp_col"] = attrs["timestamp_col"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MonitorTimeSeries. @@ -13137,7 +13419,7 @@ func (o *MonitorTimeSeries) SetGranularities(ctx context.Context, v []types.Stri type NamedTableConstraint struct { // The name of the constraint. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *NamedTableConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(plan NamedTableConstraint) { @@ -13146,10 +13428,10 @@ func (newState *NamedTableConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *NamedTableConstraint) SyncEffectiveFieldsDuringRead(existingState NamedTableConstraint) { } -func (c NamedTableConstraint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c NamedTableConstraint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NamedTableConstraint. @@ -13186,18 +13468,18 @@ func (o NamedTableConstraint) Type(ctx context.Context) attr.Type { // Online Table information. type OnlineTable struct { // Full three-part (catalog, schema, table) name of the table. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Specification of the online table. - Spec types.Object `tfsdk:"spec" tf:"optional,object"` + Spec types.Object `tfsdk:"spec"` // Online Table data synchronization status - Status types.Object `tfsdk:"status" tf:"computed,object"` + Status types.Object `tfsdk:"status"` // Data serving REST API URL for this table - TableServingUrl types.String `tfsdk:"table_serving_url" tf:"computed"` + TableServingUrl types.String `tfsdk:"table_serving_url"` // The provisioning state of the online table entity in Unity Catalog. This // is distinct from the state of the data synchronization pipeline (i.e. the // table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it // runs asynchronously). - UnityCatalogProvisioningState types.String `tfsdk:"unity_catalog_provisioning_state" tf:"computed"` + UnityCatalogProvisioningState types.String `tfsdk:"unity_catalog_provisioning_state"` } func (newState *OnlineTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTable) { @@ -13206,14 +13488,14 @@ func (newState *OnlineTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan Online func (newState *OnlineTable) SyncEffectiveFieldsDuringRead(existingState OnlineTable) { } -func (c OnlineTable) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - OnlineTableSpec{}.ApplySchemaCustomizations(cs, append(path, "spec")...) - cs.SetComputed(append(path, "status")...) - OnlineTableStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - cs.SetComputed(append(path, "table_serving_url")...) - cs.SetComputed(append(path, "unity_catalog_provisioning_state")...) +func (c OnlineTable) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() + attrs["table_serving_url"] = attrs["table_serving_url"].SetComputed() + attrs["unity_catalog_provisioning_state"] = attrs["unity_catalog_provisioning_state"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTable. @@ -13323,22 +13605,22 @@ type OnlineTableSpec struct { // the source table and there are no incremental updates. This mode is // useful for syncing views or tables without CDFs to online tables. Note // that the full-copy pipeline only supports "triggered" scheduling policy. - PerformFullCopy types.Bool `tfsdk:"perform_full_copy" tf:"optional"` + PerformFullCopy types.Bool `tfsdk:"perform_full_copy"` // ID of the associated pipeline. Generated by the server - cannot be set by // the caller. - PipelineId types.String `tfsdk:"pipeline_id" tf:"computed"` + PipelineId types.String `tfsdk:"pipeline_id"` // Primary Key columns to be used for data insert/update in the destination. - PrimaryKeyColumns types.List `tfsdk:"primary_key_columns" tf:"optional"` + PrimaryKeyColumns types.List `tfsdk:"primary_key_columns"` // Pipeline runs continuously after generating the initial data. - RunContinuously types.Object `tfsdk:"run_continuously" tf:"optional,object"` + RunContinuously types.Object `tfsdk:"run_continuously"` // Pipeline stops after generating the initial data and can be triggered // later (manually, through a cron job or through data triggers) - RunTriggered types.Object `tfsdk:"run_triggered" tf:"optional,object"` + RunTriggered types.Object `tfsdk:"run_triggered"` // Three-part (catalog, schema, table) name of the source Delta table. - SourceTableFullName types.String `tfsdk:"source_table_full_name" tf:"optional"` + SourceTableFullName types.String `tfsdk:"source_table_full_name"` // Time series key to deduplicate (tie-break) rows with the same primary // key. - TimeseriesKey types.String `tfsdk:"timeseries_key" tf:"optional"` + TimeseriesKey types.String `tfsdk:"timeseries_key"` } func (newState *OnlineTableSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTableSpec) { @@ -13347,12 +13629,16 @@ func (newState *OnlineTableSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan On func (newState *OnlineTableSpec) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpec) { } -func (c OnlineTableSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "pipeline_id")...) - OnlineTableSpecContinuousSchedulingPolicy{}.ApplySchemaCustomizations(cs, append(path, "run_continuously")...) - OnlineTableSpecTriggeredSchedulingPolicy{}.ApplySchemaCustomizations(cs, append(path, "run_triggered")...) +func (c OnlineTableSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["perform_full_copy"] = attrs["perform_full_copy"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetComputed() + attrs["primary_key_columns"] = attrs["primary_key_columns"].SetOptional() + attrs["run_continuously"] = attrs["run_continuously"].SetOptional() + attrs["run_triggered"] = attrs["run_triggered"].SetOptional() + attrs["source_table_full_name"] = attrs["source_table_full_name"].SetOptional() + attrs["timeseries_key"] = attrs["timeseries_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableSpec. @@ -13495,9 +13781,9 @@ func (newState *OnlineTableSpecContinuousSchedulingPolicy) SyncEffectiveFieldsDu func (newState *OnlineTableSpecContinuousSchedulingPolicy) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpecContinuousSchedulingPolicy) { } -func (c OnlineTableSpecContinuousSchedulingPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OnlineTableSpecContinuousSchedulingPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableSpecContinuousSchedulingPolicy. @@ -13536,9 +13822,9 @@ func (newState *OnlineTableSpecTriggeredSchedulingPolicy) SyncEffectiveFieldsDur func (newState *OnlineTableSpecTriggeredSchedulingPolicy) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpecTriggeredSchedulingPolicy) { } -func (c OnlineTableSpecTriggeredSchedulingPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OnlineTableSpecTriggeredSchedulingPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableSpecTriggeredSchedulingPolicy. @@ -13572,21 +13858,21 @@ func (o OnlineTableSpecTriggeredSchedulingPolicy) Type(ctx context.Context) attr type OnlineTableStatus struct { // Detailed status of an online table. Shown if the online table is in the // ONLINE_CONTINUOUS_UPDATE or the ONLINE_UPDATING_PIPELINE_RESOURCES state. - ContinuousUpdateStatus types.Object `tfsdk:"continuous_update_status" tf:"optional,object"` + ContinuousUpdateStatus types.Object `tfsdk:"continuous_update_status"` // The state of the online table. - DetailedState types.String `tfsdk:"detailed_state" tf:"optional"` + DetailedState types.String `tfsdk:"detailed_state"` // Detailed status of an online table. Shown if the online table is in the // OFFLINE_FAILED or the ONLINE_PIPELINE_FAILED state. - FailedStatus types.Object `tfsdk:"failed_status" tf:"optional,object"` + FailedStatus types.Object `tfsdk:"failed_status"` // A text description of the current state of the online table. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Detailed status of an online table. Shown if the online table is in the // PROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT // state. - ProvisioningStatus types.Object `tfsdk:"provisioning_status" tf:"optional,object"` + ProvisioningStatus types.Object `tfsdk:"provisioning_status"` // Detailed status of an online table. Shown if the online table is in the // ONLINE_TRIGGERED_UPDATE or the ONLINE_NO_PENDING_UPDATE state. - TriggeredUpdateStatus types.Object `tfsdk:"triggered_update_status" tf:"optional,object"` + TriggeredUpdateStatus types.Object `tfsdk:"triggered_update_status"` } func (newState *OnlineTableStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTableStatus) { @@ -13595,13 +13881,15 @@ func (newState *OnlineTableStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *OnlineTableStatus) SyncEffectiveFieldsDuringRead(existingState OnlineTableStatus) { } -func (c OnlineTableStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ContinuousUpdateStatus{}.ApplySchemaCustomizations(cs, append(path, "continuous_update_status")...) - FailedStatus{}.ApplySchemaCustomizations(cs, append(path, "failed_status")...) - ProvisioningStatus{}.ApplySchemaCustomizations(cs, append(path, "provisioning_status")...) - TriggeredUpdateStatus{}.ApplySchemaCustomizations(cs, append(path, "triggered_update_status")...) +func (c OnlineTableStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["continuous_update_status"] = attrs["continuous_update_status"].SetOptional() + attrs["detailed_state"] = attrs["detailed_state"].SetOptional() + attrs["failed_status"] = attrs["failed_status"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["provisioning_status"] = attrs["provisioning_status"].SetOptional() + attrs["triggered_update_status"] = attrs["triggered_update_status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OnlineTableStatus. @@ -13764,11 +14052,11 @@ func (o *OnlineTableStatus) SetTriggeredUpdateStatus(ctx context.Context, v Trig type PermissionsChange struct { // The set of privileges to add. - Add types.List `tfsdk:"add" tf:"optional"` + Add types.List `tfsdk:"add"` // The principal whose privileges we are changing. - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The set of privileges to remove. - Remove types.List `tfsdk:"remove" tf:"optional"` + Remove types.List `tfsdk:"remove"` } func (newState *PermissionsChange) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionsChange) { @@ -13777,9 +14065,12 @@ func (newState *PermissionsChange) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PermissionsChange) SyncEffectiveFieldsDuringRead(existingState PermissionsChange) { } -func (c PermissionsChange) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermissionsChange) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["add"] = attrs["add"].SetOptional() + attrs["principal"] = attrs["principal"].SetOptional() + attrs["remove"] = attrs["remove"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsChange. @@ -13878,7 +14169,7 @@ func (o *PermissionsChange) SetRemove(ctx context.Context, v []types.String) { type PermissionsList struct { // The privileges assigned to each principal - PrivilegeAssignments types.List `tfsdk:"privilege_assignments" tf:"optional"` + PrivilegeAssignments types.List `tfsdk:"privilege_assignments"` } func (newState *PermissionsList) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionsList) { @@ -13887,10 +14178,10 @@ func (newState *PermissionsList) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pe func (newState *PermissionsList) SyncEffectiveFieldsDuringRead(existingState PermissionsList) { } -func (c PermissionsList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PrivilegeAssignment{}.ApplySchemaCustomizations(cs, append(path, "privilege_assignments")...) +func (c PermissionsList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["privilege_assignments"] = attrs["privilege_assignments"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsList. @@ -13957,17 +14248,17 @@ func (o *PermissionsList) SetPrivilegeAssignments(ctx context.Context, v []Privi // Progress information of the Online Table data synchronization pipeline. type PipelineProgress struct { // The estimated time remaining to complete this update in seconds. - EstimatedCompletionTimeSeconds types.Float64 `tfsdk:"estimated_completion_time_seconds" tf:"optional"` + EstimatedCompletionTimeSeconds types.Float64 `tfsdk:"estimated_completion_time_seconds"` // The source table Delta version that was last processed by the pipeline. // The pipeline may not have completely processed this version yet. - LatestVersionCurrentlyProcessing types.Int64 `tfsdk:"latest_version_currently_processing" tf:"optional"` + LatestVersionCurrentlyProcessing types.Int64 `tfsdk:"latest_version_currently_processing"` // The completion ratio of this update. This is a number between 0 and 1. - SyncProgressCompletion types.Float64 `tfsdk:"sync_progress_completion" tf:"optional"` + SyncProgressCompletion types.Float64 `tfsdk:"sync_progress_completion"` // The number of rows that have been synced in this update. - SyncedRowCount types.Int64 `tfsdk:"synced_row_count" tf:"optional"` + SyncedRowCount types.Int64 `tfsdk:"synced_row_count"` // The total number of rows that need to be synced in this update. This // number may be an estimate. - TotalRowCount types.Int64 `tfsdk:"total_row_count" tf:"optional"` + TotalRowCount types.Int64 `tfsdk:"total_row_count"` } func (newState *PipelineProgress) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineProgress) { @@ -13976,9 +14267,14 @@ func (newState *PipelineProgress) SyncEffectiveFieldsDuringCreateOrUpdate(plan P func (newState *PipelineProgress) SyncEffectiveFieldsDuringRead(existingState PipelineProgress) { } -func (c PipelineProgress) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineProgress) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["estimated_completion_time_seconds"] = attrs["estimated_completion_time_seconds"].SetOptional() + attrs["latest_version_currently_processing"] = attrs["latest_version_currently_processing"].SetOptional() + attrs["sync_progress_completion"] = attrs["sync_progress_completion"].SetOptional() + attrs["synced_row_count"] = attrs["synced_row_count"].SetOptional() + attrs["total_row_count"] = attrs["total_row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineProgress. @@ -14022,9 +14318,9 @@ func (o PipelineProgress) Type(ctx context.Context) attr.Type { type PrimaryKeyConstraint struct { // Column names for this constraint. - ChildColumns types.List `tfsdk:"child_columns" tf:""` + ChildColumns types.List `tfsdk:"child_columns"` // The name of the constraint. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *PrimaryKeyConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrimaryKeyConstraint) { @@ -14033,11 +14329,11 @@ func (newState *PrimaryKeyConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *PrimaryKeyConstraint) SyncEffectiveFieldsDuringRead(existingState PrimaryKeyConstraint) { } -func (c PrimaryKeyConstraint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "child_columns")...) - cs.SetRequired(append(path, "name")...) +func (c PrimaryKeyConstraint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["child_columns"] = attrs["child_columns"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrimaryKeyConstraint. @@ -14105,9 +14401,9 @@ func (o *PrimaryKeyConstraint) SetChildColumns(ctx context.Context, v []types.St type PrivilegeAssignment struct { // The principal (user email address or group name). - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The privileges assigned to the principal. - Privileges types.List `tfsdk:"privileges" tf:"optional"` + Privileges types.List `tfsdk:"privileges"` } func (newState *PrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrivilegeAssignment) { @@ -14116,9 +14412,11 @@ func (newState *PrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *PrivilegeAssignment) SyncEffectiveFieldsDuringRead(existingState PrivilegeAssignment) { } -func (c PrivilegeAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrivilegeAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetOptional() + attrs["privileges"] = attrs["privileges"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrivilegeAssignment. @@ -14186,7 +14484,7 @@ func (o *PrivilegeAssignment) SetPrivileges(ctx context.Context, v []types.Strin // Status of an asynchronously provisioned resource. type ProvisioningInfo struct { - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *ProvisioningInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProvisioningInfo) { @@ -14195,9 +14493,10 @@ func (newState *ProvisioningInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan P func (newState *ProvisioningInfo) SyncEffectiveFieldsDuringRead(existingState ProvisioningInfo) { } -func (c ProvisioningInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ProvisioningInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProvisioningInfo. @@ -14236,7 +14535,7 @@ func (o ProvisioningInfo) Type(ctx context.Context) attr.Type { type ProvisioningStatus struct { // Details about initial data synchronization. Only populated when in the // PROVISIONING_INITIAL_SNAPSHOT state. - InitialPipelineSyncProgress types.Object `tfsdk:"initial_pipeline_sync_progress" tf:"optional,object"` + InitialPipelineSyncProgress types.Object `tfsdk:"initial_pipeline_sync_progress"` } func (newState *ProvisioningStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProvisioningStatus) { @@ -14245,10 +14544,10 @@ func (newState *ProvisioningStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ProvisioningStatus) SyncEffectiveFieldsDuringRead(existingState ProvisioningStatus) { } -func (c ProvisioningStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineProgress{}.ApplySchemaCustomizations(cs, append(path, "initial_pipeline_sync_progress")...) +func (c ProvisioningStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["initial_pipeline_sync_progress"] = attrs["initial_pipeline_sync_progress"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProvisioningStatus. @@ -14314,18 +14613,18 @@ func (o *ProvisioningStatus) SetInitialPipelineSyncProgress(ctx context.Context, type QuotaInfo struct { // The timestamp that indicates when the quota count was last updated. - LastRefreshedAt types.Int64 `tfsdk:"last_refreshed_at" tf:"optional"` + LastRefreshedAt types.Int64 `tfsdk:"last_refreshed_at"` // Name of the parent resource. Returns metastore ID if the parent is a // metastore. - ParentFullName types.String `tfsdk:"parent_full_name" tf:"optional"` + ParentFullName types.String `tfsdk:"parent_full_name"` // The quota parent securable type. - ParentSecurableType types.String `tfsdk:"parent_securable_type" tf:"optional"` + ParentSecurableType types.String `tfsdk:"parent_securable_type"` // The current usage of the resource quota. - QuotaCount types.Int64 `tfsdk:"quota_count" tf:"optional"` + QuotaCount types.Int64 `tfsdk:"quota_count"` // The current limit of the resource quota. - QuotaLimit types.Int64 `tfsdk:"quota_limit" tf:"optional"` + QuotaLimit types.Int64 `tfsdk:"quota_limit"` // The name of the quota. - QuotaName types.String `tfsdk:"quota_name" tf:"optional"` + QuotaName types.String `tfsdk:"quota_name"` } func (newState *QuotaInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuotaInfo) { @@ -14334,9 +14633,15 @@ func (newState *QuotaInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuotaInf func (newState *QuotaInfo) SyncEffectiveFieldsDuringRead(existingState QuotaInfo) { } -func (c QuotaInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c QuotaInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_refreshed_at"] = attrs["last_refreshed_at"].SetOptional() + attrs["parent_full_name"] = attrs["parent_full_name"].SetOptional() + attrs["parent_securable_type"] = attrs["parent_securable_type"].SetOptional() + attrs["quota_count"] = attrs["quota_count"].SetOptional() + attrs["quota_limit"] = attrs["quota_limit"].SetOptional() + attrs["quota_name"] = attrs["quota_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QuotaInfo. @@ -14384,11 +14689,11 @@ func (o QuotaInfo) Type(ctx context.Context) attr.Type { // https://developers.cloudflare.com/r2/api/s3/tokens/. type R2Credentials struct { // The access key ID that identifies the temporary credentials. - AccessKeyId types.String `tfsdk:"access_key_id" tf:"optional"` + AccessKeyId types.String `tfsdk:"access_key_id"` // The secret access key associated with the access key. - SecretAccessKey types.String `tfsdk:"secret_access_key" tf:"optional"` + SecretAccessKey types.String `tfsdk:"secret_access_key"` // The generated JWT that users must pass to use the temporary credentials. - SessionToken types.String `tfsdk:"session_token" tf:"optional"` + SessionToken types.String `tfsdk:"session_token"` } func (newState *R2Credentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan R2Credentials) { @@ -14397,9 +14702,12 @@ func (newState *R2Credentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan R2Cr func (newState *R2Credentials) SyncEffectiveFieldsDuringRead(existingState R2Credentials) { } -func (c R2Credentials) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c R2Credentials) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_key_id"] = attrs["access_key_id"].SetOptional() + attrs["secret_access_key"] = attrs["secret_access_key"].SetOptional() + attrs["session_token"] = attrs["session_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in R2Credentials. @@ -14484,7 +14792,7 @@ type RegenerateDashboardRequest struct { TableName types.String `tfsdk:"-"` // Optional argument to specify the warehouse for dashboard regeneration. If // not specified, the first running warehouse will be used. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *RegenerateDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegenerateDashboardRequest) { @@ -14493,10 +14801,11 @@ func (newState *RegenerateDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpd func (newState *RegenerateDashboardRequest) SyncEffectiveFieldsDuringRead(existingState RegenerateDashboardRequest) { } -func (c RegenerateDashboardRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "table_name")...) +func (c RegenerateDashboardRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegenerateDashboardRequest. @@ -14534,9 +14843,9 @@ func (o RegenerateDashboardRequest) Type(ctx context.Context) attr.Type { type RegenerateDashboardResponse struct { // Id of the regenerated monitoring dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The directory where the regenerated dashboard is stored. - ParentFolder types.String `tfsdk:"parent_folder" tf:"optional"` + ParentFolder types.String `tfsdk:"parent_folder"` } func (newState *RegenerateDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegenerateDashboardResponse) { @@ -14545,9 +14854,11 @@ func (newState *RegenerateDashboardResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *RegenerateDashboardResponse) SyncEffectiveFieldsDuringRead(existingState RegenerateDashboardResponse) { } -func (c RegenerateDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegenerateDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["parent_folder"] = attrs["parent_folder"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegenerateDashboardResponse. @@ -14586,9 +14897,9 @@ func (o RegenerateDashboardResponse) Type(ctx context.Context) attr.Type { // Registered model alias. type RegisteredModelAlias struct { // Name of the alias, e.g. 'champion' or 'latest_stable' - AliasName types.String `tfsdk:"alias_name" tf:"optional"` + AliasName types.String `tfsdk:"alias_name"` // Integer version number of the model version to which this alias points. - VersionNum types.Int64 `tfsdk:"version_num" tf:"optional"` + VersionNum types.Int64 `tfsdk:"version_num"` } func (newState *RegisteredModelAlias) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelAlias) { @@ -14597,9 +14908,11 @@ func (newState *RegisteredModelAlias) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RegisteredModelAlias) SyncEffectiveFieldsDuringRead(existingState RegisteredModelAlias) { } -func (c RegisteredModelAlias) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelAlias) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alias_name"] = attrs["alias_name"].SetOptional() + attrs["version_num"] = attrs["version_num"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelAlias. @@ -14637,38 +14950,38 @@ func (o RegisteredModelAlias) Type(ctx context.Context) attr.Type { type RegisteredModelInfo struct { // List of aliases associated with the registered model - Aliases types.List `tfsdk:"aliases" tf:"optional"` + Aliases types.List `tfsdk:"aliases"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The name of the catalog where the schema and the registered model reside - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the registered model - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation timestamp of the registered model in milliseconds since the Unix // epoch - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The identifier of the user who created the registered model - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The three-level (fully qualified) name of the registered model - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the metastore - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the registered model - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The identifier of the user who owns the registered model - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The name of the schema where the registered model resides - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud under which model version data files // are stored - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Last-update timestamp of the registered model in milliseconds since the // Unix epoch - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The identifier of the user who updated the registered model last time - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *RegisteredModelInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelInfo) { @@ -14677,10 +14990,23 @@ func (newState *RegisteredModelInfo) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RegisteredModelInfo) SyncEffectiveFieldsDuringRead(existingState RegisteredModelInfo) { } -func (c RegisteredModelInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAlias{}.ApplySchemaCustomizations(cs, append(path, "aliases")...) +func (c RegisteredModelInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aliases"] = attrs["aliases"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelInfo. @@ -14811,42 +15137,42 @@ type SchemaInfo struct { // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The type of the parent catalog. - CatalogType types.String `tfsdk:"catalog_type" tf:"optional"` + CatalogType types.String `tfsdk:"catalog_type"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this schema was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of schema creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - EffectivePredictiveOptimizationFlag types.Object `tfsdk:"effective_predictive_optimization_flag" tf:"optional,object"` + EffectivePredictiveOptimizationFlag types.Object `tfsdk:"effective_predictive_optimization_flag"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Full name of schema, in form of __catalog_name__.__schema_name__. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of schema, relative to parent catalog. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of schema. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` // The unique identifier of the schema. - SchemaId types.String `tfsdk:"schema_id" tf:"optional"` + SchemaId types.String `tfsdk:"schema_id"` // Storage location for managed tables within schema. - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for managed tables within schema. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Time at which this schema was created, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified schema. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *SchemaInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan SchemaInfo) { @@ -14855,10 +15181,27 @@ func (newState *SchemaInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan SchemaI func (newState *SchemaInfo) SyncEffectiveFieldsDuringRead(existingState SchemaInfo) { } -func (c SchemaInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EffectivePredictiveOptimizationFlag{}.ApplySchemaCustomizations(cs, append(path, "effective_predictive_optimization_flag")...) - - return cs +func (c SchemaInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["catalog_type"] = attrs["catalog_type"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["schema_id"] = attrs["schema_id"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SchemaInfo. @@ -14987,7 +15330,7 @@ func (o *SchemaInfo) SetProperties(ctx context.Context, v map[string]types.Strin type SetArtifactAllowlist struct { // A list of allowed artifact match patterns. - ArtifactMatchers types.List `tfsdk:"artifact_matchers" tf:""` + ArtifactMatchers types.List `tfsdk:"artifact_matchers"` // The artifact type of the allowlist. ArtifactType types.String `tfsdk:"-"` } @@ -14998,12 +15341,11 @@ func (newState *SetArtifactAllowlist) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SetArtifactAllowlist) SyncEffectiveFieldsDuringRead(existingState SetArtifactAllowlist) { } -func (c SetArtifactAllowlist) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "artifact_matchers")...) - ArtifactMatcher{}.ApplySchemaCustomizations(cs, append(path, "artifact_matchers")...) - cs.SetRequired(append(path, "artifact_type")...) +func (c SetArtifactAllowlist) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_matchers"] = attrs["artifact_matchers"].SetRequired() + attrs["artifact_type"] = attrs["artifact_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetArtifactAllowlist. @@ -15071,11 +15413,11 @@ func (o *SetArtifactAllowlist) SetArtifactMatchers(ctx context.Context, v []Arti type SetRegisteredModelAliasRequest struct { // The name of the alias - Alias types.String `tfsdk:"alias" tf:""` + Alias types.String `tfsdk:"alias"` // Full name of the registered model - FullName types.String `tfsdk:"full_name" tf:""` + FullName types.String `tfsdk:"full_name"` // The version number of the model version to which the alias points - VersionNum types.Int64 `tfsdk:"version_num" tf:""` + VersionNum types.Int64 `tfsdk:"version_num"` } func (newState *SetRegisteredModelAliasRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetRegisteredModelAliasRequest) { @@ -15084,12 +15426,12 @@ func (newState *SetRegisteredModelAliasRequest) SyncEffectiveFieldsDuringCreateO func (newState *SetRegisteredModelAliasRequest) SyncEffectiveFieldsDuringRead(existingState SetRegisteredModelAliasRequest) { } -func (c SetRegisteredModelAliasRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "alias")...) - cs.SetRequired(append(path, "full_name")...) - cs.SetRequired(append(path, "version_num")...) +func (c SetRegisteredModelAliasRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alias"] = attrs["alias"].SetRequired() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["version_num"] = attrs["version_num"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetRegisteredModelAliasRequest. @@ -15130,10 +15472,10 @@ func (o SetRegisteredModelAliasRequest) Type(ctx context.Context) attr.Type { // Server-Side Encryption properties for clients communicating with AWS s3. type SseEncryptionDetails struct { // The type of key encryption to use (affects headers from s3 client). - Algorithm types.String `tfsdk:"algorithm" tf:"optional"` + Algorithm types.String `tfsdk:"algorithm"` // When algorithm is **AWS_SSE_KMS** this field specifies the ARN of the SSE // key to use. - AwsKmsKeyArn types.String `tfsdk:"aws_kms_key_arn" tf:"optional"` + AwsKmsKeyArn types.String `tfsdk:"aws_kms_key_arn"` } func (newState *SseEncryptionDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan SseEncryptionDetails) { @@ -15142,9 +15484,11 @@ func (newState *SseEncryptionDetails) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SseEncryptionDetails) SyncEffectiveFieldsDuringRead(existingState SseEncryptionDetails) { } -func (c SseEncryptionDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SseEncryptionDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["algorithm"] = attrs["algorithm"].SetOptional() + attrs["aws_kms_key_arn"] = attrs["aws_kms_key_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SseEncryptionDetails. @@ -15182,42 +15526,42 @@ func (o SseEncryptionDetails) Type(ctx context.Context) attr.Type { type StorageCredentialInfo struct { // The AWS IAM role configuration. - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this Credential was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of credential creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // The full name of the credential. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the credential. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The credential name. The name must be unique within the metastore. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Time at which this credential was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the credential. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // Whether this credential is the current metastore's root storage // credential. - UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage" tf:"optional"` + UsedForManagedStorage types.Bool `tfsdk:"used_for_managed_storage"` } func (newState *StorageCredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan StorageCredentialInfo) { @@ -15226,14 +15570,27 @@ func (newState *StorageCredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *StorageCredentialInfo) SyncEffectiveFieldsDuringRead(existingState StorageCredentialInfo) { } -func (c StorageCredentialInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleResponse{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityResponse{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountResponse{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - - return cs +func (c StorageCredentialInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["used_for_managed_storage"] = attrs["used_for_managed_storage"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StorageCredentialInfo. @@ -15449,10 +15806,10 @@ func (o *StorageCredentialInfo) SetDatabricksGcpServiceAccount(ctx context.Conte type SystemSchemaInfo struct { // Name of the system schema. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // The current state of enablement for the system schema. An empty string // means the system schema is available and ready for opt-in. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *SystemSchemaInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan SystemSchemaInfo) { @@ -15461,9 +15818,11 @@ func (newState *SystemSchemaInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SystemSchemaInfo) SyncEffectiveFieldsDuringRead(existingState SystemSchemaInfo) { } -func (c SystemSchemaInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SystemSchemaInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["schema"] = attrs["schema"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SystemSchemaInfo. @@ -15503,11 +15862,11 @@ func (o SystemSchemaInfo) Type(ctx context.Context) attr.Type { // __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. type TableConstraint struct { - ForeignKeyConstraint types.Object `tfsdk:"foreign_key_constraint" tf:"optional,object"` + ForeignKeyConstraint types.Object `tfsdk:"foreign_key_constraint"` - NamedTableConstraint types.Object `tfsdk:"named_table_constraint" tf:"optional,object"` + NamedTableConstraint types.Object `tfsdk:"named_table_constraint"` - PrimaryKeyConstraint types.Object `tfsdk:"primary_key_constraint" tf:"optional,object"` + PrimaryKeyConstraint types.Object `tfsdk:"primary_key_constraint"` } func (newState *TableConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableConstraint) { @@ -15516,12 +15875,12 @@ func (newState *TableConstraint) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ta func (newState *TableConstraint) SyncEffectiveFieldsDuringRead(existingState TableConstraint) { } -func (c TableConstraint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ForeignKeyConstraint{}.ApplySchemaCustomizations(cs, append(path, "foreign_key_constraint")...) - NamedTableConstraint{}.ApplySchemaCustomizations(cs, append(path, "named_table_constraint")...) - PrimaryKeyConstraint{}.ApplySchemaCustomizations(cs, append(path, "primary_key_constraint")...) +func (c TableConstraint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["foreign_key_constraint"] = attrs["foreign_key_constraint"].SetOptional() + attrs["named_table_constraint"] = attrs["named_table_constraint"].SetOptional() + attrs["primary_key_constraint"] = attrs["primary_key_constraint"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableConstraint. @@ -15651,7 +16010,7 @@ func (o *TableConstraint) SetPrimaryKeyConstraint(ctx context.Context, v Primary type TableDependency struct { // Full name of the dependent table, in the form of // __catalog_name__.__schema_name__.__table_name__. - TableFullName types.String `tfsdk:"table_full_name" tf:""` + TableFullName types.String `tfsdk:"table_full_name"` } func (newState *TableDependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableDependency) { @@ -15660,10 +16019,10 @@ func (newState *TableDependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ta func (newState *TableDependency) SyncEffectiveFieldsDuringRead(existingState TableDependency) { } -func (c TableDependency) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "table_full_name")...) +func (c TableDependency) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["table_full_name"] = attrs["table_full_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableDependency. @@ -15699,7 +16058,7 @@ func (o TableDependency) Type(ctx context.Context) attr.Type { type TableExistsResponse struct { // Whether the table exists or not. - TableExists types.Bool `tfsdk:"table_exists" tf:"optional"` + TableExists types.Bool `tfsdk:"table_exists"` } func (newState *TableExistsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableExistsResponse) { @@ -15708,9 +16067,10 @@ func (newState *TableExistsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *TableExistsResponse) SyncEffectiveFieldsDuringRead(existingState TableExistsResponse) { } -func (c TableExistsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableExistsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["table_exists"] = attrs["table_exists"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableExistsResponse. @@ -15746,82 +16106,82 @@ func (o TableExistsResponse) Type(ctx context.Context) attr.Type { type TableInfo struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // Name of parent catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The array of __ColumnInfo__ definitions of the table's columns. - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this table was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of table creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Unique ID of the Data Access Configuration to use with the table data. - DataAccessConfigurationId types.String `tfsdk:"data_access_configuration_id" tf:"optional"` + DataAccessConfigurationId types.String `tfsdk:"data_access_configuration_id"` // Data source format - DataSourceFormat types.String `tfsdk:"data_source_format" tf:"optional"` + DataSourceFormat types.String `tfsdk:"data_source_format"` // Time at which this table was deleted, in epoch milliseconds. Field is // omitted if table is not deleted. - DeletedAt types.Int64 `tfsdk:"deleted_at" tf:"optional"` + DeletedAt types.Int64 `tfsdk:"deleted_at"` // Information pertaining to current state of the delta table. - DeltaRuntimePropertiesKvpairs types.Object `tfsdk:"delta_runtime_properties_kvpairs" tf:"optional,object"` + DeltaRuntimePropertiesKvpairs types.Object `tfsdk:"delta_runtime_properties_kvpairs"` - EffectivePredictiveOptimizationFlag types.Object `tfsdk:"effective_predictive_optimization_flag" tf:"optional,object"` + EffectivePredictiveOptimizationFlag types.Object `tfsdk:"effective_predictive_optimization_flag"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.Object `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.Object `tfsdk:"encryption_details"` // Full name of table, in form of // __catalog_name__.__schema_name__.__table_name__ - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // Unique identifier of parent metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of table, relative to parent schema. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of current owner of table. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The pipeline ID of the table. Applicable for tables created by pipelines // (Materialized View, Streaming Table, etc.). - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` - RowFilter types.Object `tfsdk:"row_filter" tf:"optional,object"` + RowFilter types.Object `tfsdk:"row_filter"` // Name of parent schema relative to its parent catalog. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // List of schemes whose objects can be referenced without qualification. - SqlPath types.String `tfsdk:"sql_path" tf:"optional"` + SqlPath types.String `tfsdk:"sql_path"` // Name of the storage credential, when a storage credential is configured // for use with this table. - StorageCredentialName types.String `tfsdk:"storage_credential_name" tf:"optional"` + StorageCredentialName types.String `tfsdk:"storage_credential_name"` // Storage root URL for table (for **MANAGED**, **EXTERNAL** tables) - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // List of table constraints. Note: this field is not set in the output of // the __listTables__ API. - TableConstraints types.List `tfsdk:"table_constraints" tf:"optional"` + TableConstraints types.List `tfsdk:"table_constraints"` // The unique identifier of the table. - TableId types.String `tfsdk:"table_id" tf:"optional"` + TableId types.String `tfsdk:"table_id"` - TableType types.String `tfsdk:"table_type" tf:"optional"` + TableType types.String `tfsdk:"table_type"` // Time at which this table was last modified, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified the table. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // View definition SQL (when __table_type__ is **VIEW**, // **MATERIALIZED_VIEW**, or **STREAMING_TABLE**) - ViewDefinition types.String `tfsdk:"view_definition" tf:"optional"` + ViewDefinition types.String `tfsdk:"view_definition"` // View dependencies (when table_type == **VIEW** or **MATERIALIZED_VIEW**, // **STREAMING_TABLE**) - when DependencyList is None, the dependency is not // provided; - when DependencyList is an empty list, the dependency is // provided but is empty; - when DependencyList is not an empty list, // dependencies are provided and recorded. - ViewDependencies types.Object `tfsdk:"view_dependencies" tf:"optional,object"` + ViewDependencies types.Object `tfsdk:"view_dependencies"` } func (newState *TableInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableInfo) { @@ -15830,16 +16190,41 @@ func (newState *TableInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableInf func (newState *TableInfo) SyncEffectiveFieldsDuringRead(existingState TableInfo) { } -func (c TableInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnInfo{}.ApplySchemaCustomizations(cs, append(path, "columns")...) - DeltaRuntimePropertiesKvPairs{}.ApplySchemaCustomizations(cs, append(path, "delta_runtime_properties_kvpairs")...) - EffectivePredictiveOptimizationFlag{}.ApplySchemaCustomizations(cs, append(path, "effective_predictive_optimization_flag")...) - EncryptionDetails{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - TableRowFilter{}.ApplySchemaCustomizations(cs, append(path, "row_filter")...) - TableConstraint{}.ApplySchemaCustomizations(cs, append(path, "table_constraints")...) - DependencyList{}.ApplySchemaCustomizations(cs, append(path, "view_dependencies")...) - - return cs +func (c TableInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["columns"] = attrs["columns"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_access_configuration_id"] = attrs["data_access_configuration_id"].SetOptional() + attrs["data_source_format"] = attrs["data_source_format"].SetOptional() + attrs["deleted_at"] = attrs["deleted_at"].SetOptional() + attrs["delta_runtime_properties_kvpairs"] = attrs["delta_runtime_properties_kvpairs"].SetOptional() + attrs["effective_predictive_optimization_flag"] = attrs["effective_predictive_optimization_flag"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() + attrs["row_filter"] = attrs["row_filter"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["sql_path"] = attrs["sql_path"].SetOptional() + attrs["storage_credential_name"] = attrs["storage_credential_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["table_constraints"] = attrs["table_constraints"].SetOptional() + attrs["table_id"] = attrs["table_id"].SetOptional() + attrs["table_type"] = attrs["table_type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["view_definition"] = attrs["view_definition"].SetOptional() + attrs["view_dependencies"] = attrs["view_dependencies"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableInfo. @@ -16170,11 +16555,11 @@ func (o *TableInfo) SetViewDependencies(ctx context.Context, v DependencyList) { type TableRowFilter struct { // The full name of the row filter SQL UDF. - FunctionName types.String `tfsdk:"function_name" tf:""` + FunctionName types.String `tfsdk:"function_name"` // The list of table columns to be passed as input to the row filter // function. The column types should match the types of the filter function // arguments. - InputColumnNames types.List `tfsdk:"input_column_names" tf:""` + InputColumnNames types.List `tfsdk:"input_column_names"` } func (newState *TableRowFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableRowFilter) { @@ -16183,11 +16568,11 @@ func (newState *TableRowFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan Tab func (newState *TableRowFilter) SyncEffectiveFieldsDuringRead(existingState TableRowFilter) { } -func (c TableRowFilter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "function_name")...) - cs.SetRequired(append(path, "input_column_names")...) +func (c TableRowFilter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["function_name"] = attrs["function_name"].SetRequired() + attrs["input_column_names"] = attrs["input_column_names"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableRowFilter. @@ -16255,9 +16640,9 @@ func (o *TableRowFilter) SetInputColumnNames(ctx context.Context, v []types.Stri type TableSummary struct { // The full name of the table. - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` - TableType types.String `tfsdk:"table_type" tf:"optional"` + TableType types.String `tfsdk:"table_type"` } func (newState *TableSummary) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSummary) { @@ -16266,9 +16651,11 @@ func (newState *TableSummary) SyncEffectiveFieldsDuringCreateOrUpdate(plan Table func (newState *TableSummary) SyncEffectiveFieldsDuringRead(existingState TableSummary) { } -func (c TableSummary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableSummary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["table_type"] = attrs["table_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableSummary. @@ -16307,14 +16694,14 @@ func (o TableSummary) Type(ctx context.Context) attr.Type { type TemporaryCredentials struct { // AWS temporary credentials for API authentication. Read more at // https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html. - AwsTempCredentials types.Object `tfsdk:"aws_temp_credentials" tf:"optional,object"` + AwsTempCredentials types.Object `tfsdk:"aws_temp_credentials"` // Azure Active Directory token, essentially the Oauth token for Azure // Service Principal or Managed Identity. Read more at // https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token - AzureAad types.Object `tfsdk:"azure_aad" tf:"optional,object"` + AzureAad types.Object `tfsdk:"azure_aad"` // Server time when the credential will expire, in epoch milliseconds. The // API client is advised to cache the credential given this expiration time. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` } func (newState *TemporaryCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan TemporaryCredentials) { @@ -16323,11 +16710,12 @@ func (newState *TemporaryCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *TemporaryCredentials) SyncEffectiveFieldsDuringRead(existingState TemporaryCredentials) { } -func (c TemporaryCredentials) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsCredentials{}.ApplySchemaCustomizations(cs, append(path, "aws_temp_credentials")...) - AzureActiveDirectoryToken{}.ApplySchemaCustomizations(cs, append(path, "azure_aad")...) +func (c TemporaryCredentials) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_temp_credentials"] = attrs["aws_temp_credentials"].SetOptional() + attrs["azure_aad"] = attrs["azure_aad"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TemporaryCredentials. @@ -16430,12 +16818,12 @@ type TriggeredUpdateStatus struct { // The last source table Delta version that was synced to the online table. // Note that this Delta version may not be completely synced to the online // table yet. - LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version" tf:"optional"` + LastProcessedCommitVersion types.Int64 `tfsdk:"last_processed_commit_version"` // The timestamp of the last time any data was synchronized from the source // table to the online table. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` // Progress of the active data synchronization pipeline. - TriggeredUpdateProgress types.Object `tfsdk:"triggered_update_progress" tf:"optional,object"` + TriggeredUpdateProgress types.Object `tfsdk:"triggered_update_progress"` } func (newState *TriggeredUpdateStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan TriggeredUpdateStatus) { @@ -16444,10 +16832,12 @@ func (newState *TriggeredUpdateStatus) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *TriggeredUpdateStatus) SyncEffectiveFieldsDuringRead(existingState TriggeredUpdateStatus) { } -func (c TriggeredUpdateStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineProgress{}.ApplySchemaCustomizations(cs, append(path, "triggered_update_progress")...) +func (c TriggeredUpdateStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_processed_commit_version"] = attrs["last_processed_commit_version"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() + attrs["triggered_update_progress"] = attrs["triggered_update_progress"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TriggeredUpdateStatus. @@ -16618,21 +17008,21 @@ func (o UpdateAssignmentResponse) Type(ctx context.Context) attr.Type { type UpdateCatalog struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // The name of the catalog. Name types.String `tfsdk:"-"` // New name for the catalog. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of catalog. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` } func (newState *UpdateCatalog) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCatalog) { @@ -16641,10 +17031,16 @@ func (newState *UpdateCatalog) SyncEffectiveFieldsDuringCreateOrUpdate(plan Upda func (newState *UpdateCatalog) SyncEffectiveFieldsDuringRead(existingState UpdateCatalog) { } -func (c UpdateCatalog) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateCatalog) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCatalog. @@ -16724,11 +17120,11 @@ type UpdateConnection struct { // Name of the connection. Name types.String `tfsdk:"-"` // New name for the connection. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // A map of key-value properties attached to the securable. - Options types.Map `tfsdk:"options" tf:""` + Options types.Map `tfsdk:"options"` // Username of current owner of the connection. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateConnection) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateConnection) { @@ -16737,11 +17133,13 @@ func (newState *UpdateConnection) SyncEffectiveFieldsDuringCreateOrUpdate(plan U func (newState *UpdateConnection) SyncEffectiveFieldsDuringRead(existingState UpdateConnection) { } -func (c UpdateConnection) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) +func (c UpdateConnection) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["options"] = attrs["options"].SetRequired() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateConnection. @@ -16813,36 +17211,36 @@ func (o *UpdateConnection) SetOptions(ctx context.Context, v map[string]types.St type UpdateCredentialRequest struct { // The AWS IAM role configuration - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. Only applicable when purpose // is **STORAGE**. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // GCP long-lived credential. Databricks-created Google Cloud Storage // service account. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // Force an update even if there are dependent services (when purpose is // **SERVICE**) or dependent external locations and external tables (when // purpose is **STORAGE**). - Force types.Bool `tfsdk:"force" tf:"optional"` + Force types.Bool `tfsdk:"force"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Name of the credential. NameArg types.String `tfsdk:"-"` // New name of credential. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Whether the credential is usable only for read operations. Only // applicable when purpose is **STORAGE**. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Supply true to this argument to skip validation of the updated // credential. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *UpdateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCredentialRequest) { @@ -16851,14 +17249,21 @@ func (newState *UpdateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateCredentialRequest) SyncEffectiveFieldsDuringRead(existingState UpdateCredentialRequest) { } -func (c UpdateCredentialRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - DatabricksGcpServiceAccount{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name_arg")...) +func (c UpdateCredentialRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["force"] = attrs["force"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name_arg"] = attrs["name_arg"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCredentialRequest. @@ -17033,35 +17438,35 @@ func (o *UpdateCredentialRequest) SetDatabricksGcpServiceAccount(ctx context.Con type UpdateExternalLocation struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the storage credential used with this location. - CredentialName types.String `tfsdk:"credential_name" tf:"optional"` + CredentialName types.String `tfsdk:"credential_name"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.Object `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.Object `tfsdk:"encryption_details"` // Indicates whether fallback mode is enabled for this external location. // When fallback mode is enabled, the access to the location falls back to // cluster credentials if UC credentials are not sufficient. - Fallback types.Bool `tfsdk:"fallback" tf:"optional"` + Fallback types.Bool `tfsdk:"fallback"` // Force update even if changing url invalidates dependent external tables // or mounts. - Force types.Bool `tfsdk:"force" tf:"optional"` + Force types.Bool `tfsdk:"force"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Name of the external location. Name types.String `tfsdk:"-"` // New name for the external location. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The owner of the external location. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Indicates whether the external location is read-only. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Skips validation of the storage credential associated with the external // location. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` // Path URL of the external location. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *UpdateExternalLocation) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExternalLocation) { @@ -17070,11 +17475,22 @@ func (newState *UpdateExternalLocation) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateExternalLocation) SyncEffectiveFieldsDuringRead(existingState UpdateExternalLocation) { } -func (c UpdateExternalLocation) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EncryptionDetails{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - cs.SetRequired(append(path, "name")...) +func (c UpdateExternalLocation) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["fallback"] = attrs["fallback"].SetOptional() + attrs["force"] = attrs["force"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExternalLocation. @@ -17167,7 +17583,7 @@ type UpdateFunction struct { // __catalog_name__.__schema_name__.__function__name__). Name types.String `tfsdk:"-"` // Username of current owner of function. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateFunction) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateFunction) { @@ -17176,10 +17592,11 @@ func (newState *UpdateFunction) SyncEffectiveFieldsDuringCreateOrUpdate(plan Upd func (newState *UpdateFunction) SyncEffectiveFieldsDuringRead(existingState UpdateFunction) { } -func (c UpdateFunction) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateFunction) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateFunction. @@ -17218,22 +17635,22 @@ func (o UpdateFunction) Type(ctx context.Context) attr.Type { type UpdateMetastore struct { // The organization name of a Delta Sharing entity, to be used in // Databricks-to-Databricks Delta Sharing as the official name. - DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name" tf:"optional"` + DeltaSharingOrganizationName types.String `tfsdk:"delta_sharing_organization_name"` // The lifetime of delta sharing recipient token in seconds. - DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds" tf:"optional"` + DeltaSharingRecipientTokenLifetimeInSeconds types.Int64 `tfsdk:"delta_sharing_recipient_token_lifetime_in_seconds"` // The scope of Delta Sharing enabled for the metastore. - DeltaSharingScope types.String `tfsdk:"delta_sharing_scope" tf:"optional"` + DeltaSharingScope types.String `tfsdk:"delta_sharing_scope"` // Unique ID of the metastore. Id types.String `tfsdk:"-"` // New name for the metastore. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The owner of the metastore. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Privilege model version of the metastore, of the form `major.minor` // (e.g., `1.0`). - PrivilegeModelVersion types.String `tfsdk:"privilege_model_version" tf:"optional"` + PrivilegeModelVersion types.String `tfsdk:"privilege_model_version"` // UUID of storage credential to access the metastore storage_root. - StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id" tf:"optional"` + StorageRootCredentialId types.String `tfsdk:"storage_root_credential_id"` } func (newState *UpdateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateMetastore) { @@ -17242,10 +17659,17 @@ func (newState *UpdateMetastore) SyncEffectiveFieldsDuringCreateOrUpdate(plan Up func (newState *UpdateMetastore) SyncEffectiveFieldsDuringRead(existingState UpdateMetastore) { } -func (c UpdateMetastore) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c UpdateMetastore) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["delta_sharing_organization_name"] = attrs["delta_sharing_organization_name"].SetOptional() + attrs["delta_sharing_recipient_token_lifetime_in_seconds"] = attrs["delta_sharing_recipient_token_lifetime_in_seconds"].SetOptional() + attrs["delta_sharing_scope"] = attrs["delta_sharing_scope"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["privilege_model_version"] = attrs["privilege_model_version"].SetOptional() + attrs["storage_root_credential_id"] = attrs["storage_root_credential_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateMetastore. @@ -17297,9 +17721,9 @@ type UpdateMetastoreAssignment struct { // The name of the default catalog in the metastore. This field is // depracted. Please use "Default Namespace API" to configure the default // catalog for a Databricks workspace. - DefaultCatalogName types.String `tfsdk:"default_catalog_name" tf:"optional"` + DefaultCatalogName types.String `tfsdk:"default_catalog_name"` // The unique ID of the metastore. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // A workspace ID. WorkspaceId types.Int64 `tfsdk:"-"` } @@ -17310,10 +17734,12 @@ func (newState *UpdateMetastoreAssignment) SyncEffectiveFieldsDuringCreateOrUpda func (newState *UpdateMetastoreAssignment) SyncEffectiveFieldsDuringRead(existingState UpdateMetastoreAssignment) { } -func (c UpdateMetastoreAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "workspace_id")...) +func (c UpdateMetastoreAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_catalog_name"] = attrs["default_catalog_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateMetastoreAssignment. @@ -17353,7 +17779,7 @@ func (o UpdateMetastoreAssignment) Type(ctx context.Context) attr.Type { type UpdateModelVersionRequest struct { // The comment attached to the model version - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The three-level (fully qualified) name of the model version FullName types.String `tfsdk:"-"` // The integer version number of the model version @@ -17366,11 +17792,12 @@ func (newState *UpdateModelVersionRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *UpdateModelVersionRequest) SyncEffectiveFieldsDuringRead(existingState UpdateModelVersionRequest) { } -func (c UpdateModelVersionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "full_name")...) - cs.SetRequired(append(path, "version")...) +func (c UpdateModelVersionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateModelVersionRequest. @@ -17412,36 +17839,36 @@ type UpdateMonitor struct { // Name of the baseline table from which drift metrics are computed from. // Columns in the monitored table should also be present in the baseline // table. - BaselineTableName types.String `tfsdk:"baseline_table_name" tf:"optional"` + BaselineTableName types.String `tfsdk:"baseline_table_name"` // Custom metrics to compute on the monitored table. These can be aggregate // metrics, derived metrics (from already computed aggregate metrics), or // drift metrics (comparing metrics across time windows). - CustomMetrics types.List `tfsdk:"custom_metrics" tf:"optional"` + CustomMetrics types.List `tfsdk:"custom_metrics"` // Id of dashboard that visualizes the computed metrics. This can be empty // if the monitor is in PENDING state. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` + DashboardId types.String `tfsdk:"dashboard_id"` // The data classification config for the monitor. - DataClassificationConfig types.Object `tfsdk:"data_classification_config" tf:"optional,object"` + DataClassificationConfig types.Object `tfsdk:"data_classification_config"` // Configuration for monitoring inference logs. - InferenceLog types.Object `tfsdk:"inference_log" tf:"optional,object"` + InferenceLog types.Object `tfsdk:"inference_log"` // The notification settings for the monitor. - Notifications types.Object `tfsdk:"notifications" tf:"optional,object"` + Notifications types.Object `tfsdk:"notifications"` // Schema where output metric tables are created. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:""` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // The schedule for automatically updating and refreshing metric tables. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // List of column expressions to slice data with for targeted analysis. The // data is grouped by each expression independently, resulting in a separate // slice for each predicate and its complements. For high-cardinality // columns, only the top 100 unique values by frequency will generate // slices. - SlicingExprs types.List `tfsdk:"slicing_exprs" tf:"optional"` + SlicingExprs types.List `tfsdk:"slicing_exprs"` // Configuration for monitoring snapshot tables. - Snapshot types.Object `tfsdk:"snapshot" tf:"optional,object"` + Snapshot types.Object `tfsdk:"snapshot"` // Full name of the table. TableName types.String `tfsdk:"-"` // Configuration for monitoring time series tables. - TimeSeries types.Object `tfsdk:"time_series" tf:"optional,object"` + TimeSeries types.Object `tfsdk:"time_series"` } func (newState *UpdateMonitor) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateMonitor) { @@ -17450,18 +17877,21 @@ func (newState *UpdateMonitor) SyncEffectiveFieldsDuringCreateOrUpdate(plan Upda func (newState *UpdateMonitor) SyncEffectiveFieldsDuringRead(existingState UpdateMonitor) { } -func (c UpdateMonitor) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MonitorMetric{}.ApplySchemaCustomizations(cs, append(path, "custom_metrics")...) - MonitorDataClassificationConfig{}.ApplySchemaCustomizations(cs, append(path, "data_classification_config")...) - MonitorInferenceLog{}.ApplySchemaCustomizations(cs, append(path, "inference_log")...) - MonitorNotifications{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - cs.SetRequired(append(path, "output_schema_name")...) - MonitorCronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - MonitorSnapshot{}.ApplySchemaCustomizations(cs, append(path, "snapshot")...) - cs.SetRequired(append(path, "table_name")...) - MonitorTimeSeries{}.ApplySchemaCustomizations(cs, append(path, "time_series")...) +func (c UpdateMonitor) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["baseline_table_name"] = attrs["baseline_table_name"].SetOptional() + attrs["custom_metrics"] = attrs["custom_metrics"].SetOptional() + attrs["dashboard_id"] = attrs["dashboard_id"].SetOptional() + attrs["data_classification_config"] = attrs["data_classification_config"].SetOptional() + attrs["inference_log"] = attrs["inference_log"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["output_schema_name"] = attrs["output_schema_name"].SetRequired() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["slicing_exprs"] = attrs["slicing_exprs"].SetOptional() + attrs["snapshot"] = attrs["snapshot"].SetOptional() + attrs["table_name"] = attrs["table_name"].SetRequired() + attrs["time_series"] = attrs["time_series"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateMonitor. @@ -17752,7 +18182,7 @@ func (o *UpdateMonitor) SetTimeSeries(ctx context.Context, v MonitorTimeSeries) type UpdatePermissions struct { // Array of permissions change objects. - Changes types.List `tfsdk:"changes" tf:"optional"` + Changes types.List `tfsdk:"changes"` // Full name of securable. FullName types.String `tfsdk:"-"` // Type of securable. @@ -17765,12 +18195,12 @@ func (newState *UpdatePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdatePermissions) SyncEffectiveFieldsDuringRead(existingState UpdatePermissions) { } -func (c UpdatePermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionsChange{}.ApplySchemaCustomizations(cs, append(path, "changes")...) - cs.SetRequired(append(path, "full_name")...) - cs.SetRequired(append(path, "securable_type")...) +func (c UpdatePermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["changes"] = attrs["changes"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["securable_type"] = attrs["securable_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePermissions. @@ -17840,13 +18270,13 @@ func (o *UpdatePermissions) SetChanges(ctx context.Context, v []PermissionsChang type UpdateRegisteredModelRequest struct { // The comment attached to the registered model - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The three-level (fully qualified) name of the registered model FullName types.String `tfsdk:"-"` // New name for the registered model. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The identifier of the user who owns the registered model - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateRegisteredModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRegisteredModelRequest) { @@ -17855,10 +18285,13 @@ func (newState *UpdateRegisteredModelRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateRegisteredModelRequest) SyncEffectiveFieldsDuringRead(existingState UpdateRegisteredModelRequest) { } -func (c UpdateRegisteredModelRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "full_name")...) +func (c UpdateRegisteredModelRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRegisteredModelRequest. @@ -17930,18 +18363,18 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type UpdateSchema struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Whether predictive optimization should be enabled for this object and // objects under it. - EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization" tf:"optional"` + EnablePredictiveOptimization types.String `tfsdk:"enable_predictive_optimization"` // Full name of the schema. FullName types.String `tfsdk:"-"` // New name for the schema. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of schema. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:"optional"` + Properties types.Map `tfsdk:"properties"` } func (newState *UpdateSchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateSchema) { @@ -17950,10 +18383,15 @@ func (newState *UpdateSchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan Updat func (newState *UpdateSchema) SyncEffectiveFieldsDuringRead(existingState UpdateSchema) { } -func (c UpdateSchema) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "full_name")...) +func (c UpdateSchema) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["enable_predictive_optimization"] = attrs["enable_predictive_optimization"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties"] = attrs["properties"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateSchema. @@ -18029,33 +18467,33 @@ func (o *UpdateSchema) SetProperties(ctx context.Context, v map[string]types.Str type UpdateStorageCredential struct { // The AWS IAM role configuration. - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The Databricks managed GCP service account configuration. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // Force update even if there are dependent external locations or external // tables. - Force types.Bool `tfsdk:"force" tf:"optional"` + Force types.Bool `tfsdk:"force"` - IsolationMode types.String `tfsdk:"isolation_mode" tf:"optional"` + IsolationMode types.String `tfsdk:"isolation_mode"` // Name of the storage credential. Name types.String `tfsdk:"-"` // New name for the storage credential. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of credential. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // Supplying true to this argument skips validation of the updated // credential. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *UpdateStorageCredential) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateStorageCredential) { @@ -18064,15 +18502,22 @@ func (newState *UpdateStorageCredential) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateStorageCredential) SyncEffectiveFieldsDuringRead(existingState UpdateStorageCredential) { } -func (c UpdateStorageCredential) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleRequest{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityResponse{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountRequest{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) - cs.SetRequired(append(path, "name")...) +func (c UpdateStorageCredential) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["force"] = attrs["force"].SetOptional() + attrs["isolation_mode"] = attrs["isolation_mode"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateStorageCredential. @@ -18281,7 +18726,7 @@ type UpdateTableRequest struct { // Full name of the table. FullName types.String `tfsdk:"-"` - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateTableRequest. @@ -18319,13 +18764,13 @@ func (o UpdateTableRequest) Type(ctx context.Context) attr.Type { type UpdateVolumeRequestContent struct { // The comment attached to the volume - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The three-level (fully qualified) name of the volume Name types.String `tfsdk:"-"` // New name for the volume. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // The identifier of the user who owns the volume - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` } func (newState *UpdateVolumeRequestContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateVolumeRequestContent) { @@ -18334,10 +18779,13 @@ func (newState *UpdateVolumeRequestContent) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateVolumeRequestContent) SyncEffectiveFieldsDuringRead(existingState UpdateVolumeRequestContent) { } -func (c UpdateVolumeRequestContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateVolumeRequestContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateVolumeRequestContent. @@ -18379,11 +18827,11 @@ func (o UpdateVolumeRequestContent) Type(ctx context.Context) attr.Type { type UpdateWorkspaceBindings struct { // A list of workspace IDs. - AssignWorkspaces types.List `tfsdk:"assign_workspaces" tf:"optional"` + AssignWorkspaces types.List `tfsdk:"assign_workspaces"` // The name of the catalog. Name types.String `tfsdk:"-"` // A list of workspace IDs. - UnassignWorkspaces types.List `tfsdk:"unassign_workspaces" tf:"optional"` + UnassignWorkspaces types.List `tfsdk:"unassign_workspaces"` } func (newState *UpdateWorkspaceBindings) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateWorkspaceBindings) { @@ -18392,10 +18840,12 @@ func (newState *UpdateWorkspaceBindings) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateWorkspaceBindings) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceBindings) { } -func (c UpdateWorkspaceBindings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateWorkspaceBindings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assign_workspaces"] = attrs["assign_workspaces"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["unassign_workspaces"] = attrs["unassign_workspaces"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceBindings. @@ -18494,9 +18944,9 @@ func (o *UpdateWorkspaceBindings) SetUnassignWorkspaces(ctx context.Context, v [ type UpdateWorkspaceBindingsParameters struct { // List of workspace bindings - Add types.List `tfsdk:"add" tf:"optional"` + Add types.List `tfsdk:"add"` // List of workspace bindings - Remove types.List `tfsdk:"remove" tf:"optional"` + Remove types.List `tfsdk:"remove"` // The name of the securable. SecurableName types.String `tfsdk:"-"` // The type of the securable to bind to a workspace. @@ -18509,13 +18959,13 @@ func (newState *UpdateWorkspaceBindingsParameters) SyncEffectiveFieldsDuringCrea func (newState *UpdateWorkspaceBindingsParameters) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceBindingsParameters) { } -func (c UpdateWorkspaceBindingsParameters) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceBinding{}.ApplySchemaCustomizations(cs, append(path, "add")...) - WorkspaceBinding{}.ApplySchemaCustomizations(cs, append(path, "remove")...) - cs.SetRequired(append(path, "securable_name")...) - cs.SetRequired(append(path, "securable_type")...) +func (c UpdateWorkspaceBindingsParameters) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["add"] = attrs["add"].SetOptional() + attrs["remove"] = attrs["remove"].SetOptional() + attrs["securable_name"] = attrs["securable_name"].SetRequired() + attrs["securable_type"] = attrs["securable_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceBindingsParameters. @@ -18616,24 +19066,24 @@ func (o *UpdateWorkspaceBindingsParameters) SetRemove(ctx context.Context, v []W type ValidateCredentialRequest struct { // The AWS IAM role configuration - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // Required. The name of an existing credential or long-lived cloud // credential to validate. - CredentialName types.String `tfsdk:"credential_name" tf:"optional"` + CredentialName types.String `tfsdk:"credential_name"` // The name of an existing external location to validate. Only applicable // for storage credentials (purpose is **STORAGE**.) - ExternalLocationName types.String `tfsdk:"external_location_name" tf:"optional"` + ExternalLocationName types.String `tfsdk:"external_location_name"` // The purpose of the credential. This should only be used when the // credential is specified. - Purpose types.String `tfsdk:"purpose" tf:"optional"` + Purpose types.String `tfsdk:"purpose"` // Whether the credential is only usable for read operations. Only // applicable for storage credentials (purpose is **STORAGE**.) - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // The external location url to validate. Only applicable when purpose is // **STORAGE**. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ValidateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateCredentialRequest) { @@ -18642,11 +19092,16 @@ func (newState *ValidateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ValidateCredentialRequest) SyncEffectiveFieldsDuringRead(existingState ValidateCredentialRequest) { } -func (c ValidateCredentialRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRole{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentity{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) +func (c ValidateCredentialRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["credential_name"] = attrs["credential_name"].SetOptional() + attrs["external_location_name"] = attrs["external_location_name"].SetOptional() + attrs["purpose"] = attrs["purpose"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateCredentialRequest. @@ -18754,9 +19209,9 @@ func (o *ValidateCredentialRequest) SetAzureManagedIdentity(ctx context.Context, type ValidateCredentialResponse struct { // Whether the tested location is a directory in cloud storage. Only // applicable for when purpose is **STORAGE**. - IsDir types.Bool `tfsdk:"isDir" tf:"optional"` + IsDir types.Bool `tfsdk:"isDir"` // The results of the validation check. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ValidateCredentialResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateCredentialResponse) { @@ -18765,10 +19220,11 @@ func (newState *ValidateCredentialResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ValidateCredentialResponse) SyncEffectiveFieldsDuringRead(existingState ValidateCredentialResponse) { } -func (c ValidateCredentialResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CredentialValidationResult{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ValidateCredentialResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["isDir"] = attrs["isDir"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateCredentialResponse. @@ -18836,23 +19292,23 @@ func (o *ValidateCredentialResponse) SetResults(ctx context.Context, v []Credent type ValidateStorageCredential struct { // The AWS IAM role configuration. - AwsIamRole types.Object `tfsdk:"aws_iam_role" tf:"optional,object"` + AwsIamRole types.Object `tfsdk:"aws_iam_role"` // The Azure managed identity configuration. - AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity" tf:"optional,object"` + AzureManagedIdentity types.Object `tfsdk:"azure_managed_identity"` // The Azure service principal configuration. - AzureServicePrincipal types.Object `tfsdk:"azure_service_principal" tf:"optional,object"` + AzureServicePrincipal types.Object `tfsdk:"azure_service_principal"` // The Cloudflare API token configuration. - CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token" tf:"optional,object"` + CloudflareApiToken types.Object `tfsdk:"cloudflare_api_token"` // The Databricks created GCP service account configuration. - DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account" tf:"optional,object"` + DatabricksGcpServiceAccount types.Object `tfsdk:"databricks_gcp_service_account"` // The name of an existing external location to validate. - ExternalLocationName types.String `tfsdk:"external_location_name" tf:"optional"` + ExternalLocationName types.String `tfsdk:"external_location_name"` // Whether the storage credential is only usable for read operations. - ReadOnly types.Bool `tfsdk:"read_only" tf:"optional"` + ReadOnly types.Bool `tfsdk:"read_only"` // The name of the storage credential to validate. - StorageCredentialName types.String `tfsdk:"storage_credential_name" tf:"optional"` + StorageCredentialName types.String `tfsdk:"storage_credential_name"` // The external location url to validate. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *ValidateStorageCredential) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateStorageCredential) { @@ -18861,14 +19317,18 @@ func (newState *ValidateStorageCredential) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ValidateStorageCredential) SyncEffectiveFieldsDuringRead(existingState ValidateStorageCredential) { } -func (c ValidateStorageCredential) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsIamRoleRequest{}.ApplySchemaCustomizations(cs, append(path, "aws_iam_role")...) - AzureManagedIdentityRequest{}.ApplySchemaCustomizations(cs, append(path, "azure_managed_identity")...) - AzureServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "azure_service_principal")...) - CloudflareApiToken{}.ApplySchemaCustomizations(cs, append(path, "cloudflare_api_token")...) - DatabricksGcpServiceAccountRequest{}.ApplySchemaCustomizations(cs, append(path, "databricks_gcp_service_account")...) +func (c ValidateStorageCredential) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_iam_role"] = attrs["aws_iam_role"].SetOptional() + attrs["azure_managed_identity"] = attrs["azure_managed_identity"].SetOptional() + attrs["azure_service_principal"] = attrs["azure_service_principal"].SetOptional() + attrs["cloudflare_api_token"] = attrs["cloudflare_api_token"].SetOptional() + attrs["databricks_gcp_service_account"] = attrs["databricks_gcp_service_account"].SetOptional() + attrs["external_location_name"] = attrs["external_location_name"].SetOptional() + attrs["read_only"] = attrs["read_only"].SetOptional() + attrs["storage_credential_name"] = attrs["storage_credential_name"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateStorageCredential. @@ -19066,9 +19526,9 @@ func (o *ValidateStorageCredential) SetDatabricksGcpServiceAccount(ctx context.C type ValidateStorageCredentialResponse struct { // Whether the tested location is a directory in cloud storage. - IsDir types.Bool `tfsdk:"isDir" tf:"optional"` + IsDir types.Bool `tfsdk:"isDir"` // The results of the validation check. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ValidateStorageCredentialResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidateStorageCredentialResponse) { @@ -19077,10 +19537,11 @@ func (newState *ValidateStorageCredentialResponse) SyncEffectiveFieldsDuringCrea func (newState *ValidateStorageCredentialResponse) SyncEffectiveFieldsDuringRead(existingState ValidateStorageCredentialResponse) { } -func (c ValidateStorageCredentialResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ValidationResult{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ValidateStorageCredentialResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["isDir"] = attrs["isDir"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidateStorageCredentialResponse. @@ -19148,11 +19609,11 @@ func (o *ValidateStorageCredentialResponse) SetResults(ctx context.Context, v [] type ValidationResult struct { // Error message would exist when the result does not equal to **PASS**. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // The operation tested. - Operation types.String `tfsdk:"operation" tf:"optional"` + Operation types.String `tfsdk:"operation"` // The results of the tested operation. - Result types.String `tfsdk:"result" tf:"optional"` + Result types.String `tfsdk:"result"` } func (newState *ValidationResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan ValidationResult) { @@ -19161,9 +19622,12 @@ func (newState *ValidationResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan V func (newState *ValidationResult) SyncEffectiveFieldsDuringRead(existingState ValidationResult) { } -func (c ValidationResult) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ValidationResult) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() + attrs["operation"] = attrs["operation"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ValidationResult. @@ -19203,41 +19667,41 @@ func (o ValidationResult) Type(ctx context.Context) attr.Type { type VolumeInfo struct { // The AWS access point to use when accesing s3 for this external location. - AccessPoint types.String `tfsdk:"access_point" tf:"optional"` + AccessPoint types.String `tfsdk:"access_point"` // Indicates whether the principal is limited to retrieving metadata for the // associated object through the BROWSE privilege when include_browse is // enabled in the request. - BrowseOnly types.Bool `tfsdk:"browse_only" tf:"optional"` + BrowseOnly types.Bool `tfsdk:"browse_only"` // The name of the catalog where the schema and the volume are - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // The comment attached to the volume - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The identifier of the user who created the volume - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Encryption options that apply to clients connecting to cloud storage. - EncryptionDetails types.Object `tfsdk:"encryption_details" tf:"optional,object"` + EncryptionDetails types.Object `tfsdk:"encryption_details"` // The three-level (fully qualified) name of the volume - FullName types.String `tfsdk:"full_name" tf:"optional"` + FullName types.String `tfsdk:"full_name"` // The unique identifier of the metastore - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the volume - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The identifier of the user who owns the volume - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The name of the schema where the volume is - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The storage location on the cloud - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The identifier of the user who updated the volume last time - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` // The unique identifier of the volume - VolumeId types.String `tfsdk:"volume_id" tf:"optional"` + VolumeId types.String `tfsdk:"volume_id"` - VolumeType types.String `tfsdk:"volume_type" tf:"optional"` + VolumeType types.String `tfsdk:"volume_type"` } func (newState *VolumeInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan VolumeInfo) { @@ -19246,10 +19710,26 @@ func (newState *VolumeInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan VolumeI func (newState *VolumeInfo) SyncEffectiveFieldsDuringRead(existingState VolumeInfo) { } -func (c VolumeInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EncryptionDetails{}.ApplySchemaCustomizations(cs, append(path, "encryption_details")...) - - return cs +func (c VolumeInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_point"] = attrs["access_point"].SetOptional() + attrs["browse_only"] = attrs["browse_only"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["encryption_details"] = attrs["encryption_details"].SetOptional() + attrs["full_name"] = attrs["full_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["volume_id"] = attrs["volume_id"].SetOptional() + attrs["volume_type"] = attrs["volume_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VolumeInfo. @@ -19346,9 +19826,9 @@ func (o *VolumeInfo) SetEncryptionDetails(ctx context.Context, v EncryptionDetai } type WorkspaceBinding struct { - BindingType types.String `tfsdk:"binding_type" tf:"optional"` + BindingType types.String `tfsdk:"binding_type"` - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *WorkspaceBinding) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceBinding) { @@ -19357,9 +19837,11 @@ func (newState *WorkspaceBinding) SyncEffectiveFieldsDuringCreateOrUpdate(plan W func (newState *WorkspaceBinding) SyncEffectiveFieldsDuringRead(existingState WorkspaceBinding) { } -func (c WorkspaceBinding) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceBinding) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["binding_type"] = attrs["binding_type"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceBinding. @@ -19398,11 +19880,11 @@ func (o WorkspaceBinding) Type(ctx context.Context) attr.Type { // Currently assigned workspace bindings type WorkspaceBindingsResponse struct { // List of workspace bindings - Bindings types.List `tfsdk:"bindings" tf:"optional"` + Bindings types.List `tfsdk:"bindings"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *WorkspaceBindingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceBindingsResponse) { @@ -19411,10 +19893,11 @@ func (newState *WorkspaceBindingsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *WorkspaceBindingsResponse) SyncEffectiveFieldsDuringRead(existingState WorkspaceBindingsResponse) { } -func (c WorkspaceBindingsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceBinding{}.ApplySchemaCustomizations(cs, append(path, "bindings")...) +func (c WorkspaceBindingsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bindings"] = attrs["bindings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceBindingsResponse. diff --git a/internal/service/cleanrooms_tf/legacy_model.go b/internal/service/cleanrooms_tf/legacy_model.go index e8e006513..0365e6639 100755 --- a/internal/service/cleanrooms_tf/legacy_model.go +++ b/internal/service/cleanrooms_tf/legacy_model.go @@ -21,6 +21,7 @@ import ( "github.com/databricks/terraform-provider-databricks/internal/service/jobs_tf" "github.com/databricks/terraform-provider-databricks/internal/service/settings_tf" "github.com/databricks/terraform-provider-databricks/internal/service/sharing_tf" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -30,33 +31,33 @@ type CleanRoom_SdkV2 struct { // Whether clean room access is restricted due to [CSP] // // [CSP]: https://docs.databricks.com/en/security/privacy/security-profile.html - AccessRestricted types.String `tfsdk:"access_restricted" tf:"computed"` + AccessRestricted types.String `tfsdk:"access_restricted"` - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // When the clean room was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The alias of the collaborator tied to the local clean room. - LocalCollaboratorAlias types.String `tfsdk:"local_collaborator_alias" tf:"computed"` + LocalCollaboratorAlias types.String `tfsdk:"local_collaborator_alias"` // The name of the clean room. It should follow [UC securable naming // requirements]. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Output catalog of the clean room. It is an output only field. Output // catalog is manipulated using the separate CreateCleanRoomOutputCatalog // API. - OutputCatalog types.List `tfsdk:"output_catalog" tf:"computed,object"` + OutputCatalog types.List `tfsdk:"output_catalog"` // This is Databricks username of the owner of the local clean room // securable for permission management. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Central clean room details. During creation, users need to specify // cloud_vendor, region, and collaborators.global_metastore_id. This field // will not be filled in the ListCleanRooms call. - RemoteDetailedInfo types.List `tfsdk:"remote_detailed_info" tf:"optional,object"` + RemoteDetailedInfo types.List `tfsdk:"remote_detailed_info"` // Clean room status. - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` // When the clean room was last updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` } func (newState *CleanRoom_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoom_SdkV2) { @@ -65,17 +66,21 @@ func (newState *CleanRoom_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cl func (newState *CleanRoom_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoom_SdkV2) { } -func (c CleanRoom_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "access_restricted")...) - cs.SetComputed(append(path, "created_at")...) - cs.SetComputed(append(path, "local_collaborator_alias")...) - cs.SetComputed(append(path, "output_catalog")...) - CleanRoomOutputCatalog_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "output_catalog")...) - CleanRoomRemoteDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "remote_detailed_info")...) - cs.SetComputed(append(path, "status")...) - cs.SetComputed(append(path, "updated_at")...) +func (c CleanRoom_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_restricted"] = attrs["access_restricted"].SetComputed() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetComputed() + attrs["local_collaborator_alias"] = attrs["local_collaborator_alias"].SetComputed() + attrs["name"] = attrs["name"].SetOptional() + attrs["output_catalog"] = attrs["output_catalog"].SetComputed() + attrs["output_catalog"] = attrs["output_catalog"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["owner"] = attrs["owner"].SetOptional() + attrs["remote_detailed_info"] = attrs["remote_detailed_info"].SetOptional() + attrs["remote_detailed_info"] = attrs["remote_detailed_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetComputed() + attrs["updated_at"] = attrs["updated_at"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoom. @@ -189,15 +194,15 @@ func (o *CleanRoom_SdkV2) SetRemoteDetailedInfo(ctx context.Context, v CleanRoom // Metadata of the clean room asset type CleanRoomAsset_SdkV2 struct { // When the asset is added to the clean room, in epoch milliseconds. - AddedAt types.Int64 `tfsdk:"added_at" tf:"computed"` + AddedAt types.Int64 `tfsdk:"added_at"` // The type of the asset. - AssetType types.String `tfsdk:"asset_type" tf:"optional"` + AssetType types.String `tfsdk:"asset_type"` // Foreign table details available to all collaborators of the clean room. // Present if and only if **asset_type** is **FOREIGN_TABLE** - ForeignTable types.List `tfsdk:"foreign_table" tf:"optional,object"` + ForeignTable types.List `tfsdk:"foreign_table"` // Local details for a foreign that are only available to its owner. Present // if and only if **asset_type** is **FOREIGN_TABLE** - ForeignTableLocalDetails types.List `tfsdk:"foreign_table_local_details" tf:"optional,object"` + ForeignTableLocalDetails types.List `tfsdk:"foreign_table_local_details"` // A fully qualified name that uniquely identifies the asset within the // clean room. This is also the name displayed in the clean room UI. // @@ -205,29 +210,29 @@ type CleanRoomAsset_SdkV2 struct { // *shared_catalog*.*shared_schema*.*asset_name* // // For notebooks, the name is the notebook file name. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Notebook details available to all collaborators of the clean room. // Present if and only if **asset_type** is **NOTEBOOK_FILE** - Notebook types.List `tfsdk:"notebook" tf:"optional,object"` + Notebook types.List `tfsdk:"notebook"` // The alias of the collaborator who owns this asset - OwnerCollaboratorAlias types.String `tfsdk:"owner_collaborator_alias" tf:"computed"` + OwnerCollaboratorAlias types.String `tfsdk:"owner_collaborator_alias"` // Status of the asset - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` // Table details available to all collaborators of the clean room. Present // if and only if **asset_type** is **TABLE** - Table types.List `tfsdk:"table" tf:"optional,object"` + Table types.List `tfsdk:"table"` // Local details for a table that are only available to its owner. Present // if and only if **asset_type** is **TABLE** - TableLocalDetails types.List `tfsdk:"table_local_details" tf:"optional,object"` + TableLocalDetails types.List `tfsdk:"table_local_details"` // View details available to all collaborators of the clean room. Present if // and only if **asset_type** is **VIEW** - View types.List `tfsdk:"view" tf:"optional,object"` + View types.List `tfsdk:"view"` // Local details for a view that are only available to its owner. Present if // and only if **asset_type** is **VIEW** - ViewLocalDetails types.List `tfsdk:"view_local_details" tf:"optional,object"` + ViewLocalDetails types.List `tfsdk:"view_local_details"` // Local details for a volume that are only available to its owner. Present // if and only if **asset_type** is **VOLUME** - VolumeLocalDetails types.List `tfsdk:"volume_local_details" tf:"optional,object"` + VolumeLocalDetails types.List `tfsdk:"volume_local_details"` } func (newState *CleanRoomAsset_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAsset_SdkV2) { @@ -236,20 +241,30 @@ func (newState *CleanRoomAsset_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CleanRoomAsset_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAsset_SdkV2) { } -func (c CleanRoomAsset_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "added_at")...) - CleanRoomAssetForeignTable_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "foreign_table")...) - CleanRoomAssetForeignTableLocalDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "foreign_table_local_details")...) - CleanRoomAssetNotebook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook")...) - cs.SetComputed(append(path, "owner_collaborator_alias")...) - cs.SetComputed(append(path, "status")...) - CleanRoomAssetTable_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table")...) - CleanRoomAssetTableLocalDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_local_details")...) - CleanRoomAssetView_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "view")...) - CleanRoomAssetViewLocalDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "view_local_details")...) - CleanRoomAssetVolumeLocalDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "volume_local_details")...) - - return cs +func (c CleanRoomAsset_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["added_at"] = attrs["added_at"].SetComputed() + attrs["asset_type"] = attrs["asset_type"].SetOptional() + attrs["foreign_table"] = attrs["foreign_table"].SetOptional() + attrs["foreign_table"] = attrs["foreign_table"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["foreign_table_local_details"] = attrs["foreign_table_local_details"].SetOptional() + attrs["foreign_table_local_details"] = attrs["foreign_table_local_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() + attrs["notebook"] = attrs["notebook"].SetOptional() + attrs["notebook"] = attrs["notebook"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["owner_collaborator_alias"] = attrs["owner_collaborator_alias"].SetComputed() + attrs["status"] = attrs["status"].SetComputed() + attrs["table"] = attrs["table"].SetOptional() + attrs["table"] = attrs["table"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table_local_details"] = attrs["table_local_details"].SetOptional() + attrs["table_local_details"] = attrs["table_local_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["view"] = attrs["view"].SetOptional() + attrs["view"] = attrs["view"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["view_local_details"] = attrs["view_local_details"].SetOptional() + attrs["view_local_details"] = attrs["view_local_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["volume_local_details"] = attrs["volume_local_details"].SetOptional() + attrs["volume_local_details"] = attrs["volume_local_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAsset. @@ -542,7 +557,7 @@ func (o *CleanRoomAsset_SdkV2) SetVolumeLocalDetails(ctx context.Context, v Clea type CleanRoomAssetForeignTable_SdkV2 struct { // The metadata information of the columns in the foreign table - Columns types.List `tfsdk:"columns" tf:"computed"` + Columns types.List `tfsdk:"columns"` } func (newState *CleanRoomAssetForeignTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetForeignTable_SdkV2) { @@ -551,10 +566,10 @@ func (newState *CleanRoomAssetForeignTable_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CleanRoomAssetForeignTable_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetForeignTable_SdkV2) { } -func (c CleanRoomAssetForeignTable_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "columns")...) +func (c CleanRoomAssetForeignTable_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetForeignTable. @@ -621,7 +636,7 @@ func (o *CleanRoomAssetForeignTable_SdkV2) SetColumns(ctx context.Context, v []c type CleanRoomAssetForeignTableLocalDetails_SdkV2 struct { // The fully qualified name of the foreign table in its owner's local // metastore, in the format of *catalog*.*schema*.*foreign_table_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` } func (newState *CleanRoomAssetForeignTableLocalDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetForeignTableLocalDetails_SdkV2) { @@ -630,9 +645,10 @@ func (newState *CleanRoomAssetForeignTableLocalDetails_SdkV2) SyncEffectiveField func (newState *CleanRoomAssetForeignTableLocalDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetForeignTableLocalDetails_SdkV2) { } -func (c CleanRoomAssetForeignTableLocalDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetForeignTableLocalDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetForeignTableLocalDetails. @@ -668,10 +684,10 @@ func (o CleanRoomAssetForeignTableLocalDetails_SdkV2) Type(ctx context.Context) type CleanRoomAssetNotebook_SdkV2 struct { // Server generated checksum that represents the notebook version. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // Base 64 representation of the notebook contents. This is the same format // as returned by :method:workspace/export with the format of **HTML**. - NotebookContent types.String `tfsdk:"notebook_content" tf:"optional"` + NotebookContent types.String `tfsdk:"notebook_content"` } func (newState *CleanRoomAssetNotebook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetNotebook_SdkV2) { @@ -680,10 +696,11 @@ func (newState *CleanRoomAssetNotebook_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CleanRoomAssetNotebook_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetNotebook_SdkV2) { } -func (c CleanRoomAssetNotebook_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "etag")...) +func (c CleanRoomAssetNotebook_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetComputed() + attrs["notebook_content"] = attrs["notebook_content"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetNotebook. @@ -721,7 +738,7 @@ func (o CleanRoomAssetNotebook_SdkV2) Type(ctx context.Context) attr.Type { type CleanRoomAssetTable_SdkV2 struct { // The metadata information of the columns in the table - Columns types.List `tfsdk:"columns" tf:"computed"` + Columns types.List `tfsdk:"columns"` } func (newState *CleanRoomAssetTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetTable_SdkV2) { @@ -730,10 +747,10 @@ func (newState *CleanRoomAssetTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CleanRoomAssetTable_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetTable_SdkV2) { } -func (c CleanRoomAssetTable_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "columns")...) +func (c CleanRoomAssetTable_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetTable. @@ -800,9 +817,9 @@ func (o *CleanRoomAssetTable_SdkV2) SetColumns(ctx context.Context, v []catalog_ type CleanRoomAssetTableLocalDetails_SdkV2 struct { // The fully qualified name of the table in its owner's local metastore, in // the format of *catalog*.*schema*.*table_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` // Partition filtering specification for a shared table. - Partitions types.List `tfsdk:"partitions" tf:"optional"` + Partitions types.List `tfsdk:"partitions"` } func (newState *CleanRoomAssetTableLocalDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetTableLocalDetails_SdkV2) { @@ -811,9 +828,11 @@ func (newState *CleanRoomAssetTableLocalDetails_SdkV2) SyncEffectiveFieldsDuring func (newState *CleanRoomAssetTableLocalDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetTableLocalDetails_SdkV2) { } -func (c CleanRoomAssetTableLocalDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetTableLocalDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() + attrs["partitions"] = attrs["partitions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetTableLocalDetails. @@ -881,7 +900,7 @@ func (o *CleanRoomAssetTableLocalDetails_SdkV2) SetPartitions(ctx context.Contex type CleanRoomAssetView_SdkV2 struct { // The metadata information of the columns in the view - Columns types.List `tfsdk:"columns" tf:"computed"` + Columns types.List `tfsdk:"columns"` } func (newState *CleanRoomAssetView_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetView_SdkV2) { @@ -890,10 +909,10 @@ func (newState *CleanRoomAssetView_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CleanRoomAssetView_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetView_SdkV2) { } -func (c CleanRoomAssetView_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "columns")...) +func (c CleanRoomAssetView_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetView. @@ -960,7 +979,7 @@ func (o *CleanRoomAssetView_SdkV2) SetColumns(ctx context.Context, v []catalog_t type CleanRoomAssetViewLocalDetails_SdkV2 struct { // The fully qualified name of the view in its owner's local metastore, in // the format of *catalog*.*schema*.*view_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` } func (newState *CleanRoomAssetViewLocalDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetViewLocalDetails_SdkV2) { @@ -969,9 +988,10 @@ func (newState *CleanRoomAssetViewLocalDetails_SdkV2) SyncEffectiveFieldsDuringC func (newState *CleanRoomAssetViewLocalDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetViewLocalDetails_SdkV2) { } -func (c CleanRoomAssetViewLocalDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetViewLocalDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetViewLocalDetails. @@ -1008,7 +1028,7 @@ func (o CleanRoomAssetViewLocalDetails_SdkV2) Type(ctx context.Context) attr.Typ type CleanRoomAssetVolumeLocalDetails_SdkV2 struct { // The fully qualified name of the volume in its owner's local metastore, in // the format of *catalog*.*schema*.*volume_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` } func (newState *CleanRoomAssetVolumeLocalDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetVolumeLocalDetails_SdkV2) { @@ -1017,9 +1037,10 @@ func (newState *CleanRoomAssetVolumeLocalDetails_SdkV2) SyncEffectiveFieldsDurin func (newState *CleanRoomAssetVolumeLocalDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetVolumeLocalDetails_SdkV2) { } -func (c CleanRoomAssetVolumeLocalDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetVolumeLocalDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetVolumeLocalDetails. @@ -1062,28 +1083,28 @@ type CleanRoomCollaborator_SdkV2 struct { // requirements]. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - CollaboratorAlias types.String `tfsdk:"collaborator_alias" tf:"optional"` + CollaboratorAlias types.String `tfsdk:"collaborator_alias"` // Generated display name for the collaborator. In the case of a single // metastore clean room, it is the clean room name. For x-metastore clean // rooms, it is the organization name of the metastore. It is not restricted // to these values and could change in the future - DisplayName types.String `tfsdk:"display_name" tf:"computed"` + DisplayName types.String `tfsdk:"display_name"` // The global Unity Catalog metastore id of the collaborator. The identifier // is of format cloud:region:metastore-uuid. - GlobalMetastoreId types.String `tfsdk:"global_metastore_id" tf:"optional"` + GlobalMetastoreId types.String `tfsdk:"global_metastore_id"` // Email of the user who is receiving the clean room "invitation". It should // be empty for the creator of the clean room, and non-empty for the // invitees of the clean room. It is only returned in the output when clean // room creator calls GET - InviteRecipientEmail types.String `tfsdk:"invite_recipient_email" tf:"optional"` + InviteRecipientEmail types.String `tfsdk:"invite_recipient_email"` // Workspace ID of the user who is receiving the clean room "invitation". // Must be specified if invite_recipient_email is specified. It should be // empty when the collaborator is the creator of the clean room. - InviteRecipientWorkspaceId types.Int64 `tfsdk:"invite_recipient_workspace_id" tf:"optional"` + InviteRecipientWorkspaceId types.Int64 `tfsdk:"invite_recipient_workspace_id"` // [Organization // name](:method:metastores/list#metastores-delta_sharing_organization_name) // configured in the metastore - OrganizationName types.String `tfsdk:"organization_name" tf:"computed"` + OrganizationName types.String `tfsdk:"organization_name"` } func (newState *CleanRoomCollaborator_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomCollaborator_SdkV2) { @@ -1092,11 +1113,15 @@ func (newState *CleanRoomCollaborator_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CleanRoomCollaborator_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomCollaborator_SdkV2) { } -func (c CleanRoomCollaborator_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "display_name")...) - cs.SetComputed(append(path, "organization_name")...) +func (c CleanRoomCollaborator_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["collaborator_alias"] = attrs["collaborator_alias"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetComputed() + attrs["global_metastore_id"] = attrs["global_metastore_id"].SetOptional() + attrs["invite_recipient_email"] = attrs["invite_recipient_email"].SetOptional() + attrs["invite_recipient_workspace_id"] = attrs["invite_recipient_workspace_id"].SetOptional() + attrs["organization_name"] = attrs["organization_name"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomCollaborator. @@ -1146,21 +1171,21 @@ type CleanRoomNotebookTaskRun_SdkV2 struct { // only included in the LIST API. if the task was run within the same // workspace the API is being called. If the task run was in a different // workspace under the same metastore, only the workspace_id is included. - CollaboratorJobRunInfo types.List `tfsdk:"collaborator_job_run_info" tf:"optional,object"` + CollaboratorJobRunInfo types.List `tfsdk:"collaborator_job_run_info"` // State of the task run. - NotebookJobRunState types.List `tfsdk:"notebook_job_run_state" tf:"optional,object"` + NotebookJobRunState types.List `tfsdk:"notebook_job_run_state"` // Asset name of the notebook executed in this task run. - NotebookName types.String `tfsdk:"notebook_name" tf:"optional"` + NotebookName types.String `tfsdk:"notebook_name"` // Expiration time of the output schema of the task run (if any), in epoch // milliseconds. - OutputSchemaExpirationTime types.Int64 `tfsdk:"output_schema_expiration_time" tf:"optional"` + OutputSchemaExpirationTime types.Int64 `tfsdk:"output_schema_expiration_time"` // Name of the output schema associated with the clean rooms notebook task // run. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:"optional"` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // Duration of the task run, in milliseconds. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // When the task run started, in epoch milliseconds. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` } func (newState *CleanRoomNotebookTaskRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomNotebookTaskRun_SdkV2) { @@ -1169,11 +1194,18 @@ func (newState *CleanRoomNotebookTaskRun_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *CleanRoomNotebookTaskRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomNotebookTaskRun_SdkV2) { } -func (c CleanRoomNotebookTaskRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CollaboratorJobRunInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "collaborator_job_run_info")...) - jobs_tf.CleanRoomTaskRunState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook_job_run_state")...) +func (c CleanRoomNotebookTaskRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["collaborator_job_run_info"] = attrs["collaborator_job_run_info"].SetOptional() + attrs["collaborator_job_run_info"] = attrs["collaborator_job_run_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_job_run_state"] = attrs["notebook_job_run_state"].SetOptional() + attrs["notebook_job_run_state"] = attrs["notebook_job_run_state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_name"] = attrs["notebook_name"].SetOptional() + attrs["output_schema_expiration_time"] = attrs["output_schema_expiration_time"].SetOptional() + attrs["output_schema_name"] = attrs["output_schema_name"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomNotebookTaskRun. @@ -1283,9 +1315,9 @@ type CleanRoomOutputCatalog_SdkV2 struct { // naming requirements]. The field will always exist if status is CREATED. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` } func (newState *CleanRoomOutputCatalog_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomOutputCatalog_SdkV2) { @@ -1294,10 +1326,11 @@ func (newState *CleanRoomOutputCatalog_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CleanRoomOutputCatalog_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomOutputCatalog_SdkV2) { } -func (c CleanRoomOutputCatalog_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "status")...) +func (c CleanRoomOutputCatalog_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomOutputCatalog. @@ -1336,9 +1369,9 @@ func (o CleanRoomOutputCatalog_SdkV2) Type(ctx context.Context) attr.Type { // Publicly visible central clean room details. type CleanRoomRemoteDetail_SdkV2 struct { // Central clean room ID. - CentralCleanRoomId types.String `tfsdk:"central_clean_room_id" tf:"computed"` + CentralCleanRoomId types.String `tfsdk:"central_clean_room_id"` // Cloud vendor (aws,azure,gcp) of the central clean room. - CloudVendor types.String `tfsdk:"cloud_vendor" tf:"optional"` + CloudVendor types.String `tfsdk:"cloud_vendor"` // Collaborators in the central clean room. There should one and only one // collaborator in the list that satisfies the owner condition: // @@ -1346,16 +1379,16 @@ type CleanRoomRemoteDetail_SdkV2 struct { // CreateCleanRoom). // // 2. Its invite_recipient_email is empty. - Collaborators types.List `tfsdk:"collaborators" tf:"optional"` + Collaborators types.List `tfsdk:"collaborators"` // The compliance security profile used to process regulated data following // compliance standards. - ComplianceSecurityProfile types.List `tfsdk:"compliance_security_profile" tf:"optional,object"` + ComplianceSecurityProfile types.List `tfsdk:"compliance_security_profile"` // Collaborator who creates the clean room. - Creator types.List `tfsdk:"creator" tf:"computed,object"` + Creator types.List `tfsdk:"creator"` // Egress network policy to apply to the central clean room workspace. - EgressNetworkPolicy types.List `tfsdk:"egress_network_policy" tf:"optional,object"` + EgressNetworkPolicy types.List `tfsdk:"egress_network_policy"` // Region of the central clean room. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *CleanRoomRemoteDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomRemoteDetail_SdkV2) { @@ -1364,15 +1397,19 @@ func (newState *CleanRoomRemoteDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CleanRoomRemoteDetail_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomRemoteDetail_SdkV2) { } -func (c CleanRoomRemoteDetail_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "central_clean_room_id")...) - CleanRoomCollaborator_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "collaborators")...) - ComplianceSecurityProfile_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "compliance_security_profile")...) - cs.SetComputed(append(path, "creator")...) - CleanRoomCollaborator_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "creator")...) - settings_tf.EgressNetworkPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "egress_network_policy")...) +func (c CleanRoomRemoteDetail_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["central_clean_room_id"] = attrs["central_clean_room_id"].SetComputed() + attrs["cloud_vendor"] = attrs["cloud_vendor"].SetOptional() + attrs["collaborators"] = attrs["collaborators"].SetOptional() + attrs["compliance_security_profile"] = attrs["compliance_security_profile"].SetOptional() + attrs["compliance_security_profile"] = attrs["compliance_security_profile"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creator"] = attrs["creator"].SetComputed() + attrs["creator"] = attrs["creator"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["egress_network_policy"] = attrs["egress_network_policy"].SetOptional() + attrs["egress_network_policy"] = attrs["egress_network_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomRemoteDetail. @@ -1537,15 +1574,15 @@ func (o *CleanRoomRemoteDetail_SdkV2) SetEgressNetworkPolicy(ctx context.Context type CollaboratorJobRunInfo_SdkV2 struct { // Alias of the collaborator that triggered the task run. - CollaboratorAlias types.String `tfsdk:"collaborator_alias" tf:"optional"` + CollaboratorAlias types.String `tfsdk:"collaborator_alias"` // Job ID of the task run in the collaborator's workspace. - CollaboratorJobId types.Int64 `tfsdk:"collaborator_job_id" tf:"optional"` + CollaboratorJobId types.Int64 `tfsdk:"collaborator_job_id"` // Job run ID of the task run in the collaborator's workspace. - CollaboratorJobRunId types.Int64 `tfsdk:"collaborator_job_run_id" tf:"optional"` + CollaboratorJobRunId types.Int64 `tfsdk:"collaborator_job_run_id"` // Task run ID of the task run in the collaborator's workspace. - CollaboratorTaskRunId types.Int64 `tfsdk:"collaborator_task_run_id" tf:"optional"` + CollaboratorTaskRunId types.Int64 `tfsdk:"collaborator_task_run_id"` // ID of the collaborator's workspace that triggered the task run. - CollaboratorWorkspaceId types.Int64 `tfsdk:"collaborator_workspace_id" tf:"optional"` + CollaboratorWorkspaceId types.Int64 `tfsdk:"collaborator_workspace_id"` } func (newState *CollaboratorJobRunInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CollaboratorJobRunInfo_SdkV2) { @@ -1554,9 +1591,14 @@ func (newState *CollaboratorJobRunInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CollaboratorJobRunInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CollaboratorJobRunInfo_SdkV2) { } -func (c CollaboratorJobRunInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CollaboratorJobRunInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["collaborator_alias"] = attrs["collaborator_alias"].SetOptional() + attrs["collaborator_job_id"] = attrs["collaborator_job_id"].SetOptional() + attrs["collaborator_job_run_id"] = attrs["collaborator_job_run_id"].SetOptional() + attrs["collaborator_task_run_id"] = attrs["collaborator_task_run_id"].SetOptional() + attrs["collaborator_workspace_id"] = attrs["collaborator_workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CollaboratorJobRunInfo. @@ -1603,9 +1645,9 @@ func (o CollaboratorJobRunInfo_SdkV2) Type(ctx context.Context) attr.Type { type ComplianceSecurityProfile_SdkV2 struct { // The list of compliance standards that the compliance security profile is // configured to enforce. - ComplianceStandards types.List `tfsdk:"compliance_standards" tf:"optional"` + ComplianceStandards types.List `tfsdk:"compliance_standards"` // Whether the compliance security profile is enabled. - IsEnabled types.Bool `tfsdk:"is_enabled" tf:"optional"` + IsEnabled types.Bool `tfsdk:"is_enabled"` } func (newState *ComplianceSecurityProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplianceSecurityProfile_SdkV2) { @@ -1614,9 +1656,11 @@ func (newState *ComplianceSecurityProfile_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ComplianceSecurityProfile_SdkV2) SyncEffectiveFieldsDuringRead(existingState ComplianceSecurityProfile_SdkV2) { } -func (c ComplianceSecurityProfile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ComplianceSecurityProfile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_standards"] = attrs["compliance_standards"].SetOptional() + attrs["is_enabled"] = attrs["is_enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplianceSecurityProfile. @@ -1685,7 +1729,7 @@ func (o *ComplianceSecurityProfile_SdkV2) SetComplianceStandards(ctx context.Con // Create an asset type CreateCleanRoomAssetRequest_SdkV2 struct { // Metadata of the clean room asset - Asset types.List `tfsdk:"asset" tf:"optional,object"` + Asset types.List `tfsdk:"asset"` // Name of the clean room. CleanRoomName types.String `tfsdk:"-"` } @@ -1758,7 +1802,7 @@ type CreateCleanRoomOutputCatalogRequest_SdkV2 struct { // Name of the clean room. CleanRoomName types.String `tfsdk:"-"` - OutputCatalog types.List `tfsdk:"output_catalog" tf:"optional,object"` + OutputCatalog types.List `tfsdk:"output_catalog"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCleanRoomOutputCatalogRequest. @@ -1825,7 +1869,7 @@ func (o *CreateCleanRoomOutputCatalogRequest_SdkV2) SetOutputCatalog(ctx context } type CreateCleanRoomOutputCatalogResponse_SdkV2 struct { - OutputCatalog types.List `tfsdk:"output_catalog" tf:"optional,object"` + OutputCatalog types.List `tfsdk:"output_catalog"` } func (newState *CreateCleanRoomOutputCatalogResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCleanRoomOutputCatalogResponse_SdkV2) { @@ -1834,10 +1878,11 @@ func (newState *CreateCleanRoomOutputCatalogResponse_SdkV2) SyncEffectiveFieldsD func (newState *CreateCleanRoomOutputCatalogResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCleanRoomOutputCatalogResponse_SdkV2) { } -func (c CreateCleanRoomOutputCatalogResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomOutputCatalog_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "output_catalog")...) +func (c CreateCleanRoomOutputCatalogResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["output_catalog"] = attrs["output_catalog"].SetOptional() + attrs["output_catalog"] = attrs["output_catalog"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCleanRoomOutputCatalogResponse. @@ -1903,7 +1948,7 @@ func (o *CreateCleanRoomOutputCatalogResponse_SdkV2) SetOutputCatalog(ctx contex // Create a clean room type CreateCleanRoomRequest_SdkV2 struct { - CleanRoom types.List `tfsdk:"clean_room" tf:"optional,object"` + CleanRoom types.List `tfsdk:"clean_room"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCleanRoomRequest. @@ -2024,9 +2069,9 @@ func (newState *DeleteCleanRoomAssetResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *DeleteCleanRoomAssetResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteCleanRoomAssetResponse_SdkV2) { } -func (c DeleteCleanRoomAssetResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCleanRoomAssetResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCleanRoomAssetResponse. @@ -2248,11 +2293,11 @@ func (o ListCleanRoomAssetsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListCleanRoomAssetsResponse_SdkV2 struct { // Assets in the clean room. - Assets types.List `tfsdk:"assets" tf:"optional"` + Assets types.List `tfsdk:"assets"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCleanRoomAssetsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCleanRoomAssetsResponse_SdkV2) { @@ -2261,10 +2306,11 @@ func (newState *ListCleanRoomAssetsResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *ListCleanRoomAssetsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCleanRoomAssetsResponse_SdkV2) { } -func (c ListCleanRoomAssetsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomAsset_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "assets")...) +func (c ListCleanRoomAssetsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets"] = attrs["assets"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCleanRoomAssetsResponse. @@ -2383,9 +2429,9 @@ type ListCleanRoomNotebookTaskRunsResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Name of the clean room. - Runs types.List `tfsdk:"runs" tf:"optional"` + Runs types.List `tfsdk:"runs"` } func (newState *ListCleanRoomNotebookTaskRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCleanRoomNotebookTaskRunsResponse_SdkV2) { @@ -2394,10 +2440,11 @@ func (newState *ListCleanRoomNotebookTaskRunsResponse_SdkV2) SyncEffectiveFields func (newState *ListCleanRoomNotebookTaskRunsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCleanRoomNotebookTaskRunsResponse_SdkV2) { } -func (c ListCleanRoomNotebookTaskRunsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomNotebookTaskRun_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "runs")...) +func (c ListCleanRoomNotebookTaskRunsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["runs"] = attrs["runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCleanRoomNotebookTaskRunsResponse. @@ -2506,11 +2553,11 @@ func (o ListCleanRoomsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListCleanRoomsResponse_SdkV2 struct { - CleanRooms types.List `tfsdk:"clean_rooms" tf:"optional"` + CleanRooms types.List `tfsdk:"clean_rooms"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCleanRoomsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCleanRoomsResponse_SdkV2) { @@ -2519,10 +2566,11 @@ func (newState *ListCleanRoomsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ListCleanRoomsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCleanRoomsResponse_SdkV2) { } -func (c ListCleanRoomsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoom_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms")...) +func (c ListCleanRoomsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_rooms"] = attrs["clean_rooms"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCleanRoomsResponse. @@ -2591,7 +2639,7 @@ func (o *ListCleanRoomsResponse_SdkV2) SetCleanRooms(ctx context.Context, v []Cl // Update an asset type UpdateCleanRoomAssetRequest_SdkV2 struct { // Metadata of the clean room asset - Asset types.List `tfsdk:"asset" tf:"optional,object"` + Asset types.List `tfsdk:"asset"` // The type of the asset. AssetType types.String `tfsdk:"-"` // Name of the clean room. @@ -2674,7 +2722,7 @@ func (o *UpdateCleanRoomAssetRequest_SdkV2) SetAsset(ctx context.Context, v Clea } type UpdateCleanRoomRequest_SdkV2 struct { - CleanRoom types.List `tfsdk:"clean_room" tf:"optional,object"` + CleanRoom types.List `tfsdk:"clean_room"` // Name of the clean room. Name types.String `tfsdk:"-"` } @@ -2685,11 +2733,12 @@ func (newState *UpdateCleanRoomRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateCleanRoomRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCleanRoomRequest_SdkV2) { } -func (c UpdateCleanRoomRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoom_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clean_room")...) - cs.SetRequired(append(path, "name")...) +func (c UpdateCleanRoomRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_room"] = attrs["clean_room"].SetOptional() + attrs["clean_room"] = attrs["clean_room"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCleanRoomRequest. diff --git a/internal/service/cleanrooms_tf/model.go b/internal/service/cleanrooms_tf/model.go index 4cfb1c2b8..157cc2795 100755 --- a/internal/service/cleanrooms_tf/model.go +++ b/internal/service/cleanrooms_tf/model.go @@ -30,33 +30,33 @@ type CleanRoom struct { // Whether clean room access is restricted due to [CSP] // // [CSP]: https://docs.databricks.com/en/security/privacy/security-profile.html - AccessRestricted types.String `tfsdk:"access_restricted" tf:"computed"` + AccessRestricted types.String `tfsdk:"access_restricted"` - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // When the clean room was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The alias of the collaborator tied to the local clean room. - LocalCollaboratorAlias types.String `tfsdk:"local_collaborator_alias" tf:"computed"` + LocalCollaboratorAlias types.String `tfsdk:"local_collaborator_alias"` // The name of the clean room. It should follow [UC securable naming // requirements]. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Output catalog of the clean room. It is an output only field. Output // catalog is manipulated using the separate CreateCleanRoomOutputCatalog // API. - OutputCatalog types.Object `tfsdk:"output_catalog" tf:"computed,object"` + OutputCatalog types.Object `tfsdk:"output_catalog"` // This is Databricks username of the owner of the local clean room // securable for permission management. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Central clean room details. During creation, users need to specify // cloud_vendor, region, and collaborators.global_metastore_id. This field // will not be filled in the ListCleanRooms call. - RemoteDetailedInfo types.Object `tfsdk:"remote_detailed_info" tf:"optional,object"` + RemoteDetailedInfo types.Object `tfsdk:"remote_detailed_info"` // Clean room status. - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` // When the clean room was last updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` } func (newState *CleanRoom) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoom) { @@ -65,17 +65,19 @@ func (newState *CleanRoom) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoo func (newState *CleanRoom) SyncEffectiveFieldsDuringRead(existingState CleanRoom) { } -func (c CleanRoom) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "access_restricted")...) - cs.SetComputed(append(path, "created_at")...) - cs.SetComputed(append(path, "local_collaborator_alias")...) - cs.SetComputed(append(path, "output_catalog")...) - CleanRoomOutputCatalog{}.ApplySchemaCustomizations(cs, append(path, "output_catalog")...) - CleanRoomRemoteDetail{}.ApplySchemaCustomizations(cs, append(path, "remote_detailed_info")...) - cs.SetComputed(append(path, "status")...) - cs.SetComputed(append(path, "updated_at")...) +func (c CleanRoom) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_restricted"] = attrs["access_restricted"].SetComputed() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetComputed() + attrs["local_collaborator_alias"] = attrs["local_collaborator_alias"].SetComputed() + attrs["name"] = attrs["name"].SetOptional() + attrs["output_catalog"] = attrs["output_catalog"].SetComputed() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["remote_detailed_info"] = attrs["remote_detailed_info"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() + attrs["updated_at"] = attrs["updated_at"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoom. @@ -189,15 +191,15 @@ func (o *CleanRoom) SetRemoteDetailedInfo(ctx context.Context, v CleanRoomRemote // Metadata of the clean room asset type CleanRoomAsset struct { // When the asset is added to the clean room, in epoch milliseconds. - AddedAt types.Int64 `tfsdk:"added_at" tf:"computed"` + AddedAt types.Int64 `tfsdk:"added_at"` // The type of the asset. - AssetType types.String `tfsdk:"asset_type" tf:"optional"` + AssetType types.String `tfsdk:"asset_type"` // Foreign table details available to all collaborators of the clean room. // Present if and only if **asset_type** is **FOREIGN_TABLE** - ForeignTable types.Object `tfsdk:"foreign_table" tf:"optional,object"` + ForeignTable types.Object `tfsdk:"foreign_table"` // Local details for a foreign that are only available to its owner. Present // if and only if **asset_type** is **FOREIGN_TABLE** - ForeignTableLocalDetails types.Object `tfsdk:"foreign_table_local_details" tf:"optional,object"` + ForeignTableLocalDetails types.Object `tfsdk:"foreign_table_local_details"` // A fully qualified name that uniquely identifies the asset within the // clean room. This is also the name displayed in the clean room UI. // @@ -205,29 +207,29 @@ type CleanRoomAsset struct { // *shared_catalog*.*shared_schema*.*asset_name* // // For notebooks, the name is the notebook file name. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Notebook details available to all collaborators of the clean room. // Present if and only if **asset_type** is **NOTEBOOK_FILE** - Notebook types.Object `tfsdk:"notebook" tf:"optional,object"` + Notebook types.Object `tfsdk:"notebook"` // The alias of the collaborator who owns this asset - OwnerCollaboratorAlias types.String `tfsdk:"owner_collaborator_alias" tf:"computed"` + OwnerCollaboratorAlias types.String `tfsdk:"owner_collaborator_alias"` // Status of the asset - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` // Table details available to all collaborators of the clean room. Present // if and only if **asset_type** is **TABLE** - Table types.Object `tfsdk:"table" tf:"optional,object"` + Table types.Object `tfsdk:"table"` // Local details for a table that are only available to its owner. Present // if and only if **asset_type** is **TABLE** - TableLocalDetails types.Object `tfsdk:"table_local_details" tf:"optional,object"` + TableLocalDetails types.Object `tfsdk:"table_local_details"` // View details available to all collaborators of the clean room. Present if // and only if **asset_type** is **VIEW** - View types.Object `tfsdk:"view" tf:"optional,object"` + View types.Object `tfsdk:"view"` // Local details for a view that are only available to its owner. Present if // and only if **asset_type** is **VIEW** - ViewLocalDetails types.Object `tfsdk:"view_local_details" tf:"optional,object"` + ViewLocalDetails types.Object `tfsdk:"view_local_details"` // Local details for a volume that are only available to its owner. Present // if and only if **asset_type** is **VOLUME** - VolumeLocalDetails types.Object `tfsdk:"volume_local_details" tf:"optional,object"` + VolumeLocalDetails types.Object `tfsdk:"volume_local_details"` } func (newState *CleanRoomAsset) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAsset) { @@ -236,20 +238,22 @@ func (newState *CleanRoomAsset) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cle func (newState *CleanRoomAsset) SyncEffectiveFieldsDuringRead(existingState CleanRoomAsset) { } -func (c CleanRoomAsset) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "added_at")...) - CleanRoomAssetForeignTable{}.ApplySchemaCustomizations(cs, append(path, "foreign_table")...) - CleanRoomAssetForeignTableLocalDetails{}.ApplySchemaCustomizations(cs, append(path, "foreign_table_local_details")...) - CleanRoomAssetNotebook{}.ApplySchemaCustomizations(cs, append(path, "notebook")...) - cs.SetComputed(append(path, "owner_collaborator_alias")...) - cs.SetComputed(append(path, "status")...) - CleanRoomAssetTable{}.ApplySchemaCustomizations(cs, append(path, "table")...) - CleanRoomAssetTableLocalDetails{}.ApplySchemaCustomizations(cs, append(path, "table_local_details")...) - CleanRoomAssetView{}.ApplySchemaCustomizations(cs, append(path, "view")...) - CleanRoomAssetViewLocalDetails{}.ApplySchemaCustomizations(cs, append(path, "view_local_details")...) - CleanRoomAssetVolumeLocalDetails{}.ApplySchemaCustomizations(cs, append(path, "volume_local_details")...) +func (c CleanRoomAsset) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["added_at"] = attrs["added_at"].SetComputed() + attrs["asset_type"] = attrs["asset_type"].SetOptional() + attrs["foreign_table"] = attrs["foreign_table"].SetOptional() + attrs["foreign_table_local_details"] = attrs["foreign_table_local_details"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notebook"] = attrs["notebook"].SetOptional() + attrs["owner_collaborator_alias"] = attrs["owner_collaborator_alias"].SetComputed() + attrs["status"] = attrs["status"].SetComputed() + attrs["table"] = attrs["table"].SetOptional() + attrs["table_local_details"] = attrs["table_local_details"].SetOptional() + attrs["view"] = attrs["view"].SetOptional() + attrs["view_local_details"] = attrs["view_local_details"].SetOptional() + attrs["volume_local_details"] = attrs["volume_local_details"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAsset. @@ -542,7 +546,7 @@ func (o *CleanRoomAsset) SetVolumeLocalDetails(ctx context.Context, v CleanRoomA type CleanRoomAssetForeignTable struct { // The metadata information of the columns in the foreign table - Columns types.List `tfsdk:"columns" tf:"computed"` + Columns types.List `tfsdk:"columns"` } func (newState *CleanRoomAssetForeignTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetForeignTable) { @@ -551,10 +555,10 @@ func (newState *CleanRoomAssetForeignTable) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CleanRoomAssetForeignTable) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetForeignTable) { } -func (c CleanRoomAssetForeignTable) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "columns")...) +func (c CleanRoomAssetForeignTable) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetForeignTable. @@ -621,7 +625,7 @@ func (o *CleanRoomAssetForeignTable) SetColumns(ctx context.Context, v []catalog type CleanRoomAssetForeignTableLocalDetails struct { // The fully qualified name of the foreign table in its owner's local // metastore, in the format of *catalog*.*schema*.*foreign_table_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` } func (newState *CleanRoomAssetForeignTableLocalDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetForeignTableLocalDetails) { @@ -630,9 +634,10 @@ func (newState *CleanRoomAssetForeignTableLocalDetails) SyncEffectiveFieldsDurin func (newState *CleanRoomAssetForeignTableLocalDetails) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetForeignTableLocalDetails) { } -func (c CleanRoomAssetForeignTableLocalDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetForeignTableLocalDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetForeignTableLocalDetails. @@ -668,10 +673,10 @@ func (o CleanRoomAssetForeignTableLocalDetails) Type(ctx context.Context) attr.T type CleanRoomAssetNotebook struct { // Server generated checksum that represents the notebook version. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // Base 64 representation of the notebook contents. This is the same format // as returned by :method:workspace/export with the format of **HTML**. - NotebookContent types.String `tfsdk:"notebook_content" tf:"optional"` + NotebookContent types.String `tfsdk:"notebook_content"` } func (newState *CleanRoomAssetNotebook) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetNotebook) { @@ -680,10 +685,11 @@ func (newState *CleanRoomAssetNotebook) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CleanRoomAssetNotebook) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetNotebook) { } -func (c CleanRoomAssetNotebook) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "etag")...) +func (c CleanRoomAssetNotebook) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetComputed() + attrs["notebook_content"] = attrs["notebook_content"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetNotebook. @@ -721,7 +727,7 @@ func (o CleanRoomAssetNotebook) Type(ctx context.Context) attr.Type { type CleanRoomAssetTable struct { // The metadata information of the columns in the table - Columns types.List `tfsdk:"columns" tf:"computed"` + Columns types.List `tfsdk:"columns"` } func (newState *CleanRoomAssetTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetTable) { @@ -730,10 +736,10 @@ func (newState *CleanRoomAssetTable) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CleanRoomAssetTable) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetTable) { } -func (c CleanRoomAssetTable) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "columns")...) +func (c CleanRoomAssetTable) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetTable. @@ -800,9 +806,9 @@ func (o *CleanRoomAssetTable) SetColumns(ctx context.Context, v []catalog_tf.Col type CleanRoomAssetTableLocalDetails struct { // The fully qualified name of the table in its owner's local metastore, in // the format of *catalog*.*schema*.*table_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` // Partition filtering specification for a shared table. - Partitions types.List `tfsdk:"partitions" tf:"optional"` + Partitions types.List `tfsdk:"partitions"` } func (newState *CleanRoomAssetTableLocalDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetTableLocalDetails) { @@ -811,9 +817,11 @@ func (newState *CleanRoomAssetTableLocalDetails) SyncEffectiveFieldsDuringCreate func (newState *CleanRoomAssetTableLocalDetails) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetTableLocalDetails) { } -func (c CleanRoomAssetTableLocalDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetTableLocalDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() + attrs["partitions"] = attrs["partitions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetTableLocalDetails. @@ -881,7 +889,7 @@ func (o *CleanRoomAssetTableLocalDetails) SetPartitions(ctx context.Context, v [ type CleanRoomAssetView struct { // The metadata information of the columns in the view - Columns types.List `tfsdk:"columns" tf:"computed"` + Columns types.List `tfsdk:"columns"` } func (newState *CleanRoomAssetView) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetView) { @@ -890,10 +898,10 @@ func (newState *CleanRoomAssetView) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CleanRoomAssetView) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetView) { } -func (c CleanRoomAssetView) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "columns")...) +func (c CleanRoomAssetView) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetView. @@ -960,7 +968,7 @@ func (o *CleanRoomAssetView) SetColumns(ctx context.Context, v []catalog_tf.Colu type CleanRoomAssetViewLocalDetails struct { // The fully qualified name of the view in its owner's local metastore, in // the format of *catalog*.*schema*.*view_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` } func (newState *CleanRoomAssetViewLocalDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetViewLocalDetails) { @@ -969,9 +977,10 @@ func (newState *CleanRoomAssetViewLocalDetails) SyncEffectiveFieldsDuringCreateO func (newState *CleanRoomAssetViewLocalDetails) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetViewLocalDetails) { } -func (c CleanRoomAssetViewLocalDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetViewLocalDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetViewLocalDetails. @@ -1008,7 +1017,7 @@ func (o CleanRoomAssetViewLocalDetails) Type(ctx context.Context) attr.Type { type CleanRoomAssetVolumeLocalDetails struct { // The fully qualified name of the volume in its owner's local metastore, in // the format of *catalog*.*schema*.*volume_name* - LocalName types.String `tfsdk:"local_name" tf:"optional"` + LocalName types.String `tfsdk:"local_name"` } func (newState *CleanRoomAssetVolumeLocalDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetVolumeLocalDetails) { @@ -1017,9 +1026,10 @@ func (newState *CleanRoomAssetVolumeLocalDetails) SyncEffectiveFieldsDuringCreat func (newState *CleanRoomAssetVolumeLocalDetails) SyncEffectiveFieldsDuringRead(existingState CleanRoomAssetVolumeLocalDetails) { } -func (c CleanRoomAssetVolumeLocalDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomAssetVolumeLocalDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["local_name"] = attrs["local_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomAssetVolumeLocalDetails. @@ -1062,28 +1072,28 @@ type CleanRoomCollaborator struct { // requirements]. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - CollaboratorAlias types.String `tfsdk:"collaborator_alias" tf:"optional"` + CollaboratorAlias types.String `tfsdk:"collaborator_alias"` // Generated display name for the collaborator. In the case of a single // metastore clean room, it is the clean room name. For x-metastore clean // rooms, it is the organization name of the metastore. It is not restricted // to these values and could change in the future - DisplayName types.String `tfsdk:"display_name" tf:"computed"` + DisplayName types.String `tfsdk:"display_name"` // The global Unity Catalog metastore id of the collaborator. The identifier // is of format cloud:region:metastore-uuid. - GlobalMetastoreId types.String `tfsdk:"global_metastore_id" tf:"optional"` + GlobalMetastoreId types.String `tfsdk:"global_metastore_id"` // Email of the user who is receiving the clean room "invitation". It should // be empty for the creator of the clean room, and non-empty for the // invitees of the clean room. It is only returned in the output when clean // room creator calls GET - InviteRecipientEmail types.String `tfsdk:"invite_recipient_email" tf:"optional"` + InviteRecipientEmail types.String `tfsdk:"invite_recipient_email"` // Workspace ID of the user who is receiving the clean room "invitation". // Must be specified if invite_recipient_email is specified. It should be // empty when the collaborator is the creator of the clean room. - InviteRecipientWorkspaceId types.Int64 `tfsdk:"invite_recipient_workspace_id" tf:"optional"` + InviteRecipientWorkspaceId types.Int64 `tfsdk:"invite_recipient_workspace_id"` // [Organization // name](:method:metastores/list#metastores-delta_sharing_organization_name) // configured in the metastore - OrganizationName types.String `tfsdk:"organization_name" tf:"computed"` + OrganizationName types.String `tfsdk:"organization_name"` } func (newState *CleanRoomCollaborator) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomCollaborator) { @@ -1092,11 +1102,15 @@ func (newState *CleanRoomCollaborator) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CleanRoomCollaborator) SyncEffectiveFieldsDuringRead(existingState CleanRoomCollaborator) { } -func (c CleanRoomCollaborator) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "display_name")...) - cs.SetComputed(append(path, "organization_name")...) +func (c CleanRoomCollaborator) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["collaborator_alias"] = attrs["collaborator_alias"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetComputed() + attrs["global_metastore_id"] = attrs["global_metastore_id"].SetOptional() + attrs["invite_recipient_email"] = attrs["invite_recipient_email"].SetOptional() + attrs["invite_recipient_workspace_id"] = attrs["invite_recipient_workspace_id"].SetOptional() + attrs["organization_name"] = attrs["organization_name"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomCollaborator. @@ -1146,21 +1160,21 @@ type CleanRoomNotebookTaskRun struct { // only included in the LIST API. if the task was run within the same // workspace the API is being called. If the task run was in a different // workspace under the same metastore, only the workspace_id is included. - CollaboratorJobRunInfo types.Object `tfsdk:"collaborator_job_run_info" tf:"optional,object"` + CollaboratorJobRunInfo types.Object `tfsdk:"collaborator_job_run_info"` // State of the task run. - NotebookJobRunState types.Object `tfsdk:"notebook_job_run_state" tf:"optional,object"` + NotebookJobRunState types.Object `tfsdk:"notebook_job_run_state"` // Asset name of the notebook executed in this task run. - NotebookName types.String `tfsdk:"notebook_name" tf:"optional"` + NotebookName types.String `tfsdk:"notebook_name"` // Expiration time of the output schema of the task run (if any), in epoch // milliseconds. - OutputSchemaExpirationTime types.Int64 `tfsdk:"output_schema_expiration_time" tf:"optional"` + OutputSchemaExpirationTime types.Int64 `tfsdk:"output_schema_expiration_time"` // Name of the output schema associated with the clean rooms notebook task // run. - OutputSchemaName types.String `tfsdk:"output_schema_name" tf:"optional"` + OutputSchemaName types.String `tfsdk:"output_schema_name"` // Duration of the task run, in milliseconds. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // When the task run started, in epoch milliseconds. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` } func (newState *CleanRoomNotebookTaskRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomNotebookTaskRun) { @@ -1169,11 +1183,16 @@ func (newState *CleanRoomNotebookTaskRun) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CleanRoomNotebookTaskRun) SyncEffectiveFieldsDuringRead(existingState CleanRoomNotebookTaskRun) { } -func (c CleanRoomNotebookTaskRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CollaboratorJobRunInfo{}.ApplySchemaCustomizations(cs, append(path, "collaborator_job_run_info")...) - jobs_tf.CleanRoomTaskRunState{}.ApplySchemaCustomizations(cs, append(path, "notebook_job_run_state")...) +func (c CleanRoomNotebookTaskRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["collaborator_job_run_info"] = attrs["collaborator_job_run_info"].SetOptional() + attrs["notebook_job_run_state"] = attrs["notebook_job_run_state"].SetOptional() + attrs["notebook_name"] = attrs["notebook_name"].SetOptional() + attrs["output_schema_expiration_time"] = attrs["output_schema_expiration_time"].SetOptional() + attrs["output_schema_name"] = attrs["output_schema_name"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomNotebookTaskRun. @@ -1283,9 +1302,9 @@ type CleanRoomOutputCatalog struct { // naming requirements]. The field will always exist if status is CREATED. // // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` } func (newState *CleanRoomOutputCatalog) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomOutputCatalog) { @@ -1294,10 +1313,11 @@ func (newState *CleanRoomOutputCatalog) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CleanRoomOutputCatalog) SyncEffectiveFieldsDuringRead(existingState CleanRoomOutputCatalog) { } -func (c CleanRoomOutputCatalog) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "status")...) +func (c CleanRoomOutputCatalog) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomOutputCatalog. @@ -1336,9 +1356,9 @@ func (o CleanRoomOutputCatalog) Type(ctx context.Context) attr.Type { // Publicly visible central clean room details. type CleanRoomRemoteDetail struct { // Central clean room ID. - CentralCleanRoomId types.String `tfsdk:"central_clean_room_id" tf:"computed"` + CentralCleanRoomId types.String `tfsdk:"central_clean_room_id"` // Cloud vendor (aws,azure,gcp) of the central clean room. - CloudVendor types.String `tfsdk:"cloud_vendor" tf:"optional"` + CloudVendor types.String `tfsdk:"cloud_vendor"` // Collaborators in the central clean room. There should one and only one // collaborator in the list that satisfies the owner condition: // @@ -1346,16 +1366,16 @@ type CleanRoomRemoteDetail struct { // CreateCleanRoom). // // 2. Its invite_recipient_email is empty. - Collaborators types.List `tfsdk:"collaborators" tf:"optional"` + Collaborators types.List `tfsdk:"collaborators"` // The compliance security profile used to process regulated data following // compliance standards. - ComplianceSecurityProfile types.Object `tfsdk:"compliance_security_profile" tf:"optional,object"` + ComplianceSecurityProfile types.Object `tfsdk:"compliance_security_profile"` // Collaborator who creates the clean room. - Creator types.Object `tfsdk:"creator" tf:"computed,object"` + Creator types.Object `tfsdk:"creator"` // Egress network policy to apply to the central clean room workspace. - EgressNetworkPolicy types.Object `tfsdk:"egress_network_policy" tf:"optional,object"` + EgressNetworkPolicy types.Object `tfsdk:"egress_network_policy"` // Region of the central clean room. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *CleanRoomRemoteDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomRemoteDetail) { @@ -1364,15 +1384,16 @@ func (newState *CleanRoomRemoteDetail) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CleanRoomRemoteDetail) SyncEffectiveFieldsDuringRead(existingState CleanRoomRemoteDetail) { } -func (c CleanRoomRemoteDetail) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "central_clean_room_id")...) - CleanRoomCollaborator{}.ApplySchemaCustomizations(cs, append(path, "collaborators")...) - ComplianceSecurityProfile{}.ApplySchemaCustomizations(cs, append(path, "compliance_security_profile")...) - cs.SetComputed(append(path, "creator")...) - CleanRoomCollaborator{}.ApplySchemaCustomizations(cs, append(path, "creator")...) - settings_tf.EgressNetworkPolicy{}.ApplySchemaCustomizations(cs, append(path, "egress_network_policy")...) +func (c CleanRoomRemoteDetail) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["central_clean_room_id"] = attrs["central_clean_room_id"].SetComputed() + attrs["cloud_vendor"] = attrs["cloud_vendor"].SetOptional() + attrs["collaborators"] = attrs["collaborators"].SetOptional() + attrs["compliance_security_profile"] = attrs["compliance_security_profile"].SetOptional() + attrs["creator"] = attrs["creator"].SetComputed() + attrs["egress_network_policy"] = attrs["egress_network_policy"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomRemoteDetail. @@ -1537,15 +1558,15 @@ func (o *CleanRoomRemoteDetail) SetEgressNetworkPolicy(ctx context.Context, v se type CollaboratorJobRunInfo struct { // Alias of the collaborator that triggered the task run. - CollaboratorAlias types.String `tfsdk:"collaborator_alias" tf:"optional"` + CollaboratorAlias types.String `tfsdk:"collaborator_alias"` // Job ID of the task run in the collaborator's workspace. - CollaboratorJobId types.Int64 `tfsdk:"collaborator_job_id" tf:"optional"` + CollaboratorJobId types.Int64 `tfsdk:"collaborator_job_id"` // Job run ID of the task run in the collaborator's workspace. - CollaboratorJobRunId types.Int64 `tfsdk:"collaborator_job_run_id" tf:"optional"` + CollaboratorJobRunId types.Int64 `tfsdk:"collaborator_job_run_id"` // Task run ID of the task run in the collaborator's workspace. - CollaboratorTaskRunId types.Int64 `tfsdk:"collaborator_task_run_id" tf:"optional"` + CollaboratorTaskRunId types.Int64 `tfsdk:"collaborator_task_run_id"` // ID of the collaborator's workspace that triggered the task run. - CollaboratorWorkspaceId types.Int64 `tfsdk:"collaborator_workspace_id" tf:"optional"` + CollaboratorWorkspaceId types.Int64 `tfsdk:"collaborator_workspace_id"` } func (newState *CollaboratorJobRunInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CollaboratorJobRunInfo) { @@ -1554,9 +1575,14 @@ func (newState *CollaboratorJobRunInfo) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CollaboratorJobRunInfo) SyncEffectiveFieldsDuringRead(existingState CollaboratorJobRunInfo) { } -func (c CollaboratorJobRunInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CollaboratorJobRunInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["collaborator_alias"] = attrs["collaborator_alias"].SetOptional() + attrs["collaborator_job_id"] = attrs["collaborator_job_id"].SetOptional() + attrs["collaborator_job_run_id"] = attrs["collaborator_job_run_id"].SetOptional() + attrs["collaborator_task_run_id"] = attrs["collaborator_task_run_id"].SetOptional() + attrs["collaborator_workspace_id"] = attrs["collaborator_workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CollaboratorJobRunInfo. @@ -1603,9 +1629,9 @@ func (o CollaboratorJobRunInfo) Type(ctx context.Context) attr.Type { type ComplianceSecurityProfile struct { // The list of compliance standards that the compliance security profile is // configured to enforce. - ComplianceStandards types.List `tfsdk:"compliance_standards" tf:"optional"` + ComplianceStandards types.List `tfsdk:"compliance_standards"` // Whether the compliance security profile is enabled. - IsEnabled types.Bool `tfsdk:"is_enabled" tf:"optional"` + IsEnabled types.Bool `tfsdk:"is_enabled"` } func (newState *ComplianceSecurityProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplianceSecurityProfile) { @@ -1614,9 +1640,11 @@ func (newState *ComplianceSecurityProfile) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ComplianceSecurityProfile) SyncEffectiveFieldsDuringRead(existingState ComplianceSecurityProfile) { } -func (c ComplianceSecurityProfile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ComplianceSecurityProfile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_standards"] = attrs["compliance_standards"].SetOptional() + attrs["is_enabled"] = attrs["is_enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplianceSecurityProfile. @@ -1685,7 +1713,7 @@ func (o *ComplianceSecurityProfile) SetComplianceStandards(ctx context.Context, // Create an asset type CreateCleanRoomAssetRequest struct { // Metadata of the clean room asset - Asset types.Object `tfsdk:"asset" tf:"optional,object"` + Asset types.Object `tfsdk:"asset"` // Name of the clean room. CleanRoomName types.String `tfsdk:"-"` } @@ -1758,7 +1786,7 @@ type CreateCleanRoomOutputCatalogRequest struct { // Name of the clean room. CleanRoomName types.String `tfsdk:"-"` - OutputCatalog types.Object `tfsdk:"output_catalog" tf:"optional,object"` + OutputCatalog types.Object `tfsdk:"output_catalog"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCleanRoomOutputCatalogRequest. @@ -1825,7 +1853,7 @@ func (o *CreateCleanRoomOutputCatalogRequest) SetOutputCatalog(ctx context.Conte } type CreateCleanRoomOutputCatalogResponse struct { - OutputCatalog types.Object `tfsdk:"output_catalog" tf:"optional,object"` + OutputCatalog types.Object `tfsdk:"output_catalog"` } func (newState *CreateCleanRoomOutputCatalogResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCleanRoomOutputCatalogResponse) { @@ -1834,10 +1862,10 @@ func (newState *CreateCleanRoomOutputCatalogResponse) SyncEffectiveFieldsDuringC func (newState *CreateCleanRoomOutputCatalogResponse) SyncEffectiveFieldsDuringRead(existingState CreateCleanRoomOutputCatalogResponse) { } -func (c CreateCleanRoomOutputCatalogResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomOutputCatalog{}.ApplySchemaCustomizations(cs, append(path, "output_catalog")...) +func (c CreateCleanRoomOutputCatalogResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["output_catalog"] = attrs["output_catalog"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCleanRoomOutputCatalogResponse. @@ -1903,7 +1931,7 @@ func (o *CreateCleanRoomOutputCatalogResponse) SetOutputCatalog(ctx context.Cont // Create a clean room type CreateCleanRoomRequest struct { - CleanRoom types.Object `tfsdk:"clean_room" tf:"optional,object"` + CleanRoom types.Object `tfsdk:"clean_room"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCleanRoomRequest. @@ -2024,9 +2052,9 @@ func (newState *DeleteCleanRoomAssetResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *DeleteCleanRoomAssetResponse) SyncEffectiveFieldsDuringRead(existingState DeleteCleanRoomAssetResponse) { } -func (c DeleteCleanRoomAssetResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCleanRoomAssetResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCleanRoomAssetResponse. @@ -2248,11 +2276,11 @@ func (o ListCleanRoomAssetsRequest) Type(ctx context.Context) attr.Type { type ListCleanRoomAssetsResponse struct { // Assets in the clean room. - Assets types.List `tfsdk:"assets" tf:"optional"` + Assets types.List `tfsdk:"assets"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCleanRoomAssetsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCleanRoomAssetsResponse) { @@ -2261,10 +2289,11 @@ func (newState *ListCleanRoomAssetsResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListCleanRoomAssetsResponse) SyncEffectiveFieldsDuringRead(existingState ListCleanRoomAssetsResponse) { } -func (c ListCleanRoomAssetsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomAsset{}.ApplySchemaCustomizations(cs, append(path, "assets")...) +func (c ListCleanRoomAssetsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets"] = attrs["assets"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCleanRoomAssetsResponse. @@ -2383,9 +2412,9 @@ type ListCleanRoomNotebookTaskRunsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Name of the clean room. - Runs types.List `tfsdk:"runs" tf:"optional"` + Runs types.List `tfsdk:"runs"` } func (newState *ListCleanRoomNotebookTaskRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCleanRoomNotebookTaskRunsResponse) { @@ -2394,10 +2423,11 @@ func (newState *ListCleanRoomNotebookTaskRunsResponse) SyncEffectiveFieldsDuring func (newState *ListCleanRoomNotebookTaskRunsResponse) SyncEffectiveFieldsDuringRead(existingState ListCleanRoomNotebookTaskRunsResponse) { } -func (c ListCleanRoomNotebookTaskRunsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomNotebookTaskRun{}.ApplySchemaCustomizations(cs, append(path, "runs")...) +func (c ListCleanRoomNotebookTaskRunsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["runs"] = attrs["runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCleanRoomNotebookTaskRunsResponse. @@ -2506,11 +2536,11 @@ func (o ListCleanRoomsRequest) Type(ctx context.Context) attr.Type { } type ListCleanRoomsResponse struct { - CleanRooms types.List `tfsdk:"clean_rooms" tf:"optional"` + CleanRooms types.List `tfsdk:"clean_rooms"` // Opaque token to retrieve the next page of results. Absent if there are no // more pages. page_token should be set to this value for the next request // (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListCleanRoomsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCleanRoomsResponse) { @@ -2519,10 +2549,11 @@ func (newState *ListCleanRoomsResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListCleanRoomsResponse) SyncEffectiveFieldsDuringRead(existingState ListCleanRoomsResponse) { } -func (c ListCleanRoomsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoom{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms")...) +func (c ListCleanRoomsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_rooms"] = attrs["clean_rooms"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCleanRoomsResponse. @@ -2591,7 +2622,7 @@ func (o *ListCleanRoomsResponse) SetCleanRooms(ctx context.Context, v []CleanRoo // Update an asset type UpdateCleanRoomAssetRequest struct { // Metadata of the clean room asset - Asset types.Object `tfsdk:"asset" tf:"optional,object"` + Asset types.Object `tfsdk:"asset"` // The type of the asset. AssetType types.String `tfsdk:"-"` // Name of the clean room. @@ -2674,7 +2705,7 @@ func (o *UpdateCleanRoomAssetRequest) SetAsset(ctx context.Context, v CleanRoomA } type UpdateCleanRoomRequest struct { - CleanRoom types.Object `tfsdk:"clean_room" tf:"optional,object"` + CleanRoom types.Object `tfsdk:"clean_room"` // Name of the clean room. Name types.String `tfsdk:"-"` } @@ -2685,11 +2716,11 @@ func (newState *UpdateCleanRoomRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateCleanRoomRequest) SyncEffectiveFieldsDuringRead(existingState UpdateCleanRoomRequest) { } -func (c UpdateCleanRoomRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoom{}.ApplySchemaCustomizations(cs, append(path, "clean_room")...) - cs.SetRequired(append(path, "name")...) +func (c UpdateCleanRoomRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_room"] = attrs["clean_room"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCleanRoomRequest. diff --git a/internal/service/compute_tf/legacy_model.go b/internal/service/compute_tf/legacy_model.go index b442d2af2..218faebca 100755 --- a/internal/service/compute_tf/legacy_model.go +++ b/internal/service/compute_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -31,16 +32,16 @@ type AddInstanceProfile_SdkV2 struct { // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html - IamRoleArn types.String `tfsdk:"iam_role_arn" tf:"optional"` + IamRoleArn types.String `tfsdk:"iam_role_arn"` // The AWS ARN of the instance profile to register with Databricks. This // field is required. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:""` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Boolean flag indicating whether the instance profile should only be used // in credential passthrough scenarios. If true, it means the instance // profile contains an meta IAM role which could assume a wide range of // roles. Therefore it should always be used with authorization. This field // is optional, the default value is `false`. - IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile" tf:"optional"` + IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile"` // By default, Databricks validates that it has sufficient permissions to // launch instances with the instance profile. This validation uses AWS // dry-run mode for the RunInstances API. If validation fails with an error @@ -48,7 +49,7 @@ type AddInstanceProfile_SdkV2 struct { // “Your requested instance type is not supported in your requested // availability zone”), you can pass this flag to skip the validation and // forcibly add the instance profile. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *AddInstanceProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddInstanceProfile_SdkV2) { @@ -57,10 +58,13 @@ func (newState *AddInstanceProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AddInstanceProfile_SdkV2) SyncEffectiveFieldsDuringRead(existingState AddInstanceProfile_SdkV2) { } -func (c AddInstanceProfile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_profile_arn")...) +func (c AddInstanceProfile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["iam_role_arn"] = attrs["iam_role_arn"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetRequired() + attrs["is_meta_instance_profile"] = attrs["is_meta_instance_profile"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddInstanceProfile. @@ -133,7 +137,7 @@ func (o AddResponse_SdkV2) Type(ctx context.Context) attr.Type { type Adlsgen2Info_SdkV2 struct { // abfss destination, e.g. // `abfss://@.dfs.core.windows.net/`. - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *Adlsgen2Info_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Adlsgen2Info_SdkV2) { @@ -142,10 +146,10 @@ func (newState *Adlsgen2Info_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *Adlsgen2Info_SdkV2) SyncEffectiveFieldsDuringRead(existingState Adlsgen2Info_SdkV2) { } -func (c Adlsgen2Info_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c Adlsgen2Info_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Adlsgen2Info. @@ -183,11 +187,11 @@ type AutoScale_SdkV2 struct { // The maximum number of workers to which the cluster can scale up when // overloaded. Note that `max_workers` must be strictly greater than // `min_workers`. - MaxWorkers types.Int64 `tfsdk:"max_workers" tf:"optional"` + MaxWorkers types.Int64 `tfsdk:"max_workers"` // The minimum number of workers to which the cluster can scale down when // underutilized. It is also the initial number of workers the cluster will // have after creation. - MinWorkers types.Int64 `tfsdk:"min_workers" tf:"optional"` + MinWorkers types.Int64 `tfsdk:"min_workers"` } func (newState *AutoScale_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoScale_SdkV2) { @@ -196,9 +200,11 @@ func (newState *AutoScale_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Au func (newState *AutoScale_SdkV2) SyncEffectiveFieldsDuringRead(existingState AutoScale_SdkV2) { } -func (c AutoScale_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AutoScale_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["max_workers"] = attrs["max_workers"].SetOptional() + attrs["min_workers"] = attrs["min_workers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoScale. @@ -240,7 +246,7 @@ type AwsAttributes_SdkV2 struct { // // Note: If `first_on_demand` is zero, this availability type will be used // for the entire cluster. - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // The number of volumes launched for each instance. Users can choose up to // 10 volumes. This feature is only enabled for supported node types. Legacy // node types cannot specify custom EBS volumes. For node types with no @@ -257,21 +263,21 @@ type AwsAttributes_SdkV2 struct { // // Please note that if EBS volumes are specified, then the Spark // configuration `spark.local.dir` will be overridden. - EbsVolumeCount types.Int64 `tfsdk:"ebs_volume_count" tf:"optional"` + EbsVolumeCount types.Int64 `tfsdk:"ebs_volume_count"` // If using gp3 volumes, what IOPS to use for the disk. If this is not set, // the maximum performance of a gp2 volume with the same volume size will be // used. - EbsVolumeIops types.Int64 `tfsdk:"ebs_volume_iops" tf:"optional"` + EbsVolumeIops types.Int64 `tfsdk:"ebs_volume_iops"` // The size of each EBS volume (in GiB) launched for each instance. For // general purpose SSD, this value must be within the range 100 - 4096. For // throughput optimized HDD, this value must be within the range 500 - 4096. - EbsVolumeSize types.Int64 `tfsdk:"ebs_volume_size" tf:"optional"` + EbsVolumeSize types.Int64 `tfsdk:"ebs_volume_size"` // If using gp3 volumes, what throughput to use for the disk. If this is not // set, the maximum performance of a gp2 volume with the same volume size // will be used. - EbsVolumeThroughput types.Int64 `tfsdk:"ebs_volume_throughput" tf:"optional"` + EbsVolumeThroughput types.Int64 `tfsdk:"ebs_volume_throughput"` // The type of EBS volumes that will be launched with this cluster. - EbsVolumeType types.String `tfsdk:"ebs_volume_type" tf:"optional"` + EbsVolumeType types.String `tfsdk:"ebs_volume_type"` // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. If this value is greater than 0, the cluster driver // node in particular will be placed on an on-demand instance. If this value @@ -281,7 +287,7 @@ type AwsAttributes_SdkV2 struct { // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. - FirstOnDemand types.Int64 `tfsdk:"first_on_demand" tf:"optional"` + FirstOnDemand types.Int64 `tfsdk:"first_on_demand"` // Nodes for this cluster will only be placed on AWS instances with this // instance profile. If ommitted, nodes will be placed on instances without // an IAM instance profile. The instance profile must have previously been @@ -291,7 +297,7 @@ type AwsAttributes_SdkV2 struct { // // If this field is ommitted, we will pull in the default from the conf if // it exists. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then @@ -306,7 +312,7 @@ type AwsAttributes_SdkV2 struct { // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidPricePercent and // CommonConf.maxSpotBidPricePercent. - SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent" tf:"optional"` + SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks @@ -317,7 +323,7 @@ type AwsAttributes_SdkV2 struct { // in a zone with high availability, and will retry placement in a different // AZ if there is not enough capacity. The list of available zones as well // as the default value can be found by using the `List Zones` method. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *AwsAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsAttributes_SdkV2) { @@ -326,9 +332,19 @@ func (newState *AwsAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AwsAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsAttributes_SdkV2) { } -func (c AwsAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AwsAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["ebs_volume_count"] = attrs["ebs_volume_count"].SetOptional() + attrs["ebs_volume_iops"] = attrs["ebs_volume_iops"].SetOptional() + attrs["ebs_volume_size"] = attrs["ebs_volume_size"].SetOptional() + attrs["ebs_volume_throughput"] = attrs["ebs_volume_throughput"].SetOptional() + attrs["ebs_volume_type"] = attrs["ebs_volume_type"].SetOptional() + attrs["first_on_demand"] = attrs["first_on_demand"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["spot_bid_price_percent"] = attrs["spot_bid_price_percent"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsAttributes. @@ -385,7 +401,7 @@ type AzureAttributes_SdkV2 struct { // `first_on_demand` ones. Note: If `first_on_demand` is zero (which only // happens on pool clusters), this availability type will be used for the // entire cluster. - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. This value should be greater than 0, to make sure // the cluster driver node is placed on an on-demand instance. If this value @@ -395,15 +411,15 @@ type AzureAttributes_SdkV2 struct { // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. - FirstOnDemand types.Int64 `tfsdk:"first_on_demand" tf:"optional"` + FirstOnDemand types.Int64 `tfsdk:"first_on_demand"` // Defines values necessary to configure and run Azure Log Analytics agent - LogAnalyticsInfo types.List `tfsdk:"log_analytics_info" tf:"optional,object"` + LogAnalyticsInfo types.List `tfsdk:"log_analytics_info"` // The max bid price to be used for Azure spot instances. The Max price for // the bid cannot be higher than the on-demand price of the instance. If not // specified, the default value is -1, which specifies that the instance // cannot be evicted on the basis of price, and only on the basis of // availability. Further, the value should > 0 or -1. - SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price" tf:"optional"` + SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price"` } func (newState *AzureAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureAttributes_SdkV2) { @@ -412,10 +428,14 @@ func (newState *AzureAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AzureAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureAttributes_SdkV2) { } -func (c AzureAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogAnalyticsInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "log_analytics_info")...) +func (c AzureAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["first_on_demand"] = attrs["first_on_demand"].SetOptional() + attrs["log_analytics_info"] = attrs["log_analytics_info"].SetOptional() + attrs["log_analytics_info"] = attrs["log_analytics_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spot_bid_max_price"] = attrs["spot_bid_max_price"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureAttributes. @@ -486,11 +506,11 @@ func (o *AzureAttributes_SdkV2) SetLogAnalyticsInfo(ctx context.Context, v LogAn } type CancelCommand_SdkV2 struct { - ClusterId types.String `tfsdk:"clusterId" tf:"optional"` + ClusterId types.String `tfsdk:"clusterId"` - CommandId types.String `tfsdk:"commandId" tf:"optional"` + CommandId types.String `tfsdk:"commandId"` - ContextId types.String `tfsdk:"contextId" tf:"optional"` + ContextId types.String `tfsdk:"contextId"` } func (newState *CancelCommand_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelCommand_SdkV2) { @@ -499,9 +519,12 @@ func (newState *CancelCommand_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CancelCommand_SdkV2) SyncEffectiveFieldsDuringRead(existingState CancelCommand_SdkV2) { } -func (c CancelCommand_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CancelCommand_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetOptional() + attrs["commandId"] = attrs["commandId"].SetOptional() + attrs["contextId"] = attrs["contextId"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CancelCommand. @@ -571,9 +594,9 @@ func (o CancelResponse_SdkV2) Type(ctx context.Context) attr.Type { type ChangeClusterOwner_SdkV2 struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // New owner of the cluster_id after this RPC. - OwnerUsername types.String `tfsdk:"owner_username" tf:""` + OwnerUsername types.String `tfsdk:"owner_username"` } func (newState *ChangeClusterOwner_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChangeClusterOwner_SdkV2) { @@ -582,11 +605,11 @@ func (newState *ChangeClusterOwner_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ChangeClusterOwner_SdkV2) SyncEffectiveFieldsDuringRead(existingState ChangeClusterOwner_SdkV2) { } -func (c ChangeClusterOwner_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "owner_username")...) +func (c ChangeClusterOwner_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["owner_username"] = attrs["owner_username"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChangeClusterOwner. @@ -631,9 +654,9 @@ func (newState *ChangeClusterOwnerResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ChangeClusterOwnerResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ChangeClusterOwnerResponse_SdkV2) { } -func (c ChangeClusterOwnerResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ChangeClusterOwnerResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChangeClusterOwnerResponse. @@ -665,9 +688,9 @@ func (o ChangeClusterOwnerResponse_SdkV2) Type(ctx context.Context) attr.Type { type ClientsTypes_SdkV2 struct { // With jobs set, the cluster can be used for jobs - Jobs types.Bool `tfsdk:"jobs" tf:"optional"` + Jobs types.Bool `tfsdk:"jobs"` // With notebooks set, this cluster can be used for notebooks - Notebooks types.Bool `tfsdk:"notebooks" tf:"optional"` + Notebooks types.Bool `tfsdk:"notebooks"` } func (newState *ClientsTypes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClientsTypes_SdkV2) { @@ -676,9 +699,11 @@ func (newState *ClientsTypes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClientsTypes_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClientsTypes_SdkV2) { } -func (c ClientsTypes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClientsTypes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["jobs"] = attrs["jobs"].SetOptional() + attrs["notebooks"] = attrs["notebooks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClientsTypes. @@ -716,7 +741,7 @@ func (o ClientsTypes_SdkV2) Type(ctx context.Context) attr.Type { type CloneCluster_SdkV2 struct { // The cluster that is being cloned. - SourceClusterId types.String `tfsdk:"source_cluster_id" tf:""` + SourceClusterId types.String `tfsdk:"source_cluster_id"` } func (newState *CloneCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloneCluster_SdkV2) { @@ -725,10 +750,10 @@ func (newState *CloneCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CloneCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState CloneCluster_SdkV2) { } -func (c CloneCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "source_cluster_id")...) +func (c CloneCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["source_cluster_id"] = attrs["source_cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloneCluster. @@ -763,7 +788,7 @@ func (o CloneCluster_SdkV2) Type(ctx context.Context) attr.Type { } type CloudProviderNodeInfo_SdkV2 struct { - Status types.List `tfsdk:"status" tf:"optional"` + Status types.List `tfsdk:"status"` } func (newState *CloudProviderNodeInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloudProviderNodeInfo_SdkV2) { @@ -772,9 +797,10 @@ func (newState *CloudProviderNodeInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CloudProviderNodeInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CloudProviderNodeInfo_SdkV2) { } -func (c CloudProviderNodeInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CloudProviderNodeInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloudProviderNodeInfo. @@ -840,13 +866,13 @@ func (o *CloudProviderNodeInfo_SdkV2) SetStatus(ctx context.Context, v []types.S type ClusterAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAccessControlRequest_SdkV2) { @@ -855,9 +881,13 @@ func (newState *ClusterAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *ClusterAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAccessControlRequest_SdkV2) { } -func (c ClusterAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAccessControlRequest. @@ -899,15 +929,15 @@ func (o ClusterAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type { type ClusterAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAccessControlResponse_SdkV2) { @@ -916,10 +946,14 @@ func (newState *ClusterAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ClusterAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAccessControlResponse_SdkV2) { } -func (c ClusterAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ClusterAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAccessControlResponse. @@ -997,23 +1031,23 @@ type ClusterAttributes_SdkV2 struct { // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -1022,7 +1056,7 @@ type ClusterAttributes_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -1052,39 +1086,39 @@ type ClusterAttributes_SdkV2 struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.List `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.List `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -1092,15 +1126,15 @@ type ClusterAttributes_SdkV2 struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -1109,15 +1143,15 @@ type ClusterAttributes_SdkV2 struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1131,23 +1165,23 @@ type ClusterAttributes_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:""` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.List `tfsdk:"workload_type"` } func (newState *ClusterAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAttributes_SdkV2) { @@ -1156,17 +1190,42 @@ func (newState *ClusterAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ClusterAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAttributes_SdkV2) { } -func (c ClusterAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - cs.SetRequired(append(path, "spark_version")...) - WorkloadType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c ClusterAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetRequired() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAttributes. @@ -1574,15 +1633,15 @@ func (o *ClusterAttributes_SdkV2) SetWorkloadType(ctx context.Context, v Workloa type ClusterCompliance_SdkV2 struct { // Canonical unique identifier for a cluster. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // Whether this cluster is in compliance with the latest version of its // policy. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. The values indicate an error message describing the // policy validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *ClusterCompliance_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterCompliance_SdkV2) { @@ -1591,10 +1650,12 @@ func (newState *ClusterCompliance_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ClusterCompliance_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterCompliance_SdkV2) { } -func (c ClusterCompliance_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c ClusterCompliance_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterCompliance. @@ -1666,47 +1727,47 @@ type ClusterDetails_SdkV2 struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // Number of CPU cores available for this cluster. Note that this can be // fractional, e.g. 7.5 cores, since certain node types are configured to // share cores between Spark nodes on the same instance. - ClusterCores types.Float64 `tfsdk:"cluster_cores" tf:"optional"` + ClusterCores types.Float64 `tfsdk:"cluster_cores"` // Canonical identifier for the cluster. This id is retained during cluster // restarts and resizes, while each new cluster has a globally unique id. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Cluster log delivery status. - ClusterLogStatus types.List `tfsdk:"cluster_log_status" tf:"optional,object"` + ClusterLogStatus types.List `tfsdk:"cluster_log_status"` // Total amount of cluster memory, in megabytes - ClusterMemoryMb types.Int64 `tfsdk:"cluster_memory_mb" tf:"optional"` + ClusterMemoryMb types.Int64 `tfsdk:"cluster_memory_mb"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. - ClusterSource types.String `tfsdk:"cluster_source" tf:"optional"` + ClusterSource types.String `tfsdk:"cluster_source"` // Creator user name. The field won't be included in the response if the // user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -1715,7 +1776,7 @@ type ClusterDetails_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -1745,7 +1806,7 @@ type ClusterDetails_SdkV2 struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -1758,48 +1819,48 @@ type ClusterDetails_SdkV2 struct { // - ClusterId: // // - Name: - DefaultTags types.Map `tfsdk:"default_tags" tf:"optional"` + DefaultTags types.Map `tfsdk:"default_tags"` - DockerImage types.List `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.List `tfsdk:"docker_image"` // Node on which the Spark driver resides. The driver node contains the // Spark master and the Databricks application that manages the per-notebook // Spark REPLs. - Driver types.List `tfsdk:"driver" tf:"optional,object"` + Driver types.List `tfsdk:"driver"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Nodes on which the Spark executors reside. - Executors types.List `tfsdk:"executors" tf:"optional"` + Executors types.List `tfsdk:"executors"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // Port on which Spark JDBC server is listening, in the driver nod. No // service will be listeningon on this port in executor nodes. - JdbcPort types.Int64 `tfsdk:"jdbc_port" tf:"optional"` + JdbcPort types.Int64 `tfsdk:"jdbc_port"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -1807,18 +1868,18 @@ type ClusterDetails_SdkV2 struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // the timestamp that the cluster was started/restarted - LastRestartedTime types.Int64 `tfsdk:"last_restarted_time" tf:"optional"` + LastRestartedTime types.Int64 `tfsdk:"last_restarted_time"` // Time when the cluster driver last lost its state (due to a restart or // driver failure). - LastStateLossTime types.Int64 `tfsdk:"last_state_loss_time" tf:"optional"` + LastStateLossTime types.Int64 `tfsdk:"last_state_loss_time"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -1829,9 +1890,9 @@ type ClusterDetails_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -1840,19 +1901,19 @@ type ClusterDetails_SdkV2 struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // A canonical SparkContext identifier. This value *does* change when the // Spark driver restarts. The pair `(cluster_id, spark_context_id)` is a // globally unique identifier over all Spark contexts. - SparkContextId types.Int64 `tfsdk:"spark_context_id" tf:"optional"` + SparkContextId types.Int64 `tfsdk:"spark_context_id"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1866,42 +1927,42 @@ type ClusterDetails_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:"optional"` + SparkVersion types.String `tfsdk:"spark_version"` // `spec` contains a snapshot of the field values that were used to create // or edit this cluster. The contents of `spec` can be used in the body of a // create cluster request. This field might not be populated for older // clusters. Note: not included in the response of the ListClusters API. - Spec types.List `tfsdk:"spec" tf:"optional,object"` + Spec types.List `tfsdk:"spec"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // Time (in epoch milliseconds) when the cluster creation request was // received (when the cluster entered a `PENDING` state). - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Current state of the cluster. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // A message associated with the most recent state transition (e.g., the // reason why the cluster entered a `TERMINATED` state). - StateMessage types.String `tfsdk:"state_message" tf:"optional"` + StateMessage types.String `tfsdk:"state_message"` // Time (in epoch milliseconds) when the cluster was terminated, if // applicable. - TerminatedTime types.Int64 `tfsdk:"terminated_time" tf:"optional"` + TerminatedTime types.Int64 `tfsdk:"terminated_time"` // Information about why the cluster was terminated. This field only appears // when the cluster is in a `TERMINATING` or `TERMINATED` state. - TerminationReason types.List `tfsdk:"termination_reason" tf:"optional,object"` + TerminationReason types.List `tfsdk:"termination_reason"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.List `tfsdk:"workload_type"` } func (newState *ClusterDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterDetails_SdkV2) { @@ -1910,22 +1971,68 @@ func (newState *ClusterDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ClusterDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterDetails_SdkV2) { } -func (c ClusterDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - LogSyncStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_status")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - SparkNode_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "driver")...) - SparkNode_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "executors")...) - GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spec")...) - TerminationReason_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "termination_reason")...) - WorkloadType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c ClusterDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_cores"] = attrs["cluster_cores"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_log_status"] = attrs["cluster_log_status"].SetOptional() + attrs["cluster_log_status"] = attrs["cluster_log_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_memory_mb"] = attrs["cluster_memory_mb"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["cluster_source"] = attrs["cluster_source"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["default_tags"] = attrs["default_tags"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver"] = attrs["driver"].SetOptional() + attrs["driver"] = attrs["driver"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["executors"] = attrs["executors"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["jdbc_port"] = attrs["jdbc_port"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["last_restarted_time"] = attrs["last_restarted_time"].SetOptional() + attrs["last_state_loss_time"] = attrs["last_state_loss_time"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_context_id"] = attrs["spark_context_id"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetOptional() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["spec"] = attrs["spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state_message"] = attrs["state_message"].SetOptional() + attrs["terminated_time"] = attrs["terminated_time"].SetOptional() + attrs["termination_reason"] = attrs["termination_reason"].SetOptional() + attrs["termination_reason"] = attrs["termination_reason"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterDetails. @@ -2578,17 +2685,17 @@ func (o *ClusterDetails_SdkV2) SetWorkloadType(ctx context.Context, v WorkloadTy type ClusterEvent_SdkV2 struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // - DataPlaneEventDetails types.List `tfsdk:"data_plane_event_details" tf:"optional,object"` + DataPlaneEventDetails types.List `tfsdk:"data_plane_event_details"` // - Details types.List `tfsdk:"details" tf:"optional,object"` + Details types.List `tfsdk:"details"` // The timestamp when the event occurred, stored as the number of // milliseconds since the Unix epoch. If not provided, this will be assigned // by the Timeline service. - Timestamp types.Int64 `tfsdk:"timestamp" tf:"optional"` + Timestamp types.Int64 `tfsdk:"timestamp"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *ClusterEvent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterEvent_SdkV2) { @@ -2597,12 +2704,16 @@ func (newState *ClusterEvent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterEvent_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterEvent_SdkV2) { } -func (c ClusterEvent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - DataPlaneEventDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_plane_event_details")...) - EventDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "details")...) +func (c ClusterEvent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["data_plane_event_details"] = attrs["data_plane_event_details"].SetOptional() + attrs["data_plane_event_details"] = attrs["data_plane_event_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["details"] = attrs["details"].SetOptional() + attrs["details"] = attrs["details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["timestamp"] = attrs["timestamp"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterEvent. @@ -2705,9 +2816,9 @@ func (o *ClusterEvent_SdkV2) SetDetails(ctx context.Context, v EventDetails_SdkV type ClusterLibraryStatuses_SdkV2 struct { // Unique identifier for the cluster. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // Status of all libraries on the cluster. - LibraryStatuses types.List `tfsdk:"library_statuses" tf:"optional"` + LibraryStatuses types.List `tfsdk:"library_statuses"` } func (newState *ClusterLibraryStatuses_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterLibraryStatuses_SdkV2) { @@ -2716,10 +2827,11 @@ func (newState *ClusterLibraryStatuses_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ClusterLibraryStatuses_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterLibraryStatuses_SdkV2) { } -func (c ClusterLibraryStatuses_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LibraryFullStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "library_statuses")...) +func (c ClusterLibraryStatuses_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["library_statuses"] = attrs["library_statuses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterLibraryStatuses. @@ -2788,13 +2900,13 @@ func (o *ClusterLibraryStatuses_SdkV2) SetLibraryStatuses(ctx context.Context, v type ClusterLogConf_SdkV2 struct { // destination needs to be provided. e.g. `{ "dbfs" : { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs types.List `tfsdk:"dbfs" tf:"optional,object"` + Dbfs types.List `tfsdk:"dbfs"` // destination and either the region or endpoint need to be provided. e.g. // `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : // "us-west-2" } }` Cluster iam role is used to access s3, please make sure // the cluster iam role in `instance_profile_arn` has permission to write // data to the s3 destination. - S3 types.List `tfsdk:"s3" tf:"optional,object"` + S3 types.List `tfsdk:"s3"` } func (newState *ClusterLogConf_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterLogConf_SdkV2) { @@ -2803,11 +2915,13 @@ func (newState *ClusterLogConf_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ClusterLogConf_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterLogConf_SdkV2) { } -func (c ClusterLogConf_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DbfsStorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbfs")...) - S3StorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "s3")...) +func (c ClusterLogConf_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbfs"] = attrs["dbfs"].SetOptional() + attrs["dbfs"] = attrs["dbfs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["s3"] = attrs["s3"].SetOptional() + attrs["s3"] = attrs["s3"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterLogConf. @@ -2903,11 +3017,11 @@ func (o *ClusterLogConf_SdkV2) SetS3(ctx context.Context, v S3StorageInfo_SdkV2) } type ClusterPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPermission_SdkV2) { @@ -2916,9 +3030,12 @@ func (newState *ClusterPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ClusterPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPermission_SdkV2) { } -func (c ClusterPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermission. @@ -2987,11 +3104,11 @@ func (o *ClusterPermission_SdkV2) SetInheritedFromObject(ctx context.Context, v } type ClusterPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ClusterPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPermissions_SdkV2) { @@ -3000,10 +3117,12 @@ func (newState *ClusterPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ClusterPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPermissions_SdkV2) { } -func (c ClusterPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ClusterPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermissions. @@ -3072,9 +3191,9 @@ func (o *ClusterPermissions_SdkV2) SetAccessControlList(ctx context.Context, v [ } type ClusterPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPermissionsDescription_SdkV2) { @@ -3083,9 +3202,11 @@ func (newState *ClusterPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCr func (newState *ClusterPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPermissionsDescription_SdkV2) { } -func (c ClusterPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermissionsDescription. @@ -3122,7 +3243,7 @@ func (o ClusterPermissionsDescription_SdkV2) Type(ctx context.Context) attr.Type } type ClusterPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The cluster for which to get or manage permissions. ClusterId types.String `tfsdk:"-"` } @@ -3133,11 +3254,11 @@ func (newState *ClusterPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ClusterPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPermissionsRequest_SdkV2) { } -func (c ClusterPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "cluster_id")...) +func (c ClusterPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermissionsRequest. @@ -3205,13 +3326,13 @@ func (o *ClusterPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Conte type ClusterPolicyAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterPolicyAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyAccessControlRequest_SdkV2) { @@ -3220,9 +3341,13 @@ func (newState *ClusterPolicyAccessControlRequest_SdkV2) SyncEffectiveFieldsDuri func (newState *ClusterPolicyAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyAccessControlRequest_SdkV2) { } -func (c ClusterPolicyAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPolicyAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyAccessControlRequest. @@ -3264,15 +3389,15 @@ func (o ClusterPolicyAccessControlRequest_SdkV2) Type(ctx context.Context) attr. type ClusterPolicyAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterPolicyAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyAccessControlResponse_SdkV2) { @@ -3281,10 +3406,14 @@ func (newState *ClusterPolicyAccessControlResponse_SdkV2) SyncEffectiveFieldsDur func (newState *ClusterPolicyAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyAccessControlResponse_SdkV2) { } -func (c ClusterPolicyAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ClusterPolicyAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyAccessControlResponse. @@ -3357,11 +3486,11 @@ func (o *ClusterPolicyAccessControlResponse_SdkV2) SetAllPermissions(ctx context } type ClusterPolicyPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPolicyPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyPermission_SdkV2) { @@ -3370,9 +3499,12 @@ func (newState *ClusterPolicyPermission_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ClusterPolicyPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermission_SdkV2) { } -func (c ClusterPolicyPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPolicyPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermission. @@ -3441,11 +3573,11 @@ func (o *ClusterPolicyPermission_SdkV2) SetInheritedFromObject(ctx context.Conte } type ClusterPolicyPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ClusterPolicyPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyPermissions_SdkV2) { @@ -3454,10 +3586,12 @@ func (newState *ClusterPolicyPermissions_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ClusterPolicyPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermissions_SdkV2) { } -func (c ClusterPolicyPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ClusterPolicyPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermissions. @@ -3526,9 +3660,9 @@ func (o *ClusterPolicyPermissions_SdkV2) SetAccessControlList(ctx context.Contex } type ClusterPolicyPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPolicyPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyPermissionsDescription_SdkV2) { @@ -3537,9 +3671,11 @@ func (newState *ClusterPolicyPermissionsDescription_SdkV2) SyncEffectiveFieldsDu func (newState *ClusterPolicyPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermissionsDescription_SdkV2) { } -func (c ClusterPolicyPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPolicyPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermissionsDescription. @@ -3576,7 +3712,7 @@ func (o ClusterPolicyPermissionsDescription_SdkV2) Type(ctx context.Context) att } type ClusterPolicyPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The cluster policy for which to get or manage permissions. ClusterPolicyId types.String `tfsdk:"-"` } @@ -3587,11 +3723,11 @@ func (newState *ClusterPolicyPermissionsRequest_SdkV2) SyncEffectiveFieldsDuring func (newState *ClusterPolicyPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermissionsRequest_SdkV2) { } -func (c ClusterPolicyPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "cluster_policy_id")...) +func (c ClusterPolicyPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["cluster_policy_id"] = attrs["cluster_policy_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermissionsRequest. @@ -3661,17 +3797,17 @@ func (o *ClusterPolicyPermissionsRequest_SdkV2) SetAccessControlList(ctx context // become compliant with its policy. type ClusterSettingsChange_SdkV2 struct { // The field where this change would be made. - Field types.String `tfsdk:"field" tf:"optional"` + Field types.String `tfsdk:"field"` // The new value of this field after enforcing policy compliance (either a // number, a boolean, or a string) converted to a string. This is intended // to be read by a human. The typed new value of this field can be retrieved // by reading the settings field in the API response. - NewValue types.String `tfsdk:"new_value" tf:"optional"` + NewValue types.String `tfsdk:"new_value"` // The previous value of this field before enforcing policy compliance // (either a number, a boolean, or a string) converted to a string. This is // intended to be read by a human. The type of the field can be retrieved by // reading the settings field in the API response. - PreviousValue types.String `tfsdk:"previous_value" tf:"optional"` + PreviousValue types.String `tfsdk:"previous_value"` } func (newState *ClusterSettingsChange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSettingsChange_SdkV2) { @@ -3680,9 +3816,12 @@ func (newState *ClusterSettingsChange_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ClusterSettingsChange_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterSettingsChange_SdkV2) { } -func (c ClusterSettingsChange_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterSettingsChange_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["field"] = attrs["field"].SetOptional() + attrs["new_value"] = attrs["new_value"].SetOptional() + attrs["previous_value"] = attrs["previous_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSettingsChange. @@ -3724,7 +3863,7 @@ type ClusterSize_SdkV2 struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -3735,7 +3874,7 @@ type ClusterSize_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` } func (newState *ClusterSize_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSize_SdkV2) { @@ -3744,10 +3883,12 @@ func (newState *ClusterSize_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterSize_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterSize_SdkV2) { } -func (c ClusterSize_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) +func (c ClusterSize_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["num_workers"] = attrs["num_workers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSize. @@ -3817,33 +3958,33 @@ type ClusterSpec_SdkV2 struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -3852,7 +3993,7 @@ type ClusterSpec_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -3882,39 +4023,39 @@ type ClusterSpec_SdkV2 struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.List `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.List `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -3922,13 +4063,13 @@ type ClusterSpec_SdkV2 struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -3939,9 +4080,9 @@ type ClusterSpec_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -3950,15 +4091,15 @@ type ClusterSpec_SdkV2 struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -3972,23 +4113,23 @@ type ClusterSpec_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:"optional"` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.List `tfsdk:"workload_type"` } func (newState *ClusterSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSpec_SdkV2) { @@ -3997,17 +4138,46 @@ func (newState *ClusterSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterSpec_SdkV2) { } -func (c ClusterSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - WorkloadType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c ClusterSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSpec. @@ -4487,13 +4657,13 @@ func (o ClusterStatus_SdkV2) Type(ctx context.Context) attr.Type { type Command_SdkV2 struct { // Running cluster id - ClusterId types.String `tfsdk:"clusterId" tf:"optional"` + ClusterId types.String `tfsdk:"clusterId"` // Executable code - Command types.String `tfsdk:"command" tf:"optional"` + Command types.String `tfsdk:"command"` // Running context id - ContextId types.String `tfsdk:"contextId" tf:"optional"` + ContextId types.String `tfsdk:"contextId"` - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` } func (newState *Command_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Command_SdkV2) { @@ -4502,9 +4672,13 @@ func (newState *Command_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Comm func (newState *Command_SdkV2) SyncEffectiveFieldsDuringRead(existingState Command_SdkV2) { } -func (c Command_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Command_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetOptional() + attrs["command"] = attrs["command"].SetOptional() + attrs["contextId"] = attrs["contextId"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Command. @@ -4589,11 +4763,11 @@ func (o CommandStatusRequest_SdkV2) Type(ctx context.Context) attr.Type { } type CommandStatusResponse_SdkV2 struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Results types.List `tfsdk:"results" tf:"optional,object"` + Results types.List `tfsdk:"results"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *CommandStatusResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CommandStatusResponse_SdkV2) { @@ -4602,10 +4776,13 @@ func (newState *CommandStatusResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CommandStatusResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CommandStatusResponse_SdkV2) { } -func (c CommandStatusResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Results_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c CommandStatusResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() + attrs["results"] = attrs["results"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CommandStatusResponse. @@ -4714,9 +4891,9 @@ func (o ContextStatusRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ContextStatusResponse_SdkV2 struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *ContextStatusResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ContextStatusResponse_SdkV2) { @@ -4725,9 +4902,11 @@ func (newState *ContextStatusResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ContextStatusResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ContextStatusResponse_SdkV2) { } -func (c ContextStatusResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ContextStatusResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ContextStatusResponse. @@ -4767,36 +4946,36 @@ type CreateCluster_SdkV2 struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // When specified, this clones libraries from a source cluster during the // creation of a new cluster. - CloneFrom types.List `tfsdk:"clone_from" tf:"optional,object"` + CloneFrom types.List `tfsdk:"clone_from"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -4805,7 +4984,7 @@ type CreateCluster_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -4835,39 +5014,39 @@ type CreateCluster_SdkV2 struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.List `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.List `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -4875,13 +5054,13 @@ type CreateCluster_SdkV2 struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -4892,9 +5071,9 @@ type CreateCluster_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -4903,15 +5082,15 @@ type CreateCluster_SdkV2 struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -4925,23 +5104,23 @@ type CreateCluster_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:""` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.List `tfsdk:"workload_type"` } func (newState *CreateCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCluster_SdkV2) { @@ -4950,19 +5129,48 @@ func (newState *CreateCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCluster_SdkV2) { } -func (c CreateCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - CloneCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clone_from")...) - ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - cs.SetRequired(append(path, "spark_version")...) - WorkloadType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c CreateCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["clone_from"] = attrs["clone_from"].SetOptional() + attrs["clone_from"] = attrs["clone_from"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetRequired() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCluster. @@ -5435,7 +5643,7 @@ func (o *CreateCluster_SdkV2) SetWorkloadType(ctx context.Context, v WorkloadTyp } type CreateClusterResponse_SdkV2 struct { - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *CreateClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateClusterResponse_SdkV2) { @@ -5444,9 +5652,10 @@ func (newState *CreateClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateClusterResponse_SdkV2) { } -func (c CreateClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateClusterResponse. @@ -5482,9 +5691,9 @@ func (o CreateClusterResponse_SdkV2) Type(ctx context.Context) attr.Type { type CreateContext_SdkV2 struct { // Running cluster id - ClusterId types.String `tfsdk:"clusterId" tf:"optional"` + ClusterId types.String `tfsdk:"clusterId"` - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` } func (newState *CreateContext_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateContext_SdkV2) { @@ -5493,9 +5702,11 @@ func (newState *CreateContext_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateContext_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateContext_SdkV2) { } -func (c CreateContext_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateContext_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateContext. @@ -5534,28 +5745,28 @@ func (o CreateContext_SdkV2) Type(ctx context.Context) attr.Type { type CreateInstancePool_SdkV2 struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec types.List `tfsdk:"disk_spec" tf:"optional,object"` + DiskSpec types.List `tfsdk:"disk_spec"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -5563,29 +5774,29 @@ type CreateInstancePool_SdkV2 struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:""` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:""` + NodeTypeId types.String `tfsdk:"node_type_id"` // Custom Docker Image BYOC - PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images" tf:"optional"` + PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images"` // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions" tf:"optional"` + PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions"` } func (newState *CreateInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateInstancePool_SdkV2) { @@ -5594,16 +5805,26 @@ func (newState *CreateInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateInstancePool_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateInstancePool_SdkV2) { } -func (c CreateInstancePool_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - InstancePoolAzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - DiskSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disk_spec")...) - InstancePoolGcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - cs.SetRequired(append(path, "instance_pool_name")...) - cs.SetRequired(append(path, "node_type_id")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "preloaded_docker_images")...) - - return cs +func (c CreateInstancePool_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetRequired() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetRequired() + attrs["preloaded_docker_images"] = attrs["preloaded_docker_images"].SetOptional() + attrs["preloaded_spark_versions"] = attrs["preloaded_spark_versions"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateInstancePool. @@ -5867,7 +6088,7 @@ func (o *CreateInstancePool_SdkV2) SetPreloadedSparkVersions(ctx context.Context type CreateInstancePoolResponse_SdkV2 struct { // The ID of the created instance pool. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` } func (newState *CreateInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateInstancePoolResponse_SdkV2) { @@ -5876,9 +6097,10 @@ func (newState *CreateInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CreateInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateInstancePoolResponse_SdkV2) { } -func (c CreateInstancePoolResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateInstancePoolResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateInstancePoolResponse. @@ -5917,18 +6139,18 @@ type CreatePolicy_SdkV2 struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Additional human-readable description of the cluster policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user" tf:"optional"` + MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user"` // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -5938,14 +6160,14 @@ type CreatePolicy_SdkV2 struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides" tf:"optional"` + PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides"` // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` } func (newState *CreatePolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePolicy_SdkV2) { @@ -5954,10 +6176,16 @@ func (newState *CreatePolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreatePolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePolicy_SdkV2) { } -func (c CreatePolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c CreatePolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["max_clusters_per_user"] = attrs["max_clusters_per_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_definition_overrides"] = attrs["policy_family_definition_overrides"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePolicy. @@ -6035,7 +6263,7 @@ func (o *CreatePolicy_SdkV2) SetLibraries(ctx context.Context, v []Library_SdkV2 type CreatePolicyResponse_SdkV2 struct { // Canonical unique identifier for the cluster policy. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *CreatePolicyResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePolicyResponse_SdkV2) { @@ -6044,9 +6272,10 @@ func (newState *CreatePolicyResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreatePolicyResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePolicyResponse_SdkV2) { } -func (c CreatePolicyResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreatePolicyResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["policy_id"] = attrs["policy_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePolicyResponse. @@ -6082,7 +6311,7 @@ func (o CreatePolicyResponse_SdkV2) Type(ctx context.Context) attr.Type { type CreateResponse_SdkV2 struct { // The global init script ID. - ScriptId types.String `tfsdk:"script_id" tf:"optional"` + ScriptId types.String `tfsdk:"script_id"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateResponse. @@ -6117,7 +6346,7 @@ func (o CreateResponse_SdkV2) Type(ctx context.Context) attr.Type { } type Created_SdkV2 struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *Created_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Created_SdkV2) { @@ -6126,9 +6355,10 @@ func (newState *Created_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Crea func (newState *Created_SdkV2) SyncEffectiveFieldsDuringRead(existingState Created_SdkV2) { } -func (c Created_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Created_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Created. @@ -6164,13 +6394,13 @@ func (o Created_SdkV2) Type(ctx context.Context) attr.Type { type DataPlaneEventDetails_SdkV2 struct { // - EventType types.String `tfsdk:"event_type" tf:"optional"` + EventType types.String `tfsdk:"event_type"` // - ExecutorFailures types.Int64 `tfsdk:"executor_failures" tf:"optional"` + ExecutorFailures types.Int64 `tfsdk:"executor_failures"` // - HostId types.String `tfsdk:"host_id" tf:"optional"` + HostId types.String `tfsdk:"host_id"` // - Timestamp types.Int64 `tfsdk:"timestamp" tf:"optional"` + Timestamp types.Int64 `tfsdk:"timestamp"` } func (newState *DataPlaneEventDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneEventDetails_SdkV2) { @@ -6179,9 +6409,13 @@ func (newState *DataPlaneEventDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *DataPlaneEventDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataPlaneEventDetails_SdkV2) { } -func (c DataPlaneEventDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataPlaneEventDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["event_type"] = attrs["event_type"].SetOptional() + attrs["executor_failures"] = attrs["executor_failures"].SetOptional() + attrs["host_id"] = attrs["host_id"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneEventDetails. @@ -6223,7 +6457,7 @@ func (o DataPlaneEventDetails_SdkV2) Type(ctx context.Context) attr.Type { type DbfsStorageInfo_SdkV2 struct { // dbfs destination, e.g. `dbfs:/my/path` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *DbfsStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbfsStorageInfo_SdkV2) { @@ -6232,10 +6466,10 @@ func (newState *DbfsStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DbfsStorageInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState DbfsStorageInfo_SdkV2) { } -func (c DbfsStorageInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c DbfsStorageInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DbfsStorageInfo. @@ -6271,7 +6505,7 @@ func (o DbfsStorageInfo_SdkV2) Type(ctx context.Context) attr.Type { type DeleteCluster_SdkV2 struct { // The cluster to be terminated. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *DeleteCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteCluster_SdkV2) { @@ -6280,10 +6514,10 @@ func (newState *DeleteCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *DeleteCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteCluster_SdkV2) { } -func (c DeleteCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c DeleteCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCluster. @@ -6326,9 +6560,9 @@ func (newState *DeleteClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *DeleteClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteClusterResponse_SdkV2) { } -func (c DeleteClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteClusterResponse. @@ -6397,7 +6631,7 @@ func (o DeleteGlobalInitScriptRequest_SdkV2) Type(ctx context.Context) attr.Type type DeleteInstancePool_SdkV2 struct { // The instance pool to be terminated. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:""` + InstancePoolId types.String `tfsdk:"instance_pool_id"` } func (newState *DeleteInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteInstancePool_SdkV2) { @@ -6406,10 +6640,10 @@ func (newState *DeleteInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *DeleteInstancePool_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteInstancePool_SdkV2) { } -func (c DeleteInstancePool_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_pool_id")...) +func (c DeleteInstancePool_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteInstancePool. @@ -6452,9 +6686,9 @@ func (newState *DeleteInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *DeleteInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteInstancePoolResponse_SdkV2) { } -func (c DeleteInstancePoolResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteInstancePoolResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteInstancePoolResponse. @@ -6486,7 +6720,7 @@ func (o DeleteInstancePoolResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeletePolicy_SdkV2 struct { // The ID of the policy to delete. - PolicyId types.String `tfsdk:"policy_id" tf:""` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *DeletePolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeletePolicy_SdkV2) { @@ -6495,10 +6729,10 @@ func (newState *DeletePolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeletePolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeletePolicy_SdkV2) { } -func (c DeletePolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "policy_id")...) +func (c DeletePolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["policy_id"] = attrs["policy_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePolicy. @@ -6541,9 +6775,9 @@ func (newState *DeletePolicyResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *DeletePolicyResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeletePolicyResponse_SdkV2) { } -func (c DeletePolicyResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeletePolicyResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePolicyResponse. @@ -6604,9 +6838,9 @@ func (o DeleteResponse_SdkV2) Type(ctx context.Context) attr.Type { } type DestroyContext_SdkV2 struct { - ClusterId types.String `tfsdk:"clusterId" tf:""` + ClusterId types.String `tfsdk:"clusterId"` - ContextId types.String `tfsdk:"contextId" tf:""` + ContextId types.String `tfsdk:"contextId"` } func (newState *DestroyContext_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DestroyContext_SdkV2) { @@ -6615,11 +6849,11 @@ func (newState *DestroyContext_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DestroyContext_SdkV2) SyncEffectiveFieldsDuringRead(existingState DestroyContext_SdkV2) { } -func (c DestroyContext_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "clusterId")...) - cs.SetRequired(append(path, "contextId")...) +func (c DestroyContext_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetRequired() + attrs["contextId"] = attrs["contextId"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DestroyContext. @@ -6702,9 +6936,9 @@ type DiskSpec_SdkV2 struct { // // Disks will be mounted at: - For AWS: `/ebs0`, `/ebs1`, and etc. - For // Azure: `/remote_volume0`, `/remote_volume1`, and etc. - DiskCount types.Int64 `tfsdk:"disk_count" tf:"optional"` + DiskCount types.Int64 `tfsdk:"disk_count"` - DiskIops types.Int64 `tfsdk:"disk_iops" tf:"optional"` + DiskIops types.Int64 `tfsdk:"disk_iops"` // The size of each disk (in GiB) launched for each instance. Values must // fall into the supported range for a particular instance type. // @@ -6713,11 +6947,11 @@ type DiskSpec_SdkV2 struct { // // For Azure: - Premium LRS (SSD): 1 - 1023 GiB - Standard LRS (HDD): 1- // 1023 GiB - DiskSize types.Int64 `tfsdk:"disk_size" tf:"optional"` + DiskSize types.Int64 `tfsdk:"disk_size"` - DiskThroughput types.Int64 `tfsdk:"disk_throughput" tf:"optional"` + DiskThroughput types.Int64 `tfsdk:"disk_throughput"` // The type of disks that will be launched with this cluster. - DiskType types.List `tfsdk:"disk_type" tf:"optional,object"` + DiskType types.List `tfsdk:"disk_type"` } func (newState *DiskSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DiskSpec_SdkV2) { @@ -6726,10 +6960,15 @@ func (newState *DiskSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dis func (newState *DiskSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState DiskSpec_SdkV2) { } -func (c DiskSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DiskType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disk_type")...) +func (c DiskSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disk_count"] = attrs["disk_count"].SetOptional() + attrs["disk_iops"] = attrs["disk_iops"].SetOptional() + attrs["disk_size"] = attrs["disk_size"].SetOptional() + attrs["disk_throughput"] = attrs["disk_throughput"].SetOptional() + attrs["disk_type"] = attrs["disk_type"].SetOptional() + attrs["disk_type"] = attrs["disk_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DiskSpec. @@ -6802,9 +7041,9 @@ func (o *DiskSpec_SdkV2) SetDiskType(ctx context.Context, v DiskType_SdkV2) { } type DiskType_SdkV2 struct { - AzureDiskVolumeType types.String `tfsdk:"azure_disk_volume_type" tf:"optional"` + AzureDiskVolumeType types.String `tfsdk:"azure_disk_volume_type"` - EbsVolumeType types.String `tfsdk:"ebs_volume_type" tf:"optional"` + EbsVolumeType types.String `tfsdk:"ebs_volume_type"` } func (newState *DiskType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DiskType_SdkV2) { @@ -6813,9 +7052,11 @@ func (newState *DiskType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dis func (newState *DiskType_SdkV2) SyncEffectiveFieldsDuringRead(existingState DiskType_SdkV2) { } -func (c DiskType_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DiskType_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["azure_disk_volume_type"] = attrs["azure_disk_volume_type"].SetOptional() + attrs["ebs_volume_type"] = attrs["ebs_volume_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DiskType. @@ -6853,9 +7094,9 @@ func (o DiskType_SdkV2) Type(ctx context.Context) attr.Type { type DockerBasicAuth_SdkV2 struct { // Password of the user - Password types.String `tfsdk:"password" tf:"optional"` + Password types.String `tfsdk:"password"` // Name of the user - Username types.String `tfsdk:"username" tf:"optional"` + Username types.String `tfsdk:"username"` } func (newState *DockerBasicAuth_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DockerBasicAuth_SdkV2) { @@ -6864,9 +7105,11 @@ func (newState *DockerBasicAuth_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DockerBasicAuth_SdkV2) SyncEffectiveFieldsDuringRead(existingState DockerBasicAuth_SdkV2) { } -func (c DockerBasicAuth_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DockerBasicAuth_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["password"] = attrs["password"].SetOptional() + attrs["username"] = attrs["username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DockerBasicAuth. @@ -6903,9 +7146,9 @@ func (o DockerBasicAuth_SdkV2) Type(ctx context.Context) attr.Type { } type DockerImage_SdkV2 struct { - BasicAuth types.List `tfsdk:"basic_auth" tf:"optional,object"` + BasicAuth types.List `tfsdk:"basic_auth"` // URL of the docker image. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *DockerImage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DockerImage_SdkV2) { @@ -6914,10 +7157,12 @@ func (newState *DockerImage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DockerImage_SdkV2) SyncEffectiveFieldsDuringRead(existingState DockerImage_SdkV2) { } -func (c DockerImage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DockerBasicAuth_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "basic_auth")...) +func (c DockerImage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["basic_auth"] = attrs["basic_auth"].SetOptional() + attrs["basic_auth"] = attrs["basic_auth"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DockerImage. @@ -6987,35 +7232,35 @@ type EditCluster_SdkV2 struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // ID of the cluster - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -7024,7 +7269,7 @@ type EditCluster_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -7054,39 +7299,39 @@ type EditCluster_SdkV2 struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.List `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.List `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -7094,13 +7339,13 @@ type EditCluster_SdkV2 struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -7111,9 +7356,9 @@ type EditCluster_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -7122,15 +7367,15 @@ type EditCluster_SdkV2 struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -7144,23 +7389,23 @@ type EditCluster_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:""` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.List `tfsdk:"workload_type"` } func (newState *EditCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditCluster_SdkV2) { @@ -7169,19 +7414,47 @@ func (newState *EditCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EditCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditCluster_SdkV2) { } -func (c EditCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - cs.SetRequired(append(path, "cluster_id")...) - ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - cs.SetRequired(append(path, "spark_version")...) - WorkloadType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c EditCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetRequired() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditCluster. @@ -7633,9 +7906,9 @@ func (newState *EditClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *EditClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditClusterResponse_SdkV2) { } -func (c EditClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditClusterResponse. @@ -7671,7 +7944,7 @@ type EditInstancePool_SdkV2 struct { // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -7679,24 +7952,24 @@ type EditInstancePool_SdkV2 struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Instance pool ID - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:""` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:""` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:""` + NodeTypeId types.String `tfsdk:"node_type_id"` } func (newState *EditInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditInstancePool_SdkV2) { @@ -7705,12 +7978,16 @@ func (newState *EditInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *EditInstancePool_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditInstancePool_SdkV2) { } -func (c EditInstancePool_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_pool_id")...) - cs.SetRequired(append(path, "instance_pool_name")...) - cs.SetRequired(append(path, "node_type_id")...) +func (c EditInstancePool_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetRequired() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditInstancePool. @@ -7795,9 +8072,9 @@ func (newState *EditInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *EditInstancePoolResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditInstancePoolResponse_SdkV2) { } -func (c EditInstancePoolResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditInstancePoolResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditInstancePoolResponse. @@ -7832,18 +8109,18 @@ type EditPolicy_SdkV2 struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Additional human-readable description of the cluster policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user" tf:"optional"` + MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user"` // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -7853,16 +8130,16 @@ type EditPolicy_SdkV2 struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides" tf:"optional"` + PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides"` // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` // The ID of the policy to update. - PolicyId types.String `tfsdk:"policy_id" tf:""` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *EditPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditPolicy_SdkV2) { @@ -7871,11 +8148,17 @@ func (newState *EditPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan E func (newState *EditPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditPolicy_SdkV2) { } -func (c EditPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - cs.SetRequired(append(path, "policy_id")...) +func (c EditPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["max_clusters_per_user"] = attrs["max_clusters_per_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_definition_overrides"] = attrs["policy_family_definition_overrides"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPolicy. @@ -7962,9 +8245,9 @@ func (newState *EditPolicyResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *EditPolicyResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditPolicyResponse_SdkV2) { } -func (c EditPolicyResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditPolicyResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPolicyResponse. @@ -8026,10 +8309,10 @@ func (o EditResponse_SdkV2) Type(ctx context.Context) attr.Type { type EnforceClusterComplianceRequest_SdkV2 struct { // The ID of the cluster you want to enforce policy compliance on. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // If set, previews the changes that would be made to a cluster to enforce // compliance but does not update the cluster. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *EnforceClusterComplianceRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforceClusterComplianceRequest_SdkV2) { @@ -8038,10 +8321,11 @@ func (newState *EnforceClusterComplianceRequest_SdkV2) SyncEffectiveFieldsDuring func (newState *EnforceClusterComplianceRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnforceClusterComplianceRequest_SdkV2) { } -func (c EnforceClusterComplianceRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c EnforceClusterComplianceRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforceClusterComplianceRequest. @@ -8080,10 +8364,10 @@ func (o EnforceClusterComplianceRequest_SdkV2) Type(ctx context.Context) attr.Ty type EnforceClusterComplianceResponse_SdkV2 struct { // A list of changes that have been made to the cluster settings for the // cluster to become compliant with its policy. - Changes types.List `tfsdk:"changes" tf:"optional"` + Changes types.List `tfsdk:"changes"` // Whether any changes have been made to the cluster settings for the // cluster to become compliant with its policy. - HasChanges types.Bool `tfsdk:"has_changes" tf:"optional"` + HasChanges types.Bool `tfsdk:"has_changes"` } func (newState *EnforceClusterComplianceResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforceClusterComplianceResponse_SdkV2) { @@ -8092,10 +8376,11 @@ func (newState *EnforceClusterComplianceResponse_SdkV2) SyncEffectiveFieldsDurin func (newState *EnforceClusterComplianceResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnforceClusterComplianceResponse_SdkV2) { } -func (c EnforceClusterComplianceResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterSettingsChange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "changes")...) +func (c EnforceClusterComplianceResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["changes"] = attrs["changes"].SetOptional() + attrs["has_changes"] = attrs["has_changes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforceClusterComplianceResponse. @@ -8169,14 +8454,14 @@ type Environment_SdkV2 struct { // environment of the runtime. Each client comes with a specific set of // pre-installed libraries. The version is a string, consisting of the major // client version. - Client types.String `tfsdk:"client" tf:""` + Client types.String `tfsdk:"client"` // List of pip dependencies, as supported by the version of pip in this // environment. Each dependency is a pip requirement file line // https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed // dependency could be , , (WSFS or Volumes in Databricks), E.g. // dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"] - Dependencies types.List `tfsdk:"dependencies" tf:"optional"` + Dependencies types.List `tfsdk:"dependencies"` } func (newState *Environment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Environment_SdkV2) { @@ -8185,10 +8470,11 @@ func (newState *Environment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *Environment_SdkV2) SyncEffectiveFieldsDuringRead(existingState Environment_SdkV2) { } -func (c Environment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "client")...) +func (c Environment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["client"] = attrs["client"].SetRequired() + attrs["dependencies"] = attrs["dependencies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Environment. @@ -8257,52 +8543,52 @@ func (o *Environment_SdkV2) SetDependencies(ctx context.Context, v []types.Strin type EventDetails_SdkV2 struct { // * For created clusters, the attributes of the cluster. * For edited // clusters, the new attributes of the cluster. - Attributes types.List `tfsdk:"attributes" tf:"optional,object"` + Attributes types.List `tfsdk:"attributes"` // The cause of a change in target size. - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // The actual cluster size that was set in the cluster creation or edit. - ClusterSize types.List `tfsdk:"cluster_size" tf:"optional,object"` + ClusterSize types.List `tfsdk:"cluster_size"` // The current number of vCPUs in the cluster. - CurrentNumVcpus types.Int64 `tfsdk:"current_num_vcpus" tf:"optional"` + CurrentNumVcpus types.Int64 `tfsdk:"current_num_vcpus"` // The current number of nodes in the cluster. - CurrentNumWorkers types.Int64 `tfsdk:"current_num_workers" tf:"optional"` + CurrentNumWorkers types.Int64 `tfsdk:"current_num_workers"` // - DidNotExpandReason types.String `tfsdk:"did_not_expand_reason" tf:"optional"` + DidNotExpandReason types.String `tfsdk:"did_not_expand_reason"` // Current disk size in bytes - DiskSize types.Int64 `tfsdk:"disk_size" tf:"optional"` + DiskSize types.Int64 `tfsdk:"disk_size"` // More details about the change in driver's state - DriverStateMessage types.String `tfsdk:"driver_state_message" tf:"optional"` + DriverStateMessage types.String `tfsdk:"driver_state_message"` // Whether or not a blocklisted node should be terminated. For // ClusterEventType NODE_BLACKLISTED. - EnableTerminationForNodeBlocklisted types.Bool `tfsdk:"enable_termination_for_node_blocklisted" tf:"optional"` + EnableTerminationForNodeBlocklisted types.Bool `tfsdk:"enable_termination_for_node_blocklisted"` // - FreeSpace types.Int64 `tfsdk:"free_space" tf:"optional"` + FreeSpace types.Int64 `tfsdk:"free_space"` // List of global and cluster init scripts associated with this cluster // event. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional,object"` + InitScripts types.List `tfsdk:"init_scripts"` // Instance Id where the event originated from - InstanceId types.String `tfsdk:"instance_id" tf:"optional"` + InstanceId types.String `tfsdk:"instance_id"` // Unique identifier of the specific job run associated with this cluster // event * For clusters created for jobs, this will be the same as the // cluster name - JobRunName types.String `tfsdk:"job_run_name" tf:"optional"` + JobRunName types.String `tfsdk:"job_run_name"` // The cluster attributes before a cluster was edited. - PreviousAttributes types.List `tfsdk:"previous_attributes" tf:"optional,object"` + PreviousAttributes types.List `tfsdk:"previous_attributes"` // The size of the cluster before an edit or resize. - PreviousClusterSize types.List `tfsdk:"previous_cluster_size" tf:"optional,object"` + PreviousClusterSize types.List `tfsdk:"previous_cluster_size"` // Previous disk size in bytes - PreviousDiskSize types.Int64 `tfsdk:"previous_disk_size" tf:"optional"` + PreviousDiskSize types.Int64 `tfsdk:"previous_disk_size"` // A termination reason: * On a TERMINATED event, this is the reason of the // termination. * On a RESIZE_COMPLETE event, this indicates the reason that // we failed to acquire some nodes. - Reason types.List `tfsdk:"reason" tf:"optional,object"` + Reason types.List `tfsdk:"reason"` // The targeted number of vCPUs in the cluster. - TargetNumVcpus types.Int64 `tfsdk:"target_num_vcpus" tf:"optional"` + TargetNumVcpus types.Int64 `tfsdk:"target_num_vcpus"` // The targeted number of nodes in the cluster. - TargetNumWorkers types.Int64 `tfsdk:"target_num_workers" tf:"optional"` + TargetNumWorkers types.Int64 `tfsdk:"target_num_workers"` // The user that caused the event to occur. (Empty if it was done by the // control plane.) - User types.String `tfsdk:"user" tf:"optional"` + User types.String `tfsdk:"user"` } func (newState *EventDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EventDetails_SdkV2) { @@ -8311,15 +8597,35 @@ func (newState *EventDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EventDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState EventDetails_SdkV2) { } -func (c EventDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "attributes")...) - ClusterSize_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_size")...) - InitScriptEventDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - ClusterAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "previous_attributes")...) - ClusterSize_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "previous_cluster_size")...) - TerminationReason_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "reason")...) - - return cs +func (c EventDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attributes"] = attrs["attributes"].SetOptional() + attrs["attributes"] = attrs["attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cause"] = attrs["cause"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["current_num_vcpus"] = attrs["current_num_vcpus"].SetOptional() + attrs["current_num_workers"] = attrs["current_num_workers"].SetOptional() + attrs["did_not_expand_reason"] = attrs["did_not_expand_reason"].SetOptional() + attrs["disk_size"] = attrs["disk_size"].SetOptional() + attrs["driver_state_message"] = attrs["driver_state_message"].SetOptional() + attrs["enable_termination_for_node_blocklisted"] = attrs["enable_termination_for_node_blocklisted"].SetOptional() + attrs["free_space"] = attrs["free_space"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["instance_id"] = attrs["instance_id"].SetOptional() + attrs["job_run_name"] = attrs["job_run_name"].SetOptional() + attrs["previous_attributes"] = attrs["previous_attributes"].SetOptional() + attrs["previous_attributes"] = attrs["previous_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["previous_cluster_size"] = attrs["previous_cluster_size"].SetOptional() + attrs["previous_cluster_size"] = attrs["previous_cluster_size"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["previous_disk_size"] = attrs["previous_disk_size"].SetOptional() + attrs["reason"] = attrs["reason"].SetOptional() + attrs["reason"] = attrs["reason"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["target_num_vcpus"] = attrs["target_num_vcpus"].SetOptional() + attrs["target_num_workers"] = attrs["target_num_workers"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EventDetails. @@ -8570,26 +8876,26 @@ type GcpAttributes_SdkV2 struct { // This field determines whether the instance pool will contain preemptible // VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs // if the former is unavailable. - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // boot disk size in GB - BootDiskSize types.Int64 `tfsdk:"boot_disk_size" tf:"optional"` + BootDiskSize types.Int64 `tfsdk:"boot_disk_size"` // If provided, the cluster will impersonate the google service account when // accessing gcloud services (like GCS). The google service account must // have previously been added to the Databricks environment by an account // administrator. - GoogleServiceAccount types.String `tfsdk:"google_service_account" tf:"optional"` + GoogleServiceAccount types.String `tfsdk:"google_service_account"` // If provided, each node (workers and driver) in the cluster will have this // number of local SSDs attached. Each local SSD is 375GB in size. Refer to // [GCP documentation] for the supported number of local SSDs for each // instance type. // // [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds - LocalSsdCount types.Int64 `tfsdk:"local_ssd_count" tf:"optional"` + LocalSsdCount types.Int64 `tfsdk:"local_ssd_count"` // This field determines whether the spark executors will be scheduled to // run on preemptible VMs (when set to true) versus standard compute engine // VMs (when set to false; default). Note: Soon to be deprecated, use the // availability field instead. - UsePreemptibleExecutors types.Bool `tfsdk:"use_preemptible_executors" tf:"optional"` + UsePreemptibleExecutors types.Bool `tfsdk:"use_preemptible_executors"` // Identifier for the availability zone in which the cluster resides. This // can be one of the following: - "HA" => High availability, spread nodes // across availability zones for a Databricks deployment region [default] - @@ -8597,7 +8903,7 @@ type GcpAttributes_SdkV2 struct { // on. - A GCP availability zone => Pick One of the available zones for // (machine type + region) from // https://cloud.google.com/compute/docs/regions-zones. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *GcpAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpAttributes_SdkV2) { @@ -8606,9 +8912,15 @@ func (newState *GcpAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *GcpAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcpAttributes_SdkV2) { } -func (c GcpAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GcpAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["boot_disk_size"] = attrs["boot_disk_size"].SetOptional() + attrs["google_service_account"] = attrs["google_service_account"].SetOptional() + attrs["local_ssd_count"] = attrs["local_ssd_count"].SetOptional() + attrs["use_preemptible_executors"] = attrs["use_preemptible_executors"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpAttributes. @@ -8654,7 +8966,7 @@ func (o GcpAttributes_SdkV2) Type(ctx context.Context) attr.Type { type GcsStorageInfo_SdkV2 struct { // GCS destination/URI, e.g. `gs://my-bucket/some-prefix` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *GcsStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcsStorageInfo_SdkV2) { @@ -8663,10 +8975,10 @@ func (newState *GcsStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *GcsStorageInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcsStorageInfo_SdkV2) { } -func (c GcsStorageInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c GcsStorageInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcsStorageInfo. @@ -8741,12 +9053,12 @@ type GetClusterComplianceResponse_SdkV2 struct { // Whether the cluster is compliant with its policy or not. Clusters could // be out of compliance if the policy was updated after the cluster was last // edited. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. The values indicate an error message describing the // policy validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *GetClusterComplianceResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetClusterComplianceResponse_SdkV2) { @@ -8755,9 +9067,11 @@ func (newState *GetClusterComplianceResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *GetClusterComplianceResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetClusterComplianceResponse_SdkV2) { } -func (c GetClusterComplianceResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetClusterComplianceResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetClusterComplianceResponse. @@ -8862,7 +9176,7 @@ func (o GetClusterPermissionLevelsRequest_SdkV2) Type(ctx context.Context) attr. type GetClusterPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetClusterPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetClusterPermissionLevelsResponse_SdkV2) { @@ -8871,10 +9185,10 @@ func (newState *GetClusterPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDur func (newState *GetClusterPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetClusterPermissionLevelsResponse_SdkV2) { } -func (c GetClusterPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetClusterPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetClusterPermissionLevelsResponse. @@ -9014,7 +9328,7 @@ func (o GetClusterPolicyPermissionLevelsRequest_SdkV2) Type(ctx context.Context) type GetClusterPolicyPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetClusterPolicyPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetClusterPolicyPermissionLevelsResponse_SdkV2) { @@ -9023,10 +9337,10 @@ func (newState *GetClusterPolicyPermissionLevelsResponse_SdkV2) SyncEffectiveFie func (newState *GetClusterPolicyPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetClusterPolicyPermissionLevelsResponse_SdkV2) { } -func (c GetClusterPolicyPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetClusterPolicyPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetClusterPolicyPermissionLevelsResponse. @@ -9203,25 +9517,25 @@ func (o GetClusterRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetEvents_SdkV2 struct { // The ID of the cluster to retrieve events about. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The end time in epoch milliseconds. If empty, returns events up to the // current time. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // An optional set of event types to filter on. If empty, all event types // are returned. - EventTypes types.List `tfsdk:"event_types" tf:"optional"` + EventTypes types.List `tfsdk:"event_types"` // The maximum number of events to include in a page of events. Defaults to // 50, and maximum allowed value is 500. - Limit types.Int64 `tfsdk:"limit" tf:"optional"` + Limit types.Int64 `tfsdk:"limit"` // The offset in the result set. Defaults to 0 (no offset). When an offset // is specified and the results are requested in descending order, the // end_time field is required. - Offset types.Int64 `tfsdk:"offset" tf:"optional"` + Offset types.Int64 `tfsdk:"offset"` // The order to list events in; either "ASC" or "DESC". Defaults to "DESC". - Order types.String `tfsdk:"order" tf:"optional"` + Order types.String `tfsdk:"order"` // The start time in epoch milliseconds. If empty, returns events starting // from the beginning of time. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` } func (newState *GetEvents_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetEvents_SdkV2) { @@ -9230,10 +9544,16 @@ func (newState *GetEvents_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ge func (newState *GetEvents_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetEvents_SdkV2) { } -func (c GetEvents_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c GetEvents_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["event_types"] = attrs["event_types"].SetOptional() + attrs["limit"] = attrs["limit"].SetOptional() + attrs["offset"] = attrs["offset"].SetOptional() + attrs["order"] = attrs["order"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetEvents. @@ -9311,13 +9631,13 @@ func (o *GetEvents_SdkV2) SetEventTypes(ctx context.Context, v []types.String) { type GetEventsResponse_SdkV2 struct { // - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` // The parameters required to retrieve the next page of events. Omitted if // there are no more events to read. - NextPage types.List `tfsdk:"next_page" tf:"optional,object"` + NextPage types.List `tfsdk:"next_page"` // The total number of events filtered by the start_time, end_time, and // event_types. - TotalCount types.Int64 `tfsdk:"total_count" tf:"optional"` + TotalCount types.Int64 `tfsdk:"total_count"` } func (newState *GetEventsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetEventsResponse_SdkV2) { @@ -9326,11 +9646,13 @@ func (newState *GetEventsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GetEventsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetEventsResponse_SdkV2) { } -func (c GetEventsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterEvent_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "events")...) - GetEvents_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "next_page")...) +func (c GetEventsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["events"] = attrs["events"].SetOptional() + attrs["next_page"] = attrs["next_page"].SetOptional() + attrs["next_page"] = attrs["next_page"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["total_count"] = attrs["total_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetEventsResponse. @@ -9467,16 +9789,16 @@ func (o GetGlobalInitScriptRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetInstancePool_SdkV2 struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -9487,19 +9809,19 @@ type GetInstancePool_SdkV2 struct { // - InstancePoolName: // // - InstancePoolId: - DefaultTags types.Map `tfsdk:"default_tags" tf:"optional"` + DefaultTags types.Map `tfsdk:"default_tags"` // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec types.List `tfsdk:"disk_spec" tf:"optional,object"` + DiskSpec types.List `tfsdk:"disk_spec"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -9507,37 +9829,37 @@ type GetInstancePool_SdkV2 struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Canonical unique identifier for the pool. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:""` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:"optional"` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Custom Docker Image BYOC - PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images" tf:"optional"` + PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images"` // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions" tf:"optional"` + PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions"` // Current state of the instance pool. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Usage statistics about the instance pool. - Stats types.List `tfsdk:"stats" tf:"optional,object"` + Stats types.List `tfsdk:"stats"` // Status of failed pending instances in the pool. - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` } func (newState *GetInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetInstancePool_SdkV2) { @@ -9546,17 +9868,33 @@ func (newState *GetInstancePool_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *GetInstancePool_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetInstancePool_SdkV2) { } -func (c GetInstancePool_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - InstancePoolAzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - DiskSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disk_spec")...) - InstancePoolGcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - cs.SetRequired(append(path, "instance_pool_id")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "preloaded_docker_images")...) - InstancePoolStats_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "stats")...) - InstancePoolStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - - return cs +func (c GetInstancePool_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["default_tags"] = attrs["default_tags"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetOptional() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["preloaded_docker_images"] = attrs["preloaded_docker_images"].SetOptional() + attrs["preloaded_spark_versions"] = attrs["preloaded_spark_versions"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["stats"] = attrs["stats"].SetOptional() + attrs["stats"] = attrs["stats"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetInstancePool. @@ -9954,7 +10292,7 @@ func (o GetInstancePoolPermissionLevelsRequest_SdkV2) Type(ctx context.Context) type GetInstancePoolPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetInstancePoolPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetInstancePoolPermissionLevelsResponse_SdkV2) { @@ -9963,10 +10301,10 @@ func (newState *GetInstancePoolPermissionLevelsResponse_SdkV2) SyncEffectiveFiel func (newState *GetInstancePoolPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetInstancePoolPermissionLevelsResponse_SdkV2) { } -func (c GetInstancePoolPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetInstancePoolPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetInstancePoolPermissionLevelsResponse. @@ -10148,7 +10486,7 @@ func (o GetPolicyFamilyRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetSparkVersionsResponse_SdkV2 struct { // All the available Spark versions. - Versions types.List `tfsdk:"versions" tf:"optional"` + Versions types.List `tfsdk:"versions"` } func (newState *GetSparkVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetSparkVersionsResponse_SdkV2) { @@ -10157,10 +10495,10 @@ func (newState *GetSparkVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *GetSparkVersionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetSparkVersionsResponse_SdkV2) { } -func (c GetSparkVersionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparkVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "versions")...) +func (c GetSparkVersionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["versions"] = attrs["versions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetSparkVersionsResponse. @@ -10226,9 +10564,9 @@ func (o *GetSparkVersionsResponse_SdkV2) SetVersions(ctx context.Context, v []Sp type GlobalInitScriptCreateRequest_SdkV2 struct { // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The position of a global init script, where 0 represents the first script // to run, 1 is the second script to run, in ascending order. // @@ -10240,9 +10578,9 @@ type GlobalInitScriptCreateRequest_SdkV2 struct { // position. If an explicit position value conflicts with an existing script // value, your request succeeds, but the original script at that position // and all later scripts have their positions incremented by 1. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The Base64-encoded content of the script. - Script types.String `tfsdk:"script" tf:""` + Script types.String `tfsdk:"script"` } func (newState *GlobalInitScriptCreateRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GlobalInitScriptCreateRequest_SdkV2) { @@ -10251,11 +10589,13 @@ func (newState *GlobalInitScriptCreateRequest_SdkV2) SyncEffectiveFieldsDuringCr func (newState *GlobalInitScriptCreateRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptCreateRequest_SdkV2) { } -func (c GlobalInitScriptCreateRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "script")...) +func (c GlobalInitScriptCreateRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["position"] = attrs["position"].SetOptional() + attrs["script"] = attrs["script"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptCreateRequest. @@ -10298,23 +10638,23 @@ func (o GlobalInitScriptCreateRequest_SdkV2) Type(ctx context.Context) attr.Type type GlobalInitScriptDetails_SdkV2 struct { // Time when the script was created, represented as a Unix timestamp in // milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The username of the user who created the script. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The global init script ID. - ScriptId types.String `tfsdk:"script_id" tf:"optional"` + ScriptId types.String `tfsdk:"script_id"` // Time when the script was updated, represented as a Unix timestamp in // milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The username of the user who last updated the script - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *GlobalInitScriptDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GlobalInitScriptDetails_SdkV2) { @@ -10323,9 +10663,17 @@ func (newState *GlobalInitScriptDetails_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *GlobalInitScriptDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptDetails_SdkV2) { } -func (c GlobalInitScriptDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GlobalInitScriptDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["script_id"] = attrs["script_id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptDetails. @@ -10376,25 +10724,25 @@ func (o GlobalInitScriptDetails_SdkV2) Type(ctx context.Context) attr.Type { type GlobalInitScriptDetailsWithContent_SdkV2 struct { // Time when the script was created, represented as a Unix timestamp in // milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The username of the user who created the script. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The Base64-encoded content of the script. - Script types.String `tfsdk:"script" tf:"optional"` + Script types.String `tfsdk:"script"` // The global init script ID. - ScriptId types.String `tfsdk:"script_id" tf:"optional"` + ScriptId types.String `tfsdk:"script_id"` // Time when the script was updated, represented as a Unix timestamp in // milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The username of the user who last updated the script - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *GlobalInitScriptDetailsWithContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GlobalInitScriptDetailsWithContent_SdkV2) { @@ -10403,9 +10751,18 @@ func (newState *GlobalInitScriptDetailsWithContent_SdkV2) SyncEffectiveFieldsDur func (newState *GlobalInitScriptDetailsWithContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptDetailsWithContent_SdkV2) { } -func (c GlobalInitScriptDetailsWithContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GlobalInitScriptDetailsWithContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["script"] = attrs["script"].SetOptional() + attrs["script_id"] = attrs["script_id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptDetailsWithContent. @@ -10457,9 +10814,9 @@ func (o GlobalInitScriptDetailsWithContent_SdkV2) Type(ctx context.Context) attr type GlobalInitScriptUpdateRequest_SdkV2 struct { // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. To move the script to // run first, set its position to 0. @@ -10472,9 +10829,9 @@ type GlobalInitScriptUpdateRequest_SdkV2 struct { // If an explicit position value conflicts with an existing script, your // request succeeds, but the original script at that position and all later // scripts have their positions incremented by 1. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The Base64-encoded content of the script. - Script types.String `tfsdk:"script" tf:""` + Script types.String `tfsdk:"script"` // The ID of the global init script. ScriptId types.String `tfsdk:"-"` } @@ -10485,12 +10842,14 @@ func (newState *GlobalInitScriptUpdateRequest_SdkV2) SyncEffectiveFieldsDuringCr func (newState *GlobalInitScriptUpdateRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptUpdateRequest_SdkV2) { } -func (c GlobalInitScriptUpdateRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "script")...) - cs.SetRequired(append(path, "script_id")...) +func (c GlobalInitScriptUpdateRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["position"] = attrs["position"].SetOptional() + attrs["script"] = attrs["script"].SetRequired() + attrs["script_id"] = attrs["script_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptUpdateRequest. @@ -10534,11 +10893,11 @@ func (o GlobalInitScriptUpdateRequest_SdkV2) Type(ctx context.Context) attr.Type type InitScriptEventDetails_SdkV2 struct { // The cluster scoped init scripts associated with this cluster event - Cluster types.List `tfsdk:"cluster" tf:"optional"` + Cluster types.List `tfsdk:"cluster"` // The global init scripts associated with this cluster event - Global types.List `tfsdk:"global" tf:"optional"` + Global types.List `tfsdk:"global"` // The private ip address of the node where the init scripts were run. - ReportedForNode types.String `tfsdk:"reported_for_node" tf:"optional"` + ReportedForNode types.String `tfsdk:"reported_for_node"` } func (newState *InitScriptEventDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptEventDetails_SdkV2) { @@ -10547,11 +10906,12 @@ func (newState *InitScriptEventDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *InitScriptEventDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState InitScriptEventDetails_SdkV2) { } -func (c InitScriptEventDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InitScriptInfoAndExecutionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster")...) - InitScriptInfoAndExecutionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "global")...) +func (c InitScriptEventDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster"] = attrs["cluster"].SetOptional() + attrs["global"] = attrs["global"].SetOptional() + attrs["reported_for_node"] = attrs["reported_for_node"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptEventDetails. @@ -10650,11 +11010,11 @@ func (o *InitScriptEventDetails_SdkV2) SetGlobal(ctx context.Context, v []InitSc type InitScriptExecutionDetails_SdkV2 struct { // Addition details regarding errors. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // The duration of the script execution in seconds. - ExecutionDurationSeconds types.Int64 `tfsdk:"execution_duration_seconds" tf:"optional"` + ExecutionDurationSeconds types.Int64 `tfsdk:"execution_duration_seconds"` // The current status of the script - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *InitScriptExecutionDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptExecutionDetails_SdkV2) { @@ -10663,9 +11023,12 @@ func (newState *InitScriptExecutionDetails_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *InitScriptExecutionDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState InitScriptExecutionDetails_SdkV2) { } -func (c InitScriptExecutionDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InitScriptExecutionDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["execution_duration_seconds"] = attrs["execution_duration_seconds"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptExecutionDetails. @@ -10707,28 +11070,28 @@ type InitScriptInfo_SdkV2 struct { // destination needs to be provided. e.g. `{ "abfss" : { "destination" : // "abfss://@.dfs.core.windows.net/" // } } - Abfss types.List `tfsdk:"abfss" tf:"optional,object"` + Abfss types.List `tfsdk:"abfss"` // destination needs to be provided. e.g. `{ "dbfs" : { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs types.List `tfsdk:"dbfs" tf:"optional,object"` + Dbfs types.List `tfsdk:"dbfs"` // destination needs to be provided. e.g. `{ "file" : { "destination" : // "file:/my/local/file.sh" } }` - File types.List `tfsdk:"file" tf:"optional,object"` + File types.List `tfsdk:"file"` // destination needs to be provided. e.g. `{ "gcs": { "destination": // "gs://my-bucket/file.sh" } }` - Gcs types.List `tfsdk:"gcs" tf:"optional,object"` + Gcs types.List `tfsdk:"gcs"` // destination and either the region or endpoint need to be provided. e.g. // `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : // "us-west-2" } }` Cluster iam role is used to access s3, please make sure // the cluster iam role in `instance_profile_arn` has permission to write // data to the s3 destination. - S3 types.List `tfsdk:"s3" tf:"optional,object"` + S3 types.List `tfsdk:"s3"` // destination needs to be provided. e.g. `{ "volumes" : { "destination" : // "/Volumes/my-init.sh" } }` - Volumes types.List `tfsdk:"volumes" tf:"optional,object"` + Volumes types.List `tfsdk:"volumes"` // destination needs to be provided. e.g. `{ "workspace" : { "destination" : // "/Users/user1@databricks.com/my-init.sh" } }` - Workspace types.List `tfsdk:"workspace" tf:"optional,object"` + Workspace types.List `tfsdk:"workspace"` } func (newState *InitScriptInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptInfo_SdkV2) { @@ -10737,16 +11100,23 @@ func (newState *InitScriptInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *InitScriptInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState InitScriptInfo_SdkV2) { } -func (c InitScriptInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Adlsgen2Info_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "abfss")...) - DbfsStorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbfs")...) - LocalFileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file")...) - GcsStorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcs")...) - S3StorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "s3")...) - VolumesStorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "volumes")...) - WorkspaceStorageInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workspace")...) +func (c InitScriptInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["abfss"] = attrs["abfss"].SetOptional() + attrs["abfss"] = attrs["abfss"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dbfs"] = attrs["dbfs"].SetOptional() + attrs["dbfs"] = attrs["dbfs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["file"] = attrs["file"].SetOptional() + attrs["file"] = attrs["file"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gcs"] = attrs["gcs"].SetOptional() + attrs["gcs"] = attrs["gcs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["s3"] = attrs["s3"].SetOptional() + attrs["s3"] = attrs["s3"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["volumes"] = attrs["volumes"].SetOptional() + attrs["volumes"] = attrs["volumes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["workspace"] = attrs["workspace"].SetOptional() + attrs["workspace"] = attrs["workspace"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptInfo. @@ -10998,9 +11368,9 @@ func (o *InitScriptInfo_SdkV2) SetWorkspace(ctx context.Context, v WorkspaceStor type InitScriptInfoAndExecutionDetails_SdkV2 struct { // Details about the script - ExecutionDetails types.List `tfsdk:"execution_details" tf:"optional,object"` + ExecutionDetails types.List `tfsdk:"execution_details"` // The script - Script types.List `tfsdk:"script" tf:"optional,object"` + Script types.List `tfsdk:"script"` } func (newState *InitScriptInfoAndExecutionDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptInfoAndExecutionDetails_SdkV2) { @@ -11009,11 +11379,13 @@ func (newState *InitScriptInfoAndExecutionDetails_SdkV2) SyncEffectiveFieldsDuri func (newState *InitScriptInfoAndExecutionDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState InitScriptInfoAndExecutionDetails_SdkV2) { } -func (c InitScriptInfoAndExecutionDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InitScriptExecutionDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "execution_details")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "script")...) +func (c InitScriptInfoAndExecutionDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["execution_details"] = attrs["execution_details"].SetOptional() + attrs["execution_details"] = attrs["execution_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["script"] = attrs["script"].SetOptional() + attrs["script"] = attrs["script"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptInfoAndExecutionDetails. @@ -11110,9 +11482,9 @@ func (o *InitScriptInfoAndExecutionDetails_SdkV2) SetScript(ctx context.Context, type InstallLibraries_SdkV2 struct { // Unique identifier for the cluster on which to install these libraries. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The libraries to install. - Libraries types.List `tfsdk:"libraries" tf:""` + Libraries types.List `tfsdk:"libraries"` } func (newState *InstallLibraries_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstallLibraries_SdkV2) { @@ -11121,12 +11493,11 @@ func (newState *InstallLibraries_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *InstallLibraries_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstallLibraries_SdkV2) { } -func (c InstallLibraries_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "libraries")...) - Library_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c InstallLibraries_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["libraries"] = attrs["libraries"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstallLibraries. @@ -11201,9 +11572,9 @@ func (newState *InstallLibrariesResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *InstallLibrariesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstallLibrariesResponse_SdkV2) { } -func (c InstallLibrariesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstallLibrariesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstallLibrariesResponse. @@ -11235,13 +11606,13 @@ func (o InstallLibrariesResponse_SdkV2) Type(ctx context.Context) attr.Type { type InstancePoolAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *InstancePoolAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAccessControlRequest_SdkV2) { @@ -11250,9 +11621,13 @@ func (newState *InstancePoolAccessControlRequest_SdkV2) SyncEffectiveFieldsDurin func (newState *InstancePoolAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolAccessControlRequest_SdkV2) { } -func (c InstancePoolAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAccessControlRequest. @@ -11294,15 +11669,15 @@ func (o InstancePoolAccessControlRequest_SdkV2) Type(ctx context.Context) attr.T type InstancePoolAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *InstancePoolAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAccessControlResponse_SdkV2) { @@ -11311,10 +11686,14 @@ func (newState *InstancePoolAccessControlResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *InstancePoolAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolAccessControlResponse_SdkV2) { } -func (c InstancePoolAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c InstancePoolAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAccessControlResponse. @@ -11389,16 +11768,16 @@ func (o *InstancePoolAccessControlResponse_SdkV2) SetAllPermissions(ctx context. type InstancePoolAndStats_SdkV2 struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -11409,19 +11788,19 @@ type InstancePoolAndStats_SdkV2 struct { // - InstancePoolName: // // - InstancePoolId: - DefaultTags types.Map `tfsdk:"default_tags" tf:"optional"` + DefaultTags types.Map `tfsdk:"default_tags"` // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec types.List `tfsdk:"disk_spec" tf:"optional,object"` + DiskSpec types.List `tfsdk:"disk_spec"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -11429,37 +11808,37 @@ type InstancePoolAndStats_SdkV2 struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Canonical unique identifier for the pool. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:"optional"` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Custom Docker Image BYOC - PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images" tf:"optional"` + PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images"` // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions" tf:"optional"` + PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions"` // Current state of the instance pool. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Usage statistics about the instance pool. - Stats types.List `tfsdk:"stats" tf:"optional,object"` + Stats types.List `tfsdk:"stats"` // Status of failed pending instances in the pool. - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` } func (newState *InstancePoolAndStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAndStats_SdkV2) { @@ -11468,16 +11847,33 @@ func (newState *InstancePoolAndStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *InstancePoolAndStats_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolAndStats_SdkV2) { } -func (c InstancePoolAndStats_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - InstancePoolAzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - DiskSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disk_spec")...) - InstancePoolGcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "preloaded_docker_images")...) - InstancePoolStats_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "stats")...) - InstancePoolStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - - return cs +func (c InstancePoolAndStats_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["default_tags"] = attrs["default_tags"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetOptional() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["preloaded_docker_images"] = attrs["preloaded_docker_images"].SetOptional() + attrs["preloaded_spark_versions"] = attrs["preloaded_spark_versions"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["stats"] = attrs["stats"].SetOptional() + attrs["stats"] = attrs["stats"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAndStats. @@ -11841,7 +12237,7 @@ type InstancePoolAwsAttributes_SdkV2 struct { // // The default value is defined by // InstancePoolConf.instancePoolDefaultAwsAvailability - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // Calculates the bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then @@ -11856,7 +12252,7 @@ type InstancePoolAwsAttributes_SdkV2 struct { // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidPricePercent and // CommonConf.maxSpotBidPricePercent. - SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent" tf:"optional"` + SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks @@ -11865,7 +12261,7 @@ type InstancePoolAwsAttributes_SdkV2 struct { // optional field at cluster creation, and if not specified, a default zone // will be used. The list of available zones as well as the default value // can be found by using the `List Zones` method. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *InstancePoolAwsAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAwsAttributes_SdkV2) { @@ -11874,9 +12270,12 @@ func (newState *InstancePoolAwsAttributes_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *InstancePoolAwsAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolAwsAttributes_SdkV2) { } -func (c InstancePoolAwsAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolAwsAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["spot_bid_price_percent"] = attrs["spot_bid_price_percent"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAwsAttributes. @@ -11919,10 +12318,10 @@ type InstancePoolAzureAttributes_SdkV2 struct { // // The default value is defined by // InstancePoolConf.instancePoolDefaultAzureAvailability - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidMaxPrice. - SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price" tf:"optional"` + SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price"` } func (newState *InstancePoolAzureAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAzureAttributes_SdkV2) { @@ -11931,9 +12330,11 @@ func (newState *InstancePoolAzureAttributes_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *InstancePoolAzureAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolAzureAttributes_SdkV2) { } -func (c InstancePoolAzureAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolAzureAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["spot_bid_max_price"] = attrs["spot_bid_max_price"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAzureAttributes. @@ -11973,14 +12374,14 @@ type InstancePoolGcpAttributes_SdkV2 struct { // This field determines whether the instance pool will contain preemptible // VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs // if the former is unavailable. - GcpAvailability types.String `tfsdk:"gcp_availability" tf:"optional"` + GcpAvailability types.String `tfsdk:"gcp_availability"` // If provided, each node in the instance pool will have this number of // local SSDs attached. Each local SSD is 375GB in size. Refer to [GCP // documentation] for the supported number of local SSDs for each instance // type. // // [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds - LocalSsdCount types.Int64 `tfsdk:"local_ssd_count" tf:"optional"` + LocalSsdCount types.Int64 `tfsdk:"local_ssd_count"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west1-a". The provided // availability zone must be in the same region as the Databricks workspace. @@ -11997,7 +12398,7 @@ type InstancePoolGcpAttributes_SdkV2 struct { // // If empty, Databricks picks an availability zone to schedule the cluster // on. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *InstancePoolGcpAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolGcpAttributes_SdkV2) { @@ -12006,9 +12407,12 @@ func (newState *InstancePoolGcpAttributes_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *InstancePoolGcpAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolGcpAttributes_SdkV2) { } -func (c InstancePoolGcpAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolGcpAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gcp_availability"] = attrs["gcp_availability"].SetOptional() + attrs["local_ssd_count"] = attrs["local_ssd_count"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolGcpAttributes. @@ -12047,11 +12451,11 @@ func (o InstancePoolGcpAttributes_SdkV2) Type(ctx context.Context) attr.Type { } type InstancePoolPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *InstancePoolPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolPermission_SdkV2) { @@ -12060,9 +12464,12 @@ func (newState *InstancePoolPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *InstancePoolPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermission_SdkV2) { } -func (c InstancePoolPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermission. @@ -12131,11 +12538,11 @@ func (o *InstancePoolPermission_SdkV2) SetInheritedFromObject(ctx context.Contex } type InstancePoolPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *InstancePoolPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolPermissions_SdkV2) { @@ -12144,10 +12551,12 @@ func (newState *InstancePoolPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *InstancePoolPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermissions_SdkV2) { } -func (c InstancePoolPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c InstancePoolPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermissions. @@ -12216,9 +12625,9 @@ func (o *InstancePoolPermissions_SdkV2) SetAccessControlList(ctx context.Context } type InstancePoolPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *InstancePoolPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolPermissionsDescription_SdkV2) { @@ -12227,9 +12636,11 @@ func (newState *InstancePoolPermissionsDescription_SdkV2) SyncEffectiveFieldsDur func (newState *InstancePoolPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermissionsDescription_SdkV2) { } -func (c InstancePoolPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermissionsDescription. @@ -12266,7 +12677,7 @@ func (o InstancePoolPermissionsDescription_SdkV2) Type(ctx context.Context) attr } type InstancePoolPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The instance pool for which to get or manage permissions. InstancePoolId types.String `tfsdk:"-"` } @@ -12277,11 +12688,11 @@ func (newState *InstancePoolPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringC func (newState *InstancePoolPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermissionsRequest_SdkV2) { } -func (c InstancePoolPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "instance_pool_id")...) +func (c InstancePoolPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermissionsRequest. @@ -12349,13 +12760,13 @@ func (o *InstancePoolPermissionsRequest_SdkV2) SetAccessControlList(ctx context. type InstancePoolStats_SdkV2 struct { // Number of active instances in the pool that are NOT part of a cluster. - IdleCount types.Int64 `tfsdk:"idle_count" tf:"optional"` + IdleCount types.Int64 `tfsdk:"idle_count"` // Number of pending instances in the pool that are NOT part of a cluster. - PendingIdleCount types.Int64 `tfsdk:"pending_idle_count" tf:"optional"` + PendingIdleCount types.Int64 `tfsdk:"pending_idle_count"` // Number of pending instances in the pool that are part of a cluster. - PendingUsedCount types.Int64 `tfsdk:"pending_used_count" tf:"optional"` + PendingUsedCount types.Int64 `tfsdk:"pending_used_count"` // Number of active instances in the pool that are part of a cluster. - UsedCount types.Int64 `tfsdk:"used_count" tf:"optional"` + UsedCount types.Int64 `tfsdk:"used_count"` } func (newState *InstancePoolStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolStats_SdkV2) { @@ -12364,9 +12775,13 @@ func (newState *InstancePoolStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *InstancePoolStats_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolStats_SdkV2) { } -func (c InstancePoolStats_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolStats_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["idle_count"] = attrs["idle_count"].SetOptional() + attrs["pending_idle_count"] = attrs["pending_idle_count"].SetOptional() + attrs["pending_used_count"] = attrs["pending_used_count"].SetOptional() + attrs["used_count"] = attrs["used_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolStats. @@ -12411,7 +12826,7 @@ type InstancePoolStatus_SdkV2 struct { // pending_instance_errors follows FIFO with maximum length of the min_idle // of the pool. The pending_instance_errors is emptied once the number of // exiting available instances reaches the min_idle of the pool. - PendingInstanceErrors types.List `tfsdk:"pending_instance_errors" tf:"optional"` + PendingInstanceErrors types.List `tfsdk:"pending_instance_errors"` } func (newState *InstancePoolStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolStatus_SdkV2) { @@ -12420,10 +12835,10 @@ func (newState *InstancePoolStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *InstancePoolStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstancePoolStatus_SdkV2) { } -func (c InstancePoolStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PendingInstanceError_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pending_instance_errors")...) +func (c InstancePoolStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pending_instance_errors"] = attrs["pending_instance_errors"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolStatus. @@ -12496,16 +12911,16 @@ type InstanceProfile_SdkV2 struct { // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html - IamRoleArn types.String `tfsdk:"iam_role_arn" tf:"optional"` + IamRoleArn types.String `tfsdk:"iam_role_arn"` // The AWS ARN of the instance profile to register with Databricks. This // field is required. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:""` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Boolean flag indicating whether the instance profile should only be used // in credential passthrough scenarios. If true, it means the instance // profile contains an meta IAM role which could assume a wide range of // roles. Therefore it should always be used with authorization. This field // is optional, the default value is `false`. - IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile" tf:"optional"` + IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile"` } func (newState *InstanceProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstanceProfile_SdkV2) { @@ -12514,10 +12929,12 @@ func (newState *InstanceProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *InstanceProfile_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstanceProfile_SdkV2) { } -func (c InstanceProfile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_profile_arn")...) +func (c InstanceProfile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["iam_role_arn"] = attrs["iam_role_arn"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetRequired() + attrs["is_meta_instance_profile"] = attrs["is_meta_instance_profile"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstanceProfile. @@ -12557,11 +12974,11 @@ func (o InstanceProfile_SdkV2) Type(ctx context.Context) attr.Type { type Library_SdkV2 struct { // Specification of a CRAN library to be installed as part of the library - Cran types.List `tfsdk:"cran" tf:"optional,object"` + Cran types.List `tfsdk:"cran"` // Deprecated. URI of the egg library to install. Installing Python egg // files is deprecated and is not supported in Databricks Runtime 14.0 and // above. - Egg types.String `tfsdk:"egg" tf:"optional"` + Egg types.String `tfsdk:"egg"` // URI of the JAR library to install. Supported URIs include Workspace // paths, Unity Catalog Volumes paths, and S3 URIs. For example: `{ "jar": // "/Workspace/path/to/library.jar" }`, `{ "jar" : @@ -12569,18 +12986,18 @@ type Library_SdkV2 struct { // "s3://my-bucket/library.jar" }`. If S3 is used, please make sure the // cluster has read access on the library. You may need to launch the // cluster with an IAM role to access the S3 URI. - Jar types.String `tfsdk:"jar" tf:"optional"` + Jar types.String `tfsdk:"jar"` // Specification of a maven library to be installed. For example: `{ // "coordinates": "org.jsoup:jsoup:1.7.2" }` - Maven types.List `tfsdk:"maven" tf:"optional,object"` + Maven types.List `tfsdk:"maven"` // Specification of a PyPi library to be installed. For example: `{ // "package": "simplejson" }` - Pypi types.List `tfsdk:"pypi" tf:"optional,object"` + Pypi types.List `tfsdk:"pypi"` // URI of the requirements.txt file to install. Only Workspace paths and // Unity Catalog Volumes paths are supported. For example: `{ // "requirements": "/Workspace/path/to/requirements.txt" }` or `{ // "requirements" : "/Volumes/path/to/requirements.txt" }` - Requirements types.String `tfsdk:"requirements" tf:"optional"` + Requirements types.String `tfsdk:"requirements"` // URI of the wheel library to install. Supported URIs include Workspace // paths, Unity Catalog Volumes paths, and S3 URIs. For example: `{ "whl": // "/Workspace/path/to/library.whl" }`, `{ "whl" : @@ -12588,7 +13005,7 @@ type Library_SdkV2 struct { // "s3://my-bucket/library.whl" }`. If S3 is used, please make sure the // cluster has read access on the library. You may need to launch the // cluster with an IAM role to access the S3 URI. - Whl types.String `tfsdk:"whl" tf:"optional"` + Whl types.String `tfsdk:"whl"` } func (newState *Library_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Library_SdkV2) { @@ -12597,12 +13014,19 @@ func (newState *Library_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Libr func (newState *Library_SdkV2) SyncEffectiveFieldsDuringRead(existingState Library_SdkV2) { } -func (c Library_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RCranLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cran")...) - MavenLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "maven")...) - PythonPyPiLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pypi")...) +func (c Library_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cran"] = attrs["cran"].SetOptional() + attrs["cran"] = attrs["cran"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["egg"] = attrs["egg"].SetOptional() + attrs["jar"] = attrs["jar"].SetOptional() + attrs["maven"] = attrs["maven"].SetOptional() + attrs["maven"] = attrs["maven"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pypi"] = attrs["pypi"].SetOptional() + attrs["pypi"] = attrs["pypi"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["requirements"] = attrs["requirements"].SetOptional() + attrs["whl"] = attrs["whl"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Library. @@ -12740,14 +13164,14 @@ func (o *Library_SdkV2) SetPypi(ctx context.Context, v PythonPyPiLibrary_SdkV2) type LibraryFullStatus_SdkV2 struct { // Whether the library was set to be installed on all clusters via the // libraries UI. - IsLibraryForAllClusters types.Bool `tfsdk:"is_library_for_all_clusters" tf:"optional"` + IsLibraryForAllClusters types.Bool `tfsdk:"is_library_for_all_clusters"` // Unique identifier for the library. - Library types.List `tfsdk:"library" tf:"optional,object"` + Library types.List `tfsdk:"library"` // All the info and warning messages that have occurred so far for this // library. - Messages types.List `tfsdk:"messages" tf:"optional"` + Messages types.List `tfsdk:"messages"` // Status of installing the library on the cluster. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *LibraryFullStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LibraryFullStatus_SdkV2) { @@ -12756,10 +13180,14 @@ func (newState *LibraryFullStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *LibraryFullStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState LibraryFullStatus_SdkV2) { } -func (c LibraryFullStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "library")...) +func (c LibraryFullStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_library_for_all_clusters"] = attrs["is_library_for_all_clusters"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["library"] = attrs["library"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["messages"] = attrs["messages"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LibraryFullStatus. @@ -12860,7 +13288,7 @@ func (o *LibraryFullStatus_SdkV2) SetMessages(ctx context.Context, v []types.Str type ListAllClusterLibraryStatusesResponse_SdkV2 struct { // A list of cluster statuses. - Statuses types.List `tfsdk:"statuses" tf:"optional"` + Statuses types.List `tfsdk:"statuses"` } func (newState *ListAllClusterLibraryStatusesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAllClusterLibraryStatusesResponse_SdkV2) { @@ -12869,10 +13297,10 @@ func (newState *ListAllClusterLibraryStatusesResponse_SdkV2) SyncEffectiveFields func (newState *ListAllClusterLibraryStatusesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAllClusterLibraryStatusesResponse_SdkV2) { } -func (c ListAllClusterLibraryStatusesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterLibraryStatuses_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "statuses")...) +func (c ListAllClusterLibraryStatusesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["statuses"] = attrs["statuses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAllClusterLibraryStatusesResponse. @@ -12939,9 +13367,9 @@ func (o *ListAllClusterLibraryStatusesResponse_SdkV2) SetStatuses(ctx context.Co type ListAvailableZonesResponse_SdkV2 struct { // The availability zone if no `zone_id` is provided in the cluster creation // request. - DefaultZone types.String `tfsdk:"default_zone" tf:"optional"` + DefaultZone types.String `tfsdk:"default_zone"` // The list of available zones (e.g., ['us-west-2c', 'us-east-2']). - Zones types.List `tfsdk:"zones" tf:"optional"` + Zones types.List `tfsdk:"zones"` } func (newState *ListAvailableZonesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAvailableZonesResponse_SdkV2) { @@ -12950,9 +13378,11 @@ func (newState *ListAvailableZonesResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListAvailableZonesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAvailableZonesResponse_SdkV2) { } -func (c ListAvailableZonesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListAvailableZonesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_zone"] = attrs["default_zone"].SetOptional() + attrs["zones"] = attrs["zones"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAvailableZonesResponse. @@ -13068,14 +13498,14 @@ func (o ListClusterCompliancesRequest_SdkV2) Type(ctx context.Context) attr.Type type ListClusterCompliancesResponse_SdkV2 struct { // A list of clusters and their policy compliance statuses. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListClusterCompliancesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClusterCompliancesResponse_SdkV2) { @@ -13084,10 +13514,12 @@ func (newState *ListClusterCompliancesResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *ListClusterCompliancesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListClusterCompliancesResponse_SdkV2) { } -func (c ListClusterCompliancesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterCompliance_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) +func (c ListClusterCompliancesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClusterCompliancesResponse. @@ -13201,13 +13633,13 @@ func (o ListClusterPoliciesRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListClustersFilterBy_SdkV2 struct { // The source of cluster creation. - ClusterSources types.List `tfsdk:"cluster_sources" tf:"optional"` + ClusterSources types.List `tfsdk:"cluster_sources"` // The current state of the clusters. - ClusterStates types.List `tfsdk:"cluster_states" tf:"optional"` + ClusterStates types.List `tfsdk:"cluster_states"` // Whether the clusters are pinned or not. - IsPinned types.Bool `tfsdk:"is_pinned" tf:"optional"` + IsPinned types.Bool `tfsdk:"is_pinned"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *ListClustersFilterBy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClustersFilterBy_SdkV2) { @@ -13216,9 +13648,13 @@ func (newState *ListClustersFilterBy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListClustersFilterBy_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListClustersFilterBy_SdkV2) { } -func (c ListClustersFilterBy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListClustersFilterBy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_sources"] = attrs["cluster_sources"].SetOptional() + attrs["cluster_states"] = attrs["cluster_states"].SetOptional() + attrs["is_pinned"] = attrs["is_pinned"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClustersFilterBy. @@ -13430,14 +13866,14 @@ func (o *ListClustersRequest_SdkV2) SetSortBy(ctx context.Context, v ListCluster type ListClustersResponse_SdkV2 struct { // - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListClustersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClustersResponse_SdkV2) { @@ -13446,10 +13882,12 @@ func (newState *ListClustersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListClustersResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListClustersResponse_SdkV2) { } -func (c ListClustersResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) +func (c ListClustersResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClustersResponse. @@ -13519,11 +13957,11 @@ func (o *ListClustersResponse_SdkV2) SetClusters(ctx context.Context, v []Cluste type ListClustersSortBy_SdkV2 struct { // The direction to sort by. - Direction types.String `tfsdk:"direction" tf:"optional"` + Direction types.String `tfsdk:"direction"` // The sorting criteria. By default, clusters are sorted by 3 columns from // highest to lowest precedence: cluster state, pinned or unpinned, then // cluster name. - Field types.String `tfsdk:"field" tf:"optional"` + Field types.String `tfsdk:"field"` } func (newState *ListClustersSortBy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClustersSortBy_SdkV2) { @@ -13532,9 +13970,11 @@ func (newState *ListClustersSortBy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListClustersSortBy_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListClustersSortBy_SdkV2) { } -func (c ListClustersSortBy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListClustersSortBy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["direction"] = attrs["direction"].SetOptional() + attrs["field"] = attrs["field"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClustersSortBy. @@ -13571,7 +14011,7 @@ func (o ListClustersSortBy_SdkV2) Type(ctx context.Context) attr.Type { } type ListGlobalInitScriptsResponse_SdkV2 struct { - Scripts types.List `tfsdk:"scripts" tf:"optional"` + Scripts types.List `tfsdk:"scripts"` } func (newState *ListGlobalInitScriptsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListGlobalInitScriptsResponse_SdkV2) { @@ -13580,10 +14020,10 @@ func (newState *ListGlobalInitScriptsResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *ListGlobalInitScriptsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListGlobalInitScriptsResponse_SdkV2) { } -func (c ListGlobalInitScriptsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GlobalInitScriptDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "scripts")...) +func (c ListGlobalInitScriptsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scripts"] = attrs["scripts"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListGlobalInitScriptsResponse. @@ -13648,7 +14088,7 @@ func (o *ListGlobalInitScriptsResponse_SdkV2) SetScripts(ctx context.Context, v } type ListInstancePools_SdkV2 struct { - InstancePools types.List `tfsdk:"instance_pools" tf:"optional"` + InstancePools types.List `tfsdk:"instance_pools"` } func (newState *ListInstancePools_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListInstancePools_SdkV2) { @@ -13657,10 +14097,10 @@ func (newState *ListInstancePools_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListInstancePools_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListInstancePools_SdkV2) { } -func (c ListInstancePools_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAndStats_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "instance_pools")...) +func (c ListInstancePools_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_pools"] = attrs["instance_pools"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListInstancePools. @@ -13726,7 +14166,7 @@ func (o *ListInstancePools_SdkV2) SetInstancePools(ctx context.Context, v []Inst type ListInstanceProfilesResponse_SdkV2 struct { // A list of instance profiles that the user can access. - InstanceProfiles types.List `tfsdk:"instance_profiles" tf:"optional"` + InstanceProfiles types.List `tfsdk:"instance_profiles"` } func (newState *ListInstanceProfilesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListInstanceProfilesResponse_SdkV2) { @@ -13735,10 +14175,10 @@ func (newState *ListInstanceProfilesResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ListInstanceProfilesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListInstanceProfilesResponse_SdkV2) { } -func (c ListInstanceProfilesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstanceProfile_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "instance_profiles")...) +func (c ListInstanceProfilesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_profiles"] = attrs["instance_profiles"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListInstanceProfilesResponse. @@ -13804,7 +14244,7 @@ func (o *ListInstanceProfilesResponse_SdkV2) SetInstanceProfiles(ctx context.Con type ListNodeTypesResponse_SdkV2 struct { // The list of available Spark node types. - NodeTypes types.List `tfsdk:"node_types" tf:"optional"` + NodeTypes types.List `tfsdk:"node_types"` } func (newState *ListNodeTypesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNodeTypesResponse_SdkV2) { @@ -13813,10 +14253,10 @@ func (newState *ListNodeTypesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListNodeTypesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListNodeTypesResponse_SdkV2) { } -func (c ListNodeTypesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NodeType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "node_types")...) +func (c ListNodeTypesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["node_types"] = attrs["node_types"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNodeTypesResponse. @@ -13882,7 +14322,7 @@ func (o *ListNodeTypesResponse_SdkV2) SetNodeTypes(ctx context.Context, v []Node type ListPoliciesResponse_SdkV2 struct { // List of policies. - Policies types.List `tfsdk:"policies" tf:"optional"` + Policies types.List `tfsdk:"policies"` } func (newState *ListPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPoliciesResponse_SdkV2) { @@ -13891,10 +14331,10 @@ func (newState *ListPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListPoliciesResponse_SdkV2) { } -func (c ListPoliciesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Policy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "policies")...) +func (c ListPoliciesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["policies"] = attrs["policies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPoliciesResponse. @@ -14002,9 +14442,9 @@ func (o ListPolicyFamiliesRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListPolicyFamiliesResponse_SdkV2 struct { // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of policy families. - PolicyFamilies types.List `tfsdk:"policy_families" tf:"optional"` + PolicyFamilies types.List `tfsdk:"policy_families"` } func (newState *ListPolicyFamiliesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPolicyFamiliesResponse_SdkV2) { @@ -14013,10 +14453,11 @@ func (newState *ListPolicyFamiliesResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListPolicyFamiliesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListPolicyFamiliesResponse_SdkV2) { } -func (c ListPolicyFamiliesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PolicyFamily_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "policy_families")...) +func (c ListPolicyFamiliesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["policy_families"] = attrs["policy_families"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPolicyFamiliesResponse. @@ -14084,7 +14525,7 @@ func (o *ListPolicyFamiliesResponse_SdkV2) SetPolicyFamilies(ctx context.Context type LocalFileInfo_SdkV2 struct { // local file destination, e.g. `file:/my/local/file.sh` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *LocalFileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LocalFileInfo_SdkV2) { @@ -14093,10 +14534,10 @@ func (newState *LocalFileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *LocalFileInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState LocalFileInfo_SdkV2) { } -func (c LocalFileInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c LocalFileInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LocalFileInfo. @@ -14132,9 +14573,9 @@ func (o LocalFileInfo_SdkV2) Type(ctx context.Context) attr.Type { type LogAnalyticsInfo_SdkV2 struct { // - LogAnalyticsPrimaryKey types.String `tfsdk:"log_analytics_primary_key" tf:"optional"` + LogAnalyticsPrimaryKey types.String `tfsdk:"log_analytics_primary_key"` // - LogAnalyticsWorkspaceId types.String `tfsdk:"log_analytics_workspace_id" tf:"optional"` + LogAnalyticsWorkspaceId types.String `tfsdk:"log_analytics_workspace_id"` } func (newState *LogAnalyticsInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogAnalyticsInfo_SdkV2) { @@ -14143,9 +14584,11 @@ func (newState *LogAnalyticsInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *LogAnalyticsInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogAnalyticsInfo_SdkV2) { } -func (c LogAnalyticsInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogAnalyticsInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_analytics_primary_key"] = attrs["log_analytics_primary_key"].SetOptional() + attrs["log_analytics_workspace_id"] = attrs["log_analytics_workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogAnalyticsInfo. @@ -14184,10 +14627,10 @@ func (o LogAnalyticsInfo_SdkV2) Type(ctx context.Context) attr.Type { type LogSyncStatus_SdkV2 struct { // The timestamp of last attempt. If the last attempt fails, // `last_exception` will contain the exception in the last attempt. - LastAttempted types.Int64 `tfsdk:"last_attempted" tf:"optional"` + LastAttempted types.Int64 `tfsdk:"last_attempted"` // The exception thrown in the last attempt, it would be null (omitted in // the response) if there is no exception in last attempted. - LastException types.String `tfsdk:"last_exception" tf:"optional"` + LastException types.String `tfsdk:"last_exception"` } func (newState *LogSyncStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogSyncStatus_SdkV2) { @@ -14196,9 +14639,11 @@ func (newState *LogSyncStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *LogSyncStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogSyncStatus_SdkV2) { } -func (c LogSyncStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogSyncStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_attempted"] = attrs["last_attempted"].SetOptional() + attrs["last_exception"] = attrs["last_exception"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogSyncStatus. @@ -14236,16 +14681,16 @@ func (o LogSyncStatus_SdkV2) Type(ctx context.Context) attr.Type { type MavenLibrary_SdkV2 struct { // Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". - Coordinates types.String `tfsdk:"coordinates" tf:""` + Coordinates types.String `tfsdk:"coordinates"` // List of dependences to exclude. For example: `["slf4j:slf4j", // "*:hadoop-client"]`. // // Maven dependency exclusions: // https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. - Exclusions types.List `tfsdk:"exclusions" tf:"optional"` + Exclusions types.List `tfsdk:"exclusions"` // Maven repo to install the Maven package from. If omitted, both Maven // Central Repository and Spark Packages are searched. - Repo types.String `tfsdk:"repo" tf:"optional"` + Repo types.String `tfsdk:"repo"` } func (newState *MavenLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MavenLibrary_SdkV2) { @@ -14254,10 +14699,12 @@ func (newState *MavenLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MavenLibrary_SdkV2) SyncEffectiveFieldsDuringRead(existingState MavenLibrary_SdkV2) { } -func (c MavenLibrary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "coordinates")...) +func (c MavenLibrary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["coordinates"] = attrs["coordinates"].SetRequired() + attrs["exclusions"] = attrs["exclusions"].SetOptional() + attrs["repo"] = attrs["repo"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MavenLibrary. @@ -14326,15 +14773,15 @@ func (o *MavenLibrary_SdkV2) SetExclusions(ctx context.Context, v []types.String } type NodeInstanceType_SdkV2 struct { - InstanceTypeId types.String `tfsdk:"instance_type_id" tf:"optional"` + InstanceTypeId types.String `tfsdk:"instance_type_id"` - LocalDiskSizeGb types.Int64 `tfsdk:"local_disk_size_gb" tf:"optional"` + LocalDiskSizeGb types.Int64 `tfsdk:"local_disk_size_gb"` - LocalDisks types.Int64 `tfsdk:"local_disks" tf:"optional"` + LocalDisks types.Int64 `tfsdk:"local_disks"` - LocalNvmeDiskSizeGb types.Int64 `tfsdk:"local_nvme_disk_size_gb" tf:"optional"` + LocalNvmeDiskSizeGb types.Int64 `tfsdk:"local_nvme_disk_size_gb"` - LocalNvmeDisks types.Int64 `tfsdk:"local_nvme_disks" tf:"optional"` + LocalNvmeDisks types.Int64 `tfsdk:"local_nvme_disks"` } func (newState *NodeInstanceType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NodeInstanceType_SdkV2) { @@ -14343,9 +14790,14 @@ func (newState *NodeInstanceType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *NodeInstanceType_SdkV2) SyncEffectiveFieldsDuringRead(existingState NodeInstanceType_SdkV2) { } -func (c NodeInstanceType_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NodeInstanceType_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_type_id"] = attrs["instance_type_id"].SetOptional() + attrs["local_disk_size_gb"] = attrs["local_disk_size_gb"].SetOptional() + attrs["local_disks"] = attrs["local_disks"].SetOptional() + attrs["local_nvme_disk_size_gb"] = attrs["local_nvme_disk_size_gb"].SetOptional() + attrs["local_nvme_disks"] = attrs["local_nvme_disks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NodeInstanceType. @@ -14388,53 +14840,53 @@ func (o NodeInstanceType_SdkV2) Type(ctx context.Context) attr.Type { } type NodeType_SdkV2 struct { - Category types.String `tfsdk:"category" tf:"optional"` + Category types.String `tfsdk:"category"` // A string description associated with this node type, e.g., "r3.xlarge". - Description types.String `tfsdk:"description" tf:""` + Description types.String `tfsdk:"description"` - DisplayOrder types.Int64 `tfsdk:"display_order" tf:"optional"` + DisplayOrder types.Int64 `tfsdk:"display_order"` // An identifier for the type of hardware that this node runs on, e.g., // "r3.2xlarge" in AWS. - InstanceTypeId types.String `tfsdk:"instance_type_id" tf:""` + InstanceTypeId types.String `tfsdk:"instance_type_id"` // Whether the node type is deprecated. Non-deprecated node types offer // greater performance. - IsDeprecated types.Bool `tfsdk:"is_deprecated" tf:"optional"` + IsDeprecated types.Bool `tfsdk:"is_deprecated"` // AWS specific, whether this instance supports encryption in transit, used // for hipaa and pci workloads. - IsEncryptedInTransit types.Bool `tfsdk:"is_encrypted_in_transit" tf:"optional"` + IsEncryptedInTransit types.Bool `tfsdk:"is_encrypted_in_transit"` - IsGraviton types.Bool `tfsdk:"is_graviton" tf:"optional"` + IsGraviton types.Bool `tfsdk:"is_graviton"` - IsHidden types.Bool `tfsdk:"is_hidden" tf:"optional"` + IsHidden types.Bool `tfsdk:"is_hidden"` - IsIoCacheEnabled types.Bool `tfsdk:"is_io_cache_enabled" tf:"optional"` + IsIoCacheEnabled types.Bool `tfsdk:"is_io_cache_enabled"` // Memory (in MB) available for this node type. - MemoryMb types.Int64 `tfsdk:"memory_mb" tf:""` + MemoryMb types.Int64 `tfsdk:"memory_mb"` - NodeInfo types.List `tfsdk:"node_info" tf:"optional,object"` + NodeInfo types.List `tfsdk:"node_info"` - NodeInstanceType types.List `tfsdk:"node_instance_type" tf:"optional,object"` + NodeInstanceType types.List `tfsdk:"node_instance_type"` // Unique identifier for this node type. - NodeTypeId types.String `tfsdk:"node_type_id" tf:""` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of CPU cores available for this node type. Note that this can be // fractional, e.g., 2.5 cores, if the the number of cores on a machine // instance is not divisible by the number of Spark nodes on that machine. - NumCores types.Float64 `tfsdk:"num_cores" tf:""` + NumCores types.Float64 `tfsdk:"num_cores"` - NumGpus types.Int64 `tfsdk:"num_gpus" tf:"optional"` + NumGpus types.Int64 `tfsdk:"num_gpus"` - PhotonDriverCapable types.Bool `tfsdk:"photon_driver_capable" tf:"optional"` + PhotonDriverCapable types.Bool `tfsdk:"photon_driver_capable"` - PhotonWorkerCapable types.Bool `tfsdk:"photon_worker_capable" tf:"optional"` + PhotonWorkerCapable types.Bool `tfsdk:"photon_worker_capable"` - SupportClusterTags types.Bool `tfsdk:"support_cluster_tags" tf:"optional"` + SupportClusterTags types.Bool `tfsdk:"support_cluster_tags"` - SupportEbsVolumes types.Bool `tfsdk:"support_ebs_volumes" tf:"optional"` + SupportEbsVolumes types.Bool `tfsdk:"support_ebs_volumes"` - SupportPortForwarding types.Bool `tfsdk:"support_port_forwarding" tf:"optional"` + SupportPortForwarding types.Bool `tfsdk:"support_port_forwarding"` // Indicates if this node type can be used for an instance pool or cluster // with elastic disk enabled. This is true for most node types. - SupportsElasticDisk types.Bool `tfsdk:"supports_elastic_disk" tf:"optional"` + SupportsElasticDisk types.Bool `tfsdk:"supports_elastic_disk"` } func (newState *NodeType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NodeType_SdkV2) { @@ -14443,16 +14895,32 @@ func (newState *NodeType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Nod func (newState *NodeType_SdkV2) SyncEffectiveFieldsDuringRead(existingState NodeType_SdkV2) { } -func (c NodeType_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "description")...) - cs.SetRequired(append(path, "instance_type_id")...) - cs.SetRequired(append(path, "memory_mb")...) - CloudProviderNodeInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "node_info")...) - NodeInstanceType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "node_instance_type")...) - cs.SetRequired(append(path, "node_type_id")...) - cs.SetRequired(append(path, "num_cores")...) - - return cs +func (c NodeType_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["category"] = attrs["category"].SetOptional() + attrs["description"] = attrs["description"].SetRequired() + attrs["display_order"] = attrs["display_order"].SetOptional() + attrs["instance_type_id"] = attrs["instance_type_id"].SetRequired() + attrs["is_deprecated"] = attrs["is_deprecated"].SetOptional() + attrs["is_encrypted_in_transit"] = attrs["is_encrypted_in_transit"].SetOptional() + attrs["is_graviton"] = attrs["is_graviton"].SetOptional() + attrs["is_hidden"] = attrs["is_hidden"].SetOptional() + attrs["is_io_cache_enabled"] = attrs["is_io_cache_enabled"].SetOptional() + attrs["memory_mb"] = attrs["memory_mb"].SetRequired() + attrs["node_info"] = attrs["node_info"].SetOptional() + attrs["node_info"] = attrs["node_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["node_instance_type"] = attrs["node_instance_type"].SetOptional() + attrs["node_instance_type"] = attrs["node_instance_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["node_type_id"] = attrs["node_type_id"].SetRequired() + attrs["num_cores"] = attrs["num_cores"].SetRequired() + attrs["num_gpus"] = attrs["num_gpus"].SetOptional() + attrs["photon_driver_capable"] = attrs["photon_driver_capable"].SetOptional() + attrs["photon_worker_capable"] = attrs["photon_worker_capable"].SetOptional() + attrs["support_cluster_tags"] = attrs["support_cluster_tags"].SetOptional() + attrs["support_ebs_volumes"] = attrs["support_ebs_volumes"].SetOptional() + attrs["support_port_forwarding"] = attrs["support_port_forwarding"].SetOptional() + attrs["supports_elastic_disk"] = attrs["supports_elastic_disk"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NodeType. @@ -14586,9 +15054,9 @@ func (o *NodeType_SdkV2) SetNodeInstanceType(ctx context.Context, v NodeInstance } type PendingInstanceError_SdkV2 struct { - InstanceId types.String `tfsdk:"instance_id" tf:"optional"` + InstanceId types.String `tfsdk:"instance_id"` - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *PendingInstanceError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PendingInstanceError_SdkV2) { @@ -14597,9 +15065,11 @@ func (newState *PendingInstanceError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *PendingInstanceError_SdkV2) SyncEffectiveFieldsDuringRead(existingState PendingInstanceError_SdkV2) { } -func (c PendingInstanceError_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PendingInstanceError_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_id"] = attrs["instance_id"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PendingInstanceError. @@ -14637,7 +15107,7 @@ func (o PendingInstanceError_SdkV2) Type(ctx context.Context) attr.Type { type PermanentDeleteCluster_SdkV2 struct { // The cluster to be deleted. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *PermanentDeleteCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermanentDeleteCluster_SdkV2) { @@ -14646,10 +15116,10 @@ func (newState *PermanentDeleteCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *PermanentDeleteCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermanentDeleteCluster_SdkV2) { } -func (c PermanentDeleteCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c PermanentDeleteCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermanentDeleteCluster. @@ -14692,9 +15162,9 @@ func (newState *PermanentDeleteClusterResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *PermanentDeleteClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermanentDeleteClusterResponse_SdkV2) { } -func (c PermanentDeleteClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermanentDeleteClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermanentDeleteClusterResponse. @@ -14726,7 +15196,7 @@ func (o PermanentDeleteClusterResponse_SdkV2) Type(ctx context.Context) attr.Typ type PinCluster_SdkV2 struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *PinCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PinCluster_SdkV2) { @@ -14735,10 +15205,10 @@ func (newState *PinCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan P func (newState *PinCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState PinCluster_SdkV2) { } -func (c PinCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c PinCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PinCluster. @@ -14781,9 +15251,9 @@ func (newState *PinClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PinClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState PinClusterResponse_SdkV2) { } -func (c PinClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PinClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PinClusterResponse. @@ -14817,30 +15287,30 @@ func (o PinClusterResponse_SdkV2) Type(ctx context.Context) attr.Type { type Policy_SdkV2 struct { // Creation time. The timestamp (in millisecond) when this Cluster Policy // was created. - CreatedAtTimestamp types.Int64 `tfsdk:"created_at_timestamp" tf:"optional"` + CreatedAtTimestamp types.Int64 `tfsdk:"created_at_timestamp"` // Creator user name. The field won't be included in the response if the // user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Policy definition document expressed in [Databricks Cluster Policy // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Additional human-readable description of the cluster policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // If true, policy is a default policy created and managed by Databricks. // Default policies cannot be deleted, and their policy families cannot be // changed. - IsDefault types.Bool `tfsdk:"is_default" tf:"optional"` + IsDefault types.Bool `tfsdk:"is_default"` // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user" tf:"optional"` + MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user"` // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -14850,16 +15320,16 @@ type Policy_SdkV2 struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides" tf:"optional"` + PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides"` // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` // Canonical unique identifier for the Cluster Policy. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *Policy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Policy_SdkV2) { @@ -14868,10 +15338,20 @@ func (newState *Policy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Polic func (newState *Policy_SdkV2) SyncEffectiveFieldsDuringRead(existingState Policy_SdkV2) { } -func (c Policy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c Policy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at_timestamp"] = attrs["created_at_timestamp"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["is_default"] = attrs["is_default"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["max_clusters_per_user"] = attrs["max_clusters_per_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_definition_overrides"] = attrs["policy_family_definition_overrides"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Policy. @@ -14960,13 +15440,13 @@ type PolicyFamily_SdkV2 struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Human-readable description of the purpose of the policy family. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Name of the policy family. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Unique identifier for the policy family. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` } func (newState *PolicyFamily_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PolicyFamily_SdkV2) { @@ -14975,9 +15455,13 @@ func (newState *PolicyFamily_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PolicyFamily_SdkV2) SyncEffectiveFieldsDuringRead(existingState PolicyFamily_SdkV2) { } -func (c PolicyFamily_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PolicyFamily_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PolicyFamily. @@ -15021,10 +15505,10 @@ type PythonPyPiLibrary_SdkV2 struct { // The name of the pypi package to install. An optional exact version // specification is also supported. Examples: "simplejson" and // "simplejson==3.8.0". - Package types.String `tfsdk:"package" tf:""` + Package types.String `tfsdk:"package"` // The repository where the package can be found. If not specified, the // default pip index is used. - Repo types.String `tfsdk:"repo" tf:"optional"` + Repo types.String `tfsdk:"repo"` } func (newState *PythonPyPiLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PythonPyPiLibrary_SdkV2) { @@ -15033,10 +15517,11 @@ func (newState *PythonPyPiLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *PythonPyPiLibrary_SdkV2) SyncEffectiveFieldsDuringRead(existingState PythonPyPiLibrary_SdkV2) { } -func (c PythonPyPiLibrary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "package")...) +func (c PythonPyPiLibrary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["package"] = attrs["package"].SetRequired() + attrs["repo"] = attrs["repo"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PythonPyPiLibrary. @@ -15074,10 +15559,10 @@ func (o PythonPyPiLibrary_SdkV2) Type(ctx context.Context) attr.Type { type RCranLibrary_SdkV2 struct { // The name of the CRAN package to install. - Package types.String `tfsdk:"package" tf:""` + Package types.String `tfsdk:"package"` // The repository where the package can be found. If not specified, the // default CRAN repo is used. - Repo types.String `tfsdk:"repo" tf:"optional"` + Repo types.String `tfsdk:"repo"` } func (newState *RCranLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RCranLibrary_SdkV2) { @@ -15086,10 +15571,11 @@ func (newState *RCranLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RCranLibrary_SdkV2) SyncEffectiveFieldsDuringRead(existingState RCranLibrary_SdkV2) { } -func (c RCranLibrary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "package")...) +func (c RCranLibrary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["package"] = attrs["package"].SetRequired() + attrs["repo"] = attrs["repo"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RCranLibrary. @@ -15127,7 +15613,7 @@ func (o RCranLibrary_SdkV2) Type(ctx context.Context) attr.Type { type RemoveInstanceProfile_SdkV2 struct { // The ARN of the instance profile to remove. This field is required. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:""` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` } func (newState *RemoveInstanceProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RemoveInstanceProfile_SdkV2) { @@ -15136,10 +15622,10 @@ func (newState *RemoveInstanceProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *RemoveInstanceProfile_SdkV2) SyncEffectiveFieldsDuringRead(existingState RemoveInstanceProfile_SdkV2) { } -func (c RemoveInstanceProfile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_profile_arn")...) +func (c RemoveInstanceProfile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RemoveInstanceProfile. @@ -15207,9 +15693,9 @@ type ResizeCluster_SdkV2 struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // The cluster to be resized. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -15220,7 +15706,7 @@ type ResizeCluster_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` } func (newState *ResizeCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResizeCluster_SdkV2) { @@ -15229,11 +15715,13 @@ func (newState *ResizeCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ResizeCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResizeCluster_SdkV2) { } -func (c ResizeCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - cs.SetRequired(append(path, "cluster_id")...) +func (c ResizeCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["num_workers"] = attrs["num_workers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResizeCluster. @@ -15310,9 +15798,9 @@ func (newState *ResizeClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ResizeClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResizeClusterResponse_SdkV2) { } -func (c ResizeClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResizeClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResizeClusterResponse. @@ -15344,9 +15832,9 @@ func (o ResizeClusterResponse_SdkV2) Type(ctx context.Context) attr.Type { type RestartCluster_SdkV2 struct { // The cluster to be started. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // - RestartUser types.String `tfsdk:"restart_user" tf:"optional"` + RestartUser types.String `tfsdk:"restart_user"` } func (newState *RestartCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestartCluster_SdkV2) { @@ -15355,10 +15843,11 @@ func (newState *RestartCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RestartCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestartCluster_SdkV2) { } -func (c RestartCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c RestartCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["restart_user"] = attrs["restart_user"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestartCluster. @@ -15403,9 +15892,9 @@ func (newState *RestartClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *RestartClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestartClusterResponse_SdkV2) { } -func (c RestartClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestartClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestartClusterResponse. @@ -15437,26 +15926,26 @@ func (o RestartClusterResponse_SdkV2) Type(ctx context.Context) attr.Type { type Results_SdkV2 struct { // The cause of the error - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` - Data types.Object `tfsdk:"data" tf:"optional"` + Data types.Object `tfsdk:"data"` // The image filename - FileName types.String `tfsdk:"fileName" tf:"optional"` + FileName types.String `tfsdk:"fileName"` - FileNames types.List `tfsdk:"fileNames" tf:"optional"` + FileNames types.List `tfsdk:"fileNames"` // true if a JSON schema is returned instead of a string representation of // the Hive type. - IsJsonSchema types.Bool `tfsdk:"isJsonSchema" tf:"optional"` + IsJsonSchema types.Bool `tfsdk:"isJsonSchema"` // internal field used by SDK - Pos types.Int64 `tfsdk:"pos" tf:"optional"` + Pos types.Int64 `tfsdk:"pos"` - ResultType types.String `tfsdk:"resultType" tf:"optional"` + ResultType types.String `tfsdk:"resultType"` // The table schema - Schema types.List `tfsdk:"schema" tf:"optional"` + Schema types.List `tfsdk:"schema"` // The summary of the error - Summary types.String `tfsdk:"summary" tf:"optional"` + Summary types.String `tfsdk:"summary"` // true if partial results are returned. - Truncated types.Bool `tfsdk:"truncated" tf:"optional"` + Truncated types.Bool `tfsdk:"truncated"` } func (newState *Results_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Results_SdkV2) { @@ -15465,9 +15954,19 @@ func (newState *Results_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Resu func (newState *Results_SdkV2) SyncEffectiveFieldsDuringRead(existingState Results_SdkV2) { } -func (c Results_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Results_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() + attrs["fileName"] = attrs["fileName"].SetOptional() + attrs["fileNames"] = attrs["fileNames"].SetOptional() + attrs["isJsonSchema"] = attrs["isJsonSchema"].SetOptional() + attrs["pos"] = attrs["pos"].SetOptional() + attrs["resultType"] = attrs["resultType"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["summary"] = attrs["summary"].SetOptional() + attrs["truncated"] = attrs["truncated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Results. @@ -15590,27 +16089,27 @@ type S3StorageInfo_SdkV2 struct { // controls. If you are using cross account role for writing data, you may // want to set `bucket-owner-full-control` to make bucket owner able to read // the logs. - CannedAcl types.String `tfsdk:"canned_acl" tf:"optional"` + CannedAcl types.String `tfsdk:"canned_acl"` // S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be // delivered using cluster iam role, please make sure you set cluster iam // role and the role has write access to the destination. Please also note // that you cannot use AWS keys to deliver logs. - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` // (Optional) Flag to enable server side encryption, `false` by default. - EnableEncryption types.Bool `tfsdk:"enable_encryption" tf:"optional"` + EnableEncryption types.Bool `tfsdk:"enable_encryption"` // (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It // will be used only when encryption is enabled and the default type is // `sse-s3`. - EncryptionType types.String `tfsdk:"encryption_type" tf:"optional"` + EncryptionType types.String `tfsdk:"encryption_type"` // S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or // endpoint needs to be set. If both are set, endpoint will be used. - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` // (Optional) Kms key which will be used if encryption is enabled and // encryption type is set to `sse-kms`. - KmsKey types.String `tfsdk:"kms_key" tf:"optional"` + KmsKey types.String `tfsdk:"kms_key"` // S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. // If both are set, endpoint will be used. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *S3StorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S3StorageInfo_SdkV2) { @@ -15619,10 +16118,16 @@ func (newState *S3StorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *S3StorageInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState S3StorageInfo_SdkV2) { } -func (c S3StorageInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c S3StorageInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["canned_acl"] = attrs["canned_acl"].SetOptional() + attrs["destination"] = attrs["destination"].SetRequired() + attrs["enable_encryption"] = attrs["enable_encryption"].SetOptional() + attrs["encryption_type"] = attrs["encryption_type"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["kms_key"] = attrs["kms_key"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in S3StorageInfo. @@ -15670,30 +16175,30 @@ func (o S3StorageInfo_SdkV2) Type(ctx context.Context) attr.Type { type SparkNode_SdkV2 struct { // The private IP address of the host instance. - HostPrivateIp types.String `tfsdk:"host_private_ip" tf:"optional"` + HostPrivateIp types.String `tfsdk:"host_private_ip"` // Globally unique identifier for the host instance from the cloud provider. - InstanceId types.String `tfsdk:"instance_id" tf:"optional"` + InstanceId types.String `tfsdk:"instance_id"` // Attributes specific to AWS for a Spark node. - NodeAwsAttributes types.List `tfsdk:"node_aws_attributes" tf:"optional,object"` + NodeAwsAttributes types.List `tfsdk:"node_aws_attributes"` // Globally unique identifier for this node. - NodeId types.String `tfsdk:"node_id" tf:"optional"` + NodeId types.String `tfsdk:"node_id"` // Private IP address (typically a 10.x.x.x address) of the Spark node. Note // that this is different from the private IP address of the host instance. - PrivateIp types.String `tfsdk:"private_ip" tf:"optional"` + PrivateIp types.String `tfsdk:"private_ip"` // Public DNS address of this node. This address can be used to access the // Spark JDBC server on the driver node. To communicate with the JDBC // server, traffic must be manually authorized by adding security group // rules to the "worker-unmanaged" security group via the AWS console. // // Actually it's the public DNS address of the host instance. - PublicDns types.String `tfsdk:"public_dns" tf:"optional"` + PublicDns types.String `tfsdk:"public_dns"` // The timestamp (in millisecond) when the Spark node is launched. // // The start_timestamp is set right before the container is being launched. // The timestamp when the container is placed on the ResourceManager, before // its launch and setup by the NodeDaemon. This timestamp is the same as the // creation timestamp in the database. - StartTimestamp types.Int64 `tfsdk:"start_timestamp" tf:"optional"` + StartTimestamp types.Int64 `tfsdk:"start_timestamp"` } func (newState *SparkNode_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkNode_SdkV2) { @@ -15702,10 +16207,17 @@ func (newState *SparkNode_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sp func (newState *SparkNode_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparkNode_SdkV2) { } -func (c SparkNode_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparkNodeAwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "node_aws_attributes")...) +func (c SparkNode_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["host_private_ip"] = attrs["host_private_ip"].SetOptional() + attrs["instance_id"] = attrs["instance_id"].SetOptional() + attrs["node_aws_attributes"] = attrs["node_aws_attributes"].SetOptional() + attrs["node_aws_attributes"] = attrs["node_aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["node_id"] = attrs["node_id"].SetOptional() + attrs["private_ip"] = attrs["private_ip"].SetOptional() + attrs["public_dns"] = attrs["public_dns"].SetOptional() + attrs["start_timestamp"] = attrs["start_timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkNode. @@ -15783,7 +16295,7 @@ func (o *SparkNode_SdkV2) SetNodeAwsAttributes(ctx context.Context, v SparkNodeA type SparkNodeAwsAttributes_SdkV2 struct { // Whether this node is on an Amazon spot instance. - IsSpot types.Bool `tfsdk:"is_spot" tf:"optional"` + IsSpot types.Bool `tfsdk:"is_spot"` } func (newState *SparkNodeAwsAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkNodeAwsAttributes_SdkV2) { @@ -15792,9 +16304,10 @@ func (newState *SparkNodeAwsAttributes_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *SparkNodeAwsAttributes_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparkNodeAwsAttributes_SdkV2) { } -func (c SparkNodeAwsAttributes_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkNodeAwsAttributes_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_spot"] = attrs["is_spot"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkNodeAwsAttributes. @@ -15834,9 +16347,9 @@ type SparkVersion_SdkV2 struct { // Note that the exact Spark version may change over time for a "wildcard" // version (i.e., "2.1.x-scala2.11" is a "wildcard" version) with minor bug // fixes. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // A descriptive name for this Spark version, for example "Spark 2.1". - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *SparkVersion_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkVersion_SdkV2) { @@ -15845,9 +16358,11 @@ func (newState *SparkVersion_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SparkVersion_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparkVersion_SdkV2) { } -func (c SparkVersion_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkVersion_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkVersion. @@ -15885,7 +16400,7 @@ func (o SparkVersion_SdkV2) Type(ctx context.Context) attr.Type { type StartCluster_SdkV2 struct { // The cluster to be started. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *StartCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartCluster_SdkV2) { @@ -15894,10 +16409,10 @@ func (newState *StartCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *StartCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState StartCluster_SdkV2) { } -func (c StartCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c StartCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartCluster. @@ -15940,9 +16455,9 @@ func (newState *StartClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *StartClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState StartClusterResponse_SdkV2) { } -func (c StartClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StartClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartClusterResponse. @@ -15974,12 +16489,12 @@ func (o StartClusterResponse_SdkV2) Type(ctx context.Context) attr.Type { type TerminationReason_SdkV2 struct { // status code indicating why the cluster was terminated - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // list of parameters that provide additional information about why the // cluster was terminated - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` // type of the termination - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *TerminationReason_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TerminationReason_SdkV2) { @@ -15988,9 +16503,12 @@ func (newState *TerminationReason_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *TerminationReason_SdkV2) SyncEffectiveFieldsDuringRead(existingState TerminationReason_SdkV2) { } -func (c TerminationReason_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TerminationReason_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TerminationReason. @@ -16060,9 +16578,9 @@ func (o *TerminationReason_SdkV2) SetParameters(ctx context.Context, v map[strin type UninstallLibraries_SdkV2 struct { // Unique identifier for the cluster on which to uninstall these libraries. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The libraries to uninstall. - Libraries types.List `tfsdk:"libraries" tf:""` + Libraries types.List `tfsdk:"libraries"` } func (newState *UninstallLibraries_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UninstallLibraries_SdkV2) { @@ -16071,12 +16589,11 @@ func (newState *UninstallLibraries_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UninstallLibraries_SdkV2) SyncEffectiveFieldsDuringRead(existingState UninstallLibraries_SdkV2) { } -func (c UninstallLibraries_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "libraries")...) - Library_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c UninstallLibraries_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["libraries"] = attrs["libraries"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UninstallLibraries. @@ -16151,9 +16668,9 @@ func (newState *UninstallLibrariesResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UninstallLibrariesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UninstallLibrariesResponse_SdkV2) { } -func (c UninstallLibrariesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UninstallLibrariesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UninstallLibrariesResponse. @@ -16185,7 +16702,7 @@ func (o UninstallLibrariesResponse_SdkV2) Type(ctx context.Context) attr.Type { type UnpinCluster_SdkV2 struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *UnpinCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UnpinCluster_SdkV2) { @@ -16194,10 +16711,10 @@ func (newState *UnpinCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UnpinCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState UnpinCluster_SdkV2) { } -func (c UnpinCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c UnpinCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UnpinCluster. @@ -16240,9 +16757,9 @@ func (newState *UnpinClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UnpinClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UnpinClusterResponse_SdkV2) { } -func (c UnpinClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UnpinClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UnpinClusterResponse. @@ -16274,15 +16791,15 @@ func (o UnpinClusterResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateCluster_SdkV2 struct { // The cluster to be updated. - Cluster types.List `tfsdk:"cluster" tf:"optional,object"` + Cluster types.List `tfsdk:"cluster"` // ID of the cluster. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // Specifies which fields of the cluster will be updated. This is required // in the POST request. The update mask should be supplied as a single // string. To specify multiple fields, separate them with commas (no // spaces). To delete a field from a cluster configuration, add it to the // `update_mask` string but omit it from the `cluster` object. - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` } func (newState *UpdateCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCluster_SdkV2) { @@ -16291,12 +16808,13 @@ func (newState *UpdateCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *UpdateCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCluster_SdkV2) { } -func (c UpdateCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateClusterResource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster")...) - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "update_mask")...) +func (c UpdateCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster"] = attrs["cluster"].SetOptional() + attrs["cluster"] = attrs["cluster"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["update_mask"] = attrs["update_mask"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCluster. @@ -16368,29 +16886,29 @@ type UpdateClusterResource_SdkV2 struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -16399,7 +16917,7 @@ type UpdateClusterResource_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -16429,39 +16947,39 @@ type UpdateClusterResource_SdkV2 struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.List `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.List `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -16469,13 +16987,13 @@ type UpdateClusterResource_SdkV2 struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -16486,9 +17004,9 @@ type UpdateClusterResource_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -16497,15 +17015,15 @@ type UpdateClusterResource_SdkV2 struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -16519,23 +17037,23 @@ type UpdateClusterResource_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:"optional"` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.List `tfsdk:"workload_type"` } func (newState *UpdateClusterResource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateClusterResource_SdkV2) { @@ -16544,17 +17062,45 @@ func (newState *UpdateClusterResource_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateClusterResource_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateClusterResource_SdkV2) { } -func (c UpdateClusterResource_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - WorkloadType_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c UpdateClusterResource_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateClusterResource. @@ -17002,9 +17548,9 @@ func (newState *UpdateClusterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateClusterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateClusterResponse_SdkV2) { } -func (c UpdateClusterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateClusterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateClusterResponse. @@ -17066,7 +17612,7 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type VolumesStorageInfo_SdkV2 struct { // Unity Catalog Volumes file destination, e.g. `/Volumes/my-init.sh` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *VolumesStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan VolumesStorageInfo_SdkV2) { @@ -17075,10 +17621,10 @@ func (newState *VolumesStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *VolumesStorageInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState VolumesStorageInfo_SdkV2) { } -func (c VolumesStorageInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c VolumesStorageInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VolumesStorageInfo. @@ -17114,7 +17660,7 @@ func (o VolumesStorageInfo_SdkV2) Type(ctx context.Context) attr.Type { type WorkloadType_SdkV2 struct { // defined what type of clients can use the cluster. E.g. Notebooks, Jobs - Clients types.List `tfsdk:"clients" tf:"object"` + Clients types.List `tfsdk:"clients"` } func (newState *WorkloadType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkloadType_SdkV2) { @@ -17123,11 +17669,11 @@ func (newState *WorkloadType_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *WorkloadType_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkloadType_SdkV2) { } -func (c WorkloadType_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "clients")...) - ClientsTypes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clients")...) +func (c WorkloadType_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clients"] = attrs["clients"].SetRequired() + attrs["clients"] = attrs["clients"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkloadType. @@ -17194,7 +17740,7 @@ func (o *WorkloadType_SdkV2) SetClients(ctx context.Context, v ClientsTypes_SdkV type WorkspaceStorageInfo_SdkV2 struct { // workspace files destination, e.g. // `/Users/user1@databricks.com/my-init.sh` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *WorkspaceStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceStorageInfo_SdkV2) { @@ -17203,10 +17749,10 @@ func (newState *WorkspaceStorageInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *WorkspaceStorageInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceStorageInfo_SdkV2) { } -func (c WorkspaceStorageInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c WorkspaceStorageInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceStorageInfo. diff --git a/internal/service/compute_tf/model.go b/internal/service/compute_tf/model.go index af9c0b136..c00ed0c27 100755 --- a/internal/service/compute_tf/model.go +++ b/internal/service/compute_tf/model.go @@ -31,16 +31,16 @@ type AddInstanceProfile struct { // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html - IamRoleArn types.String `tfsdk:"iam_role_arn" tf:"optional"` + IamRoleArn types.String `tfsdk:"iam_role_arn"` // The AWS ARN of the instance profile to register with Databricks. This // field is required. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:""` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Boolean flag indicating whether the instance profile should only be used // in credential passthrough scenarios. If true, it means the instance // profile contains an meta IAM role which could assume a wide range of // roles. Therefore it should always be used with authorization. This field // is optional, the default value is `false`. - IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile" tf:"optional"` + IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile"` // By default, Databricks validates that it has sufficient permissions to // launch instances with the instance profile. This validation uses AWS // dry-run mode for the RunInstances API. If validation fails with an error @@ -48,7 +48,7 @@ type AddInstanceProfile struct { // “Your requested instance type is not supported in your requested // availability zone”), you can pass this flag to skip the validation and // forcibly add the instance profile. - SkipValidation types.Bool `tfsdk:"skip_validation" tf:"optional"` + SkipValidation types.Bool `tfsdk:"skip_validation"` } func (newState *AddInstanceProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddInstanceProfile) { @@ -57,10 +57,13 @@ func (newState *AddInstanceProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AddInstanceProfile) SyncEffectiveFieldsDuringRead(existingState AddInstanceProfile) { } -func (c AddInstanceProfile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_profile_arn")...) +func (c AddInstanceProfile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["iam_role_arn"] = attrs["iam_role_arn"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetRequired() + attrs["is_meta_instance_profile"] = attrs["is_meta_instance_profile"].SetOptional() + attrs["skip_validation"] = attrs["skip_validation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddInstanceProfile. @@ -133,7 +136,7 @@ func (o AddResponse) Type(ctx context.Context) attr.Type { type Adlsgen2Info struct { // abfss destination, e.g. // `abfss://@.dfs.core.windows.net/`. - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *Adlsgen2Info) SyncEffectiveFieldsDuringCreateOrUpdate(plan Adlsgen2Info) { @@ -142,10 +145,10 @@ func (newState *Adlsgen2Info) SyncEffectiveFieldsDuringCreateOrUpdate(plan Adlsg func (newState *Adlsgen2Info) SyncEffectiveFieldsDuringRead(existingState Adlsgen2Info) { } -func (c Adlsgen2Info) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c Adlsgen2Info) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Adlsgen2Info. @@ -183,11 +186,11 @@ type AutoScale struct { // The maximum number of workers to which the cluster can scale up when // overloaded. Note that `max_workers` must be strictly greater than // `min_workers`. - MaxWorkers types.Int64 `tfsdk:"max_workers" tf:"optional"` + MaxWorkers types.Int64 `tfsdk:"max_workers"` // The minimum number of workers to which the cluster can scale down when // underutilized. It is also the initial number of workers the cluster will // have after creation. - MinWorkers types.Int64 `tfsdk:"min_workers" tf:"optional"` + MinWorkers types.Int64 `tfsdk:"min_workers"` } func (newState *AutoScale) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoScale) { @@ -196,9 +199,11 @@ func (newState *AutoScale) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoScal func (newState *AutoScale) SyncEffectiveFieldsDuringRead(existingState AutoScale) { } -func (c AutoScale) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AutoScale) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["max_workers"] = attrs["max_workers"].SetOptional() + attrs["min_workers"] = attrs["min_workers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoScale. @@ -240,7 +245,7 @@ type AwsAttributes struct { // // Note: If `first_on_demand` is zero, this availability type will be used // for the entire cluster. - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // The number of volumes launched for each instance. Users can choose up to // 10 volumes. This feature is only enabled for supported node types. Legacy // node types cannot specify custom EBS volumes. For node types with no @@ -257,21 +262,21 @@ type AwsAttributes struct { // // Please note that if EBS volumes are specified, then the Spark // configuration `spark.local.dir` will be overridden. - EbsVolumeCount types.Int64 `tfsdk:"ebs_volume_count" tf:"optional"` + EbsVolumeCount types.Int64 `tfsdk:"ebs_volume_count"` // If using gp3 volumes, what IOPS to use for the disk. If this is not set, // the maximum performance of a gp2 volume with the same volume size will be // used. - EbsVolumeIops types.Int64 `tfsdk:"ebs_volume_iops" tf:"optional"` + EbsVolumeIops types.Int64 `tfsdk:"ebs_volume_iops"` // The size of each EBS volume (in GiB) launched for each instance. For // general purpose SSD, this value must be within the range 100 - 4096. For // throughput optimized HDD, this value must be within the range 500 - 4096. - EbsVolumeSize types.Int64 `tfsdk:"ebs_volume_size" tf:"optional"` + EbsVolumeSize types.Int64 `tfsdk:"ebs_volume_size"` // If using gp3 volumes, what throughput to use for the disk. If this is not // set, the maximum performance of a gp2 volume with the same volume size // will be used. - EbsVolumeThroughput types.Int64 `tfsdk:"ebs_volume_throughput" tf:"optional"` + EbsVolumeThroughput types.Int64 `tfsdk:"ebs_volume_throughput"` // The type of EBS volumes that will be launched with this cluster. - EbsVolumeType types.String `tfsdk:"ebs_volume_type" tf:"optional"` + EbsVolumeType types.String `tfsdk:"ebs_volume_type"` // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. If this value is greater than 0, the cluster driver // node in particular will be placed on an on-demand instance. If this value @@ -281,7 +286,7 @@ type AwsAttributes struct { // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. - FirstOnDemand types.Int64 `tfsdk:"first_on_demand" tf:"optional"` + FirstOnDemand types.Int64 `tfsdk:"first_on_demand"` // Nodes for this cluster will only be placed on AWS instances with this // instance profile. If ommitted, nodes will be placed on instances without // an IAM instance profile. The instance profile must have previously been @@ -291,7 +296,7 @@ type AwsAttributes struct { // // If this field is ommitted, we will pull in the default from the conf if // it exists. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then @@ -306,7 +311,7 @@ type AwsAttributes struct { // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidPricePercent and // CommonConf.maxSpotBidPricePercent. - SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent" tf:"optional"` + SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks @@ -317,7 +322,7 @@ type AwsAttributes struct { // in a zone with high availability, and will retry placement in a different // AZ if there is not enough capacity. The list of available zones as well // as the default value can be found by using the `List Zones` method. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *AwsAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsAttributes) { @@ -326,9 +331,19 @@ func (newState *AwsAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsA func (newState *AwsAttributes) SyncEffectiveFieldsDuringRead(existingState AwsAttributes) { } -func (c AwsAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AwsAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["ebs_volume_count"] = attrs["ebs_volume_count"].SetOptional() + attrs["ebs_volume_iops"] = attrs["ebs_volume_iops"].SetOptional() + attrs["ebs_volume_size"] = attrs["ebs_volume_size"].SetOptional() + attrs["ebs_volume_throughput"] = attrs["ebs_volume_throughput"].SetOptional() + attrs["ebs_volume_type"] = attrs["ebs_volume_type"].SetOptional() + attrs["first_on_demand"] = attrs["first_on_demand"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["spot_bid_price_percent"] = attrs["spot_bid_price_percent"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsAttributes. @@ -385,7 +400,7 @@ type AzureAttributes struct { // `first_on_demand` ones. Note: If `first_on_demand` is zero (which only // happens on pool clusters), this availability type will be used for the // entire cluster. - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // The first `first_on_demand` nodes of the cluster will be placed on // on-demand instances. This value should be greater than 0, to make sure // the cluster driver node is placed on an on-demand instance. If this value @@ -395,15 +410,15 @@ type AzureAttributes struct { // instances and the remainder will be placed on `availability` instances. // Note that this value does not affect cluster size and cannot currently be // mutated over the lifetime of a cluster. - FirstOnDemand types.Int64 `tfsdk:"first_on_demand" tf:"optional"` + FirstOnDemand types.Int64 `tfsdk:"first_on_demand"` // Defines values necessary to configure and run Azure Log Analytics agent - LogAnalyticsInfo types.Object `tfsdk:"log_analytics_info" tf:"optional,object"` + LogAnalyticsInfo types.Object `tfsdk:"log_analytics_info"` // The max bid price to be used for Azure spot instances. The Max price for // the bid cannot be higher than the on-demand price of the instance. If not // specified, the default value is -1, which specifies that the instance // cannot be evicted on the basis of price, and only on the basis of // availability. Further, the value should > 0 or -1. - SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price" tf:"optional"` + SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price"` } func (newState *AzureAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureAttributes) { @@ -412,10 +427,13 @@ func (newState *AzureAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan Az func (newState *AzureAttributes) SyncEffectiveFieldsDuringRead(existingState AzureAttributes) { } -func (c AzureAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LogAnalyticsInfo{}.ApplySchemaCustomizations(cs, append(path, "log_analytics_info")...) +func (c AzureAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["first_on_demand"] = attrs["first_on_demand"].SetOptional() + attrs["log_analytics_info"] = attrs["log_analytics_info"].SetOptional() + attrs["spot_bid_max_price"] = attrs["spot_bid_max_price"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureAttributes. @@ -486,11 +504,11 @@ func (o *AzureAttributes) SetLogAnalyticsInfo(ctx context.Context, v LogAnalytic } type CancelCommand struct { - ClusterId types.String `tfsdk:"clusterId" tf:"optional"` + ClusterId types.String `tfsdk:"clusterId"` - CommandId types.String `tfsdk:"commandId" tf:"optional"` + CommandId types.String `tfsdk:"commandId"` - ContextId types.String `tfsdk:"contextId" tf:"optional"` + ContextId types.String `tfsdk:"contextId"` } func (newState *CancelCommand) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelCommand) { @@ -499,9 +517,12 @@ func (newState *CancelCommand) SyncEffectiveFieldsDuringCreateOrUpdate(plan Canc func (newState *CancelCommand) SyncEffectiveFieldsDuringRead(existingState CancelCommand) { } -func (c CancelCommand) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CancelCommand) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetOptional() + attrs["commandId"] = attrs["commandId"].SetOptional() + attrs["contextId"] = attrs["contextId"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CancelCommand. @@ -571,9 +592,9 @@ func (o CancelResponse) Type(ctx context.Context) attr.Type { type ChangeClusterOwner struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // New owner of the cluster_id after this RPC. - OwnerUsername types.String `tfsdk:"owner_username" tf:""` + OwnerUsername types.String `tfsdk:"owner_username"` } func (newState *ChangeClusterOwner) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChangeClusterOwner) { @@ -582,11 +603,11 @@ func (newState *ChangeClusterOwner) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ChangeClusterOwner) SyncEffectiveFieldsDuringRead(existingState ChangeClusterOwner) { } -func (c ChangeClusterOwner) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "owner_username")...) +func (c ChangeClusterOwner) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["owner_username"] = attrs["owner_username"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChangeClusterOwner. @@ -631,9 +652,9 @@ func (newState *ChangeClusterOwnerResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ChangeClusterOwnerResponse) SyncEffectiveFieldsDuringRead(existingState ChangeClusterOwnerResponse) { } -func (c ChangeClusterOwnerResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ChangeClusterOwnerResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChangeClusterOwnerResponse. @@ -665,9 +686,9 @@ func (o ChangeClusterOwnerResponse) Type(ctx context.Context) attr.Type { type ClientsTypes struct { // With jobs set, the cluster can be used for jobs - Jobs types.Bool `tfsdk:"jobs" tf:"optional"` + Jobs types.Bool `tfsdk:"jobs"` // With notebooks set, this cluster can be used for notebooks - Notebooks types.Bool `tfsdk:"notebooks" tf:"optional"` + Notebooks types.Bool `tfsdk:"notebooks"` } func (newState *ClientsTypes) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClientsTypes) { @@ -676,9 +697,11 @@ func (newState *ClientsTypes) SyncEffectiveFieldsDuringCreateOrUpdate(plan Clien func (newState *ClientsTypes) SyncEffectiveFieldsDuringRead(existingState ClientsTypes) { } -func (c ClientsTypes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClientsTypes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["jobs"] = attrs["jobs"].SetOptional() + attrs["notebooks"] = attrs["notebooks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClientsTypes. @@ -716,7 +739,7 @@ func (o ClientsTypes) Type(ctx context.Context) attr.Type { type CloneCluster struct { // The cluster that is being cloned. - SourceClusterId types.String `tfsdk:"source_cluster_id" tf:""` + SourceClusterId types.String `tfsdk:"source_cluster_id"` } func (newState *CloneCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloneCluster) { @@ -725,10 +748,10 @@ func (newState *CloneCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Clone func (newState *CloneCluster) SyncEffectiveFieldsDuringRead(existingState CloneCluster) { } -func (c CloneCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "source_cluster_id")...) +func (c CloneCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["source_cluster_id"] = attrs["source_cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloneCluster. @@ -763,7 +786,7 @@ func (o CloneCluster) Type(ctx context.Context) attr.Type { } type CloudProviderNodeInfo struct { - Status types.List `tfsdk:"status" tf:"optional"` + Status types.List `tfsdk:"status"` } func (newState *CloudProviderNodeInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloudProviderNodeInfo) { @@ -772,9 +795,10 @@ func (newState *CloudProviderNodeInfo) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CloudProviderNodeInfo) SyncEffectiveFieldsDuringRead(existingState CloudProviderNodeInfo) { } -func (c CloudProviderNodeInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CloudProviderNodeInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloudProviderNodeInfo. @@ -840,13 +864,13 @@ func (o *CloudProviderNodeInfo) SetStatus(ctx context.Context, v []types.String) type ClusterAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAccessControlRequest) { @@ -855,9 +879,13 @@ func (newState *ClusterAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUp func (newState *ClusterAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState ClusterAccessControlRequest) { } -func (c ClusterAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAccessControlRequest. @@ -899,15 +927,15 @@ func (o ClusterAccessControlRequest) Type(ctx context.Context) attr.Type { type ClusterAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAccessControlResponse) { @@ -916,10 +944,14 @@ func (newState *ClusterAccessControlResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *ClusterAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState ClusterAccessControlResponse) { } -func (c ClusterAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ClusterAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAccessControlResponse. @@ -997,23 +1029,23 @@ type ClusterAttributes struct { // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -1022,7 +1054,7 @@ type ClusterAttributes struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -1052,39 +1084,39 @@ type ClusterAttributes struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.Object `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.Object `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -1092,15 +1124,15 @@ type ClusterAttributes struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -1109,15 +1141,15 @@ type ClusterAttributes struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1131,23 +1163,23 @@ type ClusterAttributes struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:""` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.Object `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.Object `tfsdk:"workload_type"` } func (newState *ClusterAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAttributes) { @@ -1156,17 +1188,36 @@ func (newState *ClusterAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterAttributes) SyncEffectiveFieldsDuringRead(existingState ClusterAttributes) { } -func (c ClusterAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - cs.SetRequired(append(path, "spark_version")...) - WorkloadType{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c ClusterAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetRequired() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAttributes. @@ -1574,15 +1625,15 @@ func (o *ClusterAttributes) SetWorkloadType(ctx context.Context, v WorkloadType) type ClusterCompliance struct { // Canonical unique identifier for a cluster. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // Whether this cluster is in compliance with the latest version of its // policy. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. The values indicate an error message describing the // policy validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *ClusterCompliance) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterCompliance) { @@ -1591,10 +1642,12 @@ func (newState *ClusterCompliance) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterCompliance) SyncEffectiveFieldsDuringRead(existingState ClusterCompliance) { } -func (c ClusterCompliance) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c ClusterCompliance) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterCompliance. @@ -1666,47 +1719,47 @@ type ClusterDetails struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // Number of CPU cores available for this cluster. Note that this can be // fractional, e.g. 7.5 cores, since certain node types are configured to // share cores between Spark nodes on the same instance. - ClusterCores types.Float64 `tfsdk:"cluster_cores" tf:"optional"` + ClusterCores types.Float64 `tfsdk:"cluster_cores"` // Canonical identifier for the cluster. This id is retained during cluster // restarts and resizes, while each new cluster has a globally unique id. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Cluster log delivery status. - ClusterLogStatus types.Object `tfsdk:"cluster_log_status" tf:"optional,object"` + ClusterLogStatus types.Object `tfsdk:"cluster_log_status"` // Total amount of cluster memory, in megabytes - ClusterMemoryMb types.Int64 `tfsdk:"cluster_memory_mb" tf:"optional"` + ClusterMemoryMb types.Int64 `tfsdk:"cluster_memory_mb"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Determines whether the cluster was created by a user through the UI, // created by the Databricks Jobs Scheduler, or through an API request. This // is the same as cluster_creator, but read only. - ClusterSource types.String `tfsdk:"cluster_source" tf:"optional"` + ClusterSource types.String `tfsdk:"cluster_source"` // Creator user name. The field won't be included in the response if the // user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -1715,7 +1768,7 @@ type ClusterDetails struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -1745,7 +1798,7 @@ type ClusterDetails struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -1758,48 +1811,48 @@ type ClusterDetails struct { // - ClusterId: // // - Name: - DefaultTags types.Map `tfsdk:"default_tags" tf:"optional"` + DefaultTags types.Map `tfsdk:"default_tags"` - DockerImage types.Object `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.Object `tfsdk:"docker_image"` // Node on which the Spark driver resides. The driver node contains the // Spark master and the Databricks application that manages the per-notebook // Spark REPLs. - Driver types.Object `tfsdk:"driver" tf:"optional,object"` + Driver types.Object `tfsdk:"driver"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Nodes on which the Spark executors reside. - Executors types.List `tfsdk:"executors" tf:"optional"` + Executors types.List `tfsdk:"executors"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // Port on which Spark JDBC server is listening, in the driver nod. No // service will be listeningon on this port in executor nodes. - JdbcPort types.Int64 `tfsdk:"jdbc_port" tf:"optional"` + JdbcPort types.Int64 `tfsdk:"jdbc_port"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -1807,18 +1860,18 @@ type ClusterDetails struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // the timestamp that the cluster was started/restarted - LastRestartedTime types.Int64 `tfsdk:"last_restarted_time" tf:"optional"` + LastRestartedTime types.Int64 `tfsdk:"last_restarted_time"` // Time when the cluster driver last lost its state (due to a restart or // driver failure). - LastStateLossTime types.Int64 `tfsdk:"last_state_loss_time" tf:"optional"` + LastStateLossTime types.Int64 `tfsdk:"last_state_loss_time"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -1829,9 +1882,9 @@ type ClusterDetails struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -1840,19 +1893,19 @@ type ClusterDetails struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // A canonical SparkContext identifier. This value *does* change when the // Spark driver restarts. The pair `(cluster_id, spark_context_id)` is a // globally unique identifier over all Spark contexts. - SparkContextId types.Int64 `tfsdk:"spark_context_id" tf:"optional"` + SparkContextId types.Int64 `tfsdk:"spark_context_id"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -1866,42 +1919,42 @@ type ClusterDetails struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:"optional"` + SparkVersion types.String `tfsdk:"spark_version"` // `spec` contains a snapshot of the field values that were used to create // or edit this cluster. The contents of `spec` can be used in the body of a // create cluster request. This field might not be populated for older // clusters. Note: not included in the response of the ListClusters API. - Spec types.Object `tfsdk:"spec" tf:"optional,object"` + Spec types.Object `tfsdk:"spec"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // Time (in epoch milliseconds) when the cluster creation request was // received (when the cluster entered a `PENDING` state). - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Current state of the cluster. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // A message associated with the most recent state transition (e.g., the // reason why the cluster entered a `TERMINATED` state). - StateMessage types.String `tfsdk:"state_message" tf:"optional"` + StateMessage types.String `tfsdk:"state_message"` // Time (in epoch milliseconds) when the cluster was terminated, if // applicable. - TerminatedTime types.Int64 `tfsdk:"terminated_time" tf:"optional"` + TerminatedTime types.Int64 `tfsdk:"terminated_time"` // Information about why the cluster was terminated. This field only appears // when the cluster is in a `TERMINATING` or `TERMINATED` state. - TerminationReason types.Object `tfsdk:"termination_reason" tf:"optional,object"` + TerminationReason types.Object `tfsdk:"termination_reason"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.Object `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.Object `tfsdk:"workload_type"` } func (newState *ClusterDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterDetails) { @@ -1910,22 +1963,57 @@ func (newState *ClusterDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan Clu func (newState *ClusterDetails) SyncEffectiveFieldsDuringRead(existingState ClusterDetails) { } -func (c ClusterDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - LogSyncStatus{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_status")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - SparkNode{}.ApplySchemaCustomizations(cs, append(path, "driver")...) - SparkNode{}.ApplySchemaCustomizations(cs, append(path, "executors")...) - GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "spec")...) - TerminationReason{}.ApplySchemaCustomizations(cs, append(path, "termination_reason")...) - WorkloadType{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c ClusterDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["cluster_cores"] = attrs["cluster_cores"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_status"] = attrs["cluster_log_status"].SetOptional() + attrs["cluster_memory_mb"] = attrs["cluster_memory_mb"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["cluster_source"] = attrs["cluster_source"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["default_tags"] = attrs["default_tags"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["driver"] = attrs["driver"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["executors"] = attrs["executors"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["jdbc_port"] = attrs["jdbc_port"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["last_restarted_time"] = attrs["last_restarted_time"].SetOptional() + attrs["last_state_loss_time"] = attrs["last_state_loss_time"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_context_id"] = attrs["spark_context_id"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetOptional() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state_message"] = attrs["state_message"].SetOptional() + attrs["terminated_time"] = attrs["terminated_time"].SetOptional() + attrs["termination_reason"] = attrs["termination_reason"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterDetails. @@ -2578,17 +2666,17 @@ func (o *ClusterDetails) SetWorkloadType(ctx context.Context, v WorkloadType) { type ClusterEvent struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // - DataPlaneEventDetails types.Object `tfsdk:"data_plane_event_details" tf:"optional,object"` + DataPlaneEventDetails types.Object `tfsdk:"data_plane_event_details"` // - Details types.Object `tfsdk:"details" tf:"optional,object"` + Details types.Object `tfsdk:"details"` // The timestamp when the event occurred, stored as the number of // milliseconds since the Unix epoch. If not provided, this will be assigned // by the Timeline service. - Timestamp types.Int64 `tfsdk:"timestamp" tf:"optional"` + Timestamp types.Int64 `tfsdk:"timestamp"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *ClusterEvent) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterEvent) { @@ -2597,12 +2685,14 @@ func (newState *ClusterEvent) SyncEffectiveFieldsDuringCreateOrUpdate(plan Clust func (newState *ClusterEvent) SyncEffectiveFieldsDuringRead(existingState ClusterEvent) { } -func (c ClusterEvent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - DataPlaneEventDetails{}.ApplySchemaCustomizations(cs, append(path, "data_plane_event_details")...) - EventDetails{}.ApplySchemaCustomizations(cs, append(path, "details")...) +func (c ClusterEvent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["data_plane_event_details"] = attrs["data_plane_event_details"].SetOptional() + attrs["details"] = attrs["details"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterEvent. @@ -2705,9 +2795,9 @@ func (o *ClusterEvent) SetDetails(ctx context.Context, v EventDetails) { type ClusterLibraryStatuses struct { // Unique identifier for the cluster. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // Status of all libraries on the cluster. - LibraryStatuses types.List `tfsdk:"library_statuses" tf:"optional"` + LibraryStatuses types.List `tfsdk:"library_statuses"` } func (newState *ClusterLibraryStatuses) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterLibraryStatuses) { @@ -2716,10 +2806,11 @@ func (newState *ClusterLibraryStatuses) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ClusterLibraryStatuses) SyncEffectiveFieldsDuringRead(existingState ClusterLibraryStatuses) { } -func (c ClusterLibraryStatuses) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LibraryFullStatus{}.ApplySchemaCustomizations(cs, append(path, "library_statuses")...) +func (c ClusterLibraryStatuses) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["library_statuses"] = attrs["library_statuses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterLibraryStatuses. @@ -2788,13 +2879,13 @@ func (o *ClusterLibraryStatuses) SetLibraryStatuses(ctx context.Context, v []Lib type ClusterLogConf struct { // destination needs to be provided. e.g. `{ "dbfs" : { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs types.Object `tfsdk:"dbfs" tf:"optional,object"` + Dbfs types.Object `tfsdk:"dbfs"` // destination and either the region or endpoint need to be provided. e.g. // `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : // "us-west-2" } }` Cluster iam role is used to access s3, please make sure // the cluster iam role in `instance_profile_arn` has permission to write // data to the s3 destination. - S3 types.Object `tfsdk:"s3" tf:"optional,object"` + S3 types.Object `tfsdk:"s3"` } func (newState *ClusterLogConf) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterLogConf) { @@ -2803,11 +2894,11 @@ func (newState *ClusterLogConf) SyncEffectiveFieldsDuringCreateOrUpdate(plan Clu func (newState *ClusterLogConf) SyncEffectiveFieldsDuringRead(existingState ClusterLogConf) { } -func (c ClusterLogConf) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DbfsStorageInfo{}.ApplySchemaCustomizations(cs, append(path, "dbfs")...) - S3StorageInfo{}.ApplySchemaCustomizations(cs, append(path, "s3")...) +func (c ClusterLogConf) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbfs"] = attrs["dbfs"].SetOptional() + attrs["s3"] = attrs["s3"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterLogConf. @@ -2903,11 +2994,11 @@ func (o *ClusterLogConf) SetS3(ctx context.Context, v S3StorageInfo) { } type ClusterPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPermission) { @@ -2916,9 +3007,12 @@ func (newState *ClusterPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterPermission) SyncEffectiveFieldsDuringRead(existingState ClusterPermission) { } -func (c ClusterPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermission. @@ -2987,11 +3081,11 @@ func (o *ClusterPermission) SetInheritedFromObject(ctx context.Context, v []type } type ClusterPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ClusterPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPermissions) { @@ -3000,10 +3094,12 @@ func (newState *ClusterPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterPermissions) SyncEffectiveFieldsDuringRead(existingState ClusterPermissions) { } -func (c ClusterPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ClusterPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermissions. @@ -3072,9 +3168,9 @@ func (o *ClusterPermissions) SetAccessControlList(ctx context.Context, v []Clust } type ClusterPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPermissionsDescription) { @@ -3083,9 +3179,11 @@ func (newState *ClusterPermissionsDescription) SyncEffectiveFieldsDuringCreateOr func (newState *ClusterPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState ClusterPermissionsDescription) { } -func (c ClusterPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermissionsDescription. @@ -3122,7 +3220,7 @@ func (o ClusterPermissionsDescription) Type(ctx context.Context) attr.Type { } type ClusterPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The cluster for which to get or manage permissions. ClusterId types.String `tfsdk:"-"` } @@ -3133,11 +3231,11 @@ func (newState *ClusterPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ClusterPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState ClusterPermissionsRequest) { } -func (c ClusterPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "cluster_id")...) +func (c ClusterPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPermissionsRequest. @@ -3205,13 +3303,13 @@ func (o *ClusterPermissionsRequest) SetAccessControlList(ctx context.Context, v type ClusterPolicyAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterPolicyAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyAccessControlRequest) { @@ -3220,9 +3318,13 @@ func (newState *ClusterPolicyAccessControlRequest) SyncEffectiveFieldsDuringCrea func (newState *ClusterPolicyAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyAccessControlRequest) { } -func (c ClusterPolicyAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPolicyAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyAccessControlRequest. @@ -3264,15 +3366,15 @@ func (o ClusterPolicyAccessControlRequest) Type(ctx context.Context) attr.Type { type ClusterPolicyAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ClusterPolicyAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyAccessControlResponse) { @@ -3281,10 +3383,14 @@ func (newState *ClusterPolicyAccessControlResponse) SyncEffectiveFieldsDuringCre func (newState *ClusterPolicyAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyAccessControlResponse) { } -func (c ClusterPolicyAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ClusterPolicyAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyAccessControlResponse. @@ -3357,11 +3463,11 @@ func (o *ClusterPolicyAccessControlResponse) SetAllPermissions(ctx context.Conte } type ClusterPolicyPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPolicyPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyPermission) { @@ -3370,9 +3476,12 @@ func (newState *ClusterPolicyPermission) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ClusterPolicyPermission) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermission) { } -func (c ClusterPolicyPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPolicyPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermission. @@ -3441,11 +3550,11 @@ func (o *ClusterPolicyPermission) SetInheritedFromObject(ctx context.Context, v } type ClusterPolicyPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ClusterPolicyPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyPermissions) { @@ -3454,10 +3563,12 @@ func (newState *ClusterPolicyPermissions) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ClusterPolicyPermissions) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermissions) { } -func (c ClusterPolicyPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ClusterPolicyPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermissions. @@ -3526,9 +3637,9 @@ func (o *ClusterPolicyPermissions) SetAccessControlList(ctx context.Context, v [ } type ClusterPolicyPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ClusterPolicyPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterPolicyPermissionsDescription) { @@ -3537,9 +3648,11 @@ func (newState *ClusterPolicyPermissionsDescription) SyncEffectiveFieldsDuringCr func (newState *ClusterPolicyPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermissionsDescription) { } -func (c ClusterPolicyPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterPolicyPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermissionsDescription. @@ -3576,7 +3689,7 @@ func (o ClusterPolicyPermissionsDescription) Type(ctx context.Context) attr.Type } type ClusterPolicyPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The cluster policy for which to get or manage permissions. ClusterPolicyId types.String `tfsdk:"-"` } @@ -3587,11 +3700,11 @@ func (newState *ClusterPolicyPermissionsRequest) SyncEffectiveFieldsDuringCreate func (newState *ClusterPolicyPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState ClusterPolicyPermissionsRequest) { } -func (c ClusterPolicyPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "cluster_policy_id")...) +func (c ClusterPolicyPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["cluster_policy_id"] = attrs["cluster_policy_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterPolicyPermissionsRequest. @@ -3661,17 +3774,17 @@ func (o *ClusterPolicyPermissionsRequest) SetAccessControlList(ctx context.Conte // become compliant with its policy. type ClusterSettingsChange struct { // The field where this change would be made. - Field types.String `tfsdk:"field" tf:"optional"` + Field types.String `tfsdk:"field"` // The new value of this field after enforcing policy compliance (either a // number, a boolean, or a string) converted to a string. This is intended // to be read by a human. The typed new value of this field can be retrieved // by reading the settings field in the API response. - NewValue types.String `tfsdk:"new_value" tf:"optional"` + NewValue types.String `tfsdk:"new_value"` // The previous value of this field before enforcing policy compliance // (either a number, a boolean, or a string) converted to a string. This is // intended to be read by a human. The type of the field can be retrieved by // reading the settings field in the API response. - PreviousValue types.String `tfsdk:"previous_value" tf:"optional"` + PreviousValue types.String `tfsdk:"previous_value"` } func (newState *ClusterSettingsChange) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSettingsChange) { @@ -3680,9 +3793,12 @@ func (newState *ClusterSettingsChange) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ClusterSettingsChange) SyncEffectiveFieldsDuringRead(existingState ClusterSettingsChange) { } -func (c ClusterSettingsChange) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterSettingsChange) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["field"] = attrs["field"].SetOptional() + attrs["new_value"] = attrs["new_value"].SetOptional() + attrs["previous_value"] = attrs["previous_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSettingsChange. @@ -3724,7 +3840,7 @@ type ClusterSize struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -3735,7 +3851,7 @@ type ClusterSize struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` } func (newState *ClusterSize) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSize) { @@ -3744,10 +3860,11 @@ func (newState *ClusterSize) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cluste func (newState *ClusterSize) SyncEffectiveFieldsDuringRead(existingState ClusterSize) { } -func (c ClusterSize) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) +func (c ClusterSize) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSize. @@ -3817,33 +3934,33 @@ type ClusterSpec struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -3852,7 +3969,7 @@ type ClusterSpec struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -3882,39 +3999,39 @@ type ClusterSpec struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.Object `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.Object `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -3922,13 +4039,13 @@ type ClusterSpec struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -3939,9 +4056,9 @@ type ClusterSpec struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -3950,15 +4067,15 @@ type ClusterSpec struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -3972,23 +4089,23 @@ type ClusterSpec struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:"optional"` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.Object `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.Object `tfsdk:"workload_type"` } func (newState *ClusterSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSpec) { @@ -3997,17 +4114,39 @@ func (newState *ClusterSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cluste func (newState *ClusterSpec) SyncEffectiveFieldsDuringRead(existingState ClusterSpec) { } -func (c ClusterSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - WorkloadType{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c ClusterSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSpec. @@ -4487,13 +4626,13 @@ func (o ClusterStatus) Type(ctx context.Context) attr.Type { type Command struct { // Running cluster id - ClusterId types.String `tfsdk:"clusterId" tf:"optional"` + ClusterId types.String `tfsdk:"clusterId"` // Executable code - Command types.String `tfsdk:"command" tf:"optional"` + Command types.String `tfsdk:"command"` // Running context id - ContextId types.String `tfsdk:"contextId" tf:"optional"` + ContextId types.String `tfsdk:"contextId"` - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` } func (newState *Command) SyncEffectiveFieldsDuringCreateOrUpdate(plan Command) { @@ -4502,9 +4641,13 @@ func (newState *Command) SyncEffectiveFieldsDuringCreateOrUpdate(plan Command) { func (newState *Command) SyncEffectiveFieldsDuringRead(existingState Command) { } -func (c Command) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Command) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetOptional() + attrs["command"] = attrs["command"].SetOptional() + attrs["contextId"] = attrs["contextId"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Command. @@ -4589,11 +4732,11 @@ func (o CommandStatusRequest) Type(ctx context.Context) attr.Type { } type CommandStatusResponse struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Results types.Object `tfsdk:"results" tf:"optional,object"` + Results types.Object `tfsdk:"results"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *CommandStatusResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CommandStatusResponse) { @@ -4602,10 +4745,12 @@ func (newState *CommandStatusResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CommandStatusResponse) SyncEffectiveFieldsDuringRead(existingState CommandStatusResponse) { } -func (c CommandStatusResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Results{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c CommandStatusResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CommandStatusResponse. @@ -4714,9 +4859,9 @@ func (o ContextStatusRequest) Type(ctx context.Context) attr.Type { } type ContextStatusResponse struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *ContextStatusResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ContextStatusResponse) { @@ -4725,9 +4870,11 @@ func (newState *ContextStatusResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ContextStatusResponse) SyncEffectiveFieldsDuringRead(existingState ContextStatusResponse) { } -func (c ContextStatusResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ContextStatusResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ContextStatusResponse. @@ -4767,36 +4914,36 @@ type CreateCluster struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // When specified, this clones libraries from a source cluster during the // creation of a new cluster. - CloneFrom types.Object `tfsdk:"clone_from" tf:"optional,object"` + CloneFrom types.Object `tfsdk:"clone_from"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -4805,7 +4952,7 @@ type CreateCluster struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -4835,39 +4982,39 @@ type CreateCluster struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.Object `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.Object `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -4875,13 +5022,13 @@ type CreateCluster struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -4892,9 +5039,9 @@ type CreateCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -4903,15 +5050,15 @@ type CreateCluster struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -4925,23 +5072,23 @@ type CreateCluster struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:""` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.Object `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.Object `tfsdk:"workload_type"` } func (newState *CreateCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCluster) { @@ -4950,19 +5097,40 @@ func (newState *CreateCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Crea func (newState *CreateCluster) SyncEffectiveFieldsDuringRead(existingState CreateCluster) { } -func (c CreateCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - CloneCluster{}.ApplySchemaCustomizations(cs, append(path, "clone_from")...) - ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - cs.SetRequired(append(path, "spark_version")...) - WorkloadType{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c CreateCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["clone_from"] = attrs["clone_from"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetRequired() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCluster. @@ -5435,7 +5603,7 @@ func (o *CreateCluster) SetWorkloadType(ctx context.Context, v WorkloadType) { } type CreateClusterResponse struct { - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *CreateClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateClusterResponse) { @@ -5444,9 +5612,10 @@ func (newState *CreateClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateClusterResponse) SyncEffectiveFieldsDuringRead(existingState CreateClusterResponse) { } -func (c CreateClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateClusterResponse. @@ -5482,9 +5651,9 @@ func (o CreateClusterResponse) Type(ctx context.Context) attr.Type { type CreateContext struct { // Running cluster id - ClusterId types.String `tfsdk:"clusterId" tf:"optional"` + ClusterId types.String `tfsdk:"clusterId"` - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` } func (newState *CreateContext) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateContext) { @@ -5493,9 +5662,11 @@ func (newState *CreateContext) SyncEffectiveFieldsDuringCreateOrUpdate(plan Crea func (newState *CreateContext) SyncEffectiveFieldsDuringRead(existingState CreateContext) { } -func (c CreateContext) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateContext) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateContext. @@ -5534,28 +5705,28 @@ func (o CreateContext) Type(ctx context.Context) attr.Type { type CreateInstancePool struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec types.Object `tfsdk:"disk_spec" tf:"optional,object"` + DiskSpec types.Object `tfsdk:"disk_spec"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -5563,29 +5734,29 @@ type CreateInstancePool struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:""` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:""` + NodeTypeId types.String `tfsdk:"node_type_id"` // Custom Docker Image BYOC - PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images" tf:"optional"` + PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images"` // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions" tf:"optional"` + PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions"` } func (newState *CreateInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateInstancePool) { @@ -5594,16 +5765,22 @@ func (newState *CreateInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateInstancePool) SyncEffectiveFieldsDuringRead(existingState CreateInstancePool) { } -func (c CreateInstancePool) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - InstancePoolAzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - DiskSpec{}.ApplySchemaCustomizations(cs, append(path, "disk_spec")...) - InstancePoolGcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - cs.SetRequired(append(path, "instance_pool_name")...) - cs.SetRequired(append(path, "node_type_id")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "preloaded_docker_images")...) +func (c CreateInstancePool) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetRequired() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetRequired() + attrs["preloaded_docker_images"] = attrs["preloaded_docker_images"].SetOptional() + attrs["preloaded_spark_versions"] = attrs["preloaded_spark_versions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateInstancePool. @@ -5867,7 +6044,7 @@ func (o *CreateInstancePool) SetPreloadedSparkVersions(ctx context.Context, v [] type CreateInstancePoolResponse struct { // The ID of the created instance pool. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` } func (newState *CreateInstancePoolResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateInstancePoolResponse) { @@ -5876,9 +6053,10 @@ func (newState *CreateInstancePoolResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateInstancePoolResponse) SyncEffectiveFieldsDuringRead(existingState CreateInstancePoolResponse) { } -func (c CreateInstancePoolResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateInstancePoolResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateInstancePoolResponse. @@ -5917,18 +6095,18 @@ type CreatePolicy struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Additional human-readable description of the cluster policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user" tf:"optional"` + MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user"` // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -5938,14 +6116,14 @@ type CreatePolicy struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides" tf:"optional"` + PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides"` // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` } func (newState *CreatePolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePolicy) { @@ -5954,10 +6132,16 @@ func (newState *CreatePolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan Creat func (newState *CreatePolicy) SyncEffectiveFieldsDuringRead(existingState CreatePolicy) { } -func (c CreatePolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c CreatePolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["max_clusters_per_user"] = attrs["max_clusters_per_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_definition_overrides"] = attrs["policy_family_definition_overrides"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePolicy. @@ -6035,7 +6219,7 @@ func (o *CreatePolicy) SetLibraries(ctx context.Context, v []Library) { type CreatePolicyResponse struct { // Canonical unique identifier for the cluster policy. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *CreatePolicyResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePolicyResponse) { @@ -6044,9 +6228,10 @@ func (newState *CreatePolicyResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreatePolicyResponse) SyncEffectiveFieldsDuringRead(existingState CreatePolicyResponse) { } -func (c CreatePolicyResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreatePolicyResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["policy_id"] = attrs["policy_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePolicyResponse. @@ -6082,7 +6267,7 @@ func (o CreatePolicyResponse) Type(ctx context.Context) attr.Type { type CreateResponse struct { // The global init script ID. - ScriptId types.String `tfsdk:"script_id" tf:"optional"` + ScriptId types.String `tfsdk:"script_id"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateResponse. @@ -6117,7 +6302,7 @@ func (o CreateResponse) Type(ctx context.Context) attr.Type { } type Created struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *Created) SyncEffectiveFieldsDuringCreateOrUpdate(plan Created) { @@ -6126,9 +6311,10 @@ func (newState *Created) SyncEffectiveFieldsDuringCreateOrUpdate(plan Created) { func (newState *Created) SyncEffectiveFieldsDuringRead(existingState Created) { } -func (c Created) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Created) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Created. @@ -6164,13 +6350,13 @@ func (o Created) Type(ctx context.Context) attr.Type { type DataPlaneEventDetails struct { // - EventType types.String `tfsdk:"event_type" tf:"optional"` + EventType types.String `tfsdk:"event_type"` // - ExecutorFailures types.Int64 `tfsdk:"executor_failures" tf:"optional"` + ExecutorFailures types.Int64 `tfsdk:"executor_failures"` // - HostId types.String `tfsdk:"host_id" tf:"optional"` + HostId types.String `tfsdk:"host_id"` // - Timestamp types.Int64 `tfsdk:"timestamp" tf:"optional"` + Timestamp types.Int64 `tfsdk:"timestamp"` } func (newState *DataPlaneEventDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneEventDetails) { @@ -6179,9 +6365,13 @@ func (newState *DataPlaneEventDetails) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DataPlaneEventDetails) SyncEffectiveFieldsDuringRead(existingState DataPlaneEventDetails) { } -func (c DataPlaneEventDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataPlaneEventDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["event_type"] = attrs["event_type"].SetOptional() + attrs["executor_failures"] = attrs["executor_failures"].SetOptional() + attrs["host_id"] = attrs["host_id"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneEventDetails. @@ -6223,7 +6413,7 @@ func (o DataPlaneEventDetails) Type(ctx context.Context) attr.Type { type DbfsStorageInfo struct { // dbfs destination, e.g. `dbfs:/my/path` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *DbfsStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbfsStorageInfo) { @@ -6232,10 +6422,10 @@ func (newState *DbfsStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Db func (newState *DbfsStorageInfo) SyncEffectiveFieldsDuringRead(existingState DbfsStorageInfo) { } -func (c DbfsStorageInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c DbfsStorageInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DbfsStorageInfo. @@ -6271,7 +6461,7 @@ func (o DbfsStorageInfo) Type(ctx context.Context) attr.Type { type DeleteCluster struct { // The cluster to be terminated. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *DeleteCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteCluster) { @@ -6280,10 +6470,10 @@ func (newState *DeleteCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dele func (newState *DeleteCluster) SyncEffectiveFieldsDuringRead(existingState DeleteCluster) { } -func (c DeleteCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c DeleteCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCluster. @@ -6326,9 +6516,9 @@ func (newState *DeleteClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DeleteClusterResponse) SyncEffectiveFieldsDuringRead(existingState DeleteClusterResponse) { } -func (c DeleteClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteClusterResponse. @@ -6397,7 +6587,7 @@ func (o DeleteGlobalInitScriptRequest) Type(ctx context.Context) attr.Type { type DeleteInstancePool struct { // The instance pool to be terminated. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:""` + InstancePoolId types.String `tfsdk:"instance_pool_id"` } func (newState *DeleteInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteInstancePool) { @@ -6406,10 +6596,10 @@ func (newState *DeleteInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteInstancePool) SyncEffectiveFieldsDuringRead(existingState DeleteInstancePool) { } -func (c DeleteInstancePool) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_pool_id")...) +func (c DeleteInstancePool) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteInstancePool. @@ -6452,9 +6642,9 @@ func (newState *DeleteInstancePoolResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *DeleteInstancePoolResponse) SyncEffectiveFieldsDuringRead(existingState DeleteInstancePoolResponse) { } -func (c DeleteInstancePoolResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteInstancePoolResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteInstancePoolResponse. @@ -6486,7 +6676,7 @@ func (o DeleteInstancePoolResponse) Type(ctx context.Context) attr.Type { type DeletePolicy struct { // The ID of the policy to delete. - PolicyId types.String `tfsdk:"policy_id" tf:""` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *DeletePolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeletePolicy) { @@ -6495,10 +6685,10 @@ func (newState *DeletePolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delet func (newState *DeletePolicy) SyncEffectiveFieldsDuringRead(existingState DeletePolicy) { } -func (c DeletePolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "policy_id")...) +func (c DeletePolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["policy_id"] = attrs["policy_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePolicy. @@ -6541,9 +6731,9 @@ func (newState *DeletePolicyResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DeletePolicyResponse) SyncEffectiveFieldsDuringRead(existingState DeletePolicyResponse) { } -func (c DeletePolicyResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeletePolicyResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePolicyResponse. @@ -6604,9 +6794,9 @@ func (o DeleteResponse) Type(ctx context.Context) attr.Type { } type DestroyContext struct { - ClusterId types.String `tfsdk:"clusterId" tf:""` + ClusterId types.String `tfsdk:"clusterId"` - ContextId types.String `tfsdk:"contextId" tf:""` + ContextId types.String `tfsdk:"contextId"` } func (newState *DestroyContext) SyncEffectiveFieldsDuringCreateOrUpdate(plan DestroyContext) { @@ -6615,11 +6805,11 @@ func (newState *DestroyContext) SyncEffectiveFieldsDuringCreateOrUpdate(plan Des func (newState *DestroyContext) SyncEffectiveFieldsDuringRead(existingState DestroyContext) { } -func (c DestroyContext) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "clusterId")...) - cs.SetRequired(append(path, "contextId")...) +func (c DestroyContext) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusterId"] = attrs["clusterId"].SetRequired() + attrs["contextId"] = attrs["contextId"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DestroyContext. @@ -6702,9 +6892,9 @@ type DiskSpec struct { // // Disks will be mounted at: - For AWS: `/ebs0`, `/ebs1`, and etc. - For // Azure: `/remote_volume0`, `/remote_volume1`, and etc. - DiskCount types.Int64 `tfsdk:"disk_count" tf:"optional"` + DiskCount types.Int64 `tfsdk:"disk_count"` - DiskIops types.Int64 `tfsdk:"disk_iops" tf:"optional"` + DiskIops types.Int64 `tfsdk:"disk_iops"` // The size of each disk (in GiB) launched for each instance. Values must // fall into the supported range for a particular instance type. // @@ -6713,11 +6903,11 @@ type DiskSpec struct { // // For Azure: - Premium LRS (SSD): 1 - 1023 GiB - Standard LRS (HDD): 1- // 1023 GiB - DiskSize types.Int64 `tfsdk:"disk_size" tf:"optional"` + DiskSize types.Int64 `tfsdk:"disk_size"` - DiskThroughput types.Int64 `tfsdk:"disk_throughput" tf:"optional"` + DiskThroughput types.Int64 `tfsdk:"disk_throughput"` // The type of disks that will be launched with this cluster. - DiskType types.Object `tfsdk:"disk_type" tf:"optional,object"` + DiskType types.Object `tfsdk:"disk_type"` } func (newState *DiskSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan DiskSpec) { @@ -6726,10 +6916,14 @@ func (newState *DiskSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan DiskSpec) func (newState *DiskSpec) SyncEffectiveFieldsDuringRead(existingState DiskSpec) { } -func (c DiskSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DiskType{}.ApplySchemaCustomizations(cs, append(path, "disk_type")...) +func (c DiskSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disk_count"] = attrs["disk_count"].SetOptional() + attrs["disk_iops"] = attrs["disk_iops"].SetOptional() + attrs["disk_size"] = attrs["disk_size"].SetOptional() + attrs["disk_throughput"] = attrs["disk_throughput"].SetOptional() + attrs["disk_type"] = attrs["disk_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DiskSpec. @@ -6802,9 +6996,9 @@ func (o *DiskSpec) SetDiskType(ctx context.Context, v DiskType) { } type DiskType struct { - AzureDiskVolumeType types.String `tfsdk:"azure_disk_volume_type" tf:"optional"` + AzureDiskVolumeType types.String `tfsdk:"azure_disk_volume_type"` - EbsVolumeType types.String `tfsdk:"ebs_volume_type" tf:"optional"` + EbsVolumeType types.String `tfsdk:"ebs_volume_type"` } func (newState *DiskType) SyncEffectiveFieldsDuringCreateOrUpdate(plan DiskType) { @@ -6813,9 +7007,11 @@ func (newState *DiskType) SyncEffectiveFieldsDuringCreateOrUpdate(plan DiskType) func (newState *DiskType) SyncEffectiveFieldsDuringRead(existingState DiskType) { } -func (c DiskType) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DiskType) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["azure_disk_volume_type"] = attrs["azure_disk_volume_type"].SetOptional() + attrs["ebs_volume_type"] = attrs["ebs_volume_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DiskType. @@ -6853,9 +7049,9 @@ func (o DiskType) Type(ctx context.Context) attr.Type { type DockerBasicAuth struct { // Password of the user - Password types.String `tfsdk:"password" tf:"optional"` + Password types.String `tfsdk:"password"` // Name of the user - Username types.String `tfsdk:"username" tf:"optional"` + Username types.String `tfsdk:"username"` } func (newState *DockerBasicAuth) SyncEffectiveFieldsDuringCreateOrUpdate(plan DockerBasicAuth) { @@ -6864,9 +7060,11 @@ func (newState *DockerBasicAuth) SyncEffectiveFieldsDuringCreateOrUpdate(plan Do func (newState *DockerBasicAuth) SyncEffectiveFieldsDuringRead(existingState DockerBasicAuth) { } -func (c DockerBasicAuth) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DockerBasicAuth) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["password"] = attrs["password"].SetOptional() + attrs["username"] = attrs["username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DockerBasicAuth. @@ -6903,9 +7101,9 @@ func (o DockerBasicAuth) Type(ctx context.Context) attr.Type { } type DockerImage struct { - BasicAuth types.Object `tfsdk:"basic_auth" tf:"optional,object"` + BasicAuth types.Object `tfsdk:"basic_auth"` // URL of the docker image. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *DockerImage) SyncEffectiveFieldsDuringCreateOrUpdate(plan DockerImage) { @@ -6914,10 +7112,11 @@ func (newState *DockerImage) SyncEffectiveFieldsDuringCreateOrUpdate(plan Docker func (newState *DockerImage) SyncEffectiveFieldsDuringRead(existingState DockerImage) { } -func (c DockerImage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DockerBasicAuth{}.ApplySchemaCustomizations(cs, append(path, "basic_auth")...) +func (c DockerImage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["basic_auth"] = attrs["basic_auth"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DockerImage. @@ -6987,35 +7186,35 @@ type EditCluster struct { // When set to true, fixed and default values from the policy will be used // for fields that are omitted. When set to false, only fixed values from // the policy will be applied. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // ID of the cluster - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -7024,7 +7223,7 @@ type EditCluster struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -7054,39 +7253,39 @@ type EditCluster struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.Object `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.Object `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -7094,13 +7293,13 @@ type EditCluster struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -7111,9 +7310,9 @@ type EditCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -7122,15 +7321,15 @@ type EditCluster struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -7144,23 +7343,23 @@ type EditCluster struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:""` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.Object `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.Object `tfsdk:"workload_type"` } func (newState *EditCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditCluster) { @@ -7169,19 +7368,40 @@ func (newState *EditCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditCl func (newState *EditCluster) SyncEffectiveFieldsDuringRead(existingState EditCluster) { } -func (c EditCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - cs.SetRequired(append(path, "cluster_id")...) - ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - cs.SetRequired(append(path, "spark_version")...) - WorkloadType{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c EditCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetRequired() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditCluster. @@ -7633,9 +7853,9 @@ func (newState *EditClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *EditClusterResponse) SyncEffectiveFieldsDuringRead(existingState EditClusterResponse) { } -func (c EditClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditClusterResponse. @@ -7671,7 +7891,7 @@ type EditInstancePool struct { // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -7679,24 +7899,24 @@ type EditInstancePool struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Instance pool ID - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:""` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:""` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:""` + NodeTypeId types.String `tfsdk:"node_type_id"` } func (newState *EditInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditInstancePool) { @@ -7705,12 +7925,16 @@ func (newState *EditInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan E func (newState *EditInstancePool) SyncEffectiveFieldsDuringRead(existingState EditInstancePool) { } -func (c EditInstancePool) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_pool_id")...) - cs.SetRequired(append(path, "instance_pool_name")...) - cs.SetRequired(append(path, "node_type_id")...) +func (c EditInstancePool) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetRequired() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditInstancePool. @@ -7795,9 +8019,9 @@ func (newState *EditInstancePoolResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *EditInstancePoolResponse) SyncEffectiveFieldsDuringRead(existingState EditInstancePoolResponse) { } -func (c EditInstancePoolResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditInstancePoolResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditInstancePoolResponse. @@ -7832,18 +8056,18 @@ type EditPolicy struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Additional human-readable description of the cluster policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user" tf:"optional"` + MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user"` // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -7853,16 +8077,16 @@ type EditPolicy struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides" tf:"optional"` + PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides"` // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` // The ID of the policy to update. - PolicyId types.String `tfsdk:"policy_id" tf:""` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *EditPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditPolicy) { @@ -7871,11 +8095,17 @@ func (newState *EditPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditPol func (newState *EditPolicy) SyncEffectiveFieldsDuringRead(existingState EditPolicy) { } -func (c EditPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - cs.SetRequired(append(path, "policy_id")...) +func (c EditPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["max_clusters_per_user"] = attrs["max_clusters_per_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_definition_overrides"] = attrs["policy_family_definition_overrides"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPolicy. @@ -7962,9 +8192,9 @@ func (newState *EditPolicyResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EditPolicyResponse) SyncEffectiveFieldsDuringRead(existingState EditPolicyResponse) { } -func (c EditPolicyResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditPolicyResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPolicyResponse. @@ -8026,10 +8256,10 @@ func (o EditResponse) Type(ctx context.Context) attr.Type { type EnforceClusterComplianceRequest struct { // The ID of the cluster you want to enforce policy compliance on. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // If set, previews the changes that would be made to a cluster to enforce // compliance but does not update the cluster. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *EnforceClusterComplianceRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforceClusterComplianceRequest) { @@ -8038,10 +8268,11 @@ func (newState *EnforceClusterComplianceRequest) SyncEffectiveFieldsDuringCreate func (newState *EnforceClusterComplianceRequest) SyncEffectiveFieldsDuringRead(existingState EnforceClusterComplianceRequest) { } -func (c EnforceClusterComplianceRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c EnforceClusterComplianceRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforceClusterComplianceRequest. @@ -8080,10 +8311,10 @@ func (o EnforceClusterComplianceRequest) Type(ctx context.Context) attr.Type { type EnforceClusterComplianceResponse struct { // A list of changes that have been made to the cluster settings for the // cluster to become compliant with its policy. - Changes types.List `tfsdk:"changes" tf:"optional"` + Changes types.List `tfsdk:"changes"` // Whether any changes have been made to the cluster settings for the // cluster to become compliant with its policy. - HasChanges types.Bool `tfsdk:"has_changes" tf:"optional"` + HasChanges types.Bool `tfsdk:"has_changes"` } func (newState *EnforceClusterComplianceResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforceClusterComplianceResponse) { @@ -8092,10 +8323,11 @@ func (newState *EnforceClusterComplianceResponse) SyncEffectiveFieldsDuringCreat func (newState *EnforceClusterComplianceResponse) SyncEffectiveFieldsDuringRead(existingState EnforceClusterComplianceResponse) { } -func (c EnforceClusterComplianceResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterSettingsChange{}.ApplySchemaCustomizations(cs, append(path, "changes")...) +func (c EnforceClusterComplianceResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["changes"] = attrs["changes"].SetOptional() + attrs["has_changes"] = attrs["has_changes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforceClusterComplianceResponse. @@ -8169,14 +8401,14 @@ type Environment struct { // environment of the runtime. Each client comes with a specific set of // pre-installed libraries. The version is a string, consisting of the major // client version. - Client types.String `tfsdk:"client" tf:""` + Client types.String `tfsdk:"client"` // List of pip dependencies, as supported by the version of pip in this // environment. Each dependency is a pip requirement file line // https://pip.pypa.io/en/stable/reference/requirements-file-format/ Allowed // dependency could be , , (WSFS or Volumes in Databricks), E.g. // dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"] - Dependencies types.List `tfsdk:"dependencies" tf:"optional"` + Dependencies types.List `tfsdk:"dependencies"` } func (newState *Environment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Environment) { @@ -8185,10 +8417,11 @@ func (newState *Environment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Enviro func (newState *Environment) SyncEffectiveFieldsDuringRead(existingState Environment) { } -func (c Environment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "client")...) +func (c Environment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["client"] = attrs["client"].SetRequired() + attrs["dependencies"] = attrs["dependencies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Environment. @@ -8257,52 +8490,52 @@ func (o *Environment) SetDependencies(ctx context.Context, v []types.String) { type EventDetails struct { // * For created clusters, the attributes of the cluster. * For edited // clusters, the new attributes of the cluster. - Attributes types.Object `tfsdk:"attributes" tf:"optional,object"` + Attributes types.Object `tfsdk:"attributes"` // The cause of a change in target size. - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // The actual cluster size that was set in the cluster creation or edit. - ClusterSize types.Object `tfsdk:"cluster_size" tf:"optional,object"` + ClusterSize types.Object `tfsdk:"cluster_size"` // The current number of vCPUs in the cluster. - CurrentNumVcpus types.Int64 `tfsdk:"current_num_vcpus" tf:"optional"` + CurrentNumVcpus types.Int64 `tfsdk:"current_num_vcpus"` // The current number of nodes in the cluster. - CurrentNumWorkers types.Int64 `tfsdk:"current_num_workers" tf:"optional"` + CurrentNumWorkers types.Int64 `tfsdk:"current_num_workers"` // - DidNotExpandReason types.String `tfsdk:"did_not_expand_reason" tf:"optional"` + DidNotExpandReason types.String `tfsdk:"did_not_expand_reason"` // Current disk size in bytes - DiskSize types.Int64 `tfsdk:"disk_size" tf:"optional"` + DiskSize types.Int64 `tfsdk:"disk_size"` // More details about the change in driver's state - DriverStateMessage types.String `tfsdk:"driver_state_message" tf:"optional"` + DriverStateMessage types.String `tfsdk:"driver_state_message"` // Whether or not a blocklisted node should be terminated. For // ClusterEventType NODE_BLACKLISTED. - EnableTerminationForNodeBlocklisted types.Bool `tfsdk:"enable_termination_for_node_blocklisted" tf:"optional"` + EnableTerminationForNodeBlocklisted types.Bool `tfsdk:"enable_termination_for_node_blocklisted"` // - FreeSpace types.Int64 `tfsdk:"free_space" tf:"optional"` + FreeSpace types.Int64 `tfsdk:"free_space"` // List of global and cluster init scripts associated with this cluster // event. - InitScripts types.Object `tfsdk:"init_scripts" tf:"optional,object"` + InitScripts types.Object `tfsdk:"init_scripts"` // Instance Id where the event originated from - InstanceId types.String `tfsdk:"instance_id" tf:"optional"` + InstanceId types.String `tfsdk:"instance_id"` // Unique identifier of the specific job run associated with this cluster // event * For clusters created for jobs, this will be the same as the // cluster name - JobRunName types.String `tfsdk:"job_run_name" tf:"optional"` + JobRunName types.String `tfsdk:"job_run_name"` // The cluster attributes before a cluster was edited. - PreviousAttributes types.Object `tfsdk:"previous_attributes" tf:"optional,object"` + PreviousAttributes types.Object `tfsdk:"previous_attributes"` // The size of the cluster before an edit or resize. - PreviousClusterSize types.Object `tfsdk:"previous_cluster_size" tf:"optional,object"` + PreviousClusterSize types.Object `tfsdk:"previous_cluster_size"` // Previous disk size in bytes - PreviousDiskSize types.Int64 `tfsdk:"previous_disk_size" tf:"optional"` + PreviousDiskSize types.Int64 `tfsdk:"previous_disk_size"` // A termination reason: * On a TERMINATED event, this is the reason of the // termination. * On a RESIZE_COMPLETE event, this indicates the reason that // we failed to acquire some nodes. - Reason types.Object `tfsdk:"reason" tf:"optional,object"` + Reason types.Object `tfsdk:"reason"` // The targeted number of vCPUs in the cluster. - TargetNumVcpus types.Int64 `tfsdk:"target_num_vcpus" tf:"optional"` + TargetNumVcpus types.Int64 `tfsdk:"target_num_vcpus"` // The targeted number of nodes in the cluster. - TargetNumWorkers types.Int64 `tfsdk:"target_num_workers" tf:"optional"` + TargetNumWorkers types.Int64 `tfsdk:"target_num_workers"` // The user that caused the event to occur. (Empty if it was done by the // control plane.) - User types.String `tfsdk:"user" tf:"optional"` + User types.String `tfsdk:"user"` } func (newState *EventDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan EventDetails) { @@ -8311,15 +8544,29 @@ func (newState *EventDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan Event func (newState *EventDetails) SyncEffectiveFieldsDuringRead(existingState EventDetails) { } -func (c EventDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAttributes{}.ApplySchemaCustomizations(cs, append(path, "attributes")...) - ClusterSize{}.ApplySchemaCustomizations(cs, append(path, "cluster_size")...) - InitScriptEventDetails{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - ClusterAttributes{}.ApplySchemaCustomizations(cs, append(path, "previous_attributes")...) - ClusterSize{}.ApplySchemaCustomizations(cs, append(path, "previous_cluster_size")...) - TerminationReason{}.ApplySchemaCustomizations(cs, append(path, "reason")...) - - return cs +func (c EventDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attributes"] = attrs["attributes"].SetOptional() + attrs["cause"] = attrs["cause"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["current_num_vcpus"] = attrs["current_num_vcpus"].SetOptional() + attrs["current_num_workers"] = attrs["current_num_workers"].SetOptional() + attrs["did_not_expand_reason"] = attrs["did_not_expand_reason"].SetOptional() + attrs["disk_size"] = attrs["disk_size"].SetOptional() + attrs["driver_state_message"] = attrs["driver_state_message"].SetOptional() + attrs["enable_termination_for_node_blocklisted"] = attrs["enable_termination_for_node_blocklisted"].SetOptional() + attrs["free_space"] = attrs["free_space"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_id"] = attrs["instance_id"].SetOptional() + attrs["job_run_name"] = attrs["job_run_name"].SetOptional() + attrs["previous_attributes"] = attrs["previous_attributes"].SetOptional() + attrs["previous_cluster_size"] = attrs["previous_cluster_size"].SetOptional() + attrs["previous_disk_size"] = attrs["previous_disk_size"].SetOptional() + attrs["reason"] = attrs["reason"].SetOptional() + attrs["target_num_vcpus"] = attrs["target_num_vcpus"].SetOptional() + attrs["target_num_workers"] = attrs["target_num_workers"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EventDetails. @@ -8570,26 +8817,26 @@ type GcpAttributes struct { // This field determines whether the instance pool will contain preemptible // VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs // if the former is unavailable. - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // boot disk size in GB - BootDiskSize types.Int64 `tfsdk:"boot_disk_size" tf:"optional"` + BootDiskSize types.Int64 `tfsdk:"boot_disk_size"` // If provided, the cluster will impersonate the google service account when // accessing gcloud services (like GCS). The google service account must // have previously been added to the Databricks environment by an account // administrator. - GoogleServiceAccount types.String `tfsdk:"google_service_account" tf:"optional"` + GoogleServiceAccount types.String `tfsdk:"google_service_account"` // If provided, each node (workers and driver) in the cluster will have this // number of local SSDs attached. Each local SSD is 375GB in size. Refer to // [GCP documentation] for the supported number of local SSDs for each // instance type. // // [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds - LocalSsdCount types.Int64 `tfsdk:"local_ssd_count" tf:"optional"` + LocalSsdCount types.Int64 `tfsdk:"local_ssd_count"` // This field determines whether the spark executors will be scheduled to // run on preemptible VMs (when set to true) versus standard compute engine // VMs (when set to false; default). Note: Soon to be deprecated, use the // availability field instead. - UsePreemptibleExecutors types.Bool `tfsdk:"use_preemptible_executors" tf:"optional"` + UsePreemptibleExecutors types.Bool `tfsdk:"use_preemptible_executors"` // Identifier for the availability zone in which the cluster resides. This // can be one of the following: - "HA" => High availability, spread nodes // across availability zones for a Databricks deployment region [default] - @@ -8597,7 +8844,7 @@ type GcpAttributes struct { // on. - A GCP availability zone => Pick One of the available zones for // (machine type + region) from // https://cloud.google.com/compute/docs/regions-zones. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *GcpAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpAttributes) { @@ -8606,9 +8853,15 @@ func (newState *GcpAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpA func (newState *GcpAttributes) SyncEffectiveFieldsDuringRead(existingState GcpAttributes) { } -func (c GcpAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GcpAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["boot_disk_size"] = attrs["boot_disk_size"].SetOptional() + attrs["google_service_account"] = attrs["google_service_account"].SetOptional() + attrs["local_ssd_count"] = attrs["local_ssd_count"].SetOptional() + attrs["use_preemptible_executors"] = attrs["use_preemptible_executors"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpAttributes. @@ -8654,7 +8907,7 @@ func (o GcpAttributes) Type(ctx context.Context) attr.Type { type GcsStorageInfo struct { // GCS destination/URI, e.g. `gs://my-bucket/some-prefix` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *GcsStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcsStorageInfo) { @@ -8663,10 +8916,10 @@ func (newState *GcsStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Gcs func (newState *GcsStorageInfo) SyncEffectiveFieldsDuringRead(existingState GcsStorageInfo) { } -func (c GcsStorageInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c GcsStorageInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcsStorageInfo. @@ -8741,12 +8994,12 @@ type GetClusterComplianceResponse struct { // Whether the cluster is compliant with its policy or not. Clusters could // be out of compliance if the policy was updated after the cluster was last // edited. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. The values indicate an error message describing the // policy validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *GetClusterComplianceResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetClusterComplianceResponse) { @@ -8755,9 +9008,11 @@ func (newState *GetClusterComplianceResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *GetClusterComplianceResponse) SyncEffectiveFieldsDuringRead(existingState GetClusterComplianceResponse) { } -func (c GetClusterComplianceResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetClusterComplianceResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetClusterComplianceResponse. @@ -8862,7 +9117,7 @@ func (o GetClusterPermissionLevelsRequest) Type(ctx context.Context) attr.Type { type GetClusterPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetClusterPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetClusterPermissionLevelsResponse) { @@ -8871,10 +9126,10 @@ func (newState *GetClusterPermissionLevelsResponse) SyncEffectiveFieldsDuringCre func (newState *GetClusterPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetClusterPermissionLevelsResponse) { } -func (c GetClusterPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetClusterPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetClusterPermissionLevelsResponse. @@ -9014,7 +9269,7 @@ func (o GetClusterPolicyPermissionLevelsRequest) Type(ctx context.Context) attr. type GetClusterPolicyPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetClusterPolicyPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetClusterPolicyPermissionLevelsResponse) { @@ -9023,10 +9278,10 @@ func (newState *GetClusterPolicyPermissionLevelsResponse) SyncEffectiveFieldsDur func (newState *GetClusterPolicyPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetClusterPolicyPermissionLevelsResponse) { } -func (c GetClusterPolicyPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterPolicyPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetClusterPolicyPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetClusterPolicyPermissionLevelsResponse. @@ -9203,25 +9458,25 @@ func (o GetClusterRequest) Type(ctx context.Context) attr.Type { type GetEvents struct { // The ID of the cluster to retrieve events about. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The end time in epoch milliseconds. If empty, returns events up to the // current time. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // An optional set of event types to filter on. If empty, all event types // are returned. - EventTypes types.List `tfsdk:"event_types" tf:"optional"` + EventTypes types.List `tfsdk:"event_types"` // The maximum number of events to include in a page of events. Defaults to // 50, and maximum allowed value is 500. - Limit types.Int64 `tfsdk:"limit" tf:"optional"` + Limit types.Int64 `tfsdk:"limit"` // The offset in the result set. Defaults to 0 (no offset). When an offset // is specified and the results are requested in descending order, the // end_time field is required. - Offset types.Int64 `tfsdk:"offset" tf:"optional"` + Offset types.Int64 `tfsdk:"offset"` // The order to list events in; either "ASC" or "DESC". Defaults to "DESC". - Order types.String `tfsdk:"order" tf:"optional"` + Order types.String `tfsdk:"order"` // The start time in epoch milliseconds. If empty, returns events starting // from the beginning of time. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` } func (newState *GetEvents) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetEvents) { @@ -9230,10 +9485,16 @@ func (newState *GetEvents) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetEvent func (newState *GetEvents) SyncEffectiveFieldsDuringRead(existingState GetEvents) { } -func (c GetEvents) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c GetEvents) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["event_types"] = attrs["event_types"].SetOptional() + attrs["limit"] = attrs["limit"].SetOptional() + attrs["offset"] = attrs["offset"].SetOptional() + attrs["order"] = attrs["order"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetEvents. @@ -9311,13 +9572,13 @@ func (o *GetEvents) SetEventTypes(ctx context.Context, v []types.String) { type GetEventsResponse struct { // - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` // The parameters required to retrieve the next page of events. Omitted if // there are no more events to read. - NextPage types.Object `tfsdk:"next_page" tf:"optional,object"` + NextPage types.Object `tfsdk:"next_page"` // The total number of events filtered by the start_time, end_time, and // event_types. - TotalCount types.Int64 `tfsdk:"total_count" tf:"optional"` + TotalCount types.Int64 `tfsdk:"total_count"` } func (newState *GetEventsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetEventsResponse) { @@ -9326,11 +9587,12 @@ func (newState *GetEventsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GetEventsResponse) SyncEffectiveFieldsDuringRead(existingState GetEventsResponse) { } -func (c GetEventsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterEvent{}.ApplySchemaCustomizations(cs, append(path, "events")...) - GetEvents{}.ApplySchemaCustomizations(cs, append(path, "next_page")...) +func (c GetEventsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["events"] = attrs["events"].SetOptional() + attrs["next_page"] = attrs["next_page"].SetOptional() + attrs["total_count"] = attrs["total_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetEventsResponse. @@ -9467,16 +9729,16 @@ func (o GetGlobalInitScriptRequest) Type(ctx context.Context) attr.Type { type GetInstancePool struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -9487,19 +9749,19 @@ type GetInstancePool struct { // - InstancePoolName: // // - InstancePoolId: - DefaultTags types.Map `tfsdk:"default_tags" tf:"optional"` + DefaultTags types.Map `tfsdk:"default_tags"` // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec types.Object `tfsdk:"disk_spec" tf:"optional,object"` + DiskSpec types.Object `tfsdk:"disk_spec"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -9507,37 +9769,37 @@ type GetInstancePool struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Canonical unique identifier for the pool. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:""` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:"optional"` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Custom Docker Image BYOC - PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images" tf:"optional"` + PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images"` // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions" tf:"optional"` + PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions"` // Current state of the instance pool. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Usage statistics about the instance pool. - Stats types.Object `tfsdk:"stats" tf:"optional,object"` + Stats types.Object `tfsdk:"stats"` // Status of failed pending instances in the pool. - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` } func (newState *GetInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetInstancePool) { @@ -9546,17 +9808,27 @@ func (newState *GetInstancePool) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ge func (newState *GetInstancePool) SyncEffectiveFieldsDuringRead(existingState GetInstancePool) { } -func (c GetInstancePool) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - InstancePoolAzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - DiskSpec{}.ApplySchemaCustomizations(cs, append(path, "disk_spec")...) - InstancePoolGcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - cs.SetRequired(append(path, "instance_pool_id")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "preloaded_docker_images")...) - InstancePoolStats{}.ApplySchemaCustomizations(cs, append(path, "stats")...) - InstancePoolStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - - return cs +func (c GetInstancePool) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["default_tags"] = attrs["default_tags"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetOptional() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["preloaded_docker_images"] = attrs["preloaded_docker_images"].SetOptional() + attrs["preloaded_spark_versions"] = attrs["preloaded_spark_versions"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["stats"] = attrs["stats"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetInstancePool. @@ -9954,7 +10226,7 @@ func (o GetInstancePoolPermissionLevelsRequest) Type(ctx context.Context) attr.T type GetInstancePoolPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetInstancePoolPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetInstancePoolPermissionLevelsResponse) { @@ -9963,10 +10235,10 @@ func (newState *GetInstancePoolPermissionLevelsResponse) SyncEffectiveFieldsDuri func (newState *GetInstancePoolPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetInstancePoolPermissionLevelsResponse) { } -func (c GetInstancePoolPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetInstancePoolPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetInstancePoolPermissionLevelsResponse. @@ -10148,7 +10420,7 @@ func (o GetPolicyFamilyRequest) Type(ctx context.Context) attr.Type { type GetSparkVersionsResponse struct { // All the available Spark versions. - Versions types.List `tfsdk:"versions" tf:"optional"` + Versions types.List `tfsdk:"versions"` } func (newState *GetSparkVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetSparkVersionsResponse) { @@ -10157,10 +10429,10 @@ func (newState *GetSparkVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *GetSparkVersionsResponse) SyncEffectiveFieldsDuringRead(existingState GetSparkVersionsResponse) { } -func (c GetSparkVersionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparkVersion{}.ApplySchemaCustomizations(cs, append(path, "versions")...) +func (c GetSparkVersionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["versions"] = attrs["versions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetSparkVersionsResponse. @@ -10226,9 +10498,9 @@ func (o *GetSparkVersionsResponse) SetVersions(ctx context.Context, v []SparkVer type GlobalInitScriptCreateRequest struct { // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The position of a global init script, where 0 represents the first script // to run, 1 is the second script to run, in ascending order. // @@ -10240,9 +10512,9 @@ type GlobalInitScriptCreateRequest struct { // position. If an explicit position value conflicts with an existing script // value, your request succeeds, but the original script at that position // and all later scripts have their positions incremented by 1. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The Base64-encoded content of the script. - Script types.String `tfsdk:"script" tf:""` + Script types.String `tfsdk:"script"` } func (newState *GlobalInitScriptCreateRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan GlobalInitScriptCreateRequest) { @@ -10251,11 +10523,13 @@ func (newState *GlobalInitScriptCreateRequest) SyncEffectiveFieldsDuringCreateOr func (newState *GlobalInitScriptCreateRequest) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptCreateRequest) { } -func (c GlobalInitScriptCreateRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "script")...) +func (c GlobalInitScriptCreateRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["position"] = attrs["position"].SetOptional() + attrs["script"] = attrs["script"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptCreateRequest. @@ -10298,23 +10572,23 @@ func (o GlobalInitScriptCreateRequest) Type(ctx context.Context) attr.Type { type GlobalInitScriptDetails struct { // Time when the script was created, represented as a Unix timestamp in // milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The username of the user who created the script. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The global init script ID. - ScriptId types.String `tfsdk:"script_id" tf:"optional"` + ScriptId types.String `tfsdk:"script_id"` // Time when the script was updated, represented as a Unix timestamp in // milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The username of the user who last updated the script - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *GlobalInitScriptDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan GlobalInitScriptDetails) { @@ -10323,9 +10597,17 @@ func (newState *GlobalInitScriptDetails) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GlobalInitScriptDetails) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptDetails) { } -func (c GlobalInitScriptDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GlobalInitScriptDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["script_id"] = attrs["script_id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptDetails. @@ -10376,25 +10658,25 @@ func (o GlobalInitScriptDetails) Type(ctx context.Context) attr.Type { type GlobalInitScriptDetailsWithContent struct { // Time when the script was created, represented as a Unix timestamp in // milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The username of the user who created the script. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The Base64-encoded content of the script. - Script types.String `tfsdk:"script" tf:"optional"` + Script types.String `tfsdk:"script"` // The global init script ID. - ScriptId types.String `tfsdk:"script_id" tf:"optional"` + ScriptId types.String `tfsdk:"script_id"` // Time when the script was updated, represented as a Unix timestamp in // milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // The username of the user who last updated the script - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *GlobalInitScriptDetailsWithContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan GlobalInitScriptDetailsWithContent) { @@ -10403,9 +10685,18 @@ func (newState *GlobalInitScriptDetailsWithContent) SyncEffectiveFieldsDuringCre func (newState *GlobalInitScriptDetailsWithContent) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptDetailsWithContent) { } -func (c GlobalInitScriptDetailsWithContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GlobalInitScriptDetailsWithContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["script"] = attrs["script"].SetOptional() + attrs["script_id"] = attrs["script_id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptDetailsWithContent. @@ -10457,9 +10748,9 @@ func (o GlobalInitScriptDetailsWithContent) Type(ctx context.Context) attr.Type type GlobalInitScriptUpdateRequest struct { // Specifies whether the script is enabled. The script runs only if enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the script - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The position of a script, where 0 represents the first script to run, 1 // is the second script to run, in ascending order. To move the script to // run first, set its position to 0. @@ -10472,9 +10763,9 @@ type GlobalInitScriptUpdateRequest struct { // If an explicit position value conflicts with an existing script, your // request succeeds, but the original script at that position and all later // scripts have their positions incremented by 1. - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The Base64-encoded content of the script. - Script types.String `tfsdk:"script" tf:""` + Script types.String `tfsdk:"script"` // The ID of the global init script. ScriptId types.String `tfsdk:"-"` } @@ -10485,12 +10776,14 @@ func (newState *GlobalInitScriptUpdateRequest) SyncEffectiveFieldsDuringCreateOr func (newState *GlobalInitScriptUpdateRequest) SyncEffectiveFieldsDuringRead(existingState GlobalInitScriptUpdateRequest) { } -func (c GlobalInitScriptUpdateRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "script")...) - cs.SetRequired(append(path, "script_id")...) +func (c GlobalInitScriptUpdateRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["position"] = attrs["position"].SetOptional() + attrs["script"] = attrs["script"].SetRequired() + attrs["script_id"] = attrs["script_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GlobalInitScriptUpdateRequest. @@ -10534,11 +10827,11 @@ func (o GlobalInitScriptUpdateRequest) Type(ctx context.Context) attr.Type { type InitScriptEventDetails struct { // The cluster scoped init scripts associated with this cluster event - Cluster types.List `tfsdk:"cluster" tf:"optional"` + Cluster types.List `tfsdk:"cluster"` // The global init scripts associated with this cluster event - Global types.List `tfsdk:"global" tf:"optional"` + Global types.List `tfsdk:"global"` // The private ip address of the node where the init scripts were run. - ReportedForNode types.String `tfsdk:"reported_for_node" tf:"optional"` + ReportedForNode types.String `tfsdk:"reported_for_node"` } func (newState *InitScriptEventDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptEventDetails) { @@ -10547,11 +10840,12 @@ func (newState *InitScriptEventDetails) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *InitScriptEventDetails) SyncEffectiveFieldsDuringRead(existingState InitScriptEventDetails) { } -func (c InitScriptEventDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InitScriptInfoAndExecutionDetails{}.ApplySchemaCustomizations(cs, append(path, "cluster")...) - InitScriptInfoAndExecutionDetails{}.ApplySchemaCustomizations(cs, append(path, "global")...) +func (c InitScriptEventDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster"] = attrs["cluster"].SetOptional() + attrs["global"] = attrs["global"].SetOptional() + attrs["reported_for_node"] = attrs["reported_for_node"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptEventDetails. @@ -10650,11 +10944,11 @@ func (o *InitScriptEventDetails) SetGlobal(ctx context.Context, v []InitScriptIn type InitScriptExecutionDetails struct { // Addition details regarding errors. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // The duration of the script execution in seconds. - ExecutionDurationSeconds types.Int64 `tfsdk:"execution_duration_seconds" tf:"optional"` + ExecutionDurationSeconds types.Int64 `tfsdk:"execution_duration_seconds"` // The current status of the script - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *InitScriptExecutionDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptExecutionDetails) { @@ -10663,9 +10957,12 @@ func (newState *InitScriptExecutionDetails) SyncEffectiveFieldsDuringCreateOrUpd func (newState *InitScriptExecutionDetails) SyncEffectiveFieldsDuringRead(existingState InitScriptExecutionDetails) { } -func (c InitScriptExecutionDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InitScriptExecutionDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["execution_duration_seconds"] = attrs["execution_duration_seconds"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptExecutionDetails. @@ -10707,28 +11004,28 @@ type InitScriptInfo struct { // destination needs to be provided. e.g. `{ "abfss" : { "destination" : // "abfss://@.dfs.core.windows.net/" // } } - Abfss types.Object `tfsdk:"abfss" tf:"optional,object"` + Abfss types.Object `tfsdk:"abfss"` // destination needs to be provided. e.g. `{ "dbfs" : { "destination" : // "dbfs:/home/cluster_log" } }` - Dbfs types.Object `tfsdk:"dbfs" tf:"optional,object"` + Dbfs types.Object `tfsdk:"dbfs"` // destination needs to be provided. e.g. `{ "file" : { "destination" : // "file:/my/local/file.sh" } }` - File types.Object `tfsdk:"file" tf:"optional,object"` + File types.Object `tfsdk:"file"` // destination needs to be provided. e.g. `{ "gcs": { "destination": // "gs://my-bucket/file.sh" } }` - Gcs types.Object `tfsdk:"gcs" tf:"optional,object"` + Gcs types.Object `tfsdk:"gcs"` // destination and either the region or endpoint need to be provided. e.g. // `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : // "us-west-2" } }` Cluster iam role is used to access s3, please make sure // the cluster iam role in `instance_profile_arn` has permission to write // data to the s3 destination. - S3 types.Object `tfsdk:"s3" tf:"optional,object"` + S3 types.Object `tfsdk:"s3"` // destination needs to be provided. e.g. `{ "volumes" : { "destination" : // "/Volumes/my-init.sh" } }` - Volumes types.Object `tfsdk:"volumes" tf:"optional,object"` + Volumes types.Object `tfsdk:"volumes"` // destination needs to be provided. e.g. `{ "workspace" : { "destination" : // "/Users/user1@databricks.com/my-init.sh" } }` - Workspace types.Object `tfsdk:"workspace" tf:"optional,object"` + Workspace types.Object `tfsdk:"workspace"` } func (newState *InitScriptInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptInfo) { @@ -10737,16 +11034,16 @@ func (newState *InitScriptInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ini func (newState *InitScriptInfo) SyncEffectiveFieldsDuringRead(existingState InitScriptInfo) { } -func (c InitScriptInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Adlsgen2Info{}.ApplySchemaCustomizations(cs, append(path, "abfss")...) - DbfsStorageInfo{}.ApplySchemaCustomizations(cs, append(path, "dbfs")...) - LocalFileInfo{}.ApplySchemaCustomizations(cs, append(path, "file")...) - GcsStorageInfo{}.ApplySchemaCustomizations(cs, append(path, "gcs")...) - S3StorageInfo{}.ApplySchemaCustomizations(cs, append(path, "s3")...) - VolumesStorageInfo{}.ApplySchemaCustomizations(cs, append(path, "volumes")...) - WorkspaceStorageInfo{}.ApplySchemaCustomizations(cs, append(path, "workspace")...) +func (c InitScriptInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["abfss"] = attrs["abfss"].SetOptional() + attrs["dbfs"] = attrs["dbfs"].SetOptional() + attrs["file"] = attrs["file"].SetOptional() + attrs["gcs"] = attrs["gcs"].SetOptional() + attrs["s3"] = attrs["s3"].SetOptional() + attrs["volumes"] = attrs["volumes"].SetOptional() + attrs["workspace"] = attrs["workspace"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptInfo. @@ -10998,9 +11295,9 @@ func (o *InitScriptInfo) SetWorkspace(ctx context.Context, v WorkspaceStorageInf type InitScriptInfoAndExecutionDetails struct { // Details about the script - ExecutionDetails types.Object `tfsdk:"execution_details" tf:"optional,object"` + ExecutionDetails types.Object `tfsdk:"execution_details"` // The script - Script types.Object `tfsdk:"script" tf:"optional,object"` + Script types.Object `tfsdk:"script"` } func (newState *InitScriptInfoAndExecutionDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan InitScriptInfoAndExecutionDetails) { @@ -11009,11 +11306,11 @@ func (newState *InitScriptInfoAndExecutionDetails) SyncEffectiveFieldsDuringCrea func (newState *InitScriptInfoAndExecutionDetails) SyncEffectiveFieldsDuringRead(existingState InitScriptInfoAndExecutionDetails) { } -func (c InitScriptInfoAndExecutionDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InitScriptExecutionDetails{}.ApplySchemaCustomizations(cs, append(path, "execution_details")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "script")...) +func (c InitScriptInfoAndExecutionDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["execution_details"] = attrs["execution_details"].SetOptional() + attrs["script"] = attrs["script"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InitScriptInfoAndExecutionDetails. @@ -11110,9 +11407,9 @@ func (o *InitScriptInfoAndExecutionDetails) SetScript(ctx context.Context, v Ini type InstallLibraries struct { // Unique identifier for the cluster on which to install these libraries. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The libraries to install. - Libraries types.List `tfsdk:"libraries" tf:""` + Libraries types.List `tfsdk:"libraries"` } func (newState *InstallLibraries) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstallLibraries) { @@ -11121,12 +11418,11 @@ func (newState *InstallLibraries) SyncEffectiveFieldsDuringCreateOrUpdate(plan I func (newState *InstallLibraries) SyncEffectiveFieldsDuringRead(existingState InstallLibraries) { } -func (c InstallLibraries) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "libraries")...) - Library{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c InstallLibraries) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["libraries"] = attrs["libraries"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstallLibraries. @@ -11201,9 +11497,9 @@ func (newState *InstallLibrariesResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *InstallLibrariesResponse) SyncEffectiveFieldsDuringRead(existingState InstallLibrariesResponse) { } -func (c InstallLibrariesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstallLibrariesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstallLibrariesResponse. @@ -11235,13 +11531,13 @@ func (o InstallLibrariesResponse) Type(ctx context.Context) attr.Type { type InstancePoolAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *InstancePoolAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAccessControlRequest) { @@ -11250,9 +11546,13 @@ func (newState *InstancePoolAccessControlRequest) SyncEffectiveFieldsDuringCreat func (newState *InstancePoolAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState InstancePoolAccessControlRequest) { } -func (c InstancePoolAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAccessControlRequest. @@ -11294,15 +11594,15 @@ func (o InstancePoolAccessControlRequest) Type(ctx context.Context) attr.Type { type InstancePoolAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *InstancePoolAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAccessControlResponse) { @@ -11311,10 +11611,14 @@ func (newState *InstancePoolAccessControlResponse) SyncEffectiveFieldsDuringCrea func (newState *InstancePoolAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState InstancePoolAccessControlResponse) { } -func (c InstancePoolAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c InstancePoolAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAccessControlResponse. @@ -11389,16 +11693,16 @@ func (o *InstancePoolAccessControlResponse) SetAllPermissions(ctx context.Contex type InstancePoolAndStats struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to instance pools running on Azure. If not specified // at pool creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // Additional tags for pool resources. Databricks will tag all pool // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: // // - Currently, Databricks allows at most 45 custom tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: // @@ -11409,19 +11713,19 @@ type InstancePoolAndStats struct { // - InstancePoolName: // // - InstancePoolId: - DefaultTags types.Map `tfsdk:"default_tags" tf:"optional"` + DefaultTags types.Map `tfsdk:"default_tags"` // Defines the specification of the disks that will be attached to all spark // containers. - DiskSpec types.Object `tfsdk:"disk_spec" tf:"optional,object"` + DiskSpec types.Object `tfsdk:"disk_spec"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS // permissions to function correctly - refer to the User Guide for more // details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Attributes related to instance pools running on Google Cloud Platform. If // not specified at pool creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -11429,37 +11733,37 @@ type InstancePoolAndStats struct { // threshold must be between 0 and 10000 minutes. Users can also set this // value to 0 to instantly remove idle instances from the cache if min cache // size could still hold. - IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes" tf:"optional"` + IdleInstanceAutoterminationMinutes types.Int64 `tfsdk:"idle_instance_autotermination_minutes"` // Canonical unique identifier for the pool. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // Pool name requested by the user. Pool name must be unique. Length must be // between 1 and 100 characters. - InstancePoolName types.String `tfsdk:"instance_pool_name" tf:"optional"` + InstancePoolName types.String `tfsdk:"instance_pool_name"` // Maximum number of outstanding instances to keep in the pool, including // both instances used by clusters and idle instances. Clusters that require // further instance provisioning will fail during upsize requests. - MaxCapacity types.Int64 `tfsdk:"max_capacity" tf:"optional"` + MaxCapacity types.Int64 `tfsdk:"max_capacity"` // Minimum number of idle instances to keep in the instance pool - MinIdleInstances types.Int64 `tfsdk:"min_idle_instances" tf:"optional"` + MinIdleInstances types.Int64 `tfsdk:"min_idle_instances"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Custom Docker Image BYOC - PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images" tf:"optional"` + PreloadedDockerImages types.List `tfsdk:"preloaded_docker_images"` // A list containing at most one preloaded Spark image version for the pool. // Pool-backed clusters started with the preloaded Spark version will start // faster. A list of available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions" tf:"optional"` + PreloadedSparkVersions types.List `tfsdk:"preloaded_spark_versions"` // Current state of the instance pool. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Usage statistics about the instance pool. - Stats types.Object `tfsdk:"stats" tf:"optional,object"` + Stats types.Object `tfsdk:"stats"` // Status of failed pending instances in the pool. - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` } func (newState *InstancePoolAndStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAndStats) { @@ -11468,16 +11772,27 @@ func (newState *InstancePoolAndStats) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *InstancePoolAndStats) SyncEffectiveFieldsDuringRead(existingState InstancePoolAndStats) { } -func (c InstancePoolAndStats) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - InstancePoolAzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - DiskSpec{}.ApplySchemaCustomizations(cs, append(path, "disk_spec")...) - InstancePoolGcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "preloaded_docker_images")...) - InstancePoolStats{}.ApplySchemaCustomizations(cs, append(path, "stats")...) - InstancePoolStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - - return cs +func (c InstancePoolAndStats) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["default_tags"] = attrs["default_tags"].SetOptional() + attrs["disk_spec"] = attrs["disk_spec"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["idle_instance_autotermination_minutes"] = attrs["idle_instance_autotermination_minutes"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["instance_pool_name"] = attrs["instance_pool_name"].SetOptional() + attrs["max_capacity"] = attrs["max_capacity"].SetOptional() + attrs["min_idle_instances"] = attrs["min_idle_instances"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["preloaded_docker_images"] = attrs["preloaded_docker_images"].SetOptional() + attrs["preloaded_spark_versions"] = attrs["preloaded_spark_versions"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["stats"] = attrs["stats"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAndStats. @@ -11841,7 +12156,7 @@ type InstancePoolAwsAttributes struct { // // The default value is defined by // InstancePoolConf.instancePoolDefaultAwsAvailability - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // Calculates the bid price for AWS spot instances, as a percentage of the // corresponding instance type's on-demand price. For example, if this field // is set to 50, and the cluster needs a new `r3.xlarge` spot instance, then @@ -11856,7 +12171,7 @@ type InstancePoolAwsAttributes struct { // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidPricePercent and // CommonConf.maxSpotBidPricePercent. - SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent" tf:"optional"` + SpotBidPricePercent types.Int64 `tfsdk:"spot_bid_price_percent"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west-2a". The provided // availability zone must be in the same region as the Databricks @@ -11865,7 +12180,7 @@ type InstancePoolAwsAttributes struct { // optional field at cluster creation, and if not specified, a default zone // will be used. The list of available zones as well as the default value // can be found by using the `List Zones` method. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *InstancePoolAwsAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAwsAttributes) { @@ -11874,9 +12189,12 @@ func (newState *InstancePoolAwsAttributes) SyncEffectiveFieldsDuringCreateOrUpda func (newState *InstancePoolAwsAttributes) SyncEffectiveFieldsDuringRead(existingState InstancePoolAwsAttributes) { } -func (c InstancePoolAwsAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolAwsAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["spot_bid_price_percent"] = attrs["spot_bid_price_percent"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAwsAttributes. @@ -11919,10 +12237,10 @@ type InstancePoolAzureAttributes struct { // // The default value is defined by // InstancePoolConf.instancePoolDefaultAzureAvailability - Availability types.String `tfsdk:"availability" tf:"optional"` + Availability types.String `tfsdk:"availability"` // The default value and documentation here should be kept consistent with // CommonConf.defaultSpotBidMaxPrice. - SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price" tf:"optional"` + SpotBidMaxPrice types.Float64 `tfsdk:"spot_bid_max_price"` } func (newState *InstancePoolAzureAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolAzureAttributes) { @@ -11931,9 +12249,11 @@ func (newState *InstancePoolAzureAttributes) SyncEffectiveFieldsDuringCreateOrUp func (newState *InstancePoolAzureAttributes) SyncEffectiveFieldsDuringRead(existingState InstancePoolAzureAttributes) { } -func (c InstancePoolAzureAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolAzureAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["availability"] = attrs["availability"].SetOptional() + attrs["spot_bid_max_price"] = attrs["spot_bid_max_price"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolAzureAttributes. @@ -11973,14 +12293,14 @@ type InstancePoolGcpAttributes struct { // This field determines whether the instance pool will contain preemptible // VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs // if the former is unavailable. - GcpAvailability types.String `tfsdk:"gcp_availability" tf:"optional"` + GcpAvailability types.String `tfsdk:"gcp_availability"` // If provided, each node in the instance pool will have this number of // local SSDs attached. Each local SSD is 375GB in size. Refer to [GCP // documentation] for the supported number of local SSDs for each instance // type. // // [GCP documentation]: https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds - LocalSsdCount types.Int64 `tfsdk:"local_ssd_count" tf:"optional"` + LocalSsdCount types.Int64 `tfsdk:"local_ssd_count"` // Identifier for the availability zone/datacenter in which the cluster // resides. This string will be of a form like "us-west1-a". The provided // availability zone must be in the same region as the Databricks workspace. @@ -11997,7 +12317,7 @@ type InstancePoolGcpAttributes struct { // // If empty, Databricks picks an availability zone to schedule the cluster // on. - ZoneId types.String `tfsdk:"zone_id" tf:"optional"` + ZoneId types.String `tfsdk:"zone_id"` } func (newState *InstancePoolGcpAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolGcpAttributes) { @@ -12006,9 +12326,12 @@ func (newState *InstancePoolGcpAttributes) SyncEffectiveFieldsDuringCreateOrUpda func (newState *InstancePoolGcpAttributes) SyncEffectiveFieldsDuringRead(existingState InstancePoolGcpAttributes) { } -func (c InstancePoolGcpAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolGcpAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gcp_availability"] = attrs["gcp_availability"].SetOptional() + attrs["local_ssd_count"] = attrs["local_ssd_count"].SetOptional() + attrs["zone_id"] = attrs["zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolGcpAttributes. @@ -12047,11 +12370,11 @@ func (o InstancePoolGcpAttributes) Type(ctx context.Context) attr.Type { } type InstancePoolPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *InstancePoolPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolPermission) { @@ -12060,9 +12383,12 @@ func (newState *InstancePoolPermission) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *InstancePoolPermission) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermission) { } -func (c InstancePoolPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermission. @@ -12131,11 +12457,11 @@ func (o *InstancePoolPermission) SetInheritedFromObject(ctx context.Context, v [ } type InstancePoolPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *InstancePoolPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolPermissions) { @@ -12144,10 +12470,12 @@ func (newState *InstancePoolPermissions) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *InstancePoolPermissions) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermissions) { } -func (c InstancePoolPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c InstancePoolPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermissions. @@ -12216,9 +12544,9 @@ func (o *InstancePoolPermissions) SetAccessControlList(ctx context.Context, v [] } type InstancePoolPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *InstancePoolPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolPermissionsDescription) { @@ -12227,9 +12555,11 @@ func (newState *InstancePoolPermissionsDescription) SyncEffectiveFieldsDuringCre func (newState *InstancePoolPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermissionsDescription) { } -func (c InstancePoolPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermissionsDescription. @@ -12266,7 +12596,7 @@ func (o InstancePoolPermissionsDescription) Type(ctx context.Context) attr.Type } type InstancePoolPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The instance pool for which to get or manage permissions. InstancePoolId types.String `tfsdk:"-"` } @@ -12277,11 +12607,11 @@ func (newState *InstancePoolPermissionsRequest) SyncEffectiveFieldsDuringCreateO func (newState *InstancePoolPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState InstancePoolPermissionsRequest) { } -func (c InstancePoolPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "instance_pool_id")...) +func (c InstancePoolPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolPermissionsRequest. @@ -12349,13 +12679,13 @@ func (o *InstancePoolPermissionsRequest) SetAccessControlList(ctx context.Contex type InstancePoolStats struct { // Number of active instances in the pool that are NOT part of a cluster. - IdleCount types.Int64 `tfsdk:"idle_count" tf:"optional"` + IdleCount types.Int64 `tfsdk:"idle_count"` // Number of pending instances in the pool that are NOT part of a cluster. - PendingIdleCount types.Int64 `tfsdk:"pending_idle_count" tf:"optional"` + PendingIdleCount types.Int64 `tfsdk:"pending_idle_count"` // Number of pending instances in the pool that are part of a cluster. - PendingUsedCount types.Int64 `tfsdk:"pending_used_count" tf:"optional"` + PendingUsedCount types.Int64 `tfsdk:"pending_used_count"` // Number of active instances in the pool that are part of a cluster. - UsedCount types.Int64 `tfsdk:"used_count" tf:"optional"` + UsedCount types.Int64 `tfsdk:"used_count"` } func (newState *InstancePoolStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolStats) { @@ -12364,9 +12694,13 @@ func (newState *InstancePoolStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *InstancePoolStats) SyncEffectiveFieldsDuringRead(existingState InstancePoolStats) { } -func (c InstancePoolStats) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InstancePoolStats) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["idle_count"] = attrs["idle_count"].SetOptional() + attrs["pending_idle_count"] = attrs["pending_idle_count"].SetOptional() + attrs["pending_used_count"] = attrs["pending_used_count"].SetOptional() + attrs["used_count"] = attrs["used_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolStats. @@ -12411,7 +12745,7 @@ type InstancePoolStatus struct { // pending_instance_errors follows FIFO with maximum length of the min_idle // of the pool. The pending_instance_errors is emptied once the number of // exiting available instances reaches the min_idle of the pool. - PendingInstanceErrors types.List `tfsdk:"pending_instance_errors" tf:"optional"` + PendingInstanceErrors types.List `tfsdk:"pending_instance_errors"` } func (newState *InstancePoolStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstancePoolStatus) { @@ -12420,10 +12754,10 @@ func (newState *InstancePoolStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *InstancePoolStatus) SyncEffectiveFieldsDuringRead(existingState InstancePoolStatus) { } -func (c InstancePoolStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PendingInstanceError{}.ApplySchemaCustomizations(cs, append(path, "pending_instance_errors")...) +func (c InstancePoolStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pending_instance_errors"] = attrs["pending_instance_errors"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstancePoolStatus. @@ -12496,16 +12830,16 @@ type InstanceProfile struct { // Otherwise, this field is optional. // // [Databricks SQL Serverless]: https://docs.databricks.com/sql/admin/serverless.html - IamRoleArn types.String `tfsdk:"iam_role_arn" tf:"optional"` + IamRoleArn types.String `tfsdk:"iam_role_arn"` // The AWS ARN of the instance profile to register with Databricks. This // field is required. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:""` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Boolean flag indicating whether the instance profile should only be used // in credential passthrough scenarios. If true, it means the instance // profile contains an meta IAM role which could assume a wide range of // roles. Therefore it should always be used with authorization. This field // is optional, the default value is `false`. - IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile" tf:"optional"` + IsMetaInstanceProfile types.Bool `tfsdk:"is_meta_instance_profile"` } func (newState *InstanceProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstanceProfile) { @@ -12514,10 +12848,12 @@ func (newState *InstanceProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan In func (newState *InstanceProfile) SyncEffectiveFieldsDuringRead(existingState InstanceProfile) { } -func (c InstanceProfile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_profile_arn")...) +func (c InstanceProfile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["iam_role_arn"] = attrs["iam_role_arn"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetRequired() + attrs["is_meta_instance_profile"] = attrs["is_meta_instance_profile"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstanceProfile. @@ -12557,11 +12893,11 @@ func (o InstanceProfile) Type(ctx context.Context) attr.Type { type Library struct { // Specification of a CRAN library to be installed as part of the library - Cran types.Object `tfsdk:"cran" tf:"optional,object"` + Cran types.Object `tfsdk:"cran"` // Deprecated. URI of the egg library to install. Installing Python egg // files is deprecated and is not supported in Databricks Runtime 14.0 and // above. - Egg types.String `tfsdk:"egg" tf:"optional"` + Egg types.String `tfsdk:"egg"` // URI of the JAR library to install. Supported URIs include Workspace // paths, Unity Catalog Volumes paths, and S3 URIs. For example: `{ "jar": // "/Workspace/path/to/library.jar" }`, `{ "jar" : @@ -12569,18 +12905,18 @@ type Library struct { // "s3://my-bucket/library.jar" }`. If S3 is used, please make sure the // cluster has read access on the library. You may need to launch the // cluster with an IAM role to access the S3 URI. - Jar types.String `tfsdk:"jar" tf:"optional"` + Jar types.String `tfsdk:"jar"` // Specification of a maven library to be installed. For example: `{ // "coordinates": "org.jsoup:jsoup:1.7.2" }` - Maven types.Object `tfsdk:"maven" tf:"optional,object"` + Maven types.Object `tfsdk:"maven"` // Specification of a PyPi library to be installed. For example: `{ // "package": "simplejson" }` - Pypi types.Object `tfsdk:"pypi" tf:"optional,object"` + Pypi types.Object `tfsdk:"pypi"` // URI of the requirements.txt file to install. Only Workspace paths and // Unity Catalog Volumes paths are supported. For example: `{ // "requirements": "/Workspace/path/to/requirements.txt" }` or `{ // "requirements" : "/Volumes/path/to/requirements.txt" }` - Requirements types.String `tfsdk:"requirements" tf:"optional"` + Requirements types.String `tfsdk:"requirements"` // URI of the wheel library to install. Supported URIs include Workspace // paths, Unity Catalog Volumes paths, and S3 URIs. For example: `{ "whl": // "/Workspace/path/to/library.whl" }`, `{ "whl" : @@ -12588,7 +12924,7 @@ type Library struct { // "s3://my-bucket/library.whl" }`. If S3 is used, please make sure the // cluster has read access on the library. You may need to launch the // cluster with an IAM role to access the S3 URI. - Whl types.String `tfsdk:"whl" tf:"optional"` + Whl types.String `tfsdk:"whl"` } func (newState *Library) SyncEffectiveFieldsDuringCreateOrUpdate(plan Library) { @@ -12597,12 +12933,16 @@ func (newState *Library) SyncEffectiveFieldsDuringCreateOrUpdate(plan Library) { func (newState *Library) SyncEffectiveFieldsDuringRead(existingState Library) { } -func (c Library) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RCranLibrary{}.ApplySchemaCustomizations(cs, append(path, "cran")...) - MavenLibrary{}.ApplySchemaCustomizations(cs, append(path, "maven")...) - PythonPyPiLibrary{}.ApplySchemaCustomizations(cs, append(path, "pypi")...) +func (c Library) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cran"] = attrs["cran"].SetOptional() + attrs["egg"] = attrs["egg"].SetOptional() + attrs["jar"] = attrs["jar"].SetOptional() + attrs["maven"] = attrs["maven"].SetOptional() + attrs["pypi"] = attrs["pypi"].SetOptional() + attrs["requirements"] = attrs["requirements"].SetOptional() + attrs["whl"] = attrs["whl"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Library. @@ -12740,14 +13080,14 @@ func (o *Library) SetPypi(ctx context.Context, v PythonPyPiLibrary) { type LibraryFullStatus struct { // Whether the library was set to be installed on all clusters via the // libraries UI. - IsLibraryForAllClusters types.Bool `tfsdk:"is_library_for_all_clusters" tf:"optional"` + IsLibraryForAllClusters types.Bool `tfsdk:"is_library_for_all_clusters"` // Unique identifier for the library. - Library types.Object `tfsdk:"library" tf:"optional,object"` + Library types.Object `tfsdk:"library"` // All the info and warning messages that have occurred so far for this // library. - Messages types.List `tfsdk:"messages" tf:"optional"` + Messages types.List `tfsdk:"messages"` // Status of installing the library on the cluster. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *LibraryFullStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan LibraryFullStatus) { @@ -12756,10 +13096,13 @@ func (newState *LibraryFullStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *LibraryFullStatus) SyncEffectiveFieldsDuringRead(existingState LibraryFullStatus) { } -func (c LibraryFullStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library{}.ApplySchemaCustomizations(cs, append(path, "library")...) +func (c LibraryFullStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_library_for_all_clusters"] = attrs["is_library_for_all_clusters"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["messages"] = attrs["messages"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LibraryFullStatus. @@ -12860,7 +13203,7 @@ func (o *LibraryFullStatus) SetMessages(ctx context.Context, v []types.String) { type ListAllClusterLibraryStatusesResponse struct { // A list of cluster statuses. - Statuses types.List `tfsdk:"statuses" tf:"optional"` + Statuses types.List `tfsdk:"statuses"` } func (newState *ListAllClusterLibraryStatusesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAllClusterLibraryStatusesResponse) { @@ -12869,10 +13212,10 @@ func (newState *ListAllClusterLibraryStatusesResponse) SyncEffectiveFieldsDuring func (newState *ListAllClusterLibraryStatusesResponse) SyncEffectiveFieldsDuringRead(existingState ListAllClusterLibraryStatusesResponse) { } -func (c ListAllClusterLibraryStatusesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterLibraryStatuses{}.ApplySchemaCustomizations(cs, append(path, "statuses")...) +func (c ListAllClusterLibraryStatusesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["statuses"] = attrs["statuses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAllClusterLibraryStatusesResponse. @@ -12939,9 +13282,9 @@ func (o *ListAllClusterLibraryStatusesResponse) SetStatuses(ctx context.Context, type ListAvailableZonesResponse struct { // The availability zone if no `zone_id` is provided in the cluster creation // request. - DefaultZone types.String `tfsdk:"default_zone" tf:"optional"` + DefaultZone types.String `tfsdk:"default_zone"` // The list of available zones (e.g., ['us-west-2c', 'us-east-2']). - Zones types.List `tfsdk:"zones" tf:"optional"` + Zones types.List `tfsdk:"zones"` } func (newState *ListAvailableZonesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAvailableZonesResponse) { @@ -12950,9 +13293,11 @@ func (newState *ListAvailableZonesResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListAvailableZonesResponse) SyncEffectiveFieldsDuringRead(existingState ListAvailableZonesResponse) { } -func (c ListAvailableZonesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListAvailableZonesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_zone"] = attrs["default_zone"].SetOptional() + attrs["zones"] = attrs["zones"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAvailableZonesResponse. @@ -13068,14 +13413,14 @@ func (o ListClusterCompliancesRequest) Type(ctx context.Context) attr.Type { type ListClusterCompliancesResponse struct { // A list of clusters and their policy compliance statuses. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListClusterCompliancesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClusterCompliancesResponse) { @@ -13084,10 +13429,12 @@ func (newState *ListClusterCompliancesResponse) SyncEffectiveFieldsDuringCreateO func (newState *ListClusterCompliancesResponse) SyncEffectiveFieldsDuringRead(existingState ListClusterCompliancesResponse) { } -func (c ListClusterCompliancesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterCompliance{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) +func (c ListClusterCompliancesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClusterCompliancesResponse. @@ -13201,13 +13548,13 @@ func (o ListClusterPoliciesRequest) Type(ctx context.Context) attr.Type { type ListClustersFilterBy struct { // The source of cluster creation. - ClusterSources types.List `tfsdk:"cluster_sources" tf:"optional"` + ClusterSources types.List `tfsdk:"cluster_sources"` // The current state of the clusters. - ClusterStates types.List `tfsdk:"cluster_states" tf:"optional"` + ClusterStates types.List `tfsdk:"cluster_states"` // Whether the clusters are pinned or not. - IsPinned types.Bool `tfsdk:"is_pinned" tf:"optional"` + IsPinned types.Bool `tfsdk:"is_pinned"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *ListClustersFilterBy) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClustersFilterBy) { @@ -13216,9 +13563,13 @@ func (newState *ListClustersFilterBy) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListClustersFilterBy) SyncEffectiveFieldsDuringRead(existingState ListClustersFilterBy) { } -func (c ListClustersFilterBy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListClustersFilterBy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_sources"] = attrs["cluster_sources"].SetOptional() + attrs["cluster_states"] = attrs["cluster_states"].SetOptional() + attrs["is_pinned"] = attrs["is_pinned"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClustersFilterBy. @@ -13430,14 +13781,14 @@ func (o *ListClustersRequest) SetSortBy(ctx context.Context, v ListClustersSortB type ListClustersResponse struct { // - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // This field represents the pagination token to retrieve the next page of // results. If the value is "", it means no further results for the request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // This field represents the pagination token to retrieve the previous page // of results. If the value is "", it means no further results for the // request. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListClustersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClustersResponse) { @@ -13446,10 +13797,12 @@ func (newState *ListClustersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListClustersResponse) SyncEffectiveFieldsDuringRead(existingState ListClustersResponse) { } -func (c ListClustersResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterDetails{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) +func (c ListClustersResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClustersResponse. @@ -13519,11 +13872,11 @@ func (o *ListClustersResponse) SetClusters(ctx context.Context, v []ClusterDetai type ListClustersSortBy struct { // The direction to sort by. - Direction types.String `tfsdk:"direction" tf:"optional"` + Direction types.String `tfsdk:"direction"` // The sorting criteria. By default, clusters are sorted by 3 columns from // highest to lowest precedence: cluster state, pinned or unpinned, then // cluster name. - Field types.String `tfsdk:"field" tf:"optional"` + Field types.String `tfsdk:"field"` } func (newState *ListClustersSortBy) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListClustersSortBy) { @@ -13532,9 +13885,11 @@ func (newState *ListClustersSortBy) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListClustersSortBy) SyncEffectiveFieldsDuringRead(existingState ListClustersSortBy) { } -func (c ListClustersSortBy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListClustersSortBy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["direction"] = attrs["direction"].SetOptional() + attrs["field"] = attrs["field"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListClustersSortBy. @@ -13571,7 +13926,7 @@ func (o ListClustersSortBy) Type(ctx context.Context) attr.Type { } type ListGlobalInitScriptsResponse struct { - Scripts types.List `tfsdk:"scripts" tf:"optional"` + Scripts types.List `tfsdk:"scripts"` } func (newState *ListGlobalInitScriptsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListGlobalInitScriptsResponse) { @@ -13580,10 +13935,10 @@ func (newState *ListGlobalInitScriptsResponse) SyncEffectiveFieldsDuringCreateOr func (newState *ListGlobalInitScriptsResponse) SyncEffectiveFieldsDuringRead(existingState ListGlobalInitScriptsResponse) { } -func (c ListGlobalInitScriptsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GlobalInitScriptDetails{}.ApplySchemaCustomizations(cs, append(path, "scripts")...) +func (c ListGlobalInitScriptsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scripts"] = attrs["scripts"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListGlobalInitScriptsResponse. @@ -13648,7 +14003,7 @@ func (o *ListGlobalInitScriptsResponse) SetScripts(ctx context.Context, v []Glob } type ListInstancePools struct { - InstancePools types.List `tfsdk:"instance_pools" tf:"optional"` + InstancePools types.List `tfsdk:"instance_pools"` } func (newState *ListInstancePools) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListInstancePools) { @@ -13657,10 +14012,10 @@ func (newState *ListInstancePools) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListInstancePools) SyncEffectiveFieldsDuringRead(existingState ListInstancePools) { } -func (c ListInstancePools) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstancePoolAndStats{}.ApplySchemaCustomizations(cs, append(path, "instance_pools")...) +func (c ListInstancePools) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_pools"] = attrs["instance_pools"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListInstancePools. @@ -13726,7 +14081,7 @@ func (o *ListInstancePools) SetInstancePools(ctx context.Context, v []InstancePo type ListInstanceProfilesResponse struct { // A list of instance profiles that the user can access. - InstanceProfiles types.List `tfsdk:"instance_profiles" tf:"optional"` + InstanceProfiles types.List `tfsdk:"instance_profiles"` } func (newState *ListInstanceProfilesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListInstanceProfilesResponse) { @@ -13735,10 +14090,10 @@ func (newState *ListInstanceProfilesResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *ListInstanceProfilesResponse) SyncEffectiveFieldsDuringRead(existingState ListInstanceProfilesResponse) { } -func (c ListInstanceProfilesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstanceProfile{}.ApplySchemaCustomizations(cs, append(path, "instance_profiles")...) +func (c ListInstanceProfilesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_profiles"] = attrs["instance_profiles"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListInstanceProfilesResponse. @@ -13804,7 +14159,7 @@ func (o *ListInstanceProfilesResponse) SetInstanceProfiles(ctx context.Context, type ListNodeTypesResponse struct { // The list of available Spark node types. - NodeTypes types.List `tfsdk:"node_types" tf:"optional"` + NodeTypes types.List `tfsdk:"node_types"` } func (newState *ListNodeTypesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNodeTypesResponse) { @@ -13813,10 +14168,10 @@ func (newState *ListNodeTypesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListNodeTypesResponse) SyncEffectiveFieldsDuringRead(existingState ListNodeTypesResponse) { } -func (c ListNodeTypesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NodeType{}.ApplySchemaCustomizations(cs, append(path, "node_types")...) +func (c ListNodeTypesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["node_types"] = attrs["node_types"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNodeTypesResponse. @@ -13882,7 +14237,7 @@ func (o *ListNodeTypesResponse) SetNodeTypes(ctx context.Context, v []NodeType) type ListPoliciesResponse struct { // List of policies. - Policies types.List `tfsdk:"policies" tf:"optional"` + Policies types.List `tfsdk:"policies"` } func (newState *ListPoliciesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPoliciesResponse) { @@ -13891,10 +14246,10 @@ func (newState *ListPoliciesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListPoliciesResponse) SyncEffectiveFieldsDuringRead(existingState ListPoliciesResponse) { } -func (c ListPoliciesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Policy{}.ApplySchemaCustomizations(cs, append(path, "policies")...) +func (c ListPoliciesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["policies"] = attrs["policies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPoliciesResponse. @@ -14002,9 +14357,9 @@ func (o ListPolicyFamiliesRequest) Type(ctx context.Context) attr.Type { type ListPolicyFamiliesResponse struct { // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of policy families. - PolicyFamilies types.List `tfsdk:"policy_families" tf:"optional"` + PolicyFamilies types.List `tfsdk:"policy_families"` } func (newState *ListPolicyFamiliesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPolicyFamiliesResponse) { @@ -14013,10 +14368,11 @@ func (newState *ListPolicyFamiliesResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListPolicyFamiliesResponse) SyncEffectiveFieldsDuringRead(existingState ListPolicyFamiliesResponse) { } -func (c ListPolicyFamiliesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PolicyFamily{}.ApplySchemaCustomizations(cs, append(path, "policy_families")...) +func (c ListPolicyFamiliesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["policy_families"] = attrs["policy_families"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPolicyFamiliesResponse. @@ -14084,7 +14440,7 @@ func (o *ListPolicyFamiliesResponse) SetPolicyFamilies(ctx context.Context, v [] type LocalFileInfo struct { // local file destination, e.g. `file:/my/local/file.sh` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *LocalFileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan LocalFileInfo) { @@ -14093,10 +14449,10 @@ func (newState *LocalFileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Loca func (newState *LocalFileInfo) SyncEffectiveFieldsDuringRead(existingState LocalFileInfo) { } -func (c LocalFileInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c LocalFileInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LocalFileInfo. @@ -14132,9 +14488,9 @@ func (o LocalFileInfo) Type(ctx context.Context) attr.Type { type LogAnalyticsInfo struct { // - LogAnalyticsPrimaryKey types.String `tfsdk:"log_analytics_primary_key" tf:"optional"` + LogAnalyticsPrimaryKey types.String `tfsdk:"log_analytics_primary_key"` // - LogAnalyticsWorkspaceId types.String `tfsdk:"log_analytics_workspace_id" tf:"optional"` + LogAnalyticsWorkspaceId types.String `tfsdk:"log_analytics_workspace_id"` } func (newState *LogAnalyticsInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogAnalyticsInfo) { @@ -14143,9 +14499,11 @@ func (newState *LogAnalyticsInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *LogAnalyticsInfo) SyncEffectiveFieldsDuringRead(existingState LogAnalyticsInfo) { } -func (c LogAnalyticsInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogAnalyticsInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_analytics_primary_key"] = attrs["log_analytics_primary_key"].SetOptional() + attrs["log_analytics_workspace_id"] = attrs["log_analytics_workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogAnalyticsInfo. @@ -14184,10 +14542,10 @@ func (o LogAnalyticsInfo) Type(ctx context.Context) attr.Type { type LogSyncStatus struct { // The timestamp of last attempt. If the last attempt fails, // `last_exception` will contain the exception in the last attempt. - LastAttempted types.Int64 `tfsdk:"last_attempted" tf:"optional"` + LastAttempted types.Int64 `tfsdk:"last_attempted"` // The exception thrown in the last attempt, it would be null (omitted in // the response) if there is no exception in last attempted. - LastException types.String `tfsdk:"last_exception" tf:"optional"` + LastException types.String `tfsdk:"last_exception"` } func (newState *LogSyncStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogSyncStatus) { @@ -14196,9 +14554,11 @@ func (newState *LogSyncStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogS func (newState *LogSyncStatus) SyncEffectiveFieldsDuringRead(existingState LogSyncStatus) { } -func (c LogSyncStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogSyncStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["last_attempted"] = attrs["last_attempted"].SetOptional() + attrs["last_exception"] = attrs["last_exception"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogSyncStatus. @@ -14236,16 +14596,16 @@ func (o LogSyncStatus) Type(ctx context.Context) attr.Type { type MavenLibrary struct { // Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". - Coordinates types.String `tfsdk:"coordinates" tf:""` + Coordinates types.String `tfsdk:"coordinates"` // List of dependences to exclude. For example: `["slf4j:slf4j", // "*:hadoop-client"]`. // // Maven dependency exclusions: // https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. - Exclusions types.List `tfsdk:"exclusions" tf:"optional"` + Exclusions types.List `tfsdk:"exclusions"` // Maven repo to install the Maven package from. If omitted, both Maven // Central Repository and Spark Packages are searched. - Repo types.String `tfsdk:"repo" tf:"optional"` + Repo types.String `tfsdk:"repo"` } func (newState *MavenLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan MavenLibrary) { @@ -14254,10 +14614,12 @@ func (newState *MavenLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan Maven func (newState *MavenLibrary) SyncEffectiveFieldsDuringRead(existingState MavenLibrary) { } -func (c MavenLibrary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "coordinates")...) +func (c MavenLibrary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["coordinates"] = attrs["coordinates"].SetRequired() + attrs["exclusions"] = attrs["exclusions"].SetOptional() + attrs["repo"] = attrs["repo"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MavenLibrary. @@ -14326,15 +14688,15 @@ func (o *MavenLibrary) SetExclusions(ctx context.Context, v []types.String) { } type NodeInstanceType struct { - InstanceTypeId types.String `tfsdk:"instance_type_id" tf:"optional"` + InstanceTypeId types.String `tfsdk:"instance_type_id"` - LocalDiskSizeGb types.Int64 `tfsdk:"local_disk_size_gb" tf:"optional"` + LocalDiskSizeGb types.Int64 `tfsdk:"local_disk_size_gb"` - LocalDisks types.Int64 `tfsdk:"local_disks" tf:"optional"` + LocalDisks types.Int64 `tfsdk:"local_disks"` - LocalNvmeDiskSizeGb types.Int64 `tfsdk:"local_nvme_disk_size_gb" tf:"optional"` + LocalNvmeDiskSizeGb types.Int64 `tfsdk:"local_nvme_disk_size_gb"` - LocalNvmeDisks types.Int64 `tfsdk:"local_nvme_disks" tf:"optional"` + LocalNvmeDisks types.Int64 `tfsdk:"local_nvme_disks"` } func (newState *NodeInstanceType) SyncEffectiveFieldsDuringCreateOrUpdate(plan NodeInstanceType) { @@ -14343,9 +14705,14 @@ func (newState *NodeInstanceType) SyncEffectiveFieldsDuringCreateOrUpdate(plan N func (newState *NodeInstanceType) SyncEffectiveFieldsDuringRead(existingState NodeInstanceType) { } -func (c NodeInstanceType) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NodeInstanceType) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_type_id"] = attrs["instance_type_id"].SetOptional() + attrs["local_disk_size_gb"] = attrs["local_disk_size_gb"].SetOptional() + attrs["local_disks"] = attrs["local_disks"].SetOptional() + attrs["local_nvme_disk_size_gb"] = attrs["local_nvme_disk_size_gb"].SetOptional() + attrs["local_nvme_disks"] = attrs["local_nvme_disks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NodeInstanceType. @@ -14388,53 +14755,53 @@ func (o NodeInstanceType) Type(ctx context.Context) attr.Type { } type NodeType struct { - Category types.String `tfsdk:"category" tf:"optional"` + Category types.String `tfsdk:"category"` // A string description associated with this node type, e.g., "r3.xlarge". - Description types.String `tfsdk:"description" tf:""` + Description types.String `tfsdk:"description"` - DisplayOrder types.Int64 `tfsdk:"display_order" tf:"optional"` + DisplayOrder types.Int64 `tfsdk:"display_order"` // An identifier for the type of hardware that this node runs on, e.g., // "r3.2xlarge" in AWS. - InstanceTypeId types.String `tfsdk:"instance_type_id" tf:""` + InstanceTypeId types.String `tfsdk:"instance_type_id"` // Whether the node type is deprecated. Non-deprecated node types offer // greater performance. - IsDeprecated types.Bool `tfsdk:"is_deprecated" tf:"optional"` + IsDeprecated types.Bool `tfsdk:"is_deprecated"` // AWS specific, whether this instance supports encryption in transit, used // for hipaa and pci workloads. - IsEncryptedInTransit types.Bool `tfsdk:"is_encrypted_in_transit" tf:"optional"` + IsEncryptedInTransit types.Bool `tfsdk:"is_encrypted_in_transit"` - IsGraviton types.Bool `tfsdk:"is_graviton" tf:"optional"` + IsGraviton types.Bool `tfsdk:"is_graviton"` - IsHidden types.Bool `tfsdk:"is_hidden" tf:"optional"` + IsHidden types.Bool `tfsdk:"is_hidden"` - IsIoCacheEnabled types.Bool `tfsdk:"is_io_cache_enabled" tf:"optional"` + IsIoCacheEnabled types.Bool `tfsdk:"is_io_cache_enabled"` // Memory (in MB) available for this node type. - MemoryMb types.Int64 `tfsdk:"memory_mb" tf:""` + MemoryMb types.Int64 `tfsdk:"memory_mb"` - NodeInfo types.Object `tfsdk:"node_info" tf:"optional,object"` + NodeInfo types.Object `tfsdk:"node_info"` - NodeInstanceType types.Object `tfsdk:"node_instance_type" tf:"optional,object"` + NodeInstanceType types.Object `tfsdk:"node_instance_type"` // Unique identifier for this node type. - NodeTypeId types.String `tfsdk:"node_type_id" tf:""` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of CPU cores available for this node type. Note that this can be // fractional, e.g., 2.5 cores, if the the number of cores on a machine // instance is not divisible by the number of Spark nodes on that machine. - NumCores types.Float64 `tfsdk:"num_cores" tf:""` + NumCores types.Float64 `tfsdk:"num_cores"` - NumGpus types.Int64 `tfsdk:"num_gpus" tf:"optional"` + NumGpus types.Int64 `tfsdk:"num_gpus"` - PhotonDriverCapable types.Bool `tfsdk:"photon_driver_capable" tf:"optional"` + PhotonDriverCapable types.Bool `tfsdk:"photon_driver_capable"` - PhotonWorkerCapable types.Bool `tfsdk:"photon_worker_capable" tf:"optional"` + PhotonWorkerCapable types.Bool `tfsdk:"photon_worker_capable"` - SupportClusterTags types.Bool `tfsdk:"support_cluster_tags" tf:"optional"` + SupportClusterTags types.Bool `tfsdk:"support_cluster_tags"` - SupportEbsVolumes types.Bool `tfsdk:"support_ebs_volumes" tf:"optional"` + SupportEbsVolumes types.Bool `tfsdk:"support_ebs_volumes"` - SupportPortForwarding types.Bool `tfsdk:"support_port_forwarding" tf:"optional"` + SupportPortForwarding types.Bool `tfsdk:"support_port_forwarding"` // Indicates if this node type can be used for an instance pool or cluster // with elastic disk enabled. This is true for most node types. - SupportsElasticDisk types.Bool `tfsdk:"supports_elastic_disk" tf:"optional"` + SupportsElasticDisk types.Bool `tfsdk:"supports_elastic_disk"` } func (newState *NodeType) SyncEffectiveFieldsDuringCreateOrUpdate(plan NodeType) { @@ -14443,16 +14810,30 @@ func (newState *NodeType) SyncEffectiveFieldsDuringCreateOrUpdate(plan NodeType) func (newState *NodeType) SyncEffectiveFieldsDuringRead(existingState NodeType) { } -func (c NodeType) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "description")...) - cs.SetRequired(append(path, "instance_type_id")...) - cs.SetRequired(append(path, "memory_mb")...) - CloudProviderNodeInfo{}.ApplySchemaCustomizations(cs, append(path, "node_info")...) - NodeInstanceType{}.ApplySchemaCustomizations(cs, append(path, "node_instance_type")...) - cs.SetRequired(append(path, "node_type_id")...) - cs.SetRequired(append(path, "num_cores")...) - - return cs +func (c NodeType) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["category"] = attrs["category"].SetOptional() + attrs["description"] = attrs["description"].SetRequired() + attrs["display_order"] = attrs["display_order"].SetOptional() + attrs["instance_type_id"] = attrs["instance_type_id"].SetRequired() + attrs["is_deprecated"] = attrs["is_deprecated"].SetOptional() + attrs["is_encrypted_in_transit"] = attrs["is_encrypted_in_transit"].SetOptional() + attrs["is_graviton"] = attrs["is_graviton"].SetOptional() + attrs["is_hidden"] = attrs["is_hidden"].SetOptional() + attrs["is_io_cache_enabled"] = attrs["is_io_cache_enabled"].SetOptional() + attrs["memory_mb"] = attrs["memory_mb"].SetRequired() + attrs["node_info"] = attrs["node_info"].SetOptional() + attrs["node_instance_type"] = attrs["node_instance_type"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetRequired() + attrs["num_cores"] = attrs["num_cores"].SetRequired() + attrs["num_gpus"] = attrs["num_gpus"].SetOptional() + attrs["photon_driver_capable"] = attrs["photon_driver_capable"].SetOptional() + attrs["photon_worker_capable"] = attrs["photon_worker_capable"].SetOptional() + attrs["support_cluster_tags"] = attrs["support_cluster_tags"].SetOptional() + attrs["support_ebs_volumes"] = attrs["support_ebs_volumes"].SetOptional() + attrs["support_port_forwarding"] = attrs["support_port_forwarding"].SetOptional() + attrs["supports_elastic_disk"] = attrs["supports_elastic_disk"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NodeType. @@ -14586,9 +14967,9 @@ func (o *NodeType) SetNodeInstanceType(ctx context.Context, v NodeInstanceType) } type PendingInstanceError struct { - InstanceId types.String `tfsdk:"instance_id" tf:"optional"` + InstanceId types.String `tfsdk:"instance_id"` - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *PendingInstanceError) SyncEffectiveFieldsDuringCreateOrUpdate(plan PendingInstanceError) { @@ -14597,9 +14978,11 @@ func (newState *PendingInstanceError) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *PendingInstanceError) SyncEffectiveFieldsDuringRead(existingState PendingInstanceError) { } -func (c PendingInstanceError) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PendingInstanceError) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_id"] = attrs["instance_id"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PendingInstanceError. @@ -14637,7 +15020,7 @@ func (o PendingInstanceError) Type(ctx context.Context) attr.Type { type PermanentDeleteCluster struct { // The cluster to be deleted. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *PermanentDeleteCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermanentDeleteCluster) { @@ -14646,10 +15029,10 @@ func (newState *PermanentDeleteCluster) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PermanentDeleteCluster) SyncEffectiveFieldsDuringRead(existingState PermanentDeleteCluster) { } -func (c PermanentDeleteCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c PermanentDeleteCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermanentDeleteCluster. @@ -14692,9 +15075,9 @@ func (newState *PermanentDeleteClusterResponse) SyncEffectiveFieldsDuringCreateO func (newState *PermanentDeleteClusterResponse) SyncEffectiveFieldsDuringRead(existingState PermanentDeleteClusterResponse) { } -func (c PermanentDeleteClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermanentDeleteClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermanentDeleteClusterResponse. @@ -14726,7 +15109,7 @@ func (o PermanentDeleteClusterResponse) Type(ctx context.Context) attr.Type { type PinCluster struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *PinCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan PinCluster) { @@ -14735,10 +15118,10 @@ func (newState *PinCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan PinClus func (newState *PinCluster) SyncEffectiveFieldsDuringRead(existingState PinCluster) { } -func (c PinCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c PinCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PinCluster. @@ -14781,9 +15164,9 @@ func (newState *PinClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PinClusterResponse) SyncEffectiveFieldsDuringRead(existingState PinClusterResponse) { } -func (c PinClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PinClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PinClusterResponse. @@ -14817,30 +15200,30 @@ func (o PinClusterResponse) Type(ctx context.Context) attr.Type { type Policy struct { // Creation time. The timestamp (in millisecond) when this Cluster Policy // was created. - CreatedAtTimestamp types.Int64 `tfsdk:"created_at_timestamp" tf:"optional"` + CreatedAtTimestamp types.Int64 `tfsdk:"created_at_timestamp"` // Creator user name. The field won't be included in the response if the // user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Policy definition document expressed in [Databricks Cluster Policy // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Additional human-readable description of the cluster policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // If true, policy is a default policy created and managed by Databricks. // Default policies cannot be deleted, and their policy families cannot be // changed. - IsDefault types.Bool `tfsdk:"is_default" tf:"optional"` + IsDefault types.Bool `tfsdk:"is_default"` // A list of libraries to be installed on the next cluster restart that uses // this policy. The maximum number of libraries is 500. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Max number of clusters per user that can be active using this policy. If // not present, there is no max limit. - MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user" tf:"optional"` + MaxClustersPerUser types.Int64 `tfsdk:"max_clusters_per_user"` // Cluster Policy name requested by the user. This has to be unique. Length // must be between 1 and 100 characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Policy definition JSON document expressed in [Databricks Policy // Definition Language]. The JSON document must be passed as a string and // cannot be embedded in the requests. @@ -14850,16 +15233,16 @@ type Policy struct { // policy definition. // // [Databricks Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides" tf:"optional"` + PolicyFamilyDefinitionOverrides types.String `tfsdk:"policy_family_definition_overrides"` // ID of the policy family. The cluster policy's policy definition inherits // the policy family's policy definition. // // Cannot be used with `definition`. Use // `policy_family_definition_overrides` instead to customize the policy // definition. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` // Canonical unique identifier for the Cluster Policy. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` } func (newState *Policy) SyncEffectiveFieldsDuringCreateOrUpdate(plan Policy) { @@ -14868,10 +15251,20 @@ func (newState *Policy) SyncEffectiveFieldsDuringCreateOrUpdate(plan Policy) { func (newState *Policy) SyncEffectiveFieldsDuringRead(existingState Policy) { } -func (c Policy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Library{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c Policy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at_timestamp"] = attrs["created_at_timestamp"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["is_default"] = attrs["is_default"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["max_clusters_per_user"] = attrs["max_clusters_per_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_definition_overrides"] = attrs["policy_family_definition_overrides"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Policy. @@ -14960,13 +15353,13 @@ type PolicyFamily struct { // Definition Language]. // // [Databricks Cluster Policy Definition Language]: https://docs.databricks.com/administration-guide/clusters/policy-definition.html - Definition types.String `tfsdk:"definition" tf:"optional"` + Definition types.String `tfsdk:"definition"` // Human-readable description of the purpose of the policy family. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Name of the policy family. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Unique identifier for the policy family. - PolicyFamilyId types.String `tfsdk:"policy_family_id" tf:"optional"` + PolicyFamilyId types.String `tfsdk:"policy_family_id"` } func (newState *PolicyFamily) SyncEffectiveFieldsDuringCreateOrUpdate(plan PolicyFamily) { @@ -14975,9 +15368,13 @@ func (newState *PolicyFamily) SyncEffectiveFieldsDuringCreateOrUpdate(plan Polic func (newState *PolicyFamily) SyncEffectiveFieldsDuringRead(existingState PolicyFamily) { } -func (c PolicyFamily) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PolicyFamily) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["definition"] = attrs["definition"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["policy_family_id"] = attrs["policy_family_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PolicyFamily. @@ -15021,10 +15418,10 @@ type PythonPyPiLibrary struct { // The name of the pypi package to install. An optional exact version // specification is also supported. Examples: "simplejson" and // "simplejson==3.8.0". - Package types.String `tfsdk:"package" tf:""` + Package types.String `tfsdk:"package"` // The repository where the package can be found. If not specified, the // default pip index is used. - Repo types.String `tfsdk:"repo" tf:"optional"` + Repo types.String `tfsdk:"repo"` } func (newState *PythonPyPiLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan PythonPyPiLibrary) { @@ -15033,10 +15430,11 @@ func (newState *PythonPyPiLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PythonPyPiLibrary) SyncEffectiveFieldsDuringRead(existingState PythonPyPiLibrary) { } -func (c PythonPyPiLibrary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "package")...) +func (c PythonPyPiLibrary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["package"] = attrs["package"].SetRequired() + attrs["repo"] = attrs["repo"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PythonPyPiLibrary. @@ -15074,10 +15472,10 @@ func (o PythonPyPiLibrary) Type(ctx context.Context) attr.Type { type RCranLibrary struct { // The name of the CRAN package to install. - Package types.String `tfsdk:"package" tf:""` + Package types.String `tfsdk:"package"` // The repository where the package can be found. If not specified, the // default CRAN repo is used. - Repo types.String `tfsdk:"repo" tf:"optional"` + Repo types.String `tfsdk:"repo"` } func (newState *RCranLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan RCranLibrary) { @@ -15086,10 +15484,11 @@ func (newState *RCranLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan RCran func (newState *RCranLibrary) SyncEffectiveFieldsDuringRead(existingState RCranLibrary) { } -func (c RCranLibrary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "package")...) +func (c RCranLibrary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["package"] = attrs["package"].SetRequired() + attrs["repo"] = attrs["repo"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RCranLibrary. @@ -15127,7 +15526,7 @@ func (o RCranLibrary) Type(ctx context.Context) attr.Type { type RemoveInstanceProfile struct { // The ARN of the instance profile to remove. This field is required. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:""` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` } func (newState *RemoveInstanceProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan RemoveInstanceProfile) { @@ -15136,10 +15535,10 @@ func (newState *RemoveInstanceProfile) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *RemoveInstanceProfile) SyncEffectiveFieldsDuringRead(existingState RemoveInstanceProfile) { } -func (c RemoveInstanceProfile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "instance_profile_arn")...) +func (c RemoveInstanceProfile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RemoveInstanceProfile. @@ -15207,9 +15606,9 @@ type ResizeCluster struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // The cluster to be resized. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -15220,7 +15619,7 @@ type ResizeCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` } func (newState *ResizeCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResizeCluster) { @@ -15229,11 +15628,12 @@ func (newState *ResizeCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Resi func (newState *ResizeCluster) SyncEffectiveFieldsDuringRead(existingState ResizeCluster) { } -func (c ResizeCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - cs.SetRequired(append(path, "cluster_id")...) +func (c ResizeCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["num_workers"] = attrs["num_workers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResizeCluster. @@ -15310,9 +15710,9 @@ func (newState *ResizeClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ResizeClusterResponse) SyncEffectiveFieldsDuringRead(existingState ResizeClusterResponse) { } -func (c ResizeClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResizeClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResizeClusterResponse. @@ -15344,9 +15744,9 @@ func (o ResizeClusterResponse) Type(ctx context.Context) attr.Type { type RestartCluster struct { // The cluster to be started. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // - RestartUser types.String `tfsdk:"restart_user" tf:"optional"` + RestartUser types.String `tfsdk:"restart_user"` } func (newState *RestartCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestartCluster) { @@ -15355,10 +15755,11 @@ func (newState *RestartCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Res func (newState *RestartCluster) SyncEffectiveFieldsDuringRead(existingState RestartCluster) { } -func (c RestartCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c RestartCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["restart_user"] = attrs["restart_user"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestartCluster. @@ -15403,9 +15804,9 @@ func (newState *RestartClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *RestartClusterResponse) SyncEffectiveFieldsDuringRead(existingState RestartClusterResponse) { } -func (c RestartClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestartClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestartClusterResponse. @@ -15437,26 +15838,26 @@ func (o RestartClusterResponse) Type(ctx context.Context) attr.Type { type Results struct { // The cause of the error - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` - Data types.Object `tfsdk:"data" tf:"optional"` + Data types.Object `tfsdk:"data"` // The image filename - FileName types.String `tfsdk:"fileName" tf:"optional"` + FileName types.String `tfsdk:"fileName"` - FileNames types.List `tfsdk:"fileNames" tf:"optional"` + FileNames types.List `tfsdk:"fileNames"` // true if a JSON schema is returned instead of a string representation of // the Hive type. - IsJsonSchema types.Bool `tfsdk:"isJsonSchema" tf:"optional"` + IsJsonSchema types.Bool `tfsdk:"isJsonSchema"` // internal field used by SDK - Pos types.Int64 `tfsdk:"pos" tf:"optional"` + Pos types.Int64 `tfsdk:"pos"` - ResultType types.String `tfsdk:"resultType" tf:"optional"` + ResultType types.String `tfsdk:"resultType"` // The table schema - Schema types.List `tfsdk:"schema" tf:"optional"` + Schema types.List `tfsdk:"schema"` // The summary of the error - Summary types.String `tfsdk:"summary" tf:"optional"` + Summary types.String `tfsdk:"summary"` // true if partial results are returned. - Truncated types.Bool `tfsdk:"truncated" tf:"optional"` + Truncated types.Bool `tfsdk:"truncated"` } func (newState *Results) SyncEffectiveFieldsDuringCreateOrUpdate(plan Results) { @@ -15465,9 +15866,19 @@ func (newState *Results) SyncEffectiveFieldsDuringCreateOrUpdate(plan Results) { func (newState *Results) SyncEffectiveFieldsDuringRead(existingState Results) { } -func (c Results) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Results) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() + attrs["fileName"] = attrs["fileName"].SetOptional() + attrs["fileNames"] = attrs["fileNames"].SetOptional() + attrs["isJsonSchema"] = attrs["isJsonSchema"].SetOptional() + attrs["pos"] = attrs["pos"].SetOptional() + attrs["resultType"] = attrs["resultType"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["summary"] = attrs["summary"].SetOptional() + attrs["truncated"] = attrs["truncated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Results. @@ -15590,27 +16001,27 @@ type S3StorageInfo struct { // controls. If you are using cross account role for writing data, you may // want to set `bucket-owner-full-control` to make bucket owner able to read // the logs. - CannedAcl types.String `tfsdk:"canned_acl" tf:"optional"` + CannedAcl types.String `tfsdk:"canned_acl"` // S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be // delivered using cluster iam role, please make sure you set cluster iam // role and the role has write access to the destination. Please also note // that you cannot use AWS keys to deliver logs. - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` // (Optional) Flag to enable server side encryption, `false` by default. - EnableEncryption types.Bool `tfsdk:"enable_encryption" tf:"optional"` + EnableEncryption types.Bool `tfsdk:"enable_encryption"` // (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It // will be used only when encryption is enabled and the default type is // `sse-s3`. - EncryptionType types.String `tfsdk:"encryption_type" tf:"optional"` + EncryptionType types.String `tfsdk:"encryption_type"` // S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or // endpoint needs to be set. If both are set, endpoint will be used. - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` // (Optional) Kms key which will be used if encryption is enabled and // encryption type is set to `sse-kms`. - KmsKey types.String `tfsdk:"kms_key" tf:"optional"` + KmsKey types.String `tfsdk:"kms_key"` // S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. // If both are set, endpoint will be used. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *S3StorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan S3StorageInfo) { @@ -15619,10 +16030,16 @@ func (newState *S3StorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan S3St func (newState *S3StorageInfo) SyncEffectiveFieldsDuringRead(existingState S3StorageInfo) { } -func (c S3StorageInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c S3StorageInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["canned_acl"] = attrs["canned_acl"].SetOptional() + attrs["destination"] = attrs["destination"].SetRequired() + attrs["enable_encryption"] = attrs["enable_encryption"].SetOptional() + attrs["encryption_type"] = attrs["encryption_type"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["kms_key"] = attrs["kms_key"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in S3StorageInfo. @@ -15670,30 +16087,30 @@ func (o S3StorageInfo) Type(ctx context.Context) attr.Type { type SparkNode struct { // The private IP address of the host instance. - HostPrivateIp types.String `tfsdk:"host_private_ip" tf:"optional"` + HostPrivateIp types.String `tfsdk:"host_private_ip"` // Globally unique identifier for the host instance from the cloud provider. - InstanceId types.String `tfsdk:"instance_id" tf:"optional"` + InstanceId types.String `tfsdk:"instance_id"` // Attributes specific to AWS for a Spark node. - NodeAwsAttributes types.Object `tfsdk:"node_aws_attributes" tf:"optional,object"` + NodeAwsAttributes types.Object `tfsdk:"node_aws_attributes"` // Globally unique identifier for this node. - NodeId types.String `tfsdk:"node_id" tf:"optional"` + NodeId types.String `tfsdk:"node_id"` // Private IP address (typically a 10.x.x.x address) of the Spark node. Note // that this is different from the private IP address of the host instance. - PrivateIp types.String `tfsdk:"private_ip" tf:"optional"` + PrivateIp types.String `tfsdk:"private_ip"` // Public DNS address of this node. This address can be used to access the // Spark JDBC server on the driver node. To communicate with the JDBC // server, traffic must be manually authorized by adding security group // rules to the "worker-unmanaged" security group via the AWS console. // // Actually it's the public DNS address of the host instance. - PublicDns types.String `tfsdk:"public_dns" tf:"optional"` + PublicDns types.String `tfsdk:"public_dns"` // The timestamp (in millisecond) when the Spark node is launched. // // The start_timestamp is set right before the container is being launched. // The timestamp when the container is placed on the ResourceManager, before // its launch and setup by the NodeDaemon. This timestamp is the same as the // creation timestamp in the database. - StartTimestamp types.Int64 `tfsdk:"start_timestamp" tf:"optional"` + StartTimestamp types.Int64 `tfsdk:"start_timestamp"` } func (newState *SparkNode) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkNode) { @@ -15702,10 +16119,16 @@ func (newState *SparkNode) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkNod func (newState *SparkNode) SyncEffectiveFieldsDuringRead(existingState SparkNode) { } -func (c SparkNode) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparkNodeAwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "node_aws_attributes")...) +func (c SparkNode) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["host_private_ip"] = attrs["host_private_ip"].SetOptional() + attrs["instance_id"] = attrs["instance_id"].SetOptional() + attrs["node_aws_attributes"] = attrs["node_aws_attributes"].SetOptional() + attrs["node_id"] = attrs["node_id"].SetOptional() + attrs["private_ip"] = attrs["private_ip"].SetOptional() + attrs["public_dns"] = attrs["public_dns"].SetOptional() + attrs["start_timestamp"] = attrs["start_timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkNode. @@ -15783,7 +16206,7 @@ func (o *SparkNode) SetNodeAwsAttributes(ctx context.Context, v SparkNodeAwsAttr type SparkNodeAwsAttributes struct { // Whether this node is on an Amazon spot instance. - IsSpot types.Bool `tfsdk:"is_spot" tf:"optional"` + IsSpot types.Bool `tfsdk:"is_spot"` } func (newState *SparkNodeAwsAttributes) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkNodeAwsAttributes) { @@ -15792,9 +16215,10 @@ func (newState *SparkNodeAwsAttributes) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SparkNodeAwsAttributes) SyncEffectiveFieldsDuringRead(existingState SparkNodeAwsAttributes) { } -func (c SparkNodeAwsAttributes) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkNodeAwsAttributes) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_spot"] = attrs["is_spot"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkNodeAwsAttributes. @@ -15834,9 +16258,9 @@ type SparkVersion struct { // Note that the exact Spark version may change over time for a "wildcard" // version (i.e., "2.1.x-scala2.11" is a "wildcard" version) with minor bug // fixes. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // A descriptive name for this Spark version, for example "Spark 2.1". - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *SparkVersion) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkVersion) { @@ -15845,9 +16269,11 @@ func (newState *SparkVersion) SyncEffectiveFieldsDuringCreateOrUpdate(plan Spark func (newState *SparkVersion) SyncEffectiveFieldsDuringRead(existingState SparkVersion) { } -func (c SparkVersion) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkVersion) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkVersion. @@ -15885,7 +16311,7 @@ func (o SparkVersion) Type(ctx context.Context) attr.Type { type StartCluster struct { // The cluster to be started. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *StartCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartCluster) { @@ -15894,10 +16320,10 @@ func (newState *StartCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Start func (newState *StartCluster) SyncEffectiveFieldsDuringRead(existingState StartCluster) { } -func (c StartCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c StartCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartCluster. @@ -15940,9 +16366,9 @@ func (newState *StartClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *StartClusterResponse) SyncEffectiveFieldsDuringRead(existingState StartClusterResponse) { } -func (c StartClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StartClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartClusterResponse. @@ -15974,12 +16400,12 @@ func (o StartClusterResponse) Type(ctx context.Context) attr.Type { type TerminationReason struct { // status code indicating why the cluster was terminated - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // list of parameters that provide additional information about why the // cluster was terminated - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` // type of the termination - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *TerminationReason) SyncEffectiveFieldsDuringCreateOrUpdate(plan TerminationReason) { @@ -15988,9 +16414,12 @@ func (newState *TerminationReason) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TerminationReason) SyncEffectiveFieldsDuringRead(existingState TerminationReason) { } -func (c TerminationReason) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TerminationReason) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TerminationReason. @@ -16060,9 +16489,9 @@ func (o *TerminationReason) SetParameters(ctx context.Context, v map[string]type type UninstallLibraries struct { // Unique identifier for the cluster on which to uninstall these libraries. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // The libraries to uninstall. - Libraries types.List `tfsdk:"libraries" tf:""` + Libraries types.List `tfsdk:"libraries"` } func (newState *UninstallLibraries) SyncEffectiveFieldsDuringCreateOrUpdate(plan UninstallLibraries) { @@ -16071,12 +16500,11 @@ func (newState *UninstallLibraries) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UninstallLibraries) SyncEffectiveFieldsDuringRead(existingState UninstallLibraries) { } -func (c UninstallLibraries) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "libraries")...) - Library{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) +func (c UninstallLibraries) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["libraries"] = attrs["libraries"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UninstallLibraries. @@ -16151,9 +16579,9 @@ func (newState *UninstallLibrariesResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UninstallLibrariesResponse) SyncEffectiveFieldsDuringRead(existingState UninstallLibrariesResponse) { } -func (c UninstallLibrariesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UninstallLibrariesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UninstallLibrariesResponse. @@ -16185,7 +16613,7 @@ func (o UninstallLibrariesResponse) Type(ctx context.Context) attr.Type { type UnpinCluster struct { // - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` } func (newState *UnpinCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan UnpinCluster) { @@ -16194,10 +16622,10 @@ func (newState *UnpinCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Unpin func (newState *UnpinCluster) SyncEffectiveFieldsDuringRead(existingState UnpinCluster) { } -func (c UnpinCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "cluster_id")...) +func (c UnpinCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UnpinCluster. @@ -16240,9 +16668,9 @@ func (newState *UnpinClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *UnpinClusterResponse) SyncEffectiveFieldsDuringRead(existingState UnpinClusterResponse) { } -func (c UnpinClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UnpinClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UnpinClusterResponse. @@ -16274,15 +16702,15 @@ func (o UnpinClusterResponse) Type(ctx context.Context) attr.Type { type UpdateCluster struct { // The cluster to be updated. - Cluster types.Object `tfsdk:"cluster" tf:"optional,object"` + Cluster types.Object `tfsdk:"cluster"` // ID of the cluster. - ClusterId types.String `tfsdk:"cluster_id" tf:""` + ClusterId types.String `tfsdk:"cluster_id"` // Specifies which fields of the cluster will be updated. This is required // in the POST request. The update mask should be supplied as a single // string. To specify multiple fields, separate them with commas (no // spaces). To delete a field from a cluster configuration, add it to the // `update_mask` string but omit it from the `cluster` object. - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` } func (newState *UpdateCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCluster) { @@ -16291,12 +16719,12 @@ func (newState *UpdateCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Upda func (newState *UpdateCluster) SyncEffectiveFieldsDuringRead(existingState UpdateCluster) { } -func (c UpdateCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateClusterResource{}.ApplySchemaCustomizations(cs, append(path, "cluster")...) - cs.SetRequired(append(path, "cluster_id")...) - cs.SetRequired(append(path, "update_mask")...) +func (c UpdateCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster"] = attrs["cluster"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetRequired() + attrs["update_mask"] = attrs["update_mask"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCluster. @@ -16368,29 +16796,29 @@ type UpdateClusterResource struct { // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Automatically terminates the cluster after it is inactive for this time // in minutes. If not set, this cluster will not be automatically // terminated. If specified, the threshold must be between 10 and 10000 // minutes. Users can also set this value to 0 to explicitly disable // automatic termination. - AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes" tf:"optional"` + AutoterminationMinutes types.Int64 `tfsdk:"autotermination_minutes"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Two kinds of destinations (dbfs and s3) are supported. Only // one destination can be specified for one cluster. If the conf is given, // the logs will be delivered to the destination every `5 mins`. The // destination of driver logs is `$destination/$clusterId/driver`, while the // destination of executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Cluster name requested by the user. This doesn't have to be unique. If // not specified at creation, the cluster name will be an empty string. - ClusterName types.String `tfsdk:"cluster_name" tf:"optional"` + ClusterName types.String `tfsdk:"cluster_name"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -16399,7 +16827,7 @@ type UpdateClusterResource struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // Data security mode decides what data governance model to use when // accessing data from a cluster. // @@ -16429,39 +16857,39 @@ type UpdateClusterResource struct { // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This // mode provides a way that doesn’t have UC nor passthrough enabled. - DataSecurityMode types.String `tfsdk:"data_security_mode" tf:"optional"` + DataSecurityMode types.String `tfsdk:"data_security_mode"` - DockerImage types.Object `tfsdk:"docker_image" tf:"optional,object"` + DockerImage types.Object `tfsdk:"docker_image"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Autoscaling Local Storage: when enabled, this cluster will dynamically // acquire additional disk space when its Spark workers are running low on // disk space. This feature requires specific AWS permissions to function // correctly - refer to the User Guide for more details. - EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk" tf:"optional"` + EnableElasticDisk types.Bool `tfsdk:"enable_elastic_disk"` // Whether to enable LUKS on cluster VMs' local disks - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // This field can only be used with `kind`. // // When set to true, Databricks will automatically set single node related // `custom_tags`, `spark_conf`, and `num_workers` - IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + IsSingleNode types.Bool `tfsdk:"is_single_node"` // The kind of compute described by this compute specification. // // Depending on `kind`, different validations and default values will be @@ -16469,13 +16897,13 @@ type UpdateClusterResource struct { // // The first usage of this value is for the simple cluster form where it // sets `kind = CLASSIC_PREVIEW`. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -16486,9 +16914,9 @@ type UpdateClusterResource struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // Determines the cluster's runtime engine, either standard or Photon. // // This field is not compatible with legacy `spark_version` values that @@ -16497,15 +16925,15 @@ type UpdateClusterResource struct { // // If left unspecified, the runtime engine defaults to standard unless the // spark_version contains -photon-, in which case Photon will be used. - RuntimeEngine types.String `tfsdk:"runtime_engine" tf:"optional"` + RuntimeEngine types.String `tfsdk:"runtime_engine"` // Single user name if data_security_mode is `SINGLE_USER` - SingleUserName types.String `tfsdk:"single_user_name" tf:"optional"` + SingleUserName types.String `tfsdk:"single_user_name"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. Users can also pass in a string of extra // JVM options to the driver and the executors via // `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` // respectively. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -16519,23 +16947,23 @@ type UpdateClusterResource struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // The Spark version of the cluster, e.g. `3.3.x-scala2.11`. A list of // available Spark versions can be retrieved by using the // :method:clusters/sparkVersions API call. - SparkVersion types.String `tfsdk:"spark_version" tf:"optional"` + SparkVersion types.String `tfsdk:"spark_version"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or // not. - UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime"` - WorkloadType types.Object `tfsdk:"workload_type" tf:"optional,object"` + WorkloadType types.Object `tfsdk:"workload_type"` } func (newState *UpdateClusterResource) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateClusterResource) { @@ -16544,17 +16972,38 @@ func (newState *UpdateClusterResource) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateClusterResource) SyncEffectiveFieldsDuringRead(existingState UpdateClusterResource) { } -func (c UpdateClusterResource) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoScale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - DockerImage{}.ApplySchemaCustomizations(cs, append(path, "docker_image")...) - GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - InitScriptInfo{}.ApplySchemaCustomizations(cs, append(path, "init_scripts")...) - WorkloadType{}.ApplySchemaCustomizations(cs, append(path, "workload_type")...) - - return cs +func (c UpdateClusterResource) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autotermination_minutes"] = attrs["autotermination_minutes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["data_security_mode"] = attrs["data_security_mode"].SetOptional() + attrs["docker_image"] = attrs["docker_image"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_elastic_disk"] = attrs["enable_elastic_disk"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["is_single_node"] = attrs["is_single_node"].SetOptional() + attrs["kind"] = attrs["kind"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["runtime_engine"] = attrs["runtime_engine"].SetOptional() + attrs["single_user_name"] = attrs["single_user_name"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["spark_version"] = attrs["spark_version"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + attrs["use_ml_runtime"] = attrs["use_ml_runtime"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateClusterResource. @@ -17002,9 +17451,9 @@ func (newState *UpdateClusterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateClusterResponse) SyncEffectiveFieldsDuringRead(existingState UpdateClusterResponse) { } -func (c UpdateClusterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateClusterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateClusterResponse. @@ -17066,7 +17515,7 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type VolumesStorageInfo struct { // Unity Catalog Volumes file destination, e.g. `/Volumes/my-init.sh` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *VolumesStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan VolumesStorageInfo) { @@ -17075,10 +17524,10 @@ func (newState *VolumesStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *VolumesStorageInfo) SyncEffectiveFieldsDuringRead(existingState VolumesStorageInfo) { } -func (c VolumesStorageInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c VolumesStorageInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VolumesStorageInfo. @@ -17114,7 +17563,7 @@ func (o VolumesStorageInfo) Type(ctx context.Context) attr.Type { type WorkloadType struct { // defined what type of clients can use the cluster. E.g. Notebooks, Jobs - Clients types.Object `tfsdk:"clients" tf:"object"` + Clients types.Object `tfsdk:"clients"` } func (newState *WorkloadType) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkloadType) { @@ -17123,11 +17572,10 @@ func (newState *WorkloadType) SyncEffectiveFieldsDuringCreateOrUpdate(plan Workl func (newState *WorkloadType) SyncEffectiveFieldsDuringRead(existingState WorkloadType) { } -func (c WorkloadType) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "clients")...) - ClientsTypes{}.ApplySchemaCustomizations(cs, append(path, "clients")...) +func (c WorkloadType) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clients"] = attrs["clients"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkloadType. @@ -17194,7 +17642,7 @@ func (o *WorkloadType) SetClients(ctx context.Context, v ClientsTypes) { type WorkspaceStorageInfo struct { // workspace files destination, e.g. // `/Users/user1@databricks.com/my-init.sh` - Destination types.String `tfsdk:"destination" tf:""` + Destination types.String `tfsdk:"destination"` } func (newState *WorkspaceStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceStorageInfo) { @@ -17203,10 +17651,10 @@ func (newState *WorkspaceStorageInfo) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *WorkspaceStorageInfo) SyncEffectiveFieldsDuringRead(existingState WorkspaceStorageInfo) { } -func (c WorkspaceStorageInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination")...) +func (c WorkspaceStorageInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceStorageInfo. diff --git a/internal/service/dashboards_tf/legacy_model.go b/internal/service/dashboards_tf/legacy_model.go index 1f106dc97..d4955ac39 100755 --- a/internal/service/dashboards_tf/legacy_model.go +++ b/internal/service/dashboards_tf/legacy_model.go @@ -18,6 +18,7 @@ import ( "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" "github.com/databricks/terraform-provider-databricks/internal/service/sql_tf" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -25,7 +26,7 @@ import ( // Create dashboard type CreateDashboardRequest_SdkV2 struct { - Dashboard types.List `tfsdk:"dashboard" tf:"optional,object"` + Dashboard types.List `tfsdk:"dashboard"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateDashboardRequest. @@ -94,7 +95,7 @@ type CreateScheduleRequest_SdkV2 struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId types.String `tfsdk:"-"` - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateScheduleRequest. @@ -167,7 +168,7 @@ type CreateSubscriptionRequest_SdkV2 struct { // UUID identifying the schedule to which the subscription belongs. ScheduleId types.String `tfsdk:"-"` - Subscription types.List `tfsdk:"subscription" tf:"optional,object"` + Subscription types.List `tfsdk:"subscription"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateSubscriptionRequest. @@ -240,12 +241,12 @@ type CronSchedule_SdkV2 struct { // everyday at 8am. See [Cron Trigger] for details. // // [Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression types.String `tfsdk:"quartz_cron_expression" tf:""` + QuartzCronExpression types.String `tfsdk:"quartz_cron_expression"` // A Java timezone id. The schedule will be resolved with respect to this // timezone. See [Java TimeZone] for details. // // [Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html - TimezoneId types.String `tfsdk:"timezone_id" tf:""` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *CronSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronSchedule_SdkV2) { @@ -254,11 +255,11 @@ func (newState *CronSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CronSchedule_SdkV2) SyncEffectiveFieldsDuringRead(existingState CronSchedule_SdkV2) { } -func (c CronSchedule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "quartz_cron_expression")...) - cs.SetRequired(append(path, "timezone_id")...) +func (c CronSchedule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["quartz_cron_expression"] = attrs["quartz_cron_expression"].SetRequired() + attrs["timezone_id"] = attrs["timezone_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CronSchedule. @@ -296,25 +297,25 @@ func (o CronSchedule_SdkV2) Type(ctx context.Context) attr.Type { type Dashboard_SdkV2 struct { // The timestamp of when the dashboard was created. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // UUID identifying the dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` + DashboardId types.String `tfsdk:"dashboard_id"` // The display name of the dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The etag for the dashboard. Can be optionally provided on updates to // ensure that the dashboard has not been modified since the last read. This // field is excluded in List Dashboards responses. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // The state of the dashboard resource. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"computed"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // The workspace path of the folder containing the dashboard. Includes // leading slash and no trailing slash. This field is excluded in List // Dashboards responses. - ParentPath types.String `tfsdk:"parent_path" tf:"computed"` + ParentPath types.String `tfsdk:"parent_path"` // The workspace path of the dashboard asset, including the file name. // Exported dashboards always have the file extension `.lvdash.json`. This // field is excluded in List Dashboards responses. - Path types.String `tfsdk:"path" tf:"computed"` + Path types.String `tfsdk:"path"` // The contents of the dashboard in serialized string form. This field is // excluded in List Dashboards responses. Use the [get dashboard API] to // retrieve an example response, which includes the `serialized_dashboard` @@ -322,12 +323,12 @@ type Dashboard_SdkV2 struct { // represents the dashboard's layout and components. // // [get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get - SerializedDashboard types.String `tfsdk:"serialized_dashboard" tf:"optional"` + SerializedDashboard types.String `tfsdk:"serialized_dashboard"` // The timestamp of when the dashboard was last updated by the user. This // field is excluded in List Dashboards responses. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` // The warehouse ID used to run the dashboard. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *Dashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboard_SdkV2) { @@ -336,16 +337,19 @@ func (newState *Dashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Da func (newState *Dashboard_SdkV2) SyncEffectiveFieldsDuringRead(existingState Dashboard_SdkV2) { } -func (c Dashboard_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "dashboard_id")...) - cs.SetComputed(append(path, "etag")...) - cs.SetComputed(append(path, "lifecycle_state")...) - cs.SetComputed(append(path, "parent_path")...) - cs.SetComputed(append(path, "path")...) - cs.SetComputed(append(path, "update_time")...) +func (c Dashboard_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["dashboard_id"] = attrs["dashboard_id"].SetComputed() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["etag"] = attrs["etag"].SetComputed() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetComputed() + attrs["parent_path"] = attrs["parent_path"].SetComputed() + attrs["path"] = attrs["path"].SetComputed() + attrs["serialized_dashboard"] = attrs["serialized_dashboard"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetComputed() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dashboard. @@ -555,9 +559,9 @@ func (o DeleteSubscriptionResponse_SdkV2) Type(ctx context.Context) attr.Type { // Genie AI Response type GenieAttachment_SdkV2 struct { - Query types.List `tfsdk:"query" tf:"optional,object"` + Query types.List `tfsdk:"query"` - Text types.List `tfsdk:"text" tf:"optional,object"` + Text types.List `tfsdk:"text"` } func (newState *GenieAttachment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieAttachment_SdkV2) { @@ -566,11 +570,13 @@ func (newState *GenieAttachment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *GenieAttachment_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieAttachment_SdkV2) { } -func (c GenieAttachment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryAttachment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query")...) - TextAttachment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "text")...) +func (c GenieAttachment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query"] = attrs["query"].SetOptional() + attrs["query"] = attrs["query"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["text"] = attrs["text"].SetOptional() + attrs["text"] = attrs["text"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieAttachment. @@ -667,17 +673,17 @@ func (o *GenieAttachment_SdkV2) SetText(ctx context.Context, v TextAttachment_Sd type GenieConversation_SdkV2 struct { // Timestamp when the message was created - CreatedTimestamp types.Int64 `tfsdk:"created_timestamp" tf:"optional"` + CreatedTimestamp types.Int64 `tfsdk:"created_timestamp"` // Conversation ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Timestamp when the message was last updated - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Genie space ID - SpaceId types.String `tfsdk:"space_id" tf:""` + SpaceId types.String `tfsdk:"space_id"` // Conversation title - Title types.String `tfsdk:"title" tf:""` + Title types.String `tfsdk:"title"` // ID of the user who created the conversation - UserId types.Int64 `tfsdk:"user_id" tf:""` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *GenieConversation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieConversation_SdkV2) { @@ -686,13 +692,15 @@ func (newState *GenieConversation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GenieConversation_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieConversation_SdkV2) { } -func (c GenieConversation_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "space_id")...) - cs.SetRequired(append(path, "title")...) - cs.SetRequired(append(path, "user_id")...) +func (c GenieConversation_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_timestamp"] = attrs["created_timestamp"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["space_id"] = attrs["space_id"].SetRequired() + attrs["title"] = attrs["title"].SetRequired() + attrs["user_id"] = attrs["user_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieConversation. @@ -738,7 +746,7 @@ func (o GenieConversation_SdkV2) Type(ctx context.Context) attr.Type { type GenieCreateConversationMessageRequest_SdkV2 struct { // User message content. - Content types.String `tfsdk:"content" tf:""` + Content types.String `tfsdk:"content"` // The ID associated with the conversation. ConversationId types.String `tfsdk:"-"` // The ID associated with the Genie space where the conversation is started. @@ -751,12 +759,12 @@ func (newState *GenieCreateConversationMessageRequest_SdkV2) SyncEffectiveFields func (newState *GenieCreateConversationMessageRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieCreateConversationMessageRequest_SdkV2) { } -func (c GenieCreateConversationMessageRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "content")...) - cs.SetRequired(append(path, "conversation_id")...) - cs.SetRequired(append(path, "space_id")...) +func (c GenieCreateConversationMessageRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetRequired() + attrs["conversation_id"] = attrs["conversation_id"].SetRequired() + attrs["space_id"] = attrs["space_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieCreateConversationMessageRequest. @@ -934,7 +942,7 @@ func (o GenieGetMessageQueryResultRequest_SdkV2) Type(ctx context.Context) attr. type GenieGetMessageQueryResultResponse_SdkV2 struct { // SQL Statement Execution response. See [Get status, manifest, and result // first chunk](:method:statementexecution/getstatement) for more details. - StatementResponse types.List `tfsdk:"statement_response" tf:"optional,object"` + StatementResponse types.List `tfsdk:"statement_response"` } func (newState *GenieGetMessageQueryResultResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieGetMessageQueryResultResponse_SdkV2) { @@ -943,10 +951,11 @@ func (newState *GenieGetMessageQueryResultResponse_SdkV2) SyncEffectiveFieldsDur func (newState *GenieGetMessageQueryResultResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieGetMessageQueryResultResponse_SdkV2) { } -func (c GenieGetMessageQueryResultResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - sql_tf.StatementResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "statement_response")...) +func (c GenieGetMessageQueryResultResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["statement_response"] = attrs["statement_response"].SetOptional() + attrs["statement_response"] = attrs["statement_response"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieGetMessageQueryResultResponse. @@ -1012,23 +1021,23 @@ func (o *GenieGetMessageQueryResultResponse_SdkV2) SetStatementResponse(ctx cont type GenieMessage_SdkV2 struct { // AI produced response to the message - Attachments types.List `tfsdk:"attachments" tf:"optional"` + Attachments types.List `tfsdk:"attachments"` // User message content - Content types.String `tfsdk:"content" tf:""` + Content types.String `tfsdk:"content"` // Conversation ID - ConversationId types.String `tfsdk:"conversation_id" tf:""` + ConversationId types.String `tfsdk:"conversation_id"` // Timestamp when the message was created - CreatedTimestamp types.Int64 `tfsdk:"created_timestamp" tf:"optional"` + CreatedTimestamp types.Int64 `tfsdk:"created_timestamp"` // Error message if AI failed to respond to the message - Error types.List `tfsdk:"error" tf:"optional,object"` + Error types.List `tfsdk:"error"` // Message ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Timestamp when the message was last updated - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The result of SQL query if the message has a query attachment - QueryResult types.List `tfsdk:"query_result" tf:"optional,object"` + QueryResult types.List `tfsdk:"query_result"` // Genie space ID - SpaceId types.String `tfsdk:"space_id" tf:""` + SpaceId types.String `tfsdk:"space_id"` // MesssageStatus. The possible values are: * `FETCHING_METADATA`: Fetching // metadata from the data sources. * `FILTERING_CONTEXT`: Running smart // context step to determine relevant context. * `ASKING_AI`: Waiting for @@ -1045,9 +1054,9 @@ type GenieMessage_SdkV2 struct { // * `SUBMITTED`: Message has been submitted. * `QUERY_RESULT_EXPIRED`: SQL // result is not available anymore. The user needs to execute the query // again. * `CANCELLED`: Message has been cancelled. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // ID of the user who created the message - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *GenieMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieMessage_SdkV2) { @@ -1056,16 +1065,22 @@ func (newState *GenieMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GenieMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieMessage_SdkV2) { } -func (c GenieMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GenieAttachment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "attachments")...) - cs.SetRequired(append(path, "content")...) - cs.SetRequired(append(path, "conversation_id")...) - MessageError_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "error")...) - cs.SetRequired(append(path, "id")...) - Result_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query_result")...) - cs.SetRequired(append(path, "space_id")...) +func (c GenieMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attachments"] = attrs["attachments"].SetOptional() + attrs["content"] = attrs["content"].SetRequired() + attrs["conversation_id"] = attrs["conversation_id"].SetRequired() + attrs["created_timestamp"] = attrs["created_timestamp"].SetOptional() + attrs["error"] = attrs["error"].SetOptional() + attrs["error"] = attrs["error"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetRequired() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["query_result"] = attrs["query_result"].SetOptional() + attrs["query_result"] = attrs["query_result"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["space_id"] = attrs["space_id"].SetRequired() + attrs["status"] = attrs["status"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieMessage. @@ -1209,7 +1224,7 @@ func (o *GenieMessage_SdkV2) SetQueryResult(ctx context.Context, v Result_SdkV2) type GenieStartConversationMessageRequest_SdkV2 struct { // The text of the message that starts the conversation. - Content types.String `tfsdk:"content" tf:""` + Content types.String `tfsdk:"content"` // The ID associated with the Genie space where you want to start a // conversation. SpaceId types.String `tfsdk:"-"` @@ -1221,11 +1236,11 @@ func (newState *GenieStartConversationMessageRequest_SdkV2) SyncEffectiveFieldsD func (newState *GenieStartConversationMessageRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieStartConversationMessageRequest_SdkV2) { } -func (c GenieStartConversationMessageRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "content")...) - cs.SetRequired(append(path, "space_id")...) +func (c GenieStartConversationMessageRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetRequired() + attrs["space_id"] = attrs["space_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieStartConversationMessageRequest. @@ -1262,13 +1277,13 @@ func (o GenieStartConversationMessageRequest_SdkV2) Type(ctx context.Context) at } type GenieStartConversationResponse_SdkV2 struct { - Conversation types.List `tfsdk:"conversation" tf:"optional,object"` + Conversation types.List `tfsdk:"conversation"` // Conversation ID - ConversationId types.String `tfsdk:"conversation_id" tf:""` + ConversationId types.String `tfsdk:"conversation_id"` - Message types.List `tfsdk:"message" tf:"optional,object"` + Message types.List `tfsdk:"message"` // Message ID - MessageId types.String `tfsdk:"message_id" tf:""` + MessageId types.String `tfsdk:"message_id"` } func (newState *GenieStartConversationResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieStartConversationResponse_SdkV2) { @@ -1277,13 +1292,15 @@ func (newState *GenieStartConversationResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *GenieStartConversationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenieStartConversationResponse_SdkV2) { } -func (c GenieStartConversationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GenieConversation_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "conversation")...) - cs.SetRequired(append(path, "conversation_id")...) - GenieMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "message")...) - cs.SetRequired(append(path, "message_id")...) +func (c GenieStartConversationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["conversation"] = attrs["conversation"].SetOptional() + attrs["conversation"] = attrs["conversation"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["conversation_id"] = attrs["conversation_id"].SetRequired() + attrs["message"] = attrs["message"].SetOptional() + attrs["message"] = attrs["message"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["message_id"] = attrs["message_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieStartConversationResponse. @@ -1594,10 +1611,10 @@ func (o ListDashboardsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListDashboardsResponse_SdkV2 struct { - Dashboards types.List `tfsdk:"dashboards" tf:"optional"` + Dashboards types.List `tfsdk:"dashboards"` // A token, which can be sent as `page_token` to retrieve the next page. If // this field is omitted, there are no subsequent dashboards. - NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListDashboardsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDashboardsResponse_SdkV2) { @@ -1606,11 +1623,11 @@ func (newState *ListDashboardsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ListDashboardsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListDashboardsResponse_SdkV2) { } -func (c ListDashboardsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Dashboard_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dashboards")...) - cs.SetComputed(append(path, "next_page_token")...) +func (c ListDashboardsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboards"] = attrs["dashboards"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListDashboardsResponse. @@ -1726,9 +1743,9 @@ type ListSchedulesResponse_SdkV2 struct { // A token that can be used as a `page_token` in subsequent requests to // retrieve the next page of results. If this field is omitted, there are no // subsequent schedules. - NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` + NextPageToken types.String `tfsdk:"next_page_token"` - Schedules types.List `tfsdk:"schedules" tf:"optional"` + Schedules types.List `tfsdk:"schedules"` } func (newState *ListSchedulesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSchedulesResponse_SdkV2) { @@ -1737,11 +1754,11 @@ func (newState *ListSchedulesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListSchedulesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListSchedulesResponse_SdkV2) { } -func (c ListSchedulesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "next_page_token")...) - Schedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedules")...) +func (c ListSchedulesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetComputed() + attrs["schedules"] = attrs["schedules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSchedulesResponse. @@ -1861,9 +1878,9 @@ type ListSubscriptionsResponse_SdkV2 struct { // A token that can be used as a `page_token` in subsequent requests to // retrieve the next page of results. If this field is omitted, there are no // subsequent subscriptions. - NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` + NextPageToken types.String `tfsdk:"next_page_token"` - Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` + Subscriptions types.List `tfsdk:"subscriptions"` } func (newState *ListSubscriptionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSubscriptionsResponse_SdkV2) { @@ -1872,11 +1889,11 @@ func (newState *ListSubscriptionsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ListSubscriptionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListSubscriptionsResponse_SdkV2) { } -func (c ListSubscriptionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "next_page_token")...) - Subscription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "subscriptions")...) +func (c ListSubscriptionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetComputed() + attrs["subscriptions"] = attrs["subscriptions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSubscriptionsResponse. @@ -1943,9 +1960,9 @@ func (o *ListSubscriptionsResponse_SdkV2) SetSubscriptions(ctx context.Context, } type MessageError_SdkV2 struct { - Error types.String `tfsdk:"error" tf:"optional"` + Error types.String `tfsdk:"error"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *MessageError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MessageError_SdkV2) { @@ -1954,9 +1971,11 @@ func (newState *MessageError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MessageError_SdkV2) SyncEffectiveFieldsDuringRead(existingState MessageError_SdkV2) { } -func (c MessageError_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MessageError_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MessageError. @@ -1994,16 +2013,16 @@ func (o MessageError_SdkV2) Type(ctx context.Context) attr.Type { type MigrateDashboardRequest_SdkV2 struct { // Display name for the new Lakeview dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The workspace path of the folder to contain the migrated Lakeview // dashboard. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // UUID of the dashboard to be migrated. - SourceDashboardId types.String `tfsdk:"source_dashboard_id" tf:""` + SourceDashboardId types.String `tfsdk:"source_dashboard_id"` // Flag to indicate if mustache parameter syntax ({{ param }}) should be // auto-updated to named syntax (:param) when converting datasets in the // dashboard. - UpdateParameterSyntax types.Bool `tfsdk:"update_parameter_syntax" tf:"optional"` + UpdateParameterSyntax types.Bool `tfsdk:"update_parameter_syntax"` } func (newState *MigrateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigrateDashboardRequest_SdkV2) { @@ -2012,10 +2031,13 @@ func (newState *MigrateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *MigrateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState MigrateDashboardRequest_SdkV2) { } -func (c MigrateDashboardRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "source_dashboard_id")...) +func (c MigrateDashboardRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["source_dashboard_id"] = attrs["source_dashboard_id"].SetRequired() + attrs["update_parameter_syntax"] = attrs["update_parameter_syntax"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MigrateDashboardRequest. @@ -2061,10 +2083,10 @@ type PublishRequest_SdkV2 struct { // Flag to indicate if the publisher's credentials should be embedded in the // published dashboard. These embedded credentials will be used to execute // the published dashboard's queries. - EmbedCredentials types.Bool `tfsdk:"embed_credentials" tf:"optional"` + EmbedCredentials types.Bool `tfsdk:"embed_credentials"` // The ID of the warehouse that can be used to override the warehouse which // was set in the draft. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *PublishRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishRequest_SdkV2) { @@ -2073,10 +2095,12 @@ func (newState *PublishRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *PublishRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PublishRequest_SdkV2) { } -func (c PublishRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) +func (c PublishRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["embed_credentials"] = attrs["embed_credentials"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublishRequest. @@ -2116,13 +2140,13 @@ func (o PublishRequest_SdkV2) Type(ctx context.Context) attr.Type { type PublishedDashboard_SdkV2 struct { // The display name of the published dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"computed"` + DisplayName types.String `tfsdk:"display_name"` // Indicates whether credentials are embedded in the published dashboard. - EmbedCredentials types.Bool `tfsdk:"embed_credentials" tf:"optional"` + EmbedCredentials types.Bool `tfsdk:"embed_credentials"` // The timestamp of when the published dashboard was last revised. - RevisionCreateTime types.String `tfsdk:"revision_create_time" tf:"computed"` + RevisionCreateTime types.String `tfsdk:"revision_create_time"` // The warehouse ID used to run the published dashboard. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *PublishedDashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishedDashboard_SdkV2) { @@ -2131,11 +2155,13 @@ func (newState *PublishedDashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PublishedDashboard_SdkV2) SyncEffectiveFieldsDuringRead(existingState PublishedDashboard_SdkV2) { } -func (c PublishedDashboard_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "display_name")...) - cs.SetComputed(append(path, "revision_create_time")...) +func (c PublishedDashboard_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetComputed() + attrs["embed_credentials"] = attrs["embed_credentials"].SetOptional() + attrs["revision_create_time"] = attrs["revision_create_time"].SetComputed() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublishedDashboard. @@ -2176,23 +2202,23 @@ func (o PublishedDashboard_SdkV2) Type(ctx context.Context) attr.Type { } type QueryAttachment_SdkV2 struct { - CachedQuerySchema types.List `tfsdk:"cached_query_schema" tf:"optional,object"` + CachedQuerySchema types.List `tfsdk:"cached_query_schema"` // Description of the query - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // If the query was created on an instruction (trusted asset) we link to the // id - InstructionId types.String `tfsdk:"instruction_id" tf:"optional"` + InstructionId types.String `tfsdk:"instruction_id"` // Always store the title next to the id in case the original instruction // title changes or the instruction is deleted. - InstructionTitle types.String `tfsdk:"instruction_title" tf:"optional"` + InstructionTitle types.String `tfsdk:"instruction_title"` // Time when the user updated the query last - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // AI generated SQL query - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` // Name of the query - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` } func (newState *QueryAttachment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryAttachment_SdkV2) { @@ -2201,10 +2227,18 @@ func (newState *QueryAttachment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *QueryAttachment_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryAttachment_SdkV2) { } -func (c QueryAttachment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuerySchema_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cached_query_schema")...) +func (c QueryAttachment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cached_query_schema"] = attrs["cached_query_schema"].SetOptional() + attrs["cached_query_schema"] = attrs["cached_query_schema"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["instruction_id"] = attrs["instruction_id"].SetOptional() + attrs["instruction_title"] = attrs["instruction_title"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["title"] = attrs["title"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryAttachment. @@ -2283,11 +2317,11 @@ func (o *QueryAttachment_SdkV2) SetCachedQuerySchema(ctx context.Context, v Quer } type QuerySchema_SdkV2 struct { - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` // Used to determine if the stored query schema is compatible with the // latest run. The service should always clear the schema when the query is // re-executed. - StatementId types.String `tfsdk:"statement_id" tf:"optional"` + StatementId types.String `tfsdk:"statement_id"` } func (newState *QuerySchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuerySchema_SdkV2) { @@ -2296,10 +2330,11 @@ func (newState *QuerySchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QuerySchema_SdkV2) SyncEffectiveFieldsDuringRead(existingState QuerySchema_SdkV2) { } -func (c QuerySchema_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuerySchemaColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "columns")...) +func (c QuerySchema_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetOptional() + attrs["statement_id"] = attrs["statement_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QuerySchema. @@ -2368,11 +2403,11 @@ func (o *QuerySchema_SdkV2) SetColumns(ctx context.Context, v []QuerySchemaColum type QuerySchemaColumn_SdkV2 struct { // Populated from // https://docs.databricks.com/sql/language-manual/sql-ref-datatypes.html - DataType types.String `tfsdk:"data_type" tf:""` + DataType types.String `tfsdk:"data_type"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Corresponds to type desc - TypeText types.String `tfsdk:"type_text" tf:""` + TypeText types.String `tfsdk:"type_text"` } func (newState *QuerySchemaColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuerySchemaColumn_SdkV2) { @@ -2381,12 +2416,12 @@ func (newState *QuerySchemaColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *QuerySchemaColumn_SdkV2) SyncEffectiveFieldsDuringRead(existingState QuerySchemaColumn_SdkV2) { } -func (c QuerySchemaColumn_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "data_type")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "type_text")...) +func (c QuerySchemaColumn_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_type"] = attrs["data_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["type_text"] = attrs["type_text"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QuerySchemaColumn. @@ -2426,13 +2461,13 @@ func (o QuerySchemaColumn_SdkV2) Type(ctx context.Context) attr.Type { type Result_SdkV2 struct { // If result is truncated - IsTruncated types.Bool `tfsdk:"is_truncated" tf:"optional"` + IsTruncated types.Bool `tfsdk:"is_truncated"` // Row count of the result - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // Statement Execution API statement id. Use [Get status, manifest, and // result first chunk](:method:statementexecution/getstatement) to get the // full result data. - StatementId types.String `tfsdk:"statement_id" tf:"optional"` + StatementId types.String `tfsdk:"statement_id"` } func (newState *Result_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Result_SdkV2) { @@ -2441,9 +2476,12 @@ func (newState *Result_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Resul func (newState *Result_SdkV2) SyncEffectiveFieldsDuringRead(existingState Result_SdkV2) { } -func (c Result_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Result_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_truncated"] = attrs["is_truncated"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["statement_id"] = attrs["statement_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Result. @@ -2483,26 +2521,26 @@ func (o Result_SdkV2) Type(ctx context.Context) attr.Type { type Schedule_SdkV2 struct { // A timestamp indicating when the schedule was created. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // The cron expression describing the frequency of the periodic refresh for // this schedule. - CronSchedule types.List `tfsdk:"cron_schedule" tf:"object"` + CronSchedule types.List `tfsdk:"cron_schedule"` // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` + DashboardId types.String `tfsdk:"dashboard_id"` // The display name for schedule. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The etag for the schedule. Must be left empty on create, must be provided // on updates to ensure that the schedule has not been modified since the // last read, and can be optionally provided on delete. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // The status indicates whether this schedule is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // UUID identifying the schedule. - ScheduleId types.String `tfsdk:"schedule_id" tf:"computed"` + ScheduleId types.String `tfsdk:"schedule_id"` // A timestamp indicating when the schedule was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` // The warehouse id to run the dashboard with for the schedule. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *Schedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Schedule_SdkV2) { @@ -2511,16 +2549,19 @@ func (newState *Schedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sch func (newState *Schedule_SdkV2) SyncEffectiveFieldsDuringRead(existingState Schedule_SdkV2) { } -func (c Schedule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetRequired(append(path, "cron_schedule")...) - CronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cron_schedule")...) - cs.SetComputed(append(path, "dashboard_id")...) - cs.SetComputed(append(path, "etag")...) - cs.SetComputed(append(path, "schedule_id")...) - cs.SetComputed(append(path, "update_time")...) +func (c Schedule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["cron_schedule"] = attrs["cron_schedule"].SetRequired() + attrs["cron_schedule"] = attrs["cron_schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dashboard_id"] = attrs["dashboard_id"].SetComputed() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["etag"] = attrs["etag"].SetComputed() + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["schedule_id"] = attrs["schedule_id"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Schedule. @@ -2603,10 +2644,10 @@ func (o *Schedule_SdkV2) SetCronSchedule(ctx context.Context, v CronSchedule_Sdk type Subscriber_SdkV2 struct { // The destination to receive the subscription email. This parameter is // mutually exclusive with `user_subscriber`. - DestinationSubscriber types.List `tfsdk:"destination_subscriber" tf:"optional,object"` + DestinationSubscriber types.List `tfsdk:"destination_subscriber"` // The user to receive the subscription email. This parameter is mutually // exclusive with `destination_subscriber`. - UserSubscriber types.List `tfsdk:"user_subscriber" tf:"optional,object"` + UserSubscriber types.List `tfsdk:"user_subscriber"` } func (newState *Subscriber_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscriber_SdkV2) { @@ -2615,11 +2656,13 @@ func (newState *Subscriber_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *Subscriber_SdkV2) SyncEffectiveFieldsDuringRead(existingState Subscriber_SdkV2) { } -func (c Subscriber_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SubscriptionSubscriberDestination_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "destination_subscriber")...) - SubscriptionSubscriberUser_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "user_subscriber")...) +func (c Subscriber_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_subscriber"] = attrs["destination_subscriber"].SetOptional() + attrs["destination_subscriber"] = attrs["destination_subscriber"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["user_subscriber"] = attrs["user_subscriber"].SetOptional() + attrs["user_subscriber"] = attrs["user_subscriber"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Subscriber. @@ -2716,25 +2759,25 @@ func (o *Subscriber_SdkV2) SetUserSubscriber(ctx context.Context, v Subscription type Subscription_SdkV2 struct { // A timestamp indicating when the subscription was created. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // UserId of the user who adds subscribers (users or notification // destinations) to the dashboard's schedule. - CreatedByUserId types.Int64 `tfsdk:"created_by_user_id" tf:"computed"` + CreatedByUserId types.Int64 `tfsdk:"created_by_user_id"` // UUID identifying the dashboard to which the subscription belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` + DashboardId types.String `tfsdk:"dashboard_id"` // The etag for the subscription. Must be left empty on create, can be // optionally provided on delete to ensure that the subscription has not // been deleted since the last read. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // UUID identifying the schedule to which the subscription belongs. - ScheduleId types.String `tfsdk:"schedule_id" tf:"computed"` + ScheduleId types.String `tfsdk:"schedule_id"` // Subscriber details for users and destinations to be added as subscribers // to the schedule. - Subscriber types.List `tfsdk:"subscriber" tf:"object"` + Subscriber types.List `tfsdk:"subscriber"` // UUID identifying the subscription. - SubscriptionId types.String `tfsdk:"subscription_id" tf:"computed"` + SubscriptionId types.String `tfsdk:"subscription_id"` // A timestamp indicating when the subscription was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *Subscription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscription_SdkV2) { @@ -2743,18 +2786,18 @@ func (newState *Subscription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *Subscription_SdkV2) SyncEffectiveFieldsDuringRead(existingState Subscription_SdkV2) { } -func (c Subscription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "created_by_user_id")...) - cs.SetComputed(append(path, "dashboard_id")...) - cs.SetComputed(append(path, "etag")...) - cs.SetComputed(append(path, "schedule_id")...) - cs.SetRequired(append(path, "subscriber")...) - Subscriber_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "subscriber")...) - cs.SetComputed(append(path, "subscription_id")...) - cs.SetComputed(append(path, "update_time")...) +func (c Subscription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["created_by_user_id"] = attrs["created_by_user_id"].SetComputed() + attrs["dashboard_id"] = attrs["dashboard_id"].SetComputed() + attrs["etag"] = attrs["etag"].SetComputed() + attrs["schedule_id"] = attrs["schedule_id"].SetComputed() + attrs["subscriber"] = attrs["subscriber"].SetRequired() + attrs["subscriber"] = attrs["subscriber"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["subscription_id"] = attrs["subscription_id"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Subscription. @@ -2835,7 +2878,7 @@ func (o *Subscription_SdkV2) SetSubscriber(ctx context.Context, v Subscriber_Sdk type SubscriptionSubscriberDestination_SdkV2 struct { // The canonical identifier of the destination to receive email // notification. - DestinationId types.String `tfsdk:"destination_id" tf:"computed"` + DestinationId types.String `tfsdk:"destination_id"` } func (newState *SubscriptionSubscriberDestination_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberDestination_SdkV2) { @@ -2844,10 +2887,10 @@ func (newState *SubscriptionSubscriberDestination_SdkV2) SyncEffectiveFieldsDuri func (newState *SubscriptionSubscriberDestination_SdkV2) SyncEffectiveFieldsDuringRead(existingState SubscriptionSubscriberDestination_SdkV2) { } -func (c SubscriptionSubscriberDestination_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "destination_id")...) +func (c SubscriptionSubscriberDestination_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_id"] = attrs["destination_id"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubscriptionSubscriberDestination. @@ -2883,7 +2926,7 @@ func (o SubscriptionSubscriberDestination_SdkV2) Type(ctx context.Context) attr. type SubscriptionSubscriberUser_SdkV2 struct { // UserId of the subscriber. - UserId types.Int64 `tfsdk:"user_id" tf:"computed"` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *SubscriptionSubscriberUser_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberUser_SdkV2) { @@ -2892,10 +2935,10 @@ func (newState *SubscriptionSubscriberUser_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *SubscriptionSubscriberUser_SdkV2) SyncEffectiveFieldsDuringRead(existingState SubscriptionSubscriberUser_SdkV2) { } -func (c SubscriptionSubscriberUser_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "user_id")...) +func (c SubscriptionSubscriberUser_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["user_id"] = attrs["user_id"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubscriptionSubscriberUser. @@ -2931,9 +2974,9 @@ func (o SubscriptionSubscriberUser_SdkV2) Type(ctx context.Context) attr.Type { type TextAttachment_SdkV2 struct { // AI generated message - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *TextAttachment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TextAttachment_SdkV2) { @@ -2942,9 +2985,11 @@ func (newState *TextAttachment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *TextAttachment_SdkV2) SyncEffectiveFieldsDuringRead(existingState TextAttachment_SdkV2) { } -func (c TextAttachment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TextAttachment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TextAttachment. @@ -3026,9 +3071,9 @@ func (newState *TrashDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *TrashDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState TrashDashboardResponse_SdkV2) { } -func (c TrashDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TrashDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TrashDashboardResponse. @@ -3104,9 +3149,9 @@ func (newState *UnpublishDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UnpublishDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UnpublishDashboardResponse_SdkV2) { } -func (c UnpublishDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UnpublishDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UnpublishDashboardResponse. @@ -3138,7 +3183,7 @@ func (o UnpublishDashboardResponse_SdkV2) Type(ctx context.Context) attr.Type { // Update dashboard type UpdateDashboardRequest_SdkV2 struct { - Dashboard types.List `tfsdk:"dashboard" tf:"optional,object"` + Dashboard types.List `tfsdk:"dashboard"` // UUID identifying the dashboard. DashboardId types.String `tfsdk:"-"` } @@ -3211,7 +3256,7 @@ type UpdateScheduleRequest_SdkV2 struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId types.String `tfsdk:"-"` - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // UUID identifying the schedule. ScheduleId types.String `tfsdk:"-"` } diff --git a/internal/service/dashboards_tf/model.go b/internal/service/dashboards_tf/model.go index 5ac689b56..9aaf30423 100755 --- a/internal/service/dashboards_tf/model.go +++ b/internal/service/dashboards_tf/model.go @@ -25,7 +25,7 @@ import ( // Create dashboard type CreateDashboardRequest struct { - Dashboard types.Object `tfsdk:"dashboard" tf:"optional,object"` + Dashboard types.Object `tfsdk:"dashboard"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateDashboardRequest. @@ -94,7 +94,7 @@ type CreateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId types.String `tfsdk:"-"` - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateScheduleRequest. @@ -167,7 +167,7 @@ type CreateSubscriptionRequest struct { // UUID identifying the schedule to which the subscription belongs. ScheduleId types.String `tfsdk:"-"` - Subscription types.Object `tfsdk:"subscription" tf:"optional,object"` + Subscription types.Object `tfsdk:"subscription"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateSubscriptionRequest. @@ -240,12 +240,12 @@ type CronSchedule struct { // everyday at 8am. See [Cron Trigger] for details. // // [Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression types.String `tfsdk:"quartz_cron_expression" tf:""` + QuartzCronExpression types.String `tfsdk:"quartz_cron_expression"` // A Java timezone id. The schedule will be resolved with respect to this // timezone. See [Java TimeZone] for details. // // [Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html - TimezoneId types.String `tfsdk:"timezone_id" tf:""` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *CronSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronSchedule) { @@ -254,11 +254,11 @@ func (newState *CronSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronS func (newState *CronSchedule) SyncEffectiveFieldsDuringRead(existingState CronSchedule) { } -func (c CronSchedule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "quartz_cron_expression")...) - cs.SetRequired(append(path, "timezone_id")...) +func (c CronSchedule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["quartz_cron_expression"] = attrs["quartz_cron_expression"].SetRequired() + attrs["timezone_id"] = attrs["timezone_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CronSchedule. @@ -296,25 +296,25 @@ func (o CronSchedule) Type(ctx context.Context) attr.Type { type Dashboard struct { // The timestamp of when the dashboard was created. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // UUID identifying the dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` + DashboardId types.String `tfsdk:"dashboard_id"` // The display name of the dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The etag for the dashboard. Can be optionally provided on updates to // ensure that the dashboard has not been modified since the last read. This // field is excluded in List Dashboards responses. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // The state of the dashboard resource. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"computed"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // The workspace path of the folder containing the dashboard. Includes // leading slash and no trailing slash. This field is excluded in List // Dashboards responses. - ParentPath types.String `tfsdk:"parent_path" tf:"computed"` + ParentPath types.String `tfsdk:"parent_path"` // The workspace path of the dashboard asset, including the file name. // Exported dashboards always have the file extension `.lvdash.json`. This // field is excluded in List Dashboards responses. - Path types.String `tfsdk:"path" tf:"computed"` + Path types.String `tfsdk:"path"` // The contents of the dashboard in serialized string form. This field is // excluded in List Dashboards responses. Use the [get dashboard API] to // retrieve an example response, which includes the `serialized_dashboard` @@ -322,12 +322,12 @@ type Dashboard struct { // represents the dashboard's layout and components. // // [get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get - SerializedDashboard types.String `tfsdk:"serialized_dashboard" tf:"optional"` + SerializedDashboard types.String `tfsdk:"serialized_dashboard"` // The timestamp of when the dashboard was last updated by the user. This // field is excluded in List Dashboards responses. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` // The warehouse ID used to run the dashboard. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *Dashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboard) { @@ -336,16 +336,19 @@ func (newState *Dashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboar func (newState *Dashboard) SyncEffectiveFieldsDuringRead(existingState Dashboard) { } -func (c Dashboard) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "dashboard_id")...) - cs.SetComputed(append(path, "etag")...) - cs.SetComputed(append(path, "lifecycle_state")...) - cs.SetComputed(append(path, "parent_path")...) - cs.SetComputed(append(path, "path")...) - cs.SetComputed(append(path, "update_time")...) +func (c Dashboard) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["dashboard_id"] = attrs["dashboard_id"].SetComputed() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["etag"] = attrs["etag"].SetComputed() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetComputed() + attrs["parent_path"] = attrs["parent_path"].SetComputed() + attrs["path"] = attrs["path"].SetComputed() + attrs["serialized_dashboard"] = attrs["serialized_dashboard"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetComputed() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dashboard. @@ -555,9 +558,9 @@ func (o DeleteSubscriptionResponse) Type(ctx context.Context) attr.Type { // Genie AI Response type GenieAttachment struct { - Query types.Object `tfsdk:"query" tf:"optional,object"` + Query types.Object `tfsdk:"query"` - Text types.Object `tfsdk:"text" tf:"optional,object"` + Text types.Object `tfsdk:"text"` } func (newState *GenieAttachment) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieAttachment) { @@ -566,11 +569,11 @@ func (newState *GenieAttachment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ge func (newState *GenieAttachment) SyncEffectiveFieldsDuringRead(existingState GenieAttachment) { } -func (c GenieAttachment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryAttachment{}.ApplySchemaCustomizations(cs, append(path, "query")...) - TextAttachment{}.ApplySchemaCustomizations(cs, append(path, "text")...) +func (c GenieAttachment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query"] = attrs["query"].SetOptional() + attrs["text"] = attrs["text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieAttachment. @@ -667,17 +670,17 @@ func (o *GenieAttachment) SetText(ctx context.Context, v TextAttachment) { type GenieConversation struct { // Timestamp when the message was created - CreatedTimestamp types.Int64 `tfsdk:"created_timestamp" tf:"optional"` + CreatedTimestamp types.Int64 `tfsdk:"created_timestamp"` // Conversation ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Timestamp when the message was last updated - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Genie space ID - SpaceId types.String `tfsdk:"space_id" tf:""` + SpaceId types.String `tfsdk:"space_id"` // Conversation title - Title types.String `tfsdk:"title" tf:""` + Title types.String `tfsdk:"title"` // ID of the user who created the conversation - UserId types.Int64 `tfsdk:"user_id" tf:""` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *GenieConversation) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieConversation) { @@ -686,13 +689,15 @@ func (newState *GenieConversation) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GenieConversation) SyncEffectiveFieldsDuringRead(existingState GenieConversation) { } -func (c GenieConversation) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "space_id")...) - cs.SetRequired(append(path, "title")...) - cs.SetRequired(append(path, "user_id")...) +func (c GenieConversation) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_timestamp"] = attrs["created_timestamp"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["space_id"] = attrs["space_id"].SetRequired() + attrs["title"] = attrs["title"].SetRequired() + attrs["user_id"] = attrs["user_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieConversation. @@ -738,7 +743,7 @@ func (o GenieConversation) Type(ctx context.Context) attr.Type { type GenieCreateConversationMessageRequest struct { // User message content. - Content types.String `tfsdk:"content" tf:""` + Content types.String `tfsdk:"content"` // The ID associated with the conversation. ConversationId types.String `tfsdk:"-"` // The ID associated with the Genie space where the conversation is started. @@ -751,12 +756,12 @@ func (newState *GenieCreateConversationMessageRequest) SyncEffectiveFieldsDuring func (newState *GenieCreateConversationMessageRequest) SyncEffectiveFieldsDuringRead(existingState GenieCreateConversationMessageRequest) { } -func (c GenieCreateConversationMessageRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "content")...) - cs.SetRequired(append(path, "conversation_id")...) - cs.SetRequired(append(path, "space_id")...) +func (c GenieCreateConversationMessageRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetRequired() + attrs["conversation_id"] = attrs["conversation_id"].SetRequired() + attrs["space_id"] = attrs["space_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieCreateConversationMessageRequest. @@ -934,7 +939,7 @@ func (o GenieGetMessageQueryResultRequest) Type(ctx context.Context) attr.Type { type GenieGetMessageQueryResultResponse struct { // SQL Statement Execution response. See [Get status, manifest, and result // first chunk](:method:statementexecution/getstatement) for more details. - StatementResponse types.Object `tfsdk:"statement_response" tf:"optional,object"` + StatementResponse types.Object `tfsdk:"statement_response"` } func (newState *GenieGetMessageQueryResultResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieGetMessageQueryResultResponse) { @@ -943,10 +948,10 @@ func (newState *GenieGetMessageQueryResultResponse) SyncEffectiveFieldsDuringCre func (newState *GenieGetMessageQueryResultResponse) SyncEffectiveFieldsDuringRead(existingState GenieGetMessageQueryResultResponse) { } -func (c GenieGetMessageQueryResultResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - sql_tf.StatementResponse{}.ApplySchemaCustomizations(cs, append(path, "statement_response")...) +func (c GenieGetMessageQueryResultResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["statement_response"] = attrs["statement_response"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieGetMessageQueryResultResponse. @@ -1012,23 +1017,23 @@ func (o *GenieGetMessageQueryResultResponse) SetStatementResponse(ctx context.Co type GenieMessage struct { // AI produced response to the message - Attachments types.List `tfsdk:"attachments" tf:"optional"` + Attachments types.List `tfsdk:"attachments"` // User message content - Content types.String `tfsdk:"content" tf:""` + Content types.String `tfsdk:"content"` // Conversation ID - ConversationId types.String `tfsdk:"conversation_id" tf:""` + ConversationId types.String `tfsdk:"conversation_id"` // Timestamp when the message was created - CreatedTimestamp types.Int64 `tfsdk:"created_timestamp" tf:"optional"` + CreatedTimestamp types.Int64 `tfsdk:"created_timestamp"` // Error message if AI failed to respond to the message - Error types.Object `tfsdk:"error" tf:"optional,object"` + Error types.Object `tfsdk:"error"` // Message ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` // Timestamp when the message was last updated - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The result of SQL query if the message has a query attachment - QueryResult types.Object `tfsdk:"query_result" tf:"optional,object"` + QueryResult types.Object `tfsdk:"query_result"` // Genie space ID - SpaceId types.String `tfsdk:"space_id" tf:""` + SpaceId types.String `tfsdk:"space_id"` // MesssageStatus. The possible values are: * `FETCHING_METADATA`: Fetching // metadata from the data sources. * `FILTERING_CONTEXT`: Running smart // context step to determine relevant context. * `ASKING_AI`: Waiting for @@ -1045,9 +1050,9 @@ type GenieMessage struct { // * `SUBMITTED`: Message has been submitted. * `QUERY_RESULT_EXPIRED`: SQL // result is not available anymore. The user needs to execute the query // again. * `CANCELLED`: Message has been cancelled. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // ID of the user who created the message - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *GenieMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieMessage) { @@ -1056,16 +1061,20 @@ func (newState *GenieMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan Genie func (newState *GenieMessage) SyncEffectiveFieldsDuringRead(existingState GenieMessage) { } -func (c GenieMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GenieAttachment{}.ApplySchemaCustomizations(cs, append(path, "attachments")...) - cs.SetRequired(append(path, "content")...) - cs.SetRequired(append(path, "conversation_id")...) - MessageError{}.ApplySchemaCustomizations(cs, append(path, "error")...) - cs.SetRequired(append(path, "id")...) - Result{}.ApplySchemaCustomizations(cs, append(path, "query_result")...) - cs.SetRequired(append(path, "space_id")...) +func (c GenieMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attachments"] = attrs["attachments"].SetOptional() + attrs["content"] = attrs["content"].SetRequired() + attrs["conversation_id"] = attrs["conversation_id"].SetRequired() + attrs["created_timestamp"] = attrs["created_timestamp"].SetOptional() + attrs["error"] = attrs["error"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["query_result"] = attrs["query_result"].SetOptional() + attrs["space_id"] = attrs["space_id"].SetRequired() + attrs["status"] = attrs["status"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieMessage. @@ -1209,7 +1218,7 @@ func (o *GenieMessage) SetQueryResult(ctx context.Context, v Result) { type GenieStartConversationMessageRequest struct { // The text of the message that starts the conversation. - Content types.String `tfsdk:"content" tf:""` + Content types.String `tfsdk:"content"` // The ID associated with the Genie space where you want to start a // conversation. SpaceId types.String `tfsdk:"-"` @@ -1221,11 +1230,11 @@ func (newState *GenieStartConversationMessageRequest) SyncEffectiveFieldsDuringC func (newState *GenieStartConversationMessageRequest) SyncEffectiveFieldsDuringRead(existingState GenieStartConversationMessageRequest) { } -func (c GenieStartConversationMessageRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "content")...) - cs.SetRequired(append(path, "space_id")...) +func (c GenieStartConversationMessageRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetRequired() + attrs["space_id"] = attrs["space_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieStartConversationMessageRequest. @@ -1262,13 +1271,13 @@ func (o GenieStartConversationMessageRequest) Type(ctx context.Context) attr.Typ } type GenieStartConversationResponse struct { - Conversation types.Object `tfsdk:"conversation" tf:"optional,object"` + Conversation types.Object `tfsdk:"conversation"` // Conversation ID - ConversationId types.String `tfsdk:"conversation_id" tf:""` + ConversationId types.String `tfsdk:"conversation_id"` - Message types.Object `tfsdk:"message" tf:"optional,object"` + Message types.Object `tfsdk:"message"` // Message ID - MessageId types.String `tfsdk:"message_id" tf:""` + MessageId types.String `tfsdk:"message_id"` } func (newState *GenieStartConversationResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenieStartConversationResponse) { @@ -1277,13 +1286,13 @@ func (newState *GenieStartConversationResponse) SyncEffectiveFieldsDuringCreateO func (newState *GenieStartConversationResponse) SyncEffectiveFieldsDuringRead(existingState GenieStartConversationResponse) { } -func (c GenieStartConversationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GenieConversation{}.ApplySchemaCustomizations(cs, append(path, "conversation")...) - cs.SetRequired(append(path, "conversation_id")...) - GenieMessage{}.ApplySchemaCustomizations(cs, append(path, "message")...) - cs.SetRequired(append(path, "message_id")...) +func (c GenieStartConversationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["conversation"] = attrs["conversation"].SetOptional() + attrs["conversation_id"] = attrs["conversation_id"].SetRequired() + attrs["message"] = attrs["message"].SetOptional() + attrs["message_id"] = attrs["message_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenieStartConversationResponse. @@ -1594,10 +1603,10 @@ func (o ListDashboardsRequest) Type(ctx context.Context) attr.Type { } type ListDashboardsResponse struct { - Dashboards types.List `tfsdk:"dashboards" tf:"optional"` + Dashboards types.List `tfsdk:"dashboards"` // A token, which can be sent as `page_token` to retrieve the next page. If // this field is omitted, there are no subsequent dashboards. - NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListDashboardsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDashboardsResponse) { @@ -1606,11 +1615,11 @@ func (newState *ListDashboardsResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListDashboardsResponse) SyncEffectiveFieldsDuringRead(existingState ListDashboardsResponse) { } -func (c ListDashboardsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Dashboard{}.ApplySchemaCustomizations(cs, append(path, "dashboards")...) - cs.SetComputed(append(path, "next_page_token")...) +func (c ListDashboardsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboards"] = attrs["dashboards"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListDashboardsResponse. @@ -1726,9 +1735,9 @@ type ListSchedulesResponse struct { // A token that can be used as a `page_token` in subsequent requests to // retrieve the next page of results. If this field is omitted, there are no // subsequent schedules. - NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` + NextPageToken types.String `tfsdk:"next_page_token"` - Schedules types.List `tfsdk:"schedules" tf:"optional"` + Schedules types.List `tfsdk:"schedules"` } func (newState *ListSchedulesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSchedulesResponse) { @@ -1737,11 +1746,11 @@ func (newState *ListSchedulesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListSchedulesResponse) SyncEffectiveFieldsDuringRead(existingState ListSchedulesResponse) { } -func (c ListSchedulesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "next_page_token")...) - Schedule{}.ApplySchemaCustomizations(cs, append(path, "schedules")...) +func (c ListSchedulesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetComputed() + attrs["schedules"] = attrs["schedules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSchedulesResponse. @@ -1861,9 +1870,9 @@ type ListSubscriptionsResponse struct { // A token that can be used as a `page_token` in subsequent requests to // retrieve the next page of results. If this field is omitted, there are no // subsequent subscriptions. - NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` + NextPageToken types.String `tfsdk:"next_page_token"` - Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` + Subscriptions types.List `tfsdk:"subscriptions"` } func (newState *ListSubscriptionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSubscriptionsResponse) { @@ -1872,11 +1881,11 @@ func (newState *ListSubscriptionsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListSubscriptionsResponse) SyncEffectiveFieldsDuringRead(existingState ListSubscriptionsResponse) { } -func (c ListSubscriptionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "next_page_token")...) - Subscription{}.ApplySchemaCustomizations(cs, append(path, "subscriptions")...) +func (c ListSubscriptionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetComputed() + attrs["subscriptions"] = attrs["subscriptions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSubscriptionsResponse. @@ -1943,9 +1952,9 @@ func (o *ListSubscriptionsResponse) SetSubscriptions(ctx context.Context, v []Su } type MessageError struct { - Error types.String `tfsdk:"error" tf:"optional"` + Error types.String `tfsdk:"error"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *MessageError) SyncEffectiveFieldsDuringCreateOrUpdate(plan MessageError) { @@ -1954,9 +1963,11 @@ func (newState *MessageError) SyncEffectiveFieldsDuringCreateOrUpdate(plan Messa func (newState *MessageError) SyncEffectiveFieldsDuringRead(existingState MessageError) { } -func (c MessageError) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MessageError) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MessageError. @@ -1994,16 +2005,16 @@ func (o MessageError) Type(ctx context.Context) attr.Type { type MigrateDashboardRequest struct { // Display name for the new Lakeview dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The workspace path of the folder to contain the migrated Lakeview // dashboard. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // UUID of the dashboard to be migrated. - SourceDashboardId types.String `tfsdk:"source_dashboard_id" tf:""` + SourceDashboardId types.String `tfsdk:"source_dashboard_id"` // Flag to indicate if mustache parameter syntax ({{ param }}) should be // auto-updated to named syntax (:param) when converting datasets in the // dashboard. - UpdateParameterSyntax types.Bool `tfsdk:"update_parameter_syntax" tf:"optional"` + UpdateParameterSyntax types.Bool `tfsdk:"update_parameter_syntax"` } func (newState *MigrateDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigrateDashboardRequest) { @@ -2012,10 +2023,13 @@ func (newState *MigrateDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *MigrateDashboardRequest) SyncEffectiveFieldsDuringRead(existingState MigrateDashboardRequest) { } -func (c MigrateDashboardRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "source_dashboard_id")...) +func (c MigrateDashboardRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["source_dashboard_id"] = attrs["source_dashboard_id"].SetRequired() + attrs["update_parameter_syntax"] = attrs["update_parameter_syntax"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MigrateDashboardRequest. @@ -2061,10 +2075,10 @@ type PublishRequest struct { // Flag to indicate if the publisher's credentials should be embedded in the // published dashboard. These embedded credentials will be used to execute // the published dashboard's queries. - EmbedCredentials types.Bool `tfsdk:"embed_credentials" tf:"optional"` + EmbedCredentials types.Bool `tfsdk:"embed_credentials"` // The ID of the warehouse that can be used to override the warehouse which // was set in the draft. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *PublishRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishRequest) { @@ -2073,10 +2087,12 @@ func (newState *PublishRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pub func (newState *PublishRequest) SyncEffectiveFieldsDuringRead(existingState PublishRequest) { } -func (c PublishRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) +func (c PublishRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["embed_credentials"] = attrs["embed_credentials"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublishRequest. @@ -2116,13 +2132,13 @@ func (o PublishRequest) Type(ctx context.Context) attr.Type { type PublishedDashboard struct { // The display name of the published dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"computed"` + DisplayName types.String `tfsdk:"display_name"` // Indicates whether credentials are embedded in the published dashboard. - EmbedCredentials types.Bool `tfsdk:"embed_credentials" tf:"optional"` + EmbedCredentials types.Bool `tfsdk:"embed_credentials"` // The timestamp of when the published dashboard was last revised. - RevisionCreateTime types.String `tfsdk:"revision_create_time" tf:"computed"` + RevisionCreateTime types.String `tfsdk:"revision_create_time"` // The warehouse ID used to run the published dashboard. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *PublishedDashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishedDashboard) { @@ -2131,11 +2147,13 @@ func (newState *PublishedDashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PublishedDashboard) SyncEffectiveFieldsDuringRead(existingState PublishedDashboard) { } -func (c PublishedDashboard) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "display_name")...) - cs.SetComputed(append(path, "revision_create_time")...) +func (c PublishedDashboard) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetComputed() + attrs["embed_credentials"] = attrs["embed_credentials"].SetOptional() + attrs["revision_create_time"] = attrs["revision_create_time"].SetComputed() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublishedDashboard. @@ -2176,23 +2194,23 @@ func (o PublishedDashboard) Type(ctx context.Context) attr.Type { } type QueryAttachment struct { - CachedQuerySchema types.Object `tfsdk:"cached_query_schema" tf:"optional,object"` + CachedQuerySchema types.Object `tfsdk:"cached_query_schema"` // Description of the query - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // If the query was created on an instruction (trusted asset) we link to the // id - InstructionId types.String `tfsdk:"instruction_id" tf:"optional"` + InstructionId types.String `tfsdk:"instruction_id"` // Always store the title next to the id in case the original instruction // title changes or the instruction is deleted. - InstructionTitle types.String `tfsdk:"instruction_title" tf:"optional"` + InstructionTitle types.String `tfsdk:"instruction_title"` // Time when the user updated the query last - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // AI generated SQL query - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` // Name of the query - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` } func (newState *QueryAttachment) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryAttachment) { @@ -2201,10 +2219,17 @@ func (newState *QueryAttachment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Qu func (newState *QueryAttachment) SyncEffectiveFieldsDuringRead(existingState QueryAttachment) { } -func (c QueryAttachment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuerySchema{}.ApplySchemaCustomizations(cs, append(path, "cached_query_schema")...) +func (c QueryAttachment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cached_query_schema"] = attrs["cached_query_schema"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["instruction_id"] = attrs["instruction_id"].SetOptional() + attrs["instruction_title"] = attrs["instruction_title"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["title"] = attrs["title"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryAttachment. @@ -2283,11 +2308,11 @@ func (o *QueryAttachment) SetCachedQuerySchema(ctx context.Context, v QuerySchem } type QuerySchema struct { - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` // Used to determine if the stored query schema is compatible with the // latest run. The service should always clear the schema when the query is // re-executed. - StatementId types.String `tfsdk:"statement_id" tf:"optional"` + StatementId types.String `tfsdk:"statement_id"` } func (newState *QuerySchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuerySchema) { @@ -2296,10 +2321,11 @@ func (newState *QuerySchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryS func (newState *QuerySchema) SyncEffectiveFieldsDuringRead(existingState QuerySchema) { } -func (c QuerySchema) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QuerySchemaColumn{}.ApplySchemaCustomizations(cs, append(path, "columns")...) +func (c QuerySchema) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetOptional() + attrs["statement_id"] = attrs["statement_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QuerySchema. @@ -2368,11 +2394,11 @@ func (o *QuerySchema) SetColumns(ctx context.Context, v []QuerySchemaColumn) { type QuerySchemaColumn struct { // Populated from // https://docs.databricks.com/sql/language-manual/sql-ref-datatypes.html - DataType types.String `tfsdk:"data_type" tf:""` + DataType types.String `tfsdk:"data_type"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Corresponds to type desc - TypeText types.String `tfsdk:"type_text" tf:""` + TypeText types.String `tfsdk:"type_text"` } func (newState *QuerySchemaColumn) SyncEffectiveFieldsDuringCreateOrUpdate(plan QuerySchemaColumn) { @@ -2381,12 +2407,12 @@ func (newState *QuerySchemaColumn) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QuerySchemaColumn) SyncEffectiveFieldsDuringRead(existingState QuerySchemaColumn) { } -func (c QuerySchemaColumn) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "data_type")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "type_text")...) +func (c QuerySchemaColumn) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_type"] = attrs["data_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["type_text"] = attrs["type_text"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QuerySchemaColumn. @@ -2426,13 +2452,13 @@ func (o QuerySchemaColumn) Type(ctx context.Context) attr.Type { type Result struct { // If result is truncated - IsTruncated types.Bool `tfsdk:"is_truncated" tf:"optional"` + IsTruncated types.Bool `tfsdk:"is_truncated"` // Row count of the result - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // Statement Execution API statement id. Use [Get status, manifest, and // result first chunk](:method:statementexecution/getstatement) to get the // full result data. - StatementId types.String `tfsdk:"statement_id" tf:"optional"` + StatementId types.String `tfsdk:"statement_id"` } func (newState *Result) SyncEffectiveFieldsDuringCreateOrUpdate(plan Result) { @@ -2441,9 +2467,12 @@ func (newState *Result) SyncEffectiveFieldsDuringCreateOrUpdate(plan Result) { func (newState *Result) SyncEffectiveFieldsDuringRead(existingState Result) { } -func (c Result) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Result) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_truncated"] = attrs["is_truncated"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["statement_id"] = attrs["statement_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Result. @@ -2483,26 +2512,26 @@ func (o Result) Type(ctx context.Context) attr.Type { type Schedule struct { // A timestamp indicating when the schedule was created. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // The cron expression describing the frequency of the periodic refresh for // this schedule. - CronSchedule types.Object `tfsdk:"cron_schedule" tf:"object"` + CronSchedule types.Object `tfsdk:"cron_schedule"` // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` + DashboardId types.String `tfsdk:"dashboard_id"` // The display name for schedule. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The etag for the schedule. Must be left empty on create, must be provided // on updates to ensure that the schedule has not been modified since the // last read, and can be optionally provided on delete. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // The status indicates whether this schedule is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // UUID identifying the schedule. - ScheduleId types.String `tfsdk:"schedule_id" tf:"computed"` + ScheduleId types.String `tfsdk:"schedule_id"` // A timestamp indicating when the schedule was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` // The warehouse id to run the dashboard with for the schedule. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *Schedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan Schedule) { @@ -2511,16 +2540,18 @@ func (newState *Schedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan Schedule) func (newState *Schedule) SyncEffectiveFieldsDuringRead(existingState Schedule) { } -func (c Schedule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetRequired(append(path, "cron_schedule")...) - CronSchedule{}.ApplySchemaCustomizations(cs, append(path, "cron_schedule")...) - cs.SetComputed(append(path, "dashboard_id")...) - cs.SetComputed(append(path, "etag")...) - cs.SetComputed(append(path, "schedule_id")...) - cs.SetComputed(append(path, "update_time")...) +func (c Schedule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["cron_schedule"] = attrs["cron_schedule"].SetRequired() + attrs["dashboard_id"] = attrs["dashboard_id"].SetComputed() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["etag"] = attrs["etag"].SetComputed() + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["schedule_id"] = attrs["schedule_id"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Schedule. @@ -2603,10 +2634,10 @@ func (o *Schedule) SetCronSchedule(ctx context.Context, v CronSchedule) { type Subscriber struct { // The destination to receive the subscription email. This parameter is // mutually exclusive with `user_subscriber`. - DestinationSubscriber types.Object `tfsdk:"destination_subscriber" tf:"optional,object"` + DestinationSubscriber types.Object `tfsdk:"destination_subscriber"` // The user to receive the subscription email. This parameter is mutually // exclusive with `destination_subscriber`. - UserSubscriber types.Object `tfsdk:"user_subscriber" tf:"optional,object"` + UserSubscriber types.Object `tfsdk:"user_subscriber"` } func (newState *Subscriber) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscriber) { @@ -2615,11 +2646,11 @@ func (newState *Subscriber) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscri func (newState *Subscriber) SyncEffectiveFieldsDuringRead(existingState Subscriber) { } -func (c Subscriber) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SubscriptionSubscriberDestination{}.ApplySchemaCustomizations(cs, append(path, "destination_subscriber")...) - SubscriptionSubscriberUser{}.ApplySchemaCustomizations(cs, append(path, "user_subscriber")...) +func (c Subscriber) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_subscriber"] = attrs["destination_subscriber"].SetOptional() + attrs["user_subscriber"] = attrs["user_subscriber"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Subscriber. @@ -2716,25 +2747,25 @@ func (o *Subscriber) SetUserSubscriber(ctx context.Context, v SubscriptionSubscr type Subscription struct { // A timestamp indicating when the subscription was created. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // UserId of the user who adds subscribers (users or notification // destinations) to the dashboard's schedule. - CreatedByUserId types.Int64 `tfsdk:"created_by_user_id" tf:"computed"` + CreatedByUserId types.Int64 `tfsdk:"created_by_user_id"` // UUID identifying the dashboard to which the subscription belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` + DashboardId types.String `tfsdk:"dashboard_id"` // The etag for the subscription. Must be left empty on create, can be // optionally provided on delete to ensure that the subscription has not // been deleted since the last read. - Etag types.String `tfsdk:"etag" tf:"computed"` + Etag types.String `tfsdk:"etag"` // UUID identifying the schedule to which the subscription belongs. - ScheduleId types.String `tfsdk:"schedule_id" tf:"computed"` + ScheduleId types.String `tfsdk:"schedule_id"` // Subscriber details for users and destinations to be added as subscribers // to the schedule. - Subscriber types.Object `tfsdk:"subscriber" tf:"object"` + Subscriber types.Object `tfsdk:"subscriber"` // UUID identifying the subscription. - SubscriptionId types.String `tfsdk:"subscription_id" tf:"computed"` + SubscriptionId types.String `tfsdk:"subscription_id"` // A timestamp indicating when the subscription was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *Subscription) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscription) { @@ -2743,18 +2774,17 @@ func (newState *Subscription) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subsc func (newState *Subscription) SyncEffectiveFieldsDuringRead(existingState Subscription) { } -func (c Subscription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - cs.SetComputed(append(path, "created_by_user_id")...) - cs.SetComputed(append(path, "dashboard_id")...) - cs.SetComputed(append(path, "etag")...) - cs.SetComputed(append(path, "schedule_id")...) - cs.SetRequired(append(path, "subscriber")...) - Subscriber{}.ApplySchemaCustomizations(cs, append(path, "subscriber")...) - cs.SetComputed(append(path, "subscription_id")...) - cs.SetComputed(append(path, "update_time")...) +func (c Subscription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["created_by_user_id"] = attrs["created_by_user_id"].SetComputed() + attrs["dashboard_id"] = attrs["dashboard_id"].SetComputed() + attrs["etag"] = attrs["etag"].SetComputed() + attrs["schedule_id"] = attrs["schedule_id"].SetComputed() + attrs["subscriber"] = attrs["subscriber"].SetRequired() + attrs["subscription_id"] = attrs["subscription_id"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Subscription. @@ -2835,7 +2865,7 @@ func (o *Subscription) SetSubscriber(ctx context.Context, v Subscriber) { type SubscriptionSubscriberDestination struct { // The canonical identifier of the destination to receive email // notification. - DestinationId types.String `tfsdk:"destination_id" tf:"computed"` + DestinationId types.String `tfsdk:"destination_id"` } func (newState *SubscriptionSubscriberDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberDestination) { @@ -2844,10 +2874,10 @@ func (newState *SubscriptionSubscriberDestination) SyncEffectiveFieldsDuringCrea func (newState *SubscriptionSubscriberDestination) SyncEffectiveFieldsDuringRead(existingState SubscriptionSubscriberDestination) { } -func (c SubscriptionSubscriberDestination) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "destination_id")...) +func (c SubscriptionSubscriberDestination) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_id"] = attrs["destination_id"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubscriptionSubscriberDestination. @@ -2883,7 +2913,7 @@ func (o SubscriptionSubscriberDestination) Type(ctx context.Context) attr.Type { type SubscriptionSubscriberUser struct { // UserId of the subscriber. - UserId types.Int64 `tfsdk:"user_id" tf:"computed"` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *SubscriptionSubscriberUser) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberUser) { @@ -2892,10 +2922,10 @@ func (newState *SubscriptionSubscriberUser) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SubscriptionSubscriberUser) SyncEffectiveFieldsDuringRead(existingState SubscriptionSubscriberUser) { } -func (c SubscriptionSubscriberUser) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "user_id")...) +func (c SubscriptionSubscriberUser) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["user_id"] = attrs["user_id"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubscriptionSubscriberUser. @@ -2931,9 +2961,9 @@ func (o SubscriptionSubscriberUser) Type(ctx context.Context) attr.Type { type TextAttachment struct { // AI generated message - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *TextAttachment) SyncEffectiveFieldsDuringCreateOrUpdate(plan TextAttachment) { @@ -2942,9 +2972,11 @@ func (newState *TextAttachment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Tex func (newState *TextAttachment) SyncEffectiveFieldsDuringRead(existingState TextAttachment) { } -func (c TextAttachment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TextAttachment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TextAttachment. @@ -3026,9 +3058,9 @@ func (newState *TrashDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *TrashDashboardResponse) SyncEffectiveFieldsDuringRead(existingState TrashDashboardResponse) { } -func (c TrashDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TrashDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TrashDashboardResponse. @@ -3104,9 +3136,9 @@ func (newState *UnpublishDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UnpublishDashboardResponse) SyncEffectiveFieldsDuringRead(existingState UnpublishDashboardResponse) { } -func (c UnpublishDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UnpublishDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UnpublishDashboardResponse. @@ -3138,7 +3170,7 @@ func (o UnpublishDashboardResponse) Type(ctx context.Context) attr.Type { // Update dashboard type UpdateDashboardRequest struct { - Dashboard types.Object `tfsdk:"dashboard" tf:"optional,object"` + Dashboard types.Object `tfsdk:"dashboard"` // UUID identifying the dashboard. DashboardId types.String `tfsdk:"-"` } @@ -3211,7 +3243,7 @@ type UpdateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. DashboardId types.String `tfsdk:"-"` - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // UUID identifying the schedule. ScheduleId types.String `tfsdk:"-"` } diff --git a/internal/service/files_tf/legacy_model.go b/internal/service/files_tf/legacy_model.go index 355bd57a8..b779f763d 100755 --- a/internal/service/files_tf/legacy_model.go +++ b/internal/service/files_tf/legacy_model.go @@ -25,9 +25,9 @@ import ( type AddBlock_SdkV2 struct { // The base64-encoded data to append to the stream. This has a limit of 1 // MB. - Data types.String `tfsdk:"data" tf:""` + Data types.String `tfsdk:"data"` // The handle on an open stream. - Handle types.Int64 `tfsdk:"handle" tf:""` + Handle types.Int64 `tfsdk:"handle"` } func (newState *AddBlock_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddBlock_SdkV2) { @@ -36,11 +36,11 @@ func (newState *AddBlock_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Add func (newState *AddBlock_SdkV2) SyncEffectiveFieldsDuringRead(existingState AddBlock_SdkV2) { } -func (c AddBlock_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "data")...) - cs.SetRequired(append(path, "handle")...) +func (c AddBlock_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data"] = attrs["data"].SetRequired() + attrs["handle"] = attrs["handle"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddBlock. @@ -85,9 +85,9 @@ func (newState *AddBlockResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *AddBlockResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AddBlockResponse_SdkV2) { } -func (c AddBlockResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AddBlockResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddBlockResponse. @@ -119,7 +119,7 @@ func (o AddBlockResponse_SdkV2) Type(ctx context.Context) attr.Type { type Close_SdkV2 struct { // The handle on an open stream. - Handle types.Int64 `tfsdk:"handle" tf:""` + Handle types.Int64 `tfsdk:"handle"` } func (newState *Close_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Close_SdkV2) { @@ -128,10 +128,10 @@ func (newState *Close_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Close_ func (newState *Close_SdkV2) SyncEffectiveFieldsDuringRead(existingState Close_SdkV2) { } -func (c Close_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "handle")...) +func (c Close_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["handle"] = attrs["handle"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Close. @@ -174,9 +174,9 @@ func (newState *CloseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CloseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CloseResponse_SdkV2) { } -func (c CloseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CloseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloseResponse. @@ -208,9 +208,9 @@ func (o CloseResponse_SdkV2) Type(ctx context.Context) attr.Type { type Create_SdkV2 struct { // The flag that specifies whether to overwrite existing file/files. - Overwrite types.Bool `tfsdk:"overwrite" tf:"optional"` + Overwrite types.Bool `tfsdk:"overwrite"` // The path of the new file. The path should be the absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Create_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Create_SdkV2) { @@ -219,10 +219,11 @@ func (newState *Create_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Creat func (newState *Create_SdkV2) SyncEffectiveFieldsDuringRead(existingState Create_SdkV2) { } -func (c Create_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Create_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["overwrite"] = attrs["overwrite"].SetOptional() + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Create. @@ -328,7 +329,7 @@ func (o CreateDirectoryResponse_SdkV2) Type(ctx context.Context) attr.Type { type CreateResponse_SdkV2 struct { // Handle which should subsequently be passed into the AddBlock and Close // calls when writing to a file through a stream. - Handle types.Int64 `tfsdk:"handle" tf:"optional"` + Handle types.Int64 `tfsdk:"handle"` } func (newState *CreateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateResponse_SdkV2) { @@ -337,9 +338,10 @@ func (newState *CreateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateResponse_SdkV2) { } -func (c CreateResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["handle"] = attrs["handle"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateResponse. @@ -376,10 +378,10 @@ func (o CreateResponse_SdkV2) Type(ctx context.Context) attr.Type { type Delete_SdkV2 struct { // The path of the file or directory to delete. The path should be the // absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` // Whether or not to recursively delete the directory's contents. Deleting // empty directories can be done without providing the recursive flag. - Recursive types.Bool `tfsdk:"recursive" tf:"optional"` + Recursive types.Bool `tfsdk:"recursive"` } func (newState *Delete_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete_SdkV2) { @@ -388,10 +390,11 @@ func (newState *Delete_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delet func (newState *Delete_SdkV2) SyncEffectiveFieldsDuringRead(existingState Delete_SdkV2) { } -func (c Delete_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Delete_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() + attrs["recursive"] = attrs["recursive"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Delete. @@ -540,9 +543,9 @@ func (newState *DeleteResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DeleteResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteResponse_SdkV2) { } -func (c DeleteResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteResponse. @@ -574,16 +577,16 @@ func (o DeleteResponse_SdkV2) Type(ctx context.Context) attr.Type { type DirectoryEntry_SdkV2 struct { // The length of the file in bytes. This field is omitted for directories. - FileSize types.Int64 `tfsdk:"file_size" tf:"optional"` + FileSize types.Int64 `tfsdk:"file_size"` // True if the path is a directory. - IsDirectory types.Bool `tfsdk:"is_directory" tf:"optional"` + IsDirectory types.Bool `tfsdk:"is_directory"` // Last modification time of given file in milliseconds since unix epoch. - LastModified types.Int64 `tfsdk:"last_modified" tf:"optional"` + LastModified types.Int64 `tfsdk:"last_modified"` // The name of the file or directory. This is the last component of the // path. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The absolute path of the file or directory. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *DirectoryEntry_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DirectoryEntry_SdkV2) { @@ -592,9 +595,14 @@ func (newState *DirectoryEntry_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DirectoryEntry_SdkV2) SyncEffectiveFieldsDuringRead(existingState DirectoryEntry_SdkV2) { } -func (c DirectoryEntry_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DirectoryEntry_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_size"] = attrs["file_size"].SetOptional() + attrs["is_directory"] = attrs["is_directory"].SetOptional() + attrs["last_modified"] = attrs["last_modified"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DirectoryEntry. @@ -722,13 +730,13 @@ func (o DownloadResponse_SdkV2) Type(ctx context.Context) attr.Type { type FileInfo_SdkV2 struct { // The length of the file in bytes. This field is omitted for directories. - FileSize types.Int64 `tfsdk:"file_size" tf:"optional"` + FileSize types.Int64 `tfsdk:"file_size"` // True if the path is a directory. - IsDir types.Bool `tfsdk:"is_dir" tf:"optional"` + IsDir types.Bool `tfsdk:"is_dir"` // Last modification time of given file in milliseconds since epoch. - ModificationTime types.Int64 `tfsdk:"modification_time" tf:"optional"` + ModificationTime types.Int64 `tfsdk:"modification_time"` // The absolute path of the file or directory. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo_SdkV2) { @@ -737,9 +745,13 @@ func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Fil func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState FileInfo_SdkV2) { } -func (c FileInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_size"] = attrs["file_size"].SetOptional() + attrs["is_dir"] = attrs["is_dir"].SetOptional() + attrs["modification_time"] = attrs["modification_time"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileInfo. @@ -1065,9 +1077,9 @@ func (o ListDirectoryContentsRequest_SdkV2) Type(ctx context.Context) attr.Type type ListDirectoryResponse_SdkV2 struct { // Array of DirectoryEntry. - Contents types.List `tfsdk:"contents" tf:"optional"` + Contents types.List `tfsdk:"contents"` // A token, which can be sent as `page_token` to retrieve the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListDirectoryResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDirectoryResponse_SdkV2) { @@ -1076,10 +1088,11 @@ func (newState *ListDirectoryResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListDirectoryResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListDirectoryResponse_SdkV2) { } -func (c ListDirectoryResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DirectoryEntry_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "contents")...) +func (c ListDirectoryResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["contents"] = attrs["contents"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListDirectoryResponse. @@ -1148,7 +1161,7 @@ func (o *ListDirectoryResponse_SdkV2) SetContents(ctx context.Context, v []Direc type ListStatusResponse_SdkV2 struct { // A list of FileInfo's that describe contents of directory or file. See // example above. - Files types.List `tfsdk:"files" tf:"optional"` + Files types.List `tfsdk:"files"` } func (newState *ListStatusResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListStatusResponse_SdkV2) { @@ -1157,10 +1170,10 @@ func (newState *ListStatusResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListStatusResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListStatusResponse_SdkV2) { } -func (c ListStatusResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "files")...) +func (c ListStatusResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["files"] = attrs["files"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListStatusResponse. @@ -1226,7 +1239,7 @@ func (o *ListStatusResponse_SdkV2) SetFiles(ctx context.Context, v []FileInfo_Sd type MkDirs_SdkV2 struct { // The path of the new directory. The path should be the absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *MkDirs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MkDirs_SdkV2) { @@ -1235,10 +1248,10 @@ func (newState *MkDirs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MkDir func (newState *MkDirs_SdkV2) SyncEffectiveFieldsDuringRead(existingState MkDirs_SdkV2) { } -func (c MkDirs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c MkDirs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MkDirs. @@ -1281,9 +1294,9 @@ func (newState *MkDirsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *MkDirsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState MkDirsResponse_SdkV2) { } -func (c MkDirsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MkDirsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MkDirsResponse. @@ -1316,10 +1329,10 @@ func (o MkDirsResponse_SdkV2) Type(ctx context.Context) attr.Type { type Move_SdkV2 struct { // The destination path of the file or directory. The path should be the // absolute DBFS path. - DestinationPath types.String `tfsdk:"destination_path" tf:""` + DestinationPath types.String `tfsdk:"destination_path"` // The source path of the file or directory. The path should be the absolute // DBFS path. - SourcePath types.String `tfsdk:"source_path" tf:""` + SourcePath types.String `tfsdk:"source_path"` } func (newState *Move_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Move_SdkV2) { @@ -1328,11 +1341,11 @@ func (newState *Move_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Move_Sd func (newState *Move_SdkV2) SyncEffectiveFieldsDuringRead(existingState Move_SdkV2) { } -func (c Move_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination_path")...) - cs.SetRequired(append(path, "source_path")...) +func (c Move_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_path"] = attrs["destination_path"].SetRequired() + attrs["source_path"] = attrs["source_path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Move. @@ -1377,9 +1390,9 @@ func (newState *MoveResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MoveResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState MoveResponse_SdkV2) { } -func (c MoveResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MoveResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MoveResponse. @@ -1411,11 +1424,11 @@ func (o MoveResponse_SdkV2) Type(ctx context.Context) attr.Type { type Put_SdkV2 struct { // This parameter might be absent, and instead a posted file will be used. - Contents types.String `tfsdk:"contents" tf:"optional"` + Contents types.String `tfsdk:"contents"` // The flag that specifies whether to overwrite existing file/files. - Overwrite types.Bool `tfsdk:"overwrite" tf:"optional"` + Overwrite types.Bool `tfsdk:"overwrite"` // The path of the new file. The path should be the absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Put_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Put_SdkV2) { @@ -1424,10 +1437,12 @@ func (newState *Put_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Put_SdkV func (newState *Put_SdkV2) SyncEffectiveFieldsDuringRead(existingState Put_SdkV2) { } -func (c Put_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Put_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["contents"] = attrs["contents"].SetOptional() + attrs["overwrite"] = attrs["overwrite"].SetOptional() + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Put. @@ -1474,9 +1489,9 @@ func (newState *PutResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PutResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState PutResponse_SdkV2) { } -func (c PutResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PutResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutResponse. @@ -1556,9 +1571,9 @@ type ReadResponse_SdkV2 struct { // The number of bytes read (could be less than ``length`` if we hit end of // file). This refers to number of bytes read in unencoded version (response // data is base64-encoded). - BytesRead types.Int64 `tfsdk:"bytes_read" tf:"optional"` + BytesRead types.Int64 `tfsdk:"bytes_read"` // The base64-encoded contents of the file read. - Data types.String `tfsdk:"data" tf:"optional"` + Data types.String `tfsdk:"data"` } func (newState *ReadResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReadResponse_SdkV2) { @@ -1567,9 +1582,11 @@ func (newState *ReadResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ReadResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ReadResponse_SdkV2) { } -func (c ReadResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ReadResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bytes_read"] = attrs["bytes_read"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ReadResponse. diff --git a/internal/service/files_tf/model.go b/internal/service/files_tf/model.go index 9e6745fd2..9150fe621 100755 --- a/internal/service/files_tf/model.go +++ b/internal/service/files_tf/model.go @@ -25,9 +25,9 @@ import ( type AddBlock struct { // The base64-encoded data to append to the stream. This has a limit of 1 // MB. - Data types.String `tfsdk:"data" tf:""` + Data types.String `tfsdk:"data"` // The handle on an open stream. - Handle types.Int64 `tfsdk:"handle" tf:""` + Handle types.Int64 `tfsdk:"handle"` } func (newState *AddBlock) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddBlock) { @@ -36,11 +36,11 @@ func (newState *AddBlock) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddBlock) func (newState *AddBlock) SyncEffectiveFieldsDuringRead(existingState AddBlock) { } -func (c AddBlock) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "data")...) - cs.SetRequired(append(path, "handle")...) +func (c AddBlock) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data"] = attrs["data"].SetRequired() + attrs["handle"] = attrs["handle"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddBlock. @@ -85,9 +85,9 @@ func (newState *AddBlockResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan A func (newState *AddBlockResponse) SyncEffectiveFieldsDuringRead(existingState AddBlockResponse) { } -func (c AddBlockResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AddBlockResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddBlockResponse. @@ -119,7 +119,7 @@ func (o AddBlockResponse) Type(ctx context.Context) attr.Type { type Close struct { // The handle on an open stream. - Handle types.Int64 `tfsdk:"handle" tf:""` + Handle types.Int64 `tfsdk:"handle"` } func (newState *Close) SyncEffectiveFieldsDuringCreateOrUpdate(plan Close) { @@ -128,10 +128,10 @@ func (newState *Close) SyncEffectiveFieldsDuringCreateOrUpdate(plan Close) { func (newState *Close) SyncEffectiveFieldsDuringRead(existingState Close) { } -func (c Close) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "handle")...) +func (c Close) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["handle"] = attrs["handle"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Close. @@ -174,9 +174,9 @@ func (newState *CloseResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Clos func (newState *CloseResponse) SyncEffectiveFieldsDuringRead(existingState CloseResponse) { } -func (c CloseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CloseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloseResponse. @@ -208,9 +208,9 @@ func (o CloseResponse) Type(ctx context.Context) attr.Type { type Create struct { // The flag that specifies whether to overwrite existing file/files. - Overwrite types.Bool `tfsdk:"overwrite" tf:"optional"` + Overwrite types.Bool `tfsdk:"overwrite"` // The path of the new file. The path should be the absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Create) SyncEffectiveFieldsDuringCreateOrUpdate(plan Create) { @@ -219,10 +219,11 @@ func (newState *Create) SyncEffectiveFieldsDuringCreateOrUpdate(plan Create) { func (newState *Create) SyncEffectiveFieldsDuringRead(existingState Create) { } -func (c Create) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Create) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["overwrite"] = attrs["overwrite"].SetOptional() + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Create. @@ -328,7 +329,7 @@ func (o CreateDirectoryResponse) Type(ctx context.Context) attr.Type { type CreateResponse struct { // Handle which should subsequently be passed into the AddBlock and Close // calls when writing to a file through a stream. - Handle types.Int64 `tfsdk:"handle" tf:"optional"` + Handle types.Int64 `tfsdk:"handle"` } func (newState *CreateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateResponse) { @@ -337,9 +338,10 @@ func (newState *CreateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CreateResponse) SyncEffectiveFieldsDuringRead(existingState CreateResponse) { } -func (c CreateResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["handle"] = attrs["handle"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateResponse. @@ -376,10 +378,10 @@ func (o CreateResponse) Type(ctx context.Context) attr.Type { type Delete struct { // The path of the file or directory to delete. The path should be the // absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` // Whether or not to recursively delete the directory's contents. Deleting // empty directories can be done without providing the recursive flag. - Recursive types.Bool `tfsdk:"recursive" tf:"optional"` + Recursive types.Bool `tfsdk:"recursive"` } func (newState *Delete) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete) { @@ -388,10 +390,11 @@ func (newState *Delete) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete) { func (newState *Delete) SyncEffectiveFieldsDuringRead(existingState Delete) { } -func (c Delete) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Delete) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() + attrs["recursive"] = attrs["recursive"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Delete. @@ -540,9 +543,9 @@ func (newState *DeleteResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Del func (newState *DeleteResponse) SyncEffectiveFieldsDuringRead(existingState DeleteResponse) { } -func (c DeleteResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteResponse. @@ -574,16 +577,16 @@ func (o DeleteResponse) Type(ctx context.Context) attr.Type { type DirectoryEntry struct { // The length of the file in bytes. This field is omitted for directories. - FileSize types.Int64 `tfsdk:"file_size" tf:"optional"` + FileSize types.Int64 `tfsdk:"file_size"` // True if the path is a directory. - IsDirectory types.Bool `tfsdk:"is_directory" tf:"optional"` + IsDirectory types.Bool `tfsdk:"is_directory"` // Last modification time of given file in milliseconds since unix epoch. - LastModified types.Int64 `tfsdk:"last_modified" tf:"optional"` + LastModified types.Int64 `tfsdk:"last_modified"` // The name of the file or directory. This is the last component of the // path. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The absolute path of the file or directory. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *DirectoryEntry) SyncEffectiveFieldsDuringCreateOrUpdate(plan DirectoryEntry) { @@ -592,9 +595,14 @@ func (newState *DirectoryEntry) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dir func (newState *DirectoryEntry) SyncEffectiveFieldsDuringRead(existingState DirectoryEntry) { } -func (c DirectoryEntry) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DirectoryEntry) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_size"] = attrs["file_size"].SetOptional() + attrs["is_directory"] = attrs["is_directory"].SetOptional() + attrs["last_modified"] = attrs["last_modified"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DirectoryEntry. @@ -722,13 +730,13 @@ func (o DownloadResponse) Type(ctx context.Context) attr.Type { type FileInfo struct { // The length of the file in bytes. This field is omitted for directories. - FileSize types.Int64 `tfsdk:"file_size" tf:"optional"` + FileSize types.Int64 `tfsdk:"file_size"` // True if the path is a directory. - IsDir types.Bool `tfsdk:"is_dir" tf:"optional"` + IsDir types.Bool `tfsdk:"is_dir"` // Last modification time of given file in milliseconds since epoch. - ModificationTime types.Int64 `tfsdk:"modification_time" tf:"optional"` + ModificationTime types.Int64 `tfsdk:"modification_time"` // The absolute path of the file or directory. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *FileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo) { @@ -737,9 +745,13 @@ func (newState *FileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo) func (newState *FileInfo) SyncEffectiveFieldsDuringRead(existingState FileInfo) { } -func (c FileInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_size"] = attrs["file_size"].SetOptional() + attrs["is_dir"] = attrs["is_dir"].SetOptional() + attrs["modification_time"] = attrs["modification_time"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileInfo. @@ -1065,9 +1077,9 @@ func (o ListDirectoryContentsRequest) Type(ctx context.Context) attr.Type { type ListDirectoryResponse struct { // Array of DirectoryEntry. - Contents types.List `tfsdk:"contents" tf:"optional"` + Contents types.List `tfsdk:"contents"` // A token, which can be sent as `page_token` to retrieve the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListDirectoryResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDirectoryResponse) { @@ -1076,10 +1088,11 @@ func (newState *ListDirectoryResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListDirectoryResponse) SyncEffectiveFieldsDuringRead(existingState ListDirectoryResponse) { } -func (c ListDirectoryResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DirectoryEntry{}.ApplySchemaCustomizations(cs, append(path, "contents")...) +func (c ListDirectoryResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["contents"] = attrs["contents"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListDirectoryResponse. @@ -1148,7 +1161,7 @@ func (o *ListDirectoryResponse) SetContents(ctx context.Context, v []DirectoryEn type ListStatusResponse struct { // A list of FileInfo's that describe contents of directory or file. See // example above. - Files types.List `tfsdk:"files" tf:"optional"` + Files types.List `tfsdk:"files"` } func (newState *ListStatusResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListStatusResponse) { @@ -1157,10 +1170,10 @@ func (newState *ListStatusResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListStatusResponse) SyncEffectiveFieldsDuringRead(existingState ListStatusResponse) { } -func (c ListStatusResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo{}.ApplySchemaCustomizations(cs, append(path, "files")...) +func (c ListStatusResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["files"] = attrs["files"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListStatusResponse. @@ -1226,7 +1239,7 @@ func (o *ListStatusResponse) SetFiles(ctx context.Context, v []FileInfo) { type MkDirs struct { // The path of the new directory. The path should be the absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *MkDirs) SyncEffectiveFieldsDuringCreateOrUpdate(plan MkDirs) { @@ -1235,10 +1248,10 @@ func (newState *MkDirs) SyncEffectiveFieldsDuringCreateOrUpdate(plan MkDirs) { func (newState *MkDirs) SyncEffectiveFieldsDuringRead(existingState MkDirs) { } -func (c MkDirs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c MkDirs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MkDirs. @@ -1281,9 +1294,9 @@ func (newState *MkDirsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan MkD func (newState *MkDirsResponse) SyncEffectiveFieldsDuringRead(existingState MkDirsResponse) { } -func (c MkDirsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MkDirsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MkDirsResponse. @@ -1316,10 +1329,10 @@ func (o MkDirsResponse) Type(ctx context.Context) attr.Type { type Move struct { // The destination path of the file or directory. The path should be the // absolute DBFS path. - DestinationPath types.String `tfsdk:"destination_path" tf:""` + DestinationPath types.String `tfsdk:"destination_path"` // The source path of the file or directory. The path should be the absolute // DBFS path. - SourcePath types.String `tfsdk:"source_path" tf:""` + SourcePath types.String `tfsdk:"source_path"` } func (newState *Move) SyncEffectiveFieldsDuringCreateOrUpdate(plan Move) { @@ -1328,11 +1341,11 @@ func (newState *Move) SyncEffectiveFieldsDuringCreateOrUpdate(plan Move) { func (newState *Move) SyncEffectiveFieldsDuringRead(existingState Move) { } -func (c Move) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "destination_path")...) - cs.SetRequired(append(path, "source_path")...) +func (c Move) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_path"] = attrs["destination_path"].SetRequired() + attrs["source_path"] = attrs["source_path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Move. @@ -1377,9 +1390,9 @@ func (newState *MoveResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan MoveR func (newState *MoveResponse) SyncEffectiveFieldsDuringRead(existingState MoveResponse) { } -func (c MoveResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MoveResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MoveResponse. @@ -1411,11 +1424,11 @@ func (o MoveResponse) Type(ctx context.Context) attr.Type { type Put struct { // This parameter might be absent, and instead a posted file will be used. - Contents types.String `tfsdk:"contents" tf:"optional"` + Contents types.String `tfsdk:"contents"` // The flag that specifies whether to overwrite existing file/files. - Overwrite types.Bool `tfsdk:"overwrite" tf:"optional"` + Overwrite types.Bool `tfsdk:"overwrite"` // The path of the new file. The path should be the absolute DBFS path. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Put) SyncEffectiveFieldsDuringCreateOrUpdate(plan Put) { @@ -1424,10 +1437,12 @@ func (newState *Put) SyncEffectiveFieldsDuringCreateOrUpdate(plan Put) { func (newState *Put) SyncEffectiveFieldsDuringRead(existingState Put) { } -func (c Put) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Put) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["contents"] = attrs["contents"].SetOptional() + attrs["overwrite"] = attrs["overwrite"].SetOptional() + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Put. @@ -1474,9 +1489,9 @@ func (newState *PutResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutRes func (newState *PutResponse) SyncEffectiveFieldsDuringRead(existingState PutResponse) { } -func (c PutResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PutResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutResponse. @@ -1556,9 +1571,9 @@ type ReadResponse struct { // The number of bytes read (could be less than ``length`` if we hit end of // file). This refers to number of bytes read in unencoded version (response // data is base64-encoded). - BytesRead types.Int64 `tfsdk:"bytes_read" tf:"optional"` + BytesRead types.Int64 `tfsdk:"bytes_read"` // The base64-encoded contents of the file read. - Data types.String `tfsdk:"data" tf:"optional"` + Data types.String `tfsdk:"data"` } func (newState *ReadResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReadResponse) { @@ -1567,9 +1582,11 @@ func (newState *ReadResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReadR func (newState *ReadResponse) SyncEffectiveFieldsDuringRead(existingState ReadResponse) { } -func (c ReadResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ReadResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bytes_read"] = attrs["bytes_read"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ReadResponse. diff --git a/internal/service/iam_tf/legacy_model.go b/internal/service/iam_tf/legacy_model.go index 98a9e540c..59a73c9b7 100755 --- a/internal/service/iam_tf/legacy_model.go +++ b/internal/service/iam_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -24,13 +25,13 @@ import ( type AccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccessControlRequest_SdkV2) { @@ -39,9 +40,13 @@ func (newState *AccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *AccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccessControlRequest_SdkV2) { } -func (c AccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccessControlRequest. @@ -83,15 +88,15 @@ func (o AccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type { type AccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccessControlResponse_SdkV2) { @@ -100,10 +105,14 @@ func (newState *AccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *AccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccessControlResponse_SdkV2) { } -func (c AccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Permission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c AccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccessControlResponse. @@ -176,15 +185,15 @@ func (o *AccessControlResponse_SdkV2) SetAllPermissions(ctx context.Context, v [ } type ComplexValue_SdkV2 struct { - Display types.String `tfsdk:"display" tf:"optional"` + Display types.String `tfsdk:"display"` - Primary types.Bool `tfsdk:"primary" tf:"optional"` + Primary types.Bool `tfsdk:"primary"` - Ref types.String `tfsdk:"$ref" tf:"optional"` + Ref types.String `tfsdk:"$ref"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ComplexValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplexValue_SdkV2) { @@ -193,9 +202,14 @@ func (newState *ComplexValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ComplexValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState ComplexValue_SdkV2) { } -func (c ComplexValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ComplexValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display"] = attrs["display"].SetOptional() + attrs["primary"] = attrs["primary"].SetOptional() + attrs["$ref"] = attrs["$ref"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplexValue. @@ -539,9 +553,9 @@ func (newState *DeleteWorkspacePermissionAssignmentResponse_SdkV2) SyncEffective func (newState *DeleteWorkspacePermissionAssignmentResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteWorkspacePermissionAssignmentResponse_SdkV2) { } -func (c DeleteWorkspacePermissionAssignmentResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteWorkspacePermissionAssignmentResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteWorkspacePermissionAssignmentResponse. @@ -755,7 +769,7 @@ func (o GetAssignableRolesForResourceRequest_SdkV2) Type(ctx context.Context) at } type GetAssignableRolesForResourceResponse_SdkV2 struct { - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` } func (newState *GetAssignableRolesForResourceResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetAssignableRolesForResourceResponse_SdkV2) { @@ -764,10 +778,10 @@ func (newState *GetAssignableRolesForResourceResponse_SdkV2) SyncEffectiveFields func (newState *GetAssignableRolesForResourceResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetAssignableRolesForResourceResponse_SdkV2) { } -func (c GetAssignableRolesForResourceResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Role_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c GetAssignableRolesForResourceResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["roles"] = attrs["roles"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetAssignableRolesForResourceResponse. @@ -870,7 +884,7 @@ func (o GetGroupRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetPasswordPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetPasswordPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPasswordPermissionLevelsResponse_SdkV2) { @@ -879,10 +893,10 @@ func (newState *GetPasswordPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDu func (newState *GetPasswordPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPasswordPermissionLevelsResponse_SdkV2) { } -func (c GetPasswordPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetPasswordPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPasswordPermissionLevelsResponse. @@ -989,7 +1003,7 @@ func (o GetPermissionLevelsRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPermissionLevelsResponse_SdkV2) { @@ -998,10 +1012,10 @@ func (newState *GetPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *GetPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPermissionLevelsResponse_SdkV2) { } -func (c GetPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPermissionLevelsResponse. @@ -1306,9 +1320,9 @@ func (o GetWorkspaceAssignmentRequest_SdkV2) Type(ctx context.Context) attr.Type type GrantRule_SdkV2 struct { // Principals this grant rule applies to. - Principals types.List `tfsdk:"principals" tf:"optional"` + Principals types.List `tfsdk:"principals"` // Role that is assigned to the list of principals. - Role types.String `tfsdk:"role" tf:""` + Role types.String `tfsdk:"role"` } func (newState *GrantRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GrantRule_SdkV2) { @@ -1317,10 +1331,11 @@ func (newState *GrantRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Gr func (newState *GrantRule_SdkV2) SyncEffectiveFieldsDuringRead(existingState GrantRule_SdkV2) { } -func (c GrantRule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "role")...) +func (c GrantRule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principals"] = attrs["principals"].SetOptional() + attrs["role"] = attrs["role"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GrantRule. @@ -1388,26 +1403,26 @@ func (o *GrantRule_SdkV2) SetPrincipals(ctx context.Context, v []types.String) { type Group_SdkV2 struct { // String that represents a human-readable group name - DisplayName types.String `tfsdk:"displayName" tf:"optional"` + DisplayName types.String `tfsdk:"displayName"` // Entitlements assigned to the group. See [assigning entitlements] for a // full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements types.List `tfsdk:"entitlements" tf:"optional"` + Entitlements types.List `tfsdk:"entitlements"` - ExternalId types.String `tfsdk:"externalId" tf:"optional"` + ExternalId types.String `tfsdk:"externalId"` - Groups types.List `tfsdk:"groups" tf:"optional"` + Groups types.List `tfsdk:"groups"` // Databricks group ID - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Members types.List `tfsdk:"members" tf:"optional"` + Members types.List `tfsdk:"members"` // Container for the group identifier. Workspace local versus account. - Meta types.List `tfsdk:"meta" tf:"optional,object"` + Meta types.List `tfsdk:"meta"` // Corresponds to AWS instance profile/arn role. - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` // The schema of the group. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *Group_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Group_SdkV2) { @@ -1416,14 +1431,19 @@ func (newState *Group_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Group_ func (newState *Group_SdkV2) SyncEffectiveFieldsDuringRead(existingState Group_SdkV2) { } -func (c Group_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "entitlements")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "groups")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "members")...) - ResourceMeta_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "meta")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c Group_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["displayName"] = attrs["displayName"].SetOptional() + attrs["entitlements"] = attrs["entitlements"].SetOptional() + attrs["externalId"] = attrs["externalId"].SetOptional() + attrs["groups"] = attrs["groups"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["members"] = attrs["members"].SetOptional() + attrs["meta"] = attrs["meta"].SetOptional() + attrs["meta"] = attrs["meta"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["roles"] = attrs["roles"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Group. @@ -1919,16 +1939,16 @@ func (o ListGroupsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListGroupsResponse_SdkV2 struct { // Total results returned in the response. - ItemsPerPage types.Int64 `tfsdk:"itemsPerPage" tf:"optional"` + ItemsPerPage types.Int64 `tfsdk:"itemsPerPage"` // User objects returned in the response. - Resources types.List `tfsdk:"Resources" tf:"optional"` + Resources types.List `tfsdk:"Resources"` // The schema of the service principal. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex types.Int64 `tfsdk:"startIndex" tf:"optional"` + StartIndex types.Int64 `tfsdk:"startIndex"` // Total results that match the request filters. - TotalResults types.Int64 `tfsdk:"totalResults" tf:"optional"` + TotalResults types.Int64 `tfsdk:"totalResults"` } func (newState *ListGroupsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListGroupsResponse_SdkV2) { @@ -1937,10 +1957,14 @@ func (newState *ListGroupsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListGroupsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListGroupsResponse_SdkV2) { } -func (c ListGroupsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Group_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "Resources")...) +func (c ListGroupsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["itemsPerPage"] = attrs["itemsPerPage"].SetOptional() + attrs["Resources"] = attrs["Resources"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["startIndex"] = attrs["startIndex"].SetOptional() + attrs["totalResults"] = attrs["totalResults"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListGroupsResponse. @@ -2043,16 +2067,16 @@ func (o *ListGroupsResponse_SdkV2) SetSchemas(ctx context.Context, v []types.Str type ListServicePrincipalResponse_SdkV2 struct { // Total results returned in the response. - ItemsPerPage types.Int64 `tfsdk:"itemsPerPage" tf:"optional"` + ItemsPerPage types.Int64 `tfsdk:"itemsPerPage"` // User objects returned in the response. - Resources types.List `tfsdk:"Resources" tf:"optional"` + Resources types.List `tfsdk:"Resources"` // The schema of the List response. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex types.Int64 `tfsdk:"startIndex" tf:"optional"` + StartIndex types.Int64 `tfsdk:"startIndex"` // Total results that match the request filters. - TotalResults types.Int64 `tfsdk:"totalResults" tf:"optional"` + TotalResults types.Int64 `tfsdk:"totalResults"` } func (newState *ListServicePrincipalResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListServicePrincipalResponse_SdkV2) { @@ -2061,10 +2085,14 @@ func (newState *ListServicePrincipalResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ListServicePrincipalResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListServicePrincipalResponse_SdkV2) { } -func (c ListServicePrincipalResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServicePrincipal_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "Resources")...) +func (c ListServicePrincipalResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["itemsPerPage"] = attrs["itemsPerPage"].SetOptional() + attrs["Resources"] = attrs["Resources"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["startIndex"] = attrs["startIndex"].SetOptional() + attrs["totalResults"] = attrs["totalResults"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListServicePrincipalResponse. @@ -2302,16 +2330,16 @@ func (o ListUsersRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListUsersResponse_SdkV2 struct { // Total results returned in the response. - ItemsPerPage types.Int64 `tfsdk:"itemsPerPage" tf:"optional"` + ItemsPerPage types.Int64 `tfsdk:"itemsPerPage"` // User objects returned in the response. - Resources types.List `tfsdk:"Resources" tf:"optional"` + Resources types.List `tfsdk:"Resources"` // The schema of the List response. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex types.Int64 `tfsdk:"startIndex" tf:"optional"` + StartIndex types.Int64 `tfsdk:"startIndex"` // Total results that match the request filters. - TotalResults types.Int64 `tfsdk:"totalResults" tf:"optional"` + TotalResults types.Int64 `tfsdk:"totalResults"` } func (newState *ListUsersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListUsersResponse_SdkV2) { @@ -2320,10 +2348,14 @@ func (newState *ListUsersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListUsersResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListUsersResponse_SdkV2) { } -func (c ListUsersResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - User_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "Resources")...) +func (c ListUsersResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["itemsPerPage"] = attrs["itemsPerPage"].SetOptional() + attrs["Resources"] = attrs["Resources"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["startIndex"] = attrs["startIndex"].SetOptional() + attrs["totalResults"] = attrs["totalResults"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListUsersResponse. @@ -2463,14 +2495,14 @@ func (o ListWorkspaceAssignmentRequest_SdkV2) Type(ctx context.Context) attr.Typ type MigratePermissionsRequest_SdkV2 struct { // The name of the workspace group that permissions will be migrated from. - FromWorkspaceGroupName types.String `tfsdk:"from_workspace_group_name" tf:""` + FromWorkspaceGroupName types.String `tfsdk:"from_workspace_group_name"` // The maximum number of permissions that will be migrated. - Size types.Int64 `tfsdk:"size" tf:"optional"` + Size types.Int64 `tfsdk:"size"` // The name of the account group that permissions will be migrated to. - ToAccountGroupName types.String `tfsdk:"to_account_group_name" tf:""` + ToAccountGroupName types.String `tfsdk:"to_account_group_name"` // WorkspaceId of the associated workspace where the permission migration // will occur. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:""` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *MigratePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigratePermissionsRequest_SdkV2) { @@ -2479,12 +2511,13 @@ func (newState *MigratePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *MigratePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState MigratePermissionsRequest_SdkV2) { } -func (c MigratePermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "from_workspace_group_name")...) - cs.SetRequired(append(path, "to_account_group_name")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c MigratePermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["from_workspace_group_name"] = attrs["from_workspace_group_name"].SetRequired() + attrs["size"] = attrs["size"].SetOptional() + attrs["to_account_group_name"] = attrs["to_account_group_name"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MigratePermissionsRequest. @@ -2526,7 +2559,7 @@ func (o MigratePermissionsRequest_SdkV2) Type(ctx context.Context) attr.Type { type MigratePermissionsResponse_SdkV2 struct { // Number of permissions migrated. - PermissionsMigrated types.Int64 `tfsdk:"permissions_migrated" tf:"optional"` + PermissionsMigrated types.Int64 `tfsdk:"permissions_migrated"` } func (newState *MigratePermissionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigratePermissionsResponse_SdkV2) { @@ -2535,9 +2568,10 @@ func (newState *MigratePermissionsResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *MigratePermissionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState MigratePermissionsResponse_SdkV2) { } -func (c MigratePermissionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MigratePermissionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permissions_migrated"] = attrs["permissions_migrated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MigratePermissionsResponse. @@ -2573,9 +2607,9 @@ func (o MigratePermissionsResponse_SdkV2) Type(ctx context.Context) attr.Type { type Name_SdkV2 struct { // Family name of the Databricks user. - FamilyName types.String `tfsdk:"familyName" tf:"optional"` + FamilyName types.String `tfsdk:"familyName"` // Given name of the Databricks user. - GivenName types.String `tfsdk:"givenName" tf:"optional"` + GivenName types.String `tfsdk:"givenName"` } func (newState *Name_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Name_SdkV2) { @@ -2584,9 +2618,11 @@ func (newState *Name_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Name_Sd func (newState *Name_SdkV2) SyncEffectiveFieldsDuringRead(existingState Name_SdkV2) { } -func (c Name_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Name_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["familyName"] = attrs["familyName"].SetOptional() + attrs["givenName"] = attrs["givenName"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Name. @@ -2623,11 +2659,11 @@ func (o Name_SdkV2) Type(ctx context.Context) attr.Type { } type ObjectPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ObjectPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ObjectPermissions_SdkV2) { @@ -2636,10 +2672,12 @@ func (newState *ObjectPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ObjectPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState ObjectPermissions_SdkV2) { } -func (c ObjectPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ObjectPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ObjectPermissions. @@ -2711,10 +2749,10 @@ type PartialUpdate_SdkV2 struct { // Unique ID for a user in the Databricks workspace. Id types.String `tfsdk:"-"` - Operations types.List `tfsdk:"Operations" tf:"optional"` + Operations types.List `tfsdk:"Operations"` // The schema of the patch request. Must be // ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *PartialUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartialUpdate_SdkV2) { @@ -2723,11 +2761,12 @@ func (newState *PartialUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *PartialUpdate_SdkV2) SyncEffectiveFieldsDuringRead(existingState PartialUpdate_SdkV2) { } -func (c PartialUpdate_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - Patch_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "Operations")...) +func (c PartialUpdate_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["Operations"] = attrs["Operations"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartialUpdate. @@ -2826,13 +2865,13 @@ func (o *PartialUpdate_SdkV2) SetSchemas(ctx context.Context, v []types.String) type PasswordAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PasswordAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordAccessControlRequest_SdkV2) { @@ -2841,9 +2880,13 @@ func (newState *PasswordAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *PasswordAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PasswordAccessControlRequest_SdkV2) { } -func (c PasswordAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PasswordAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordAccessControlRequest. @@ -2885,15 +2928,15 @@ func (o PasswordAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type type PasswordAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PasswordAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordAccessControlResponse_SdkV2) { @@ -2902,10 +2945,14 @@ func (newState *PasswordAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *PasswordAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState PasswordAccessControlResponse_SdkV2) { } -func (c PasswordAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c PasswordAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordAccessControlResponse. @@ -2978,11 +3025,11 @@ func (o *PasswordAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Cont } type PasswordPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PasswordPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermission_SdkV2) { @@ -2991,9 +3038,12 @@ func (newState *PasswordPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PasswordPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState PasswordPermission_SdkV2) { } -func (c PasswordPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PasswordPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermission. @@ -3062,11 +3112,11 @@ func (o *PasswordPermission_SdkV2) SetInheritedFromObject(ctx context.Context, v } type PasswordPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *PasswordPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermissions_SdkV2) { @@ -3075,10 +3125,12 @@ func (newState *PasswordPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *PasswordPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState PasswordPermissions_SdkV2) { } -func (c PasswordPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c PasswordPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermissions. @@ -3147,9 +3199,9 @@ func (o *PasswordPermissions_SdkV2) SetAccessControlList(ctx context.Context, v } type PasswordPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PasswordPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermissionsDescription_SdkV2) { @@ -3158,9 +3210,11 @@ func (newState *PasswordPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringC func (newState *PasswordPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState PasswordPermissionsDescription_SdkV2) { } -func (c PasswordPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PasswordPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermissionsDescription. @@ -3197,7 +3251,7 @@ func (o PasswordPermissionsDescription_SdkV2) Type(ctx context.Context) attr.Typ } type PasswordPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` } func (newState *PasswordPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermissionsRequest_SdkV2) { @@ -3206,10 +3260,10 @@ func (newState *PasswordPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *PasswordPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PasswordPermissionsRequest_SdkV2) { } -func (c PasswordPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c PasswordPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermissionsRequest. @@ -3275,11 +3329,11 @@ func (o *PasswordPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Cont type Patch_SdkV2 struct { // Type of patch operation. - Op types.String `tfsdk:"op" tf:"optional"` + Op types.String `tfsdk:"op"` // Selection of patch operation - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Value to modify - Value types.Object `tfsdk:"value" tf:"optional"` + Value types.Object `tfsdk:"value"` } func (newState *Patch_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Patch_SdkV2) { @@ -3288,9 +3342,12 @@ func (newState *Patch_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Patch_ func (newState *Patch_SdkV2) SyncEffectiveFieldsDuringRead(existingState Patch_SdkV2) { } -func (c Patch_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Patch_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["op"] = attrs["op"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Patch. @@ -3359,11 +3416,11 @@ func (o PatchResponse_SdkV2) Type(ctx context.Context) attr.Type { } type Permission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *Permission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Permission_SdkV2) { @@ -3372,9 +3429,12 @@ func (newState *Permission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan P func (newState *Permission_SdkV2) SyncEffectiveFieldsDuringRead(existingState Permission_SdkV2) { } -func (c Permission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Permission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Permission. @@ -3446,11 +3506,11 @@ func (o *Permission_SdkV2) SetInheritedFromObject(ctx context.Context, v []types // contains some info for user consumption. type PermissionAssignment_SdkV2 struct { // Error response associated with a workspace permission assignment, if any. - Error types.String `tfsdk:"error" tf:"optional"` + Error types.String `tfsdk:"error"` // The permissions level of the principal. - Permissions types.List `tfsdk:"permissions" tf:"optional"` + Permissions types.List `tfsdk:"permissions"` // Information about the principal assigned to the workspace. - Principal types.List `tfsdk:"principal" tf:"optional,object"` + Principal types.List `tfsdk:"principal"` } func (newState *PermissionAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionAssignment_SdkV2) { @@ -3459,10 +3519,13 @@ func (newState *PermissionAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *PermissionAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionAssignment_SdkV2) { } -func (c PermissionAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PrincipalOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "principal")...) +func (c PermissionAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["permissions"] = attrs["permissions"].SetOptional() + attrs["principal"] = attrs["principal"].SetOptional() + attrs["principal"] = attrs["principal"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionAssignment. @@ -3561,7 +3624,7 @@ func (o *PermissionAssignment_SdkV2) SetPrincipal(ctx context.Context, v Princip type PermissionAssignments_SdkV2 struct { // Array of permissions assignments defined for a workspace. - PermissionAssignments types.List `tfsdk:"permission_assignments" tf:"optional"` + PermissionAssignments types.List `tfsdk:"permission_assignments"` } func (newState *PermissionAssignments_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionAssignments_SdkV2) { @@ -3570,10 +3633,10 @@ func (newState *PermissionAssignments_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *PermissionAssignments_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionAssignments_SdkV2) { } -func (c PermissionAssignments_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_assignments")...) +func (c PermissionAssignments_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_assignments"] = attrs["permission_assignments"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionAssignments. @@ -3639,9 +3702,9 @@ func (o *PermissionAssignments_SdkV2) SetPermissionAssignments(ctx context.Conte type PermissionOutput_SdkV2 struct { // The results of a permissions query. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PermissionOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionOutput_SdkV2) { @@ -3650,9 +3713,11 @@ func (newState *PermissionOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PermissionOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionOutput_SdkV2) { } -func (c PermissionOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermissionOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionOutput. @@ -3689,9 +3754,9 @@ func (o PermissionOutput_SdkV2) Type(ctx context.Context) attr.Type { } type PermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionsDescription_SdkV2) { @@ -3700,9 +3765,11 @@ func (newState *PermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *PermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionsDescription_SdkV2) { } -func (c PermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsDescription. @@ -3739,7 +3806,7 @@ func (o PermissionsDescription_SdkV2) Type(ctx context.Context) attr.Type { } type PermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The id of the request object. RequestObjectId types.String `tfsdk:"-"` // The type of the request object. Can be one of the following: alerts, @@ -3756,12 +3823,12 @@ func (newState *PermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PermissionsRequest_SdkV2) { } -func (c PermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "request_object_id")...) - cs.SetRequired(append(path, "request_object_type")...) +func (c PermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["request_object_id"] = attrs["request_object_id"].SetRequired() + attrs["request_object_type"] = attrs["request_object_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsRequest. @@ -3832,16 +3899,16 @@ func (o *PermissionsRequest_SdkV2) SetAccessControlList(ctx context.Context, v [ // Information about the principal assigned to the workspace. type PrincipalOutput_SdkV2 struct { // The display name of the principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The group name of the group. Present only if the principal is a group. - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // The unique, opaque id of the principal. - PrincipalId types.Int64 `tfsdk:"principal_id" tf:"optional"` + PrincipalId types.Int64 `tfsdk:"principal_id"` // The name of the service principal. Present only if the principal is a // service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // The username of the user. Present only if the principal is a user. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PrincipalOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrincipalOutput_SdkV2) { @@ -3850,9 +3917,14 @@ func (newState *PrincipalOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PrincipalOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState PrincipalOutput_SdkV2) { } -func (c PrincipalOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrincipalOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["principal_id"] = attrs["principal_id"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrincipalOutput. @@ -3897,7 +3969,7 @@ func (o PrincipalOutput_SdkV2) Type(ctx context.Context) attr.Type { type ResourceMeta_SdkV2 struct { // Identifier for group type. Can be local workspace group // (`WorkspaceGroup`) or account group (`Group`). - ResourceType types.String `tfsdk:"resourceType" tf:"optional"` + ResourceType types.String `tfsdk:"resourceType"` } func (newState *ResourceMeta_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResourceMeta_SdkV2) { @@ -3906,9 +3978,10 @@ func (newState *ResourceMeta_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ResourceMeta_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResourceMeta_SdkV2) { } -func (c ResourceMeta_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResourceMeta_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["resourceType"] = attrs["resourceType"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResourceMeta. @@ -3944,7 +4017,7 @@ func (o ResourceMeta_SdkV2) Type(ctx context.Context) attr.Type { type Role_SdkV2 struct { // Role to assign to a principal or a list of principals on a resource. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *Role_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Role_SdkV2) { @@ -3953,10 +4026,10 @@ func (newState *Role_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Role_Sd func (newState *Role_SdkV2) SyncEffectiveFieldsDuringRead(existingState Role_SdkV2) { } -func (c Role_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c Role_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Role. @@ -3992,11 +4065,11 @@ func (o Role_SdkV2) Type(ctx context.Context) attr.Type { type RuleSetResponse_SdkV2 struct { // Identifies the version of the rule set returned. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - GrantRules types.List `tfsdk:"grant_rules" tf:"optional"` + GrantRules types.List `tfsdk:"grant_rules"` // Name of the rule set. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *RuleSetResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RuleSetResponse_SdkV2) { @@ -4005,10 +4078,12 @@ func (newState *RuleSetResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *RuleSetResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RuleSetResponse_SdkV2) { } -func (c RuleSetResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GrantRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "grant_rules")...) +func (c RuleSetResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["grant_rules"] = attrs["grant_rules"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RuleSetResponse. @@ -4080,11 +4155,11 @@ type RuleSetUpdateRequest_SdkV2 struct { // The expected etag of the rule set to update. The update will fail if the // value does not match the value that is stored in account access control // service. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` - GrantRules types.List `tfsdk:"grant_rules" tf:"optional"` + GrantRules types.List `tfsdk:"grant_rules"` // Name of the rule set. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *RuleSetUpdateRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RuleSetUpdateRequest_SdkV2) { @@ -4093,12 +4168,12 @@ func (newState *RuleSetUpdateRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *RuleSetUpdateRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RuleSetUpdateRequest_SdkV2) { } -func (c RuleSetUpdateRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) - GrantRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "grant_rules")...) - cs.SetRequired(append(path, "name")...) +func (c RuleSetUpdateRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() + attrs["grant_rules"] = attrs["grant_rules"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RuleSetUpdateRequest. @@ -4168,26 +4243,26 @@ func (o *RuleSetUpdateRequest_SdkV2) SetGrantRules(ctx context.Context, v []Gran type ServicePrincipal_SdkV2 struct { // If this user is active - Active types.Bool `tfsdk:"active" tf:"optional"` + Active types.Bool `tfsdk:"active"` // UUID relating to the service principal - ApplicationId types.String `tfsdk:"applicationId" tf:"optional"` + ApplicationId types.String `tfsdk:"applicationId"` // String that represents a concatenation of given and family names. - DisplayName types.String `tfsdk:"displayName" tf:"optional"` + DisplayName types.String `tfsdk:"displayName"` // Entitlements assigned to the service principal. See [assigning // entitlements] for a full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements types.List `tfsdk:"entitlements" tf:"optional"` + Entitlements types.List `tfsdk:"entitlements"` - ExternalId types.String `tfsdk:"externalId" tf:"optional"` + ExternalId types.String `tfsdk:"externalId"` - Groups types.List `tfsdk:"groups" tf:"optional"` + Groups types.List `tfsdk:"groups"` // Databricks service principal ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Corresponds to AWS instance profile/arn role. - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` // The schema of the List response. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *ServicePrincipal_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServicePrincipal_SdkV2) { @@ -4196,12 +4271,18 @@ func (newState *ServicePrincipal_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ServicePrincipal_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServicePrincipal_SdkV2) { } -func (c ServicePrincipal_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "entitlements")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "groups")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c ServicePrincipal_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active"] = attrs["active"].SetOptional() + attrs["applicationId"] = attrs["applicationId"].SetOptional() + attrs["displayName"] = attrs["displayName"].SetOptional() + attrs["entitlements"] = attrs["entitlements"].SetOptional() + attrs["externalId"] = attrs["externalId"].SetOptional() + attrs["groups"] = attrs["groups"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["roles"] = attrs["roles"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServicePrincipal. @@ -4400,9 +4481,9 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateRuleSetRequest_SdkV2 struct { // Name of the rule set. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - RuleSet types.List `tfsdk:"rule_set" tf:"object"` + RuleSet types.List `tfsdk:"rule_set"` } func (newState *UpdateRuleSetRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRuleSetRequest_SdkV2) { @@ -4411,12 +4492,12 @@ func (newState *UpdateRuleSetRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateRuleSetRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRuleSetRequest_SdkV2) { } -func (c UpdateRuleSetRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "rule_set")...) - RuleSetUpdateRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "rule_set")...) +func (c UpdateRuleSetRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["rule_set"] = attrs["rule_set"].SetRequired() + attrs["rule_set"] = attrs["rule_set"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRuleSetRequest. @@ -4489,7 +4570,7 @@ type UpdateWorkspaceAssignments_SdkV2 struct { // that excluding this field, or providing unsupported values, will have the // same effect as providing an empty list, which will result in the deletion // of all permissions for the principal. - Permissions types.List `tfsdk:"permissions" tf:"optional"` + Permissions types.List `tfsdk:"permissions"` // The ID of the user, service principal, or group. PrincipalId types.Int64 `tfsdk:"-"` // The workspace ID. @@ -4502,11 +4583,12 @@ func (newState *UpdateWorkspaceAssignments_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UpdateWorkspaceAssignments_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceAssignments_SdkV2) { } -func (c UpdateWorkspaceAssignments_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "principal_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c UpdateWorkspaceAssignments_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permissions"] = attrs["permissions"].SetOptional() + attrs["principal_id"] = attrs["principal_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceAssignments. @@ -4576,36 +4658,36 @@ func (o *UpdateWorkspaceAssignments_SdkV2) SetPermissions(ctx context.Context, v type User_SdkV2 struct { // If this user is active - Active types.Bool `tfsdk:"active" tf:"optional"` + Active types.Bool `tfsdk:"active"` // String that represents a concatenation of given and family names. For // example `John Smith`. This field cannot be updated through the Workspace // SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to // update `displayName`. // // [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation - DisplayName types.String `tfsdk:"displayName" tf:"optional"` + DisplayName types.String `tfsdk:"displayName"` // All the emails associated with the Databricks user. - Emails types.List `tfsdk:"emails" tf:"optional"` + Emails types.List `tfsdk:"emails"` // Entitlements assigned to the user. See [assigning entitlements] for a // full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements types.List `tfsdk:"entitlements" tf:"optional"` + Entitlements types.List `tfsdk:"entitlements"` // External ID is not currently supported. It is reserved for future use. - ExternalId types.String `tfsdk:"externalId" tf:"optional"` + ExternalId types.String `tfsdk:"externalId"` - Groups types.List `tfsdk:"groups" tf:"optional"` + Groups types.List `tfsdk:"groups"` // Databricks user ID. This is automatically set by Databricks. Any value // provided by the client will be ignored. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Name types.List `tfsdk:"name" tf:"optional,object"` + Name types.List `tfsdk:"name"` // Corresponds to AWS instance profile/arn role. - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` // The schema of the user. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Email address of the Databricks user. - UserName types.String `tfsdk:"userName" tf:"optional"` + UserName types.String `tfsdk:"userName"` } func (newState *User_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan User_SdkV2) { @@ -4614,14 +4696,21 @@ func (newState *User_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan User_Sd func (newState *User_SdkV2) SyncEffectiveFieldsDuringRead(existingState User_SdkV2) { } -func (c User_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "emails")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "entitlements")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "groups")...) - Name_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "name")...) - ComplexValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c User_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active"] = attrs["active"].SetOptional() + attrs["displayName"] = attrs["displayName"].SetOptional() + attrs["emails"] = attrs["emails"].SetOptional() + attrs["entitlements"] = attrs["entitlements"].SetOptional() + attrs["externalId"] = attrs["externalId"].SetOptional() + attrs["groups"] = attrs["groups"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["name"] = attrs["name"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["roles"] = attrs["roles"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["userName"] = attrs["userName"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in User. @@ -4852,7 +4941,7 @@ func (o *User_SdkV2) SetSchemas(ctx context.Context, v []types.String) { type WorkspacePermissions_SdkV2 struct { // Array of permissions defined for a workspace. - Permissions types.List `tfsdk:"permissions" tf:"optional"` + Permissions types.List `tfsdk:"permissions"` } func (newState *WorkspacePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspacePermissions_SdkV2) { @@ -4861,10 +4950,10 @@ func (newState *WorkspacePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *WorkspacePermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspacePermissions_SdkV2) { } -func (c WorkspacePermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permissions")...) +func (c WorkspacePermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permissions"] = attrs["permissions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspacePermissions. diff --git a/internal/service/iam_tf/model.go b/internal/service/iam_tf/model.go index b0b0e0fc2..2d7f350d8 100755 --- a/internal/service/iam_tf/model.go +++ b/internal/service/iam_tf/model.go @@ -24,13 +24,13 @@ import ( type AccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccessControlRequest) { @@ -39,9 +39,13 @@ func (newState *AccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AccessControlRequest) SyncEffectiveFieldsDuringRead(existingState AccessControlRequest) { } -func (c AccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccessControlRequest. @@ -83,15 +87,15 @@ func (o AccessControlRequest) Type(ctx context.Context) attr.Type { type AccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccessControlResponse) { @@ -100,10 +104,14 @@ func (newState *AccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AccessControlResponse) SyncEffectiveFieldsDuringRead(existingState AccessControlResponse) { } -func (c AccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Permission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c AccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccessControlResponse. @@ -176,15 +184,15 @@ func (o *AccessControlResponse) SetAllPermissions(ctx context.Context, v []Permi } type ComplexValue struct { - Display types.String `tfsdk:"display" tf:"optional"` + Display types.String `tfsdk:"display"` - Primary types.Bool `tfsdk:"primary" tf:"optional"` + Primary types.Bool `tfsdk:"primary"` - Ref types.String `tfsdk:"$ref" tf:"optional"` + Ref types.String `tfsdk:"$ref"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ComplexValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplexValue) { @@ -193,9 +201,14 @@ func (newState *ComplexValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan Compl func (newState *ComplexValue) SyncEffectiveFieldsDuringRead(existingState ComplexValue) { } -func (c ComplexValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ComplexValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display"] = attrs["display"].SetOptional() + attrs["primary"] = attrs["primary"].SetOptional() + attrs["$ref"] = attrs["$ref"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplexValue. @@ -539,9 +552,9 @@ func (newState *DeleteWorkspacePermissionAssignmentResponse) SyncEffectiveFields func (newState *DeleteWorkspacePermissionAssignmentResponse) SyncEffectiveFieldsDuringRead(existingState DeleteWorkspacePermissionAssignmentResponse) { } -func (c DeleteWorkspacePermissionAssignmentResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteWorkspacePermissionAssignmentResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteWorkspacePermissionAssignmentResponse. @@ -755,7 +768,7 @@ func (o GetAssignableRolesForResourceRequest) Type(ctx context.Context) attr.Typ } type GetAssignableRolesForResourceResponse struct { - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` } func (newState *GetAssignableRolesForResourceResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetAssignableRolesForResourceResponse) { @@ -764,10 +777,10 @@ func (newState *GetAssignableRolesForResourceResponse) SyncEffectiveFieldsDuring func (newState *GetAssignableRolesForResourceResponse) SyncEffectiveFieldsDuringRead(existingState GetAssignableRolesForResourceResponse) { } -func (c GetAssignableRolesForResourceResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Role{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c GetAssignableRolesForResourceResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["roles"] = attrs["roles"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetAssignableRolesForResourceResponse. @@ -870,7 +883,7 @@ func (o GetGroupRequest) Type(ctx context.Context) attr.Type { type GetPasswordPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetPasswordPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPasswordPermissionLevelsResponse) { @@ -879,10 +892,10 @@ func (newState *GetPasswordPermissionLevelsResponse) SyncEffectiveFieldsDuringCr func (newState *GetPasswordPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetPasswordPermissionLevelsResponse) { } -func (c GetPasswordPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetPasswordPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPasswordPermissionLevelsResponse. @@ -989,7 +1002,7 @@ func (o GetPermissionLevelsRequest) Type(ctx context.Context) attr.Type { type GetPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPermissionLevelsResponse) { @@ -998,10 +1011,10 @@ func (newState *GetPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *GetPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetPermissionLevelsResponse) { } -func (c GetPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPermissionLevelsResponse. @@ -1306,9 +1319,9 @@ func (o GetWorkspaceAssignmentRequest) Type(ctx context.Context) attr.Type { type GrantRule struct { // Principals this grant rule applies to. - Principals types.List `tfsdk:"principals" tf:"optional"` + Principals types.List `tfsdk:"principals"` // Role that is assigned to the list of principals. - Role types.String `tfsdk:"role" tf:""` + Role types.String `tfsdk:"role"` } func (newState *GrantRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan GrantRule) { @@ -1317,10 +1330,11 @@ func (newState *GrantRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan GrantRul func (newState *GrantRule) SyncEffectiveFieldsDuringRead(existingState GrantRule) { } -func (c GrantRule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "role")...) +func (c GrantRule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principals"] = attrs["principals"].SetOptional() + attrs["role"] = attrs["role"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GrantRule. @@ -1388,26 +1402,26 @@ func (o *GrantRule) SetPrincipals(ctx context.Context, v []types.String) { type Group struct { // String that represents a human-readable group name - DisplayName types.String `tfsdk:"displayName" tf:"optional"` + DisplayName types.String `tfsdk:"displayName"` // Entitlements assigned to the group. See [assigning entitlements] for a // full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements types.List `tfsdk:"entitlements" tf:"optional"` + Entitlements types.List `tfsdk:"entitlements"` - ExternalId types.String `tfsdk:"externalId" tf:"optional"` + ExternalId types.String `tfsdk:"externalId"` - Groups types.List `tfsdk:"groups" tf:"optional"` + Groups types.List `tfsdk:"groups"` // Databricks group ID - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Members types.List `tfsdk:"members" tf:"optional"` + Members types.List `tfsdk:"members"` // Container for the group identifier. Workspace local versus account. - Meta types.Object `tfsdk:"meta" tf:"optional,object"` + Meta types.Object `tfsdk:"meta"` // Corresponds to AWS instance profile/arn role. - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` // The schema of the group. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *Group) SyncEffectiveFieldsDuringCreateOrUpdate(plan Group) { @@ -1416,14 +1430,18 @@ func (newState *Group) SyncEffectiveFieldsDuringCreateOrUpdate(plan Group) { func (newState *Group) SyncEffectiveFieldsDuringRead(existingState Group) { } -func (c Group) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "entitlements")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "groups")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "members")...) - ResourceMeta{}.ApplySchemaCustomizations(cs, append(path, "meta")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c Group) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["displayName"] = attrs["displayName"].SetOptional() + attrs["entitlements"] = attrs["entitlements"].SetOptional() + attrs["externalId"] = attrs["externalId"].SetOptional() + attrs["groups"] = attrs["groups"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["members"] = attrs["members"].SetOptional() + attrs["meta"] = attrs["meta"].SetOptional() + attrs["roles"] = attrs["roles"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Group. @@ -1919,16 +1937,16 @@ func (o ListGroupsRequest) Type(ctx context.Context) attr.Type { type ListGroupsResponse struct { // Total results returned in the response. - ItemsPerPage types.Int64 `tfsdk:"itemsPerPage" tf:"optional"` + ItemsPerPage types.Int64 `tfsdk:"itemsPerPage"` // User objects returned in the response. - Resources types.List `tfsdk:"Resources" tf:"optional"` + Resources types.List `tfsdk:"Resources"` // The schema of the service principal. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex types.Int64 `tfsdk:"startIndex" tf:"optional"` + StartIndex types.Int64 `tfsdk:"startIndex"` // Total results that match the request filters. - TotalResults types.Int64 `tfsdk:"totalResults" tf:"optional"` + TotalResults types.Int64 `tfsdk:"totalResults"` } func (newState *ListGroupsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListGroupsResponse) { @@ -1937,10 +1955,14 @@ func (newState *ListGroupsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListGroupsResponse) SyncEffectiveFieldsDuringRead(existingState ListGroupsResponse) { } -func (c ListGroupsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Group{}.ApplySchemaCustomizations(cs, append(path, "Resources")...) +func (c ListGroupsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["itemsPerPage"] = attrs["itemsPerPage"].SetOptional() + attrs["Resources"] = attrs["Resources"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["startIndex"] = attrs["startIndex"].SetOptional() + attrs["totalResults"] = attrs["totalResults"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListGroupsResponse. @@ -2043,16 +2065,16 @@ func (o *ListGroupsResponse) SetSchemas(ctx context.Context, v []types.String) { type ListServicePrincipalResponse struct { // Total results returned in the response. - ItemsPerPage types.Int64 `tfsdk:"itemsPerPage" tf:"optional"` + ItemsPerPage types.Int64 `tfsdk:"itemsPerPage"` // User objects returned in the response. - Resources types.List `tfsdk:"Resources" tf:"optional"` + Resources types.List `tfsdk:"Resources"` // The schema of the List response. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex types.Int64 `tfsdk:"startIndex" tf:"optional"` + StartIndex types.Int64 `tfsdk:"startIndex"` // Total results that match the request filters. - TotalResults types.Int64 `tfsdk:"totalResults" tf:"optional"` + TotalResults types.Int64 `tfsdk:"totalResults"` } func (newState *ListServicePrincipalResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListServicePrincipalResponse) { @@ -2061,10 +2083,14 @@ func (newState *ListServicePrincipalResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *ListServicePrincipalResponse) SyncEffectiveFieldsDuringRead(existingState ListServicePrincipalResponse) { } -func (c ListServicePrincipalResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServicePrincipal{}.ApplySchemaCustomizations(cs, append(path, "Resources")...) +func (c ListServicePrincipalResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["itemsPerPage"] = attrs["itemsPerPage"].SetOptional() + attrs["Resources"] = attrs["Resources"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["startIndex"] = attrs["startIndex"].SetOptional() + attrs["totalResults"] = attrs["totalResults"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListServicePrincipalResponse. @@ -2302,16 +2328,16 @@ func (o ListUsersRequest) Type(ctx context.Context) attr.Type { type ListUsersResponse struct { // Total results returned in the response. - ItemsPerPage types.Int64 `tfsdk:"itemsPerPage" tf:"optional"` + ItemsPerPage types.Int64 `tfsdk:"itemsPerPage"` // User objects returned in the response. - Resources types.List `tfsdk:"Resources" tf:"optional"` + Resources types.List `tfsdk:"Resources"` // The schema of the List response. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Starting index of all the results that matched the request filters. First // item is number 1. - StartIndex types.Int64 `tfsdk:"startIndex" tf:"optional"` + StartIndex types.Int64 `tfsdk:"startIndex"` // Total results that match the request filters. - TotalResults types.Int64 `tfsdk:"totalResults" tf:"optional"` + TotalResults types.Int64 `tfsdk:"totalResults"` } func (newState *ListUsersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListUsersResponse) { @@ -2320,10 +2346,14 @@ func (newState *ListUsersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListUsersResponse) SyncEffectiveFieldsDuringRead(existingState ListUsersResponse) { } -func (c ListUsersResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - User{}.ApplySchemaCustomizations(cs, append(path, "Resources")...) +func (c ListUsersResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["itemsPerPage"] = attrs["itemsPerPage"].SetOptional() + attrs["Resources"] = attrs["Resources"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["startIndex"] = attrs["startIndex"].SetOptional() + attrs["totalResults"] = attrs["totalResults"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListUsersResponse. @@ -2463,14 +2493,14 @@ func (o ListWorkspaceAssignmentRequest) Type(ctx context.Context) attr.Type { type MigratePermissionsRequest struct { // The name of the workspace group that permissions will be migrated from. - FromWorkspaceGroupName types.String `tfsdk:"from_workspace_group_name" tf:""` + FromWorkspaceGroupName types.String `tfsdk:"from_workspace_group_name"` // The maximum number of permissions that will be migrated. - Size types.Int64 `tfsdk:"size" tf:"optional"` + Size types.Int64 `tfsdk:"size"` // The name of the account group that permissions will be migrated to. - ToAccountGroupName types.String `tfsdk:"to_account_group_name" tf:""` + ToAccountGroupName types.String `tfsdk:"to_account_group_name"` // WorkspaceId of the associated workspace where the permission migration // will occur. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:""` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *MigratePermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigratePermissionsRequest) { @@ -2479,12 +2509,13 @@ func (newState *MigratePermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *MigratePermissionsRequest) SyncEffectiveFieldsDuringRead(existingState MigratePermissionsRequest) { } -func (c MigratePermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "from_workspace_group_name")...) - cs.SetRequired(append(path, "to_account_group_name")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c MigratePermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["from_workspace_group_name"] = attrs["from_workspace_group_name"].SetRequired() + attrs["size"] = attrs["size"].SetOptional() + attrs["to_account_group_name"] = attrs["to_account_group_name"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MigratePermissionsRequest. @@ -2526,7 +2557,7 @@ func (o MigratePermissionsRequest) Type(ctx context.Context) attr.Type { type MigratePermissionsResponse struct { // Number of permissions migrated. - PermissionsMigrated types.Int64 `tfsdk:"permissions_migrated" tf:"optional"` + PermissionsMigrated types.Int64 `tfsdk:"permissions_migrated"` } func (newState *MigratePermissionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigratePermissionsResponse) { @@ -2535,9 +2566,10 @@ func (newState *MigratePermissionsResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *MigratePermissionsResponse) SyncEffectiveFieldsDuringRead(existingState MigratePermissionsResponse) { } -func (c MigratePermissionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MigratePermissionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permissions_migrated"] = attrs["permissions_migrated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MigratePermissionsResponse. @@ -2573,9 +2605,9 @@ func (o MigratePermissionsResponse) Type(ctx context.Context) attr.Type { type Name struct { // Family name of the Databricks user. - FamilyName types.String `tfsdk:"familyName" tf:"optional"` + FamilyName types.String `tfsdk:"familyName"` // Given name of the Databricks user. - GivenName types.String `tfsdk:"givenName" tf:"optional"` + GivenName types.String `tfsdk:"givenName"` } func (newState *Name) SyncEffectiveFieldsDuringCreateOrUpdate(plan Name) { @@ -2584,9 +2616,11 @@ func (newState *Name) SyncEffectiveFieldsDuringCreateOrUpdate(plan Name) { func (newState *Name) SyncEffectiveFieldsDuringRead(existingState Name) { } -func (c Name) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Name) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["familyName"] = attrs["familyName"].SetOptional() + attrs["givenName"] = attrs["givenName"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Name. @@ -2623,11 +2657,11 @@ func (o Name) Type(ctx context.Context) attr.Type { } type ObjectPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ObjectPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan ObjectPermissions) { @@ -2636,10 +2670,12 @@ func (newState *ObjectPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ObjectPermissions) SyncEffectiveFieldsDuringRead(existingState ObjectPermissions) { } -func (c ObjectPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ObjectPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ObjectPermissions. @@ -2711,10 +2747,10 @@ type PartialUpdate struct { // Unique ID for a user in the Databricks workspace. Id types.String `tfsdk:"-"` - Operations types.List `tfsdk:"Operations" tf:"optional"` + Operations types.List `tfsdk:"Operations"` // The schema of the patch request. Must be // ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *PartialUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartialUpdate) { @@ -2723,11 +2759,12 @@ func (newState *PartialUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(plan Part func (newState *PartialUpdate) SyncEffectiveFieldsDuringRead(existingState PartialUpdate) { } -func (c PartialUpdate) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - Patch{}.ApplySchemaCustomizations(cs, append(path, "Operations")...) +func (c PartialUpdate) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["Operations"] = attrs["Operations"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartialUpdate. @@ -2826,13 +2863,13 @@ func (o *PartialUpdate) SetSchemas(ctx context.Context, v []types.String) { type PasswordAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PasswordAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordAccessControlRequest) { @@ -2841,9 +2878,13 @@ func (newState *PasswordAccessControlRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *PasswordAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState PasswordAccessControlRequest) { } -func (c PasswordAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PasswordAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordAccessControlRequest. @@ -2885,15 +2926,15 @@ func (o PasswordAccessControlRequest) Type(ctx context.Context) attr.Type { type PasswordAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PasswordAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordAccessControlResponse) { @@ -2902,10 +2943,14 @@ func (newState *PasswordAccessControlResponse) SyncEffectiveFieldsDuringCreateOr func (newState *PasswordAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState PasswordAccessControlResponse) { } -func (c PasswordAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c PasswordAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordAccessControlResponse. @@ -2978,11 +3023,11 @@ func (o *PasswordAccessControlResponse) SetAllPermissions(ctx context.Context, v } type PasswordPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PasswordPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermission) { @@ -2991,9 +3036,12 @@ func (newState *PasswordPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PasswordPermission) SyncEffectiveFieldsDuringRead(existingState PasswordPermission) { } -func (c PasswordPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PasswordPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermission. @@ -3062,11 +3110,11 @@ func (o *PasswordPermission) SetInheritedFromObject(ctx context.Context, v []typ } type PasswordPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *PasswordPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermissions) { @@ -3075,10 +3123,12 @@ func (newState *PasswordPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *PasswordPermissions) SyncEffectiveFieldsDuringRead(existingState PasswordPermissions) { } -func (c PasswordPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c PasswordPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermissions. @@ -3147,9 +3197,9 @@ func (o *PasswordPermissions) SetAccessControlList(ctx context.Context, v []Pass } type PasswordPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PasswordPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermissionsDescription) { @@ -3158,9 +3208,11 @@ func (newState *PasswordPermissionsDescription) SyncEffectiveFieldsDuringCreateO func (newState *PasswordPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState PasswordPermissionsDescription) { } -func (c PasswordPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PasswordPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermissionsDescription. @@ -3197,7 +3249,7 @@ func (o PasswordPermissionsDescription) Type(ctx context.Context) attr.Type { } type PasswordPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` } func (newState *PasswordPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan PasswordPermissionsRequest) { @@ -3206,10 +3258,10 @@ func (newState *PasswordPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpd func (newState *PasswordPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState PasswordPermissionsRequest) { } -func (c PasswordPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PasswordAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c PasswordPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PasswordPermissionsRequest. @@ -3275,11 +3327,11 @@ func (o *PasswordPermissionsRequest) SetAccessControlList(ctx context.Context, v type Patch struct { // Type of patch operation. - Op types.String `tfsdk:"op" tf:"optional"` + Op types.String `tfsdk:"op"` // Selection of patch operation - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Value to modify - Value types.Object `tfsdk:"value" tf:"optional"` + Value types.Object `tfsdk:"value"` } func (newState *Patch) SyncEffectiveFieldsDuringCreateOrUpdate(plan Patch) { @@ -3288,9 +3340,12 @@ func (newState *Patch) SyncEffectiveFieldsDuringCreateOrUpdate(plan Patch) { func (newState *Patch) SyncEffectiveFieldsDuringRead(existingState Patch) { } -func (c Patch) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Patch) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["op"] = attrs["op"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Patch. @@ -3359,11 +3414,11 @@ func (o PatchResponse) Type(ctx context.Context) attr.Type { } type Permission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *Permission) SyncEffectiveFieldsDuringCreateOrUpdate(plan Permission) { @@ -3372,9 +3427,12 @@ func (newState *Permission) SyncEffectiveFieldsDuringCreateOrUpdate(plan Permiss func (newState *Permission) SyncEffectiveFieldsDuringRead(existingState Permission) { } -func (c Permission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Permission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Permission. @@ -3446,11 +3504,11 @@ func (o *Permission) SetInheritedFromObject(ctx context.Context, v []types.Strin // contains some info for user consumption. type PermissionAssignment struct { // Error response associated with a workspace permission assignment, if any. - Error types.String `tfsdk:"error" tf:"optional"` + Error types.String `tfsdk:"error"` // The permissions level of the principal. - Permissions types.List `tfsdk:"permissions" tf:"optional"` + Permissions types.List `tfsdk:"permissions"` // Information about the principal assigned to the workspace. - Principal types.Object `tfsdk:"principal" tf:"optional,object"` + Principal types.Object `tfsdk:"principal"` } func (newState *PermissionAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionAssignment) { @@ -3459,10 +3517,12 @@ func (newState *PermissionAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *PermissionAssignment) SyncEffectiveFieldsDuringRead(existingState PermissionAssignment) { } -func (c PermissionAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PrincipalOutput{}.ApplySchemaCustomizations(cs, append(path, "principal")...) +func (c PermissionAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["permissions"] = attrs["permissions"].SetOptional() + attrs["principal"] = attrs["principal"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionAssignment. @@ -3561,7 +3621,7 @@ func (o *PermissionAssignment) SetPrincipal(ctx context.Context, v PrincipalOutp type PermissionAssignments struct { // Array of permissions assignments defined for a workspace. - PermissionAssignments types.List `tfsdk:"permission_assignments" tf:"optional"` + PermissionAssignments types.List `tfsdk:"permission_assignments"` } func (newState *PermissionAssignments) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionAssignments) { @@ -3570,10 +3630,10 @@ func (newState *PermissionAssignments) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PermissionAssignments) SyncEffectiveFieldsDuringRead(existingState PermissionAssignments) { } -func (c PermissionAssignments) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionAssignment{}.ApplySchemaCustomizations(cs, append(path, "permission_assignments")...) +func (c PermissionAssignments) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_assignments"] = attrs["permission_assignments"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionAssignments. @@ -3639,9 +3699,9 @@ func (o *PermissionAssignments) SetPermissionAssignments(ctx context.Context, v type PermissionOutput struct { // The results of a permissions query. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PermissionOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionOutput) { @@ -3650,9 +3710,11 @@ func (newState *PermissionOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan P func (newState *PermissionOutput) SyncEffectiveFieldsDuringRead(existingState PermissionOutput) { } -func (c PermissionOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermissionOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionOutput. @@ -3689,9 +3751,9 @@ func (o PermissionOutput) Type(ctx context.Context) attr.Type { } type PermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan PermissionsDescription) { @@ -3700,9 +3762,11 @@ func (newState *PermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PermissionsDescription) SyncEffectiveFieldsDuringRead(existingState PermissionsDescription) { } -func (c PermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsDescription. @@ -3739,7 +3803,7 @@ func (o PermissionsDescription) Type(ctx context.Context) attr.Type { } type PermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The id of the request object. RequestObjectId types.String `tfsdk:"-"` // The type of the request object. Can be one of the following: alerts, @@ -3756,12 +3820,12 @@ func (newState *PermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PermissionsRequest) SyncEffectiveFieldsDuringRead(existingState PermissionsRequest) { } -func (c PermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "request_object_id")...) - cs.SetRequired(append(path, "request_object_type")...) +func (c PermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["request_object_id"] = attrs["request_object_id"].SetRequired() + attrs["request_object_type"] = attrs["request_object_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PermissionsRequest. @@ -3832,16 +3896,16 @@ func (o *PermissionsRequest) SetAccessControlList(ctx context.Context, v []Acces // Information about the principal assigned to the workspace. type PrincipalOutput struct { // The display name of the principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The group name of the group. Present only if the principal is a group. - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // The unique, opaque id of the principal. - PrincipalId types.Int64 `tfsdk:"principal_id" tf:"optional"` + PrincipalId types.Int64 `tfsdk:"principal_id"` // The name of the service principal. Present only if the principal is a // service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // The username of the user. Present only if the principal is a user. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PrincipalOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrincipalOutput) { @@ -3850,9 +3914,14 @@ func (newState *PrincipalOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pr func (newState *PrincipalOutput) SyncEffectiveFieldsDuringRead(existingState PrincipalOutput) { } -func (c PrincipalOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrincipalOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["principal_id"] = attrs["principal_id"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrincipalOutput. @@ -3897,7 +3966,7 @@ func (o PrincipalOutput) Type(ctx context.Context) attr.Type { type ResourceMeta struct { // Identifier for group type. Can be local workspace group // (`WorkspaceGroup`) or account group (`Group`). - ResourceType types.String `tfsdk:"resourceType" tf:"optional"` + ResourceType types.String `tfsdk:"resourceType"` } func (newState *ResourceMeta) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResourceMeta) { @@ -3906,9 +3975,10 @@ func (newState *ResourceMeta) SyncEffectiveFieldsDuringCreateOrUpdate(plan Resou func (newState *ResourceMeta) SyncEffectiveFieldsDuringRead(existingState ResourceMeta) { } -func (c ResourceMeta) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResourceMeta) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["resourceType"] = attrs["resourceType"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResourceMeta. @@ -3944,7 +4014,7 @@ func (o ResourceMeta) Type(ctx context.Context) attr.Type { type Role struct { // Role to assign to a principal or a list of principals on a resource. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *Role) SyncEffectiveFieldsDuringCreateOrUpdate(plan Role) { @@ -3953,10 +4023,10 @@ func (newState *Role) SyncEffectiveFieldsDuringCreateOrUpdate(plan Role) { func (newState *Role) SyncEffectiveFieldsDuringRead(existingState Role) { } -func (c Role) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c Role) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Role. @@ -3992,11 +4062,11 @@ func (o Role) Type(ctx context.Context) attr.Type { type RuleSetResponse struct { // Identifies the version of the rule set returned. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - GrantRules types.List `tfsdk:"grant_rules" tf:"optional"` + GrantRules types.List `tfsdk:"grant_rules"` // Name of the rule set. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *RuleSetResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RuleSetResponse) { @@ -4005,10 +4075,12 @@ func (newState *RuleSetResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ru func (newState *RuleSetResponse) SyncEffectiveFieldsDuringRead(existingState RuleSetResponse) { } -func (c RuleSetResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GrantRule{}.ApplySchemaCustomizations(cs, append(path, "grant_rules")...) +func (c RuleSetResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["grant_rules"] = attrs["grant_rules"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RuleSetResponse. @@ -4080,11 +4152,11 @@ type RuleSetUpdateRequest struct { // The expected etag of the rule set to update. The update will fail if the // value does not match the value that is stored in account access control // service. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` - GrantRules types.List `tfsdk:"grant_rules" tf:"optional"` + GrantRules types.List `tfsdk:"grant_rules"` // Name of the rule set. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *RuleSetUpdateRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RuleSetUpdateRequest) { @@ -4093,12 +4165,12 @@ func (newState *RuleSetUpdateRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RuleSetUpdateRequest) SyncEffectiveFieldsDuringRead(existingState RuleSetUpdateRequest) { } -func (c RuleSetUpdateRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) - GrantRule{}.ApplySchemaCustomizations(cs, append(path, "grant_rules")...) - cs.SetRequired(append(path, "name")...) +func (c RuleSetUpdateRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() + attrs["grant_rules"] = attrs["grant_rules"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RuleSetUpdateRequest. @@ -4168,26 +4240,26 @@ func (o *RuleSetUpdateRequest) SetGrantRules(ctx context.Context, v []GrantRule) type ServicePrincipal struct { // If this user is active - Active types.Bool `tfsdk:"active" tf:"optional"` + Active types.Bool `tfsdk:"active"` // UUID relating to the service principal - ApplicationId types.String `tfsdk:"applicationId" tf:"optional"` + ApplicationId types.String `tfsdk:"applicationId"` // String that represents a concatenation of given and family names. - DisplayName types.String `tfsdk:"displayName" tf:"optional"` + DisplayName types.String `tfsdk:"displayName"` // Entitlements assigned to the service principal. See [assigning // entitlements] for a full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements types.List `tfsdk:"entitlements" tf:"optional"` + Entitlements types.List `tfsdk:"entitlements"` - ExternalId types.String `tfsdk:"externalId" tf:"optional"` + ExternalId types.String `tfsdk:"externalId"` - Groups types.List `tfsdk:"groups" tf:"optional"` + Groups types.List `tfsdk:"groups"` // Databricks service principal ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Corresponds to AWS instance profile/arn role. - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` // The schema of the List response. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` } func (newState *ServicePrincipal) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServicePrincipal) { @@ -4196,12 +4268,18 @@ func (newState *ServicePrincipal) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *ServicePrincipal) SyncEffectiveFieldsDuringRead(existingState ServicePrincipal) { } -func (c ServicePrincipal) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "entitlements")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "groups")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c ServicePrincipal) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active"] = attrs["active"].SetOptional() + attrs["applicationId"] = attrs["applicationId"].SetOptional() + attrs["displayName"] = attrs["displayName"].SetOptional() + attrs["entitlements"] = attrs["entitlements"].SetOptional() + attrs["externalId"] = attrs["externalId"].SetOptional() + attrs["groups"] = attrs["groups"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["roles"] = attrs["roles"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServicePrincipal. @@ -4400,9 +4478,9 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type UpdateRuleSetRequest struct { // Name of the rule set. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - RuleSet types.Object `tfsdk:"rule_set" tf:"object"` + RuleSet types.Object `tfsdk:"rule_set"` } func (newState *UpdateRuleSetRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRuleSetRequest) { @@ -4411,12 +4489,11 @@ func (newState *UpdateRuleSetRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *UpdateRuleSetRequest) SyncEffectiveFieldsDuringRead(existingState UpdateRuleSetRequest) { } -func (c UpdateRuleSetRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "rule_set")...) - RuleSetUpdateRequest{}.ApplySchemaCustomizations(cs, append(path, "rule_set")...) +func (c UpdateRuleSetRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["rule_set"] = attrs["rule_set"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRuleSetRequest. @@ -4489,7 +4566,7 @@ type UpdateWorkspaceAssignments struct { // that excluding this field, or providing unsupported values, will have the // same effect as providing an empty list, which will result in the deletion // of all permissions for the principal. - Permissions types.List `tfsdk:"permissions" tf:"optional"` + Permissions types.List `tfsdk:"permissions"` // The ID of the user, service principal, or group. PrincipalId types.Int64 `tfsdk:"-"` // The workspace ID. @@ -4502,11 +4579,12 @@ func (newState *UpdateWorkspaceAssignments) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateWorkspaceAssignments) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceAssignments) { } -func (c UpdateWorkspaceAssignments) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "principal_id")...) - cs.SetRequired(append(path, "workspace_id")...) +func (c UpdateWorkspaceAssignments) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permissions"] = attrs["permissions"].SetOptional() + attrs["principal_id"] = attrs["principal_id"].SetRequired() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceAssignments. @@ -4576,36 +4654,36 @@ func (o *UpdateWorkspaceAssignments) SetPermissions(ctx context.Context, v []typ type User struct { // If this user is active - Active types.Bool `tfsdk:"active" tf:"optional"` + Active types.Bool `tfsdk:"active"` // String that represents a concatenation of given and family names. For // example `John Smith`. This field cannot be updated through the Workspace // SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to // update `displayName`. // // [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation - DisplayName types.String `tfsdk:"displayName" tf:"optional"` + DisplayName types.String `tfsdk:"displayName"` // All the emails associated with the Databricks user. - Emails types.List `tfsdk:"emails" tf:"optional"` + Emails types.List `tfsdk:"emails"` // Entitlements assigned to the user. See [assigning entitlements] for a // full list of supported values. // // [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements - Entitlements types.List `tfsdk:"entitlements" tf:"optional"` + Entitlements types.List `tfsdk:"entitlements"` // External ID is not currently supported. It is reserved for future use. - ExternalId types.String `tfsdk:"externalId" tf:"optional"` + ExternalId types.String `tfsdk:"externalId"` - Groups types.List `tfsdk:"groups" tf:"optional"` + Groups types.List `tfsdk:"groups"` // Databricks user ID. This is automatically set by Databricks. Any value // provided by the client will be ignored. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Name types.Object `tfsdk:"name" tf:"optional,object"` + Name types.Object `tfsdk:"name"` // Corresponds to AWS instance profile/arn role. - Roles types.List `tfsdk:"roles" tf:"optional"` + Roles types.List `tfsdk:"roles"` // The schema of the user. - Schemas types.List `tfsdk:"schemas" tf:"optional"` + Schemas types.List `tfsdk:"schemas"` // Email address of the Databricks user. - UserName types.String `tfsdk:"userName" tf:"optional"` + UserName types.String `tfsdk:"userName"` } func (newState *User) SyncEffectiveFieldsDuringCreateOrUpdate(plan User) { @@ -4614,14 +4692,20 @@ func (newState *User) SyncEffectiveFieldsDuringCreateOrUpdate(plan User) { func (newState *User) SyncEffectiveFieldsDuringRead(existingState User) { } -func (c User) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "emails")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "entitlements")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "groups")...) - Name{}.ApplySchemaCustomizations(cs, append(path, "name")...) - ComplexValue{}.ApplySchemaCustomizations(cs, append(path, "roles")...) +func (c User) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active"] = attrs["active"].SetOptional() + attrs["displayName"] = attrs["displayName"].SetOptional() + attrs["emails"] = attrs["emails"].SetOptional() + attrs["entitlements"] = attrs["entitlements"].SetOptional() + attrs["externalId"] = attrs["externalId"].SetOptional() + attrs["groups"] = attrs["groups"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["roles"] = attrs["roles"].SetOptional() + attrs["schemas"] = attrs["schemas"].SetOptional() + attrs["userName"] = attrs["userName"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in User. @@ -4852,7 +4936,7 @@ func (o *User) SetSchemas(ctx context.Context, v []types.String) { type WorkspacePermissions struct { // Array of permissions defined for a workspace. - Permissions types.List `tfsdk:"permissions" tf:"optional"` + Permissions types.List `tfsdk:"permissions"` } func (newState *WorkspacePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspacePermissions) { @@ -4861,10 +4945,10 @@ func (newState *WorkspacePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *WorkspacePermissions) SyncEffectiveFieldsDuringRead(existingState WorkspacePermissions) { } -func (c WorkspacePermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PermissionOutput{}.ApplySchemaCustomizations(cs, append(path, "permissions")...) +func (c WorkspacePermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permissions"] = attrs["permissions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspacePermissions. diff --git a/internal/service/jobs_tf/legacy_model.go b/internal/service/jobs_tf/legacy_model.go index 6d09e4f1e..4bfa89821 100755 --- a/internal/service/jobs_tf/legacy_model.go +++ b/internal/service/jobs_tf/legacy_model.go @@ -18,6 +18,7 @@ import ( "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" "github.com/databricks/terraform-provider-databricks/internal/service/compute_tf" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -26,22 +27,22 @@ import ( type BaseJob_SdkV2 struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). - CreatedTime types.Int64 `tfsdk:"created_time" tf:"optional"` + CreatedTime types.Int64 `tfsdk:"created_time"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // The id of the budget policy used by this job for cost attribution // purposes. This may be set through (in order of precedence): 1. Budget // admins through the account or workspace console 2. Jobs UI in the job // details page and Jobs API using `budget_policy_id` 3. Inferred default // based on accessible budget policies of the run_as identity on job // creation or modification. - EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` // The canonical identifier for this job. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // Settings for this job and all of its runs. These settings can be updated // using the `resetJob` method. - Settings types.List `tfsdk:"settings" tf:"optional,object"` + Settings types.List `tfsdk:"settings"` } func (newState *BaseJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseJob_SdkV2) { @@ -50,11 +51,15 @@ func (newState *BaseJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Base func (newState *BaseJob_SdkV2) SyncEffectiveFieldsDuringRead(existingState BaseJob_SdkV2) { } -func (c BaseJob_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "effective_budget_policy_id")...) - JobSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "settings")...) +func (c BaseJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_time"] = attrs["created_time"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["settings"] = attrs["settings"].SetOptional() + attrs["settings"] = attrs["settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BaseJob. @@ -134,28 +139,28 @@ type BaseRun_SdkV2 struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + AttemptNumber types.Int64 `tfsdk:"attempt_number"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration types.Int64 `tfsdk:"cleanup_duration" tf:"optional"` + CleanupDuration types.Int64 `tfsdk:"cleanup_duration"` // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance types.List `tfsdk:"cluster_instance" tf:"optional,object"` + ClusterInstance types.List `tfsdk:"cluster_instance"` // A snapshot of the job’s cluster specification when this run was // created. - ClusterSpec types.List `tfsdk:"cluster_spec" tf:"optional,object"` + ClusterSpec types.List `tfsdk:"cluster_spec"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Description of the run - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -163,7 +168,7 @@ type BaseRun_SdkV2 struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration types.Int64 `tfsdk:"execution_duration" tf:"optional"` + ExecutionDuration types.Int64 `tfsdk:"execution_duration"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -174,53 +179,53 @@ type BaseRun_SdkV2 struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.List `tfsdk:"git_source" tf:"optional,object"` + GitSource types.List `tfsdk:"git_source"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_clusters" tf:"optional"` + JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used in the run - JobParameters types.List `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.List `tfsdk:"job_parameters"` // ID of the job run that this run belongs to. For legacy and single-task // job runs the field is populated with the job run ID. For task runs, the // field is populated with the ID of the job run that the task run belongs // to. - JobRunId types.Int64 `tfsdk:"job_run_id" tf:"optional"` + JobRunId types.Int64 `tfsdk:"job_run_id"` // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob types.Int64 `tfsdk:"number_in_job" tf:"optional"` + NumberInJob types.Int64 `tfsdk:"number_in_job"` // If this run is a retry of a prior run attempt, this field contains the // run_id of the original attempt; otherwise, it is the same as the run_id. - OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id" tf:"optional"` + OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id"` // The parameters used for this run. - OverridingParameters types.List `tfsdk:"overriding_parameters" tf:"optional,object"` + OverridingParameters types.List `tfsdk:"overriding_parameters"` // The time in milliseconds that the run has spent in the queue. - QueueDuration types.Int64 `tfsdk:"queue_duration" tf:"optional"` + QueueDuration types.Int64 `tfsdk:"queue_duration"` // The repair history of the run. - RepairHistory types.List `tfsdk:"repair_history" tf:"optional"` + RepairHistory types.List `tfsdk:"repair_history"` // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` // An optional name for the run. The maximum length is 4096 bytes in UTF-8 // encoding. - RunName types.String `tfsdk:"run_name" tf:"optional"` + RunName types.String `tfsdk:"run_name"` // The URL to the detail page of the run. - RunPageUrl types.String `tfsdk:"run_page_url" tf:"optional"` + RunPageUrl types.String `tfsdk:"run_page_url"` // The type of a run. * `JOB_RUN`: Normal job run. A run created with // :method:jobs/runNow. * `WORKFLOW_RUN`: Workflow run. A run created with // [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit run. A run created with // :method:jobs/submit. // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow - RunType types.String `tfsdk:"run_type" tf:"optional"` + RunType types.String `tfsdk:"run_type"` // The cron schedule that triggered this run if it was triggered by the // periodic scheduler. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -228,19 +233,19 @@ type BaseRun_SdkV2 struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration types.Int64 `tfsdk:"setup_duration" tf:"optional"` + SetupDuration types.Int64 `tfsdk:"setup_duration"` // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The current status of the run - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` // which you can use to call `JobsGetOutput` to retrieve the run resutls. - Tasks types.List `tfsdk:"tasks" tf:"optional"` + Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // // * `PERIODIC`: Schedules that periodically trigger runs, such as a cron @@ -253,9 +258,9 @@ type BaseRun_SdkV2 struct { // arrival. * `TABLE`: Indicates a run that is triggered by a table update. // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually // restart a continuous job run. - Trigger types.String `tfsdk:"trigger" tf:"optional"` + Trigger types.String `tfsdk:"trigger"` // Additional details about what triggered the run - TriggerInfo types.List `tfsdk:"trigger_info" tf:"optional,object"` + TriggerInfo types.List `tfsdk:"trigger_info"` } func (newState *BaseRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseRun_SdkV2) { @@ -264,21 +269,48 @@ func (newState *BaseRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Base func (newState *BaseRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState BaseRun_SdkV2) { } -func (c BaseRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterInstance_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_instance")...) - ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_spec")...) - GitSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_clusters")...) - JobParameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_parameters")...) - RunParameters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "overriding_parameters")...) - RepairHistoryItem_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "repair_history")...) - CronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - RunState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - RunTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tasks")...) - TriggerInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger_info")...) - - return cs +func (c BaseRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attempt_number"] = attrs["attempt_number"].SetOptional() + attrs["cleanup_duration"] = attrs["cleanup_duration"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_spec"] = attrs["cluster_spec"].SetOptional() + attrs["cluster_spec"] = attrs["cluster_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["execution_duration"] = attrs["execution_duration"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["job_clusters"] = attrs["job_clusters"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["job_run_id"] = attrs["job_run_id"].SetOptional() + attrs["number_in_job"] = attrs["number_in_job"].SetOptional() + attrs["original_attempt_run_id"] = attrs["original_attempt_run_id"].SetOptional() + attrs["overriding_parameters"] = attrs["overriding_parameters"].SetOptional() + attrs["overriding_parameters"] = attrs["overriding_parameters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["queue_duration"] = attrs["queue_duration"].SetOptional() + attrs["repair_history"] = attrs["repair_history"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_name"] = attrs["run_name"].SetOptional() + attrs["run_page_url"] = attrs["run_page_url"].SetOptional() + attrs["run_type"] = attrs["run_type"].SetOptional() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["setup_duration"] = attrs["setup_duration"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tasks"] = attrs["tasks"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger_info"] = attrs["trigger_info"].SetOptional() + attrs["trigger_info"] = attrs["trigger_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BaseRun. @@ -724,9 +756,9 @@ func (o *BaseRun_SdkV2) SetTriggerInfo(ctx context.Context, v TriggerInfo_SdkV2) type CancelAllRuns_SdkV2 struct { // Optional boolean parameter to cancel all queued runs. If no job_id is // provided, all queued runs in the workspace are canceled. - AllQueuedRuns types.Bool `tfsdk:"all_queued_runs" tf:"optional"` + AllQueuedRuns types.Bool `tfsdk:"all_queued_runs"` // The canonical identifier of the job to cancel all runs of. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` } func (newState *CancelAllRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelAllRuns_SdkV2) { @@ -735,9 +767,11 @@ func (newState *CancelAllRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CancelAllRuns_SdkV2) SyncEffectiveFieldsDuringRead(existingState CancelAllRuns_SdkV2) { } -func (c CancelAllRuns_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CancelAllRuns_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_queued_runs"] = attrs["all_queued_runs"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CancelAllRuns. @@ -805,7 +839,7 @@ func (o CancelAllRunsResponse_SdkV2) Type(ctx context.Context) attr.Type { type CancelRun_SdkV2 struct { // This field is required. - RunId types.Int64 `tfsdk:"run_id" tf:""` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *CancelRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelRun_SdkV2) { @@ -814,10 +848,10 @@ func (newState *CancelRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ca func (newState *CancelRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState CancelRun_SdkV2) { } -func (c CancelRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c CancelRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CancelRun. @@ -885,10 +919,10 @@ func (o CancelRunResponse_SdkV2) Type(ctx context.Context) attr.Type { type CleanRoomTaskRunState_SdkV2 struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. - LifeCycleState types.String `tfsdk:"life_cycle_state" tf:"optional"` + LifeCycleState types.String `tfsdk:"life_cycle_state"` // A value indicating the run's result. This field is only available for // terminal lifecycle states. - ResultState types.String `tfsdk:"result_state" tf:"optional"` + ResultState types.String `tfsdk:"result_state"` } func (newState *CleanRoomTaskRunState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomTaskRunState_SdkV2) { @@ -897,9 +931,11 @@ func (newState *CleanRoomTaskRunState_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CleanRoomTaskRunState_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomTaskRunState_SdkV2) { } -func (c CleanRoomTaskRunState_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomTaskRunState_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["life_cycle_state"] = attrs["life_cycle_state"].SetOptional() + attrs["result_state"] = attrs["result_state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomTaskRunState. @@ -937,15 +973,15 @@ func (o CleanRoomTaskRunState_SdkV2) Type(ctx context.Context) attr.Type { type CleanRoomsNotebookTask_SdkV2 struct { // The clean room that the notebook belongs to. - CleanRoomName types.String `tfsdk:"clean_room_name" tf:""` + CleanRoomName types.String `tfsdk:"clean_room_name"` // Checksum to validate the freshness of the notebook resource (i.e. the // notebook being run is the latest version). It can be fetched by calling // the :method:cleanroomassets/get API. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Base parameters to be used for the clean room notebook job. - NotebookBaseParameters types.Map `tfsdk:"notebook_base_parameters" tf:"optional"` + NotebookBaseParameters types.Map `tfsdk:"notebook_base_parameters"` // Name of the notebook being run. - NotebookName types.String `tfsdk:"notebook_name" tf:""` + NotebookName types.String `tfsdk:"notebook_name"` } func (newState *CleanRoomsNotebookTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomsNotebookTask_SdkV2) { @@ -954,11 +990,13 @@ func (newState *CleanRoomsNotebookTask_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CleanRoomsNotebookTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomsNotebookTask_SdkV2) { } -func (c CleanRoomsNotebookTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "clean_room_name")...) - cs.SetRequired(append(path, "notebook_name")...) +func (c CleanRoomsNotebookTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_room_name"] = attrs["clean_room_name"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["notebook_base_parameters"] = attrs["notebook_base_parameters"].SetOptional() + attrs["notebook_name"] = attrs["notebook_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomsNotebookTask. @@ -1037,7 +1075,7 @@ type ClusterInstance_SdkV2 struct { // // The response won’t include this field if the identifier is not // available yet. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The canonical identifier for the Spark context used by a run. This field // is filled in once the run begins execution. This value can be used to // view the Spark UI by browsing to @@ -1046,7 +1084,7 @@ type ClusterInstance_SdkV2 struct { // // The response won’t include this field if the identifier is not // available yet. - SparkContextId types.String `tfsdk:"spark_context_id" tf:"optional"` + SparkContextId types.String `tfsdk:"spark_context_id"` } func (newState *ClusterInstance_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterInstance_SdkV2) { @@ -1055,9 +1093,11 @@ func (newState *ClusterInstance_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ClusterInstance_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterInstance_SdkV2) { } -func (c ClusterInstance_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterInstance_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["spark_context_id"] = attrs["spark_context_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterInstance. @@ -1098,16 +1138,16 @@ type ClusterSpec_SdkV2 struct { // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:"optional"` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.List `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.List `tfsdk:"new_cluster"` } func (newState *ClusterSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSpec_SdkV2) { @@ -1116,10 +1156,14 @@ func (newState *ClusterSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ClusterSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterSpec_SdkV2) { } -func (c ClusterSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - compute_tf.ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) +func (c ClusterSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSpec. @@ -1221,7 +1265,7 @@ func (o *ClusterSpec_SdkV2) SetNewCluster(ctx context.Context, v compute_tf.Clus type ConditionTask_SdkV2 struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. - Left types.String `tfsdk:"left" tf:""` + Left types.String `tfsdk:"left"` // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their // operands. This means that `“12.0” == “12”` will evaluate to // `false`. * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, @@ -1232,10 +1276,10 @@ type ConditionTask_SdkV2 struct { // The boolean comparison to task values can be implemented with operators // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it // will be serialized to `“true”` or `“false”` for the comparison. - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // The right operand of the condition task. Can be either a string value or // a job state or parameter reference. - Right types.String `tfsdk:"right" tf:""` + Right types.String `tfsdk:"right"` } func (newState *ConditionTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ConditionTask_SdkV2) { @@ -1244,12 +1288,12 @@ func (newState *ConditionTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ConditionTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState ConditionTask_SdkV2) { } -func (c ConditionTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "left")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "right")...) +func (c ConditionTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["left"] = attrs["left"].SetRequired() + attrs["op"] = attrs["op"].SetRequired() + attrs["right"] = attrs["right"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ConditionTask. @@ -1290,7 +1334,7 @@ func (o ConditionTask_SdkV2) Type(ctx context.Context) attr.Type { type Continuous_SdkV2 struct { // Indicate whether the continuous execution of the job is paused or not. // Defaults to UNPAUSED. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` } func (newState *Continuous_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Continuous_SdkV2) { @@ -1299,9 +1343,10 @@ func (newState *Continuous_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *Continuous_SdkV2) SyncEffectiveFieldsDuringRead(existingState Continuous_SdkV2) { } -func (c Continuous_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Continuous_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pause_status"] = attrs["pause_status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Continuous. @@ -1337,40 +1382,40 @@ func (o Continuous_SdkV2) Type(ctx context.Context) attr.Type { type CreateJob_SdkV2 struct { // List of permissions to set on the job. - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The id of the user specified budget policy to use for this job. If not // specified, a default budget policy may be applied when creating or // modifying the job. See `effective_budget_policy_id` for the budget policy // used by this workload. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. - Continuous types.List `tfsdk:"continuous" tf:"optional,object"` + Continuous types.List `tfsdk:"continuous"` // Deployment information for jobs managed by external sources. - Deployment types.List `tfsdk:"deployment" tf:"optional,object"` + Deployment types.List `tfsdk:"deployment"` // An optional description for the job. The maximum length is 27700 // characters in UTF-8 encoding. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. - EditMode types.String `tfsdk:"edit_mode" tf:"optional"` + EditMode types.String `tfsdk:"edit_mode"` // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. - EmailNotifications types.List `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.List `tfsdk:"email_notifications"` // A list of task execution environment specifications that can be // referenced by serverless tasks of this job. An environment is required to // be present for serverless tasks. For serverless notebook tasks, the // environment is accessible in the notebook environment panel. For other // serverless tasks, the task environment is required to be specified using // environment_key in the task settings. - Environments types.List `tfsdk:"environment" tf:"optional"` + Environments types.List `tfsdk:"environment"` // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -1381,13 +1426,13 @@ type CreateJob_SdkV2 struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.List `tfsdk:"git_source" tf:"optional,object"` + GitSource types.List `tfsdk:"git_source"` // An optional set of health rules that can be defined for this job. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_cluster" tf:"optional"` + JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same // job concurrently. This is useful for example if you trigger your job on a @@ -1399,45 +1444,45 @@ type CreateJob_SdkV2 struct { // runs. However, from then on, new runs are skipped unless there are fewer // than 3 active runs. This value cannot exceed 1000. Setting this value to // `0` causes all new runs to be skipped. - MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs" tf:"optional"` + MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs"` // An optional name for the job. The maximum length is 4096 bytes in UTF-8 // encoding. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // job. - NotificationSettings types.List `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.List `tfsdk:"notification_settings"` // Job-level parameter definitions - Parameters types.List `tfsdk:"parameter" tf:"optional"` + Parameters types.List `tfsdk:"parameter"` // The queue settings of the job. - Queue types.List `tfsdk:"queue" tf:"optional,object"` + Queue types.List `tfsdk:"queue"` // Write-only setting. Specifies the user or service principal that the job // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. - RunAs types.List `tfsdk:"run_as" tf:"optional,object"` + RunAs types.List `tfsdk:"run_as"` // An optional periodic schedule for this job. The default behavior is that // the job only runs when triggered by clicking “Run Now” in the Jobs UI // or sending an API request to `runNow`. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // A map of tags associated with the job. These are forwarded to the cluster // as cluster tags for jobs clusters, and are subject to the same // limitations as cluster tags. A maximum of 25 tags can be added to the // job. - Tags types.Map `tfsdk:"tags" tf:"optional"` + Tags types.Map `tfsdk:"tags"` // A list of task specifications to be executed by this job. - Tasks types.List `tfsdk:"task" tf:"optional"` + Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A configuration to trigger a run when certain conditions are met. The // default behavior is that the job runs only when triggered by clicking // “Run Now” in the Jobs UI or sending an API request to `runNow`. - Trigger types.List `tfsdk:"trigger" tf:"optional,object"` + Trigger types.List `tfsdk:"trigger"` // A collection of system notification IDs to notify when runs of this job // begin or complete. - WebhookNotifications types.List `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.List `tfsdk:"webhook_notifications"` } func (newState *CreateJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateJob_SdkV2) { @@ -1446,25 +1491,44 @@ func (newState *CreateJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cr func (newState *CreateJob_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateJob_SdkV2) { } -func (c CreateJob_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - Continuous_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "continuous")...) - JobDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - JobEmailNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - JobEnvironment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "environment")...) - GitSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobsHealthRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - JobCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_cluster")...) - JobNotificationSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - JobParameterDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameter")...) - QueueSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "queue")...) - JobRunAs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_as")...) - CronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - Task_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "task")...) - TriggerSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - WebhookNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c CreateJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["continuous"] = attrs["continuous"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment"] = attrs["deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["description"] = attrs["description"].SetOptional() + attrs["edit_mode"] = attrs["edit_mode"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["environment"] = attrs["environment"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["job_cluster"] = attrs["job_cluster"].SetOptional() + attrs["max_concurrent_runs"] = attrs["max_concurrent_runs"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parameter"] = attrs["parameter"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["queue"] = attrs["queue"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["run_as"] = attrs["run_as"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger"] = attrs["trigger"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateJob. @@ -2041,7 +2105,7 @@ func (o *CreateJob_SdkV2) SetWebhookNotifications(ctx context.Context, v Webhook // Job was created successfully type CreateResponse_SdkV2 struct { // The canonical identifier for the newly created job. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` } func (newState *CreateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateResponse_SdkV2) { @@ -2050,9 +2114,10 @@ func (newState *CreateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateResponse_SdkV2) { } -func (c CreateResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateResponse. @@ -2088,17 +2153,17 @@ func (o CreateResponse_SdkV2) Type(ctx context.Context) attr.Type { type CronSchedule_SdkV2 struct { // Indicate whether this schedule is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // A Cron expression using Quartz syntax that describes the schedule for a // job. See [Cron Trigger] for details. This field is required. // // [Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression types.String `tfsdk:"quartz_cron_expression" tf:""` + QuartzCronExpression types.String `tfsdk:"quartz_cron_expression"` // A Java timezone ID. The schedule for a job is resolved with respect to // this timezone. See [Java TimeZone] for details. This field is required. // // [Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html - TimezoneId types.String `tfsdk:"timezone_id" tf:""` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *CronSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronSchedule_SdkV2) { @@ -2107,11 +2172,12 @@ func (newState *CronSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CronSchedule_SdkV2) SyncEffectiveFieldsDuringRead(existingState CronSchedule_SdkV2) { } -func (c CronSchedule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "quartz_cron_expression")...) - cs.SetRequired(append(path, "timezone_id")...) +func (c CronSchedule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["quartz_cron_expression"] = attrs["quartz_cron_expression"].SetRequired() + attrs["timezone_id"] = attrs["timezone_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CronSchedule. @@ -2152,11 +2218,11 @@ func (o CronSchedule_SdkV2) Type(ctx context.Context) attr.Type { type DbtOutput_SdkV2 struct { // An optional map of headers to send when retrieving the artifact from the // `artifacts_link`. - ArtifactsHeaders types.Map `tfsdk:"artifacts_headers" tf:"optional"` + ArtifactsHeaders types.Map `tfsdk:"artifacts_headers"` // A pre-signed URL to download the (compressed) dbt artifacts. This link is // valid for a limited time (30 minutes). This information is only available // after the run has finished. - ArtifactsLink types.String `tfsdk:"artifacts_link" tf:"optional"` + ArtifactsLink types.String `tfsdk:"artifacts_link"` } func (newState *DbtOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtOutput_SdkV2) { @@ -2165,9 +2231,11 @@ func (newState *DbtOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Db func (newState *DbtOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState DbtOutput_SdkV2) { } -func (c DbtOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DbtOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifacts_headers"] = attrs["artifacts_headers"].SetOptional() + attrs["artifacts_link"] = attrs["artifacts_link"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DbtOutput. @@ -2238,22 +2306,22 @@ type DbtTask_SdkV2 struct { // 3-level namespace of Unity Catalog (catalog / schema / relation). The // catalog value can only be specified if a warehouse_id is specified. // Requires dbt-databricks >= 1.1.1. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // A list of dbt commands to execute. All commands must start with `dbt`. // This parameter must not be empty. A maximum of up to 10 commands can be // provided. - Commands types.List `tfsdk:"commands" tf:""` + Commands types.List `tfsdk:"commands"` // Optional (relative) path to the profiles directory. Can only be specified // if no warehouse_id is specified. If no warehouse_id is specified and this // folder is unset, the root directory is used. - ProfilesDirectory types.String `tfsdk:"profiles_directory" tf:"optional"` + ProfilesDirectory types.String `tfsdk:"profiles_directory"` // Path to the project directory. Optional for Git sourced tasks, in which // case if no value is provided, the root of the Git repository is used. - ProjectDirectory types.String `tfsdk:"project_directory" tf:"optional"` + ProjectDirectory types.String `tfsdk:"project_directory"` // Optional schema to write to. This parameter is only used when a // warehouse_id is also provided. If not provided, the `default` schema is // used. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Optional location type of the project directory. When set to `WORKSPACE`, // the project will be retrieved from the local Databricks workspace. When // set to `GIT`, the project will be retrieved from a Git repository defined @@ -2262,12 +2330,12 @@ type DbtTask_SdkV2 struct { // // * `WORKSPACE`: Project is located in Databricks workspace. * `GIT`: // Project is located in cloud Git provider. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // ID of the SQL warehouse to connect to. If provided, we automatically // generate and provide the profile and connection details to dbt. It can be // overridden on a per-command basis by using the `--profiles-dir` command // line argument. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *DbtTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtTask_SdkV2) { @@ -2276,10 +2344,16 @@ func (newState *DbtTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtT func (newState *DbtTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState DbtTask_SdkV2) { } -func (c DbtTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "commands")...) +func (c DbtTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["commands"] = attrs["commands"].SetRequired() + attrs["profiles_directory"] = attrs["profiles_directory"].SetOptional() + attrs["project_directory"] = attrs["project_directory"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DbtTask. @@ -2357,7 +2431,7 @@ func (o *DbtTask_SdkV2) SetCommands(ctx context.Context, v []types.String) { type DeleteJob_SdkV2 struct { // The canonical identifier of the job to delete. This field is required. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` } func (newState *DeleteJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteJob_SdkV2) { @@ -2366,10 +2440,10 @@ func (newState *DeleteJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan De func (newState *DeleteJob_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteJob_SdkV2) { } -func (c DeleteJob_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) +func (c DeleteJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteJob. @@ -2435,7 +2509,7 @@ func (o DeleteResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeleteRun_SdkV2 struct { // ID of the run to delete. - RunId types.Int64 `tfsdk:"run_id" tf:""` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *DeleteRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRun_SdkV2) { @@ -2444,10 +2518,10 @@ func (newState *DeleteRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan De func (newState *DeleteRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRun_SdkV2) { } -func (c DeleteRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c DeleteRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRun. @@ -2516,17 +2590,17 @@ func (o DeleteRunResponse_SdkV2) Type(ctx context.Context) attr.Type { type EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2 struct { // The field where this change would be made, prepended with the job cluster // key. - Field types.String `tfsdk:"field" tf:"optional"` + Field types.String `tfsdk:"field"` // The new value of this field after enforcing policy compliance (either a // number, a boolean, or a string) converted to a string. This is intended // to be read by a human. The typed new value of this field can be retrieved // by reading the settings field in the API response. - NewValue types.String `tfsdk:"new_value" tf:"optional"` + NewValue types.String `tfsdk:"new_value"` // The previous value of this field before enforcing policy compliance // (either a number, a boolean, or a string) converted to a string. This is // intended to be read by a human. The type of the field can be retrieved by // reading the settings field in the API response. - PreviousValue types.String `tfsdk:"previous_value" tf:"optional"` + PreviousValue types.String `tfsdk:"previous_value"` } func (newState *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) { @@ -2535,9 +2609,12 @@ func (newState *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_Sd func (newState *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) { } -func (c EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["field"] = attrs["field"].SetOptional() + attrs["new_value"] = attrs["new_value"].SetOptional() + attrs["previous_value"] = attrs["previous_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforcePolicyComplianceForJobResponseJobClusterSettingsChange. @@ -2577,10 +2654,10 @@ func (o EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2) Typ type EnforcePolicyComplianceRequest_SdkV2 struct { // The ID of the job you want to enforce policy compliance on. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // If set, previews changes made to the job to comply with its policy, but // does not update the job. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *EnforcePolicyComplianceRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforcePolicyComplianceRequest_SdkV2) { @@ -2589,10 +2666,11 @@ func (newState *EnforcePolicyComplianceRequest_SdkV2) SyncEffectiveFieldsDuringC func (newState *EnforcePolicyComplianceRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnforcePolicyComplianceRequest_SdkV2) { } -func (c EnforcePolicyComplianceRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) +func (c EnforcePolicyComplianceRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforcePolicyComplianceRequest. @@ -2631,18 +2709,18 @@ func (o EnforcePolicyComplianceRequest_SdkV2) Type(ctx context.Context) attr.Typ type EnforcePolicyComplianceResponse_SdkV2 struct { // Whether any changes have been made to the job cluster settings for the // job to become compliant with its policies. - HasChanges types.Bool `tfsdk:"has_changes" tf:"optional"` + HasChanges types.Bool `tfsdk:"has_changes"` // A list of job cluster changes that have been made to the job’s cluster // settings in order for all job clusters to become compliant with their // policies. - JobClusterChanges types.List `tfsdk:"job_cluster_changes" tf:"optional"` + JobClusterChanges types.List `tfsdk:"job_cluster_changes"` // Updated job settings after policy enforcement. Policy enforcement only // applies to job clusters that are created when running the job (which are // specified in new_cluster) and does not apply to existing all-purpose // clusters. Updated job settings are derived by applying policy default // values to the existing job clusters in order to satisfy policy // requirements. - Settings types.List `tfsdk:"settings" tf:"optional,object"` + Settings types.List `tfsdk:"settings"` } func (newState *EnforcePolicyComplianceResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforcePolicyComplianceResponse_SdkV2) { @@ -2651,11 +2729,13 @@ func (newState *EnforcePolicyComplianceResponse_SdkV2) SyncEffectiveFieldsDuring func (newState *EnforcePolicyComplianceResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnforcePolicyComplianceResponse_SdkV2) { } -func (c EnforcePolicyComplianceResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EnforcePolicyComplianceForJobResponseJobClusterSettingsChange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_cluster_changes")...) - JobSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "settings")...) +func (c EnforcePolicyComplianceResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_changes"] = attrs["has_changes"].SetOptional() + attrs["job_cluster_changes"] = attrs["job_cluster_changes"].SetOptional() + attrs["settings"] = attrs["settings"].SetOptional() + attrs["settings"] = attrs["settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforcePolicyComplianceResponse. @@ -2759,7 +2839,7 @@ type ExportRunOutput_SdkV2 struct { // script]. // // [Python script]: https://docs.databricks.com/en/_static/examples/extract.py - Views types.List `tfsdk:"views" tf:"optional"` + Views types.List `tfsdk:"views"` } func (newState *ExportRunOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExportRunOutput_SdkV2) { @@ -2768,10 +2848,10 @@ func (newState *ExportRunOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ExportRunOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExportRunOutput_SdkV2) { } -func (c ExportRunOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ViewItem_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "views")...) +func (c ExportRunOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["views"] = attrs["views"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExportRunOutput. @@ -2880,15 +2960,15 @@ type FileArrivalTriggerConfiguration_SdkV2 struct { // If set, the trigger starts a run only after the specified amount of time // passed since the last time the trigger fired. The minimum allowed value // is 60 seconds - MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds" tf:"optional"` + MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds"` // URL to be monitored for file arrivals. The path must point to the root or // a subpath of the external location. - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` // If set, the trigger starts a run only after no file activity has occurred // for the specified amount of time. This makes it possible to wait for a // batch of incoming files to arrive before triggering a run. The minimum // allowed value is 60 seconds. - WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds" tf:"optional"` + WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds"` } func (newState *FileArrivalTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileArrivalTriggerConfiguration_SdkV2) { @@ -2897,10 +2977,12 @@ func (newState *FileArrivalTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuring func (newState *FileArrivalTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState FileArrivalTriggerConfiguration_SdkV2) { } -func (c FileArrivalTriggerConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "url")...) +func (c FileArrivalTriggerConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["min_time_between_triggers_seconds"] = attrs["min_time_between_triggers_seconds"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() + attrs["wait_after_last_change_seconds"] = attrs["wait_after_last_change_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileArrivalTriggerConfiguration. @@ -2940,9 +3022,9 @@ func (o FileArrivalTriggerConfiguration_SdkV2) Type(ctx context.Context) attr.Ty type ForEachStats_SdkV2 struct { // Sample of 3 most common error messages occurred during the iteration. - ErrorMessageStats types.List `tfsdk:"error_message_stats" tf:"optional"` + ErrorMessageStats types.List `tfsdk:"error_message_stats"` // Describes stats of the iteration. Only latest retries are considered. - TaskRunStats types.List `tfsdk:"task_run_stats" tf:"optional,object"` + TaskRunStats types.List `tfsdk:"task_run_stats"` } func (newState *ForEachStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachStats_SdkV2) { @@ -2951,11 +3033,12 @@ func (newState *ForEachStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ForEachStats_SdkV2) SyncEffectiveFieldsDuringRead(existingState ForEachStats_SdkV2) { } -func (c ForEachStats_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ForEachTaskErrorMessageStats_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "error_message_stats")...) - ForEachTaskTaskRunStats_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "task_run_stats")...) +func (c ForEachStats_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_message_stats"] = attrs["error_message_stats"].SetOptional() + attrs["task_run_stats"] = attrs["task_run_stats"].SetOptional() + attrs["task_run_stats"] = attrs["task_run_stats"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachStats. @@ -3054,12 +3137,12 @@ type ForEachTask_SdkV2 struct { // An optional maximum allowed number of concurrent runs of the task. Set // this value if you want to be able to execute multiple runs of the task // concurrently. - Concurrency types.Int64 `tfsdk:"concurrency" tf:"optional"` + Concurrency types.Int64 `tfsdk:"concurrency"` // Array for task to iterate on. This can be a JSON string or a reference to // an array parameter. - Inputs types.String `tfsdk:"inputs" tf:""` + Inputs types.String `tfsdk:"inputs"` // Configuration for the task that will be run for each element in the array - Task types.List `tfsdk:"task" tf:"object"` + Task types.List `tfsdk:"task"` } func (newState *ForEachTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachTask_SdkV2) { @@ -3068,12 +3151,13 @@ func (newState *ForEachTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ForEachTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState ForEachTask_SdkV2) { } -func (c ForEachTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "inputs")...) - cs.SetRequired(append(path, "task")...) - Task_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "task")...) +func (c ForEachTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["concurrency"] = attrs["concurrency"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetRequired() + attrs["task"] = attrs["task"].SetRequired() + attrs["task"] = attrs["task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachTask. @@ -3144,11 +3228,11 @@ func (o *ForEachTask_SdkV2) SetTask(ctx context.Context, v Task_SdkV2) { type ForEachTaskErrorMessageStats_SdkV2 struct { // Describes the count of such error message encountered during the // iterations. - Count types.Int64 `tfsdk:"count" tf:"optional"` + Count types.Int64 `tfsdk:"count"` // Describes the error message occured during the iterations. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // Describes the termination reason for the error message. - TerminationCategory types.String `tfsdk:"termination_category" tf:"optional"` + TerminationCategory types.String `tfsdk:"termination_category"` } func (newState *ForEachTaskErrorMessageStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachTaskErrorMessageStats_SdkV2) { @@ -3157,9 +3241,12 @@ func (newState *ForEachTaskErrorMessageStats_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ForEachTaskErrorMessageStats_SdkV2) SyncEffectiveFieldsDuringRead(existingState ForEachTaskErrorMessageStats_SdkV2) { } -func (c ForEachTaskErrorMessageStats_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ForEachTaskErrorMessageStats_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["count"] = attrs["count"].SetOptional() + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["termination_category"] = attrs["termination_category"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachTaskErrorMessageStats. @@ -3200,17 +3287,17 @@ func (o ForEachTaskErrorMessageStats_SdkV2) Type(ctx context.Context) attr.Type type ForEachTaskTaskRunStats_SdkV2 struct { // Describes the iteration runs having an active lifecycle state or an // active run sub state. - ActiveIterations types.Int64 `tfsdk:"active_iterations" tf:"optional"` + ActiveIterations types.Int64 `tfsdk:"active_iterations"` // Describes the number of failed and succeeded iteration runs. - CompletedIterations types.Int64 `tfsdk:"completed_iterations" tf:"optional"` + CompletedIterations types.Int64 `tfsdk:"completed_iterations"` // Describes the number of failed iteration runs. - FailedIterations types.Int64 `tfsdk:"failed_iterations" tf:"optional"` + FailedIterations types.Int64 `tfsdk:"failed_iterations"` // Describes the number of iteration runs that have been scheduled. - ScheduledIterations types.Int64 `tfsdk:"scheduled_iterations" tf:"optional"` + ScheduledIterations types.Int64 `tfsdk:"scheduled_iterations"` // Describes the number of succeeded iteration runs. - SucceededIterations types.Int64 `tfsdk:"succeeded_iterations" tf:"optional"` + SucceededIterations types.Int64 `tfsdk:"succeeded_iterations"` // Describes the length of the list of items to iterate over. - TotalIterations types.Int64 `tfsdk:"total_iterations" tf:"optional"` + TotalIterations types.Int64 `tfsdk:"total_iterations"` } func (newState *ForEachTaskTaskRunStats_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachTaskTaskRunStats_SdkV2) { @@ -3219,9 +3306,15 @@ func (newState *ForEachTaskTaskRunStats_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ForEachTaskTaskRunStats_SdkV2) SyncEffectiveFieldsDuringRead(existingState ForEachTaskTaskRunStats_SdkV2) { } -func (c ForEachTaskTaskRunStats_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ForEachTaskTaskRunStats_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active_iterations"] = attrs["active_iterations"].SetOptional() + attrs["completed_iterations"] = attrs["completed_iterations"].SetOptional() + attrs["failed_iterations"] = attrs["failed_iterations"].SetOptional() + attrs["scheduled_iterations"] = attrs["scheduled_iterations"].SetOptional() + attrs["succeeded_iterations"] = attrs["succeeded_iterations"].SetOptional() + attrs["total_iterations"] = attrs["total_iterations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachTaskTaskRunStats. @@ -3304,7 +3397,7 @@ func (o GetJobPermissionLevelsRequest_SdkV2) Type(ctx context.Context) attr.Type type GetJobPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetJobPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetJobPermissionLevelsResponse_SdkV2) { @@ -3313,10 +3406,10 @@ func (newState *GetJobPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *GetJobPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetJobPermissionLevelsResponse_SdkV2) { } -func (c GetJobPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetJobPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetJobPermissionLevelsResponse. @@ -3497,13 +3590,13 @@ type GetPolicyComplianceResponse_SdkV2 struct { // of compliance if a policy they are using was updated after the job was // last edited and some of its job clusters no longer comply with their // updated policies. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. An identifier for the job cluster is prepended to the // path. The values indicate an error message describing the policy // validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *GetPolicyComplianceResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPolicyComplianceResponse_SdkV2) { @@ -3512,9 +3605,11 @@ func (newState *GetPolicyComplianceResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *GetPolicyComplianceResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPolicyComplianceResponse_SdkV2) { } -func (c GetPolicyComplianceResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetPolicyComplianceResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPolicyComplianceResponse. @@ -3674,7 +3769,7 @@ type GitSnapshot_SdkV2 struct { // Commit that was used to execute the run. If git_branch was specified, // this points to the HEAD of the branch at the time of the run; if git_tag // was specified, this points to the commit the tag points to. - UsedCommit types.String `tfsdk:"used_commit" tf:"optional"` + UsedCommit types.String `tfsdk:"used_commit"` } func (newState *GitSnapshot_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GitSnapshot_SdkV2) { @@ -3683,9 +3778,10 @@ func (newState *GitSnapshot_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GitSnapshot_SdkV2) SyncEffectiveFieldsDuringRead(existingState GitSnapshot_SdkV2) { } -func (c GitSnapshot_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GitSnapshot_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["used_commit"] = attrs["used_commit"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GitSnapshot. @@ -3732,24 +3828,24 @@ func (o GitSnapshot_SdkV2) Type(ctx context.Context) attr.Type { type GitSource_SdkV2 struct { // Name of the branch to be checked out and used by this job. This field // cannot be specified in conjunction with git_tag or git_commit. - GitBranch types.String `tfsdk:"branch" tf:"optional"` + GitBranch types.String `tfsdk:"branch"` // Commit to be checked out and used by this job. This field cannot be // specified in conjunction with git_branch or git_tag. - GitCommit types.String `tfsdk:"commit" tf:"optional"` + GitCommit types.String `tfsdk:"commit"` // Unique identifier of the service used to host the Git repository. The // value is case insensitive. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // Read-only state of the remote repository at the time the job was run. // This field is only included on job runs. - GitSnapshot types.List `tfsdk:"git_snapshot" tf:"optional,object"` + GitSnapshot types.List `tfsdk:"git_snapshot"` // Name of the tag to be checked out and used by this job. This field cannot // be specified in conjunction with git_branch or git_commit. - GitTag types.String `tfsdk:"tag" tf:"optional"` + GitTag types.String `tfsdk:"tag"` // URL of the repository to be cloned by this job. - GitUrl types.String `tfsdk:"url" tf:""` + GitUrl types.String `tfsdk:"url"` // The source of the job specification in the remote repository when the job // is source controlled. - JobSource types.List `tfsdk:"job_source" tf:"optional,object"` + JobSource types.List `tfsdk:"job_source"` } func (newState *GitSource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GitSource_SdkV2) { @@ -3758,13 +3854,18 @@ func (newState *GitSource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Gi func (newState *GitSource_SdkV2) SyncEffectiveFieldsDuringRead(existingState GitSource_SdkV2) { } -func (c GitSource_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "git_provider")...) - GitSnapshot_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_snapshot")...) - cs.SetRequired(append(path, "url")...) - JobSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_source")...) +func (c GitSource_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["commit"] = attrs["commit"].SetOptional() + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_snapshot"] = attrs["git_snapshot"].SetOptional() + attrs["git_snapshot"] = attrs["git_snapshot"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tag"] = attrs["tag"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() + attrs["job_source"] = attrs["job_source"].SetOptional() + attrs["job_source"] = attrs["job_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GitSource. @@ -3873,19 +3974,19 @@ func (o *GitSource_SdkV2) SetJobSource(ctx context.Context, v JobSource_SdkV2) { type Job_SdkV2 struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). - CreatedTime types.Int64 `tfsdk:"created_time" tf:"optional"` + CreatedTime types.Int64 `tfsdk:"created_time"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // The id of the budget policy used by this job for cost attribution // purposes. This may be set through (in order of precedence): 1. Budget // admins through the account or workspace console 2. Jobs UI in the job // details page and Jobs API using `budget_policy_id` 3. Inferred default // based on accessible budget policies of the run_as identity on job // creation or modification. - EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` // The canonical identifier for this job. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // The email of an active workspace user or the application ID of a service // principal that the job runs as. This value can be changed by setting the // `run_as` field when creating or updating a job. @@ -3893,10 +3994,10 @@ type Job_SdkV2 struct { // By default, `run_as_user_name` is based on the current job settings and // is set to the creator of the job if job access control is disabled or to // the user with the `is_owner` permission if job access control is enabled. - RunAsUserName types.String `tfsdk:"run_as_user_name" tf:"optional"` + RunAsUserName types.String `tfsdk:"run_as_user_name"` // Settings for this job and all of its runs. These settings can be updated // using the `resetJob` method. - Settings types.List `tfsdk:"settings" tf:"optional,object"` + Settings types.List `tfsdk:"settings"` } func (newState *Job_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job_SdkV2) { @@ -3905,11 +4006,16 @@ func (newState *Job_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job_SdkV func (newState *Job_SdkV2) SyncEffectiveFieldsDuringRead(existingState Job_SdkV2) { } -func (c Job_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "effective_budget_policy_id")...) - JobSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "settings")...) +func (c Job_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_time"] = attrs["created_time"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() + attrs["settings"] = attrs["settings"].SetOptional() + attrs["settings"] = attrs["settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Job. @@ -3985,13 +4091,13 @@ func (o *Job_SdkV2) SetSettings(ctx context.Context, v JobSettings_SdkV2) { type JobAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *JobAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobAccessControlRequest_SdkV2) { @@ -4000,9 +4106,13 @@ func (newState *JobAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *JobAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobAccessControlRequest_SdkV2) { } -func (c JobAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobAccessControlRequest. @@ -4044,15 +4154,15 @@ func (o JobAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type { type JobAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *JobAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobAccessControlResponse_SdkV2) { @@ -4061,10 +4171,14 @@ func (newState *JobAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *JobAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobAccessControlResponse_SdkV2) { } -func (c JobAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c JobAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobAccessControlResponse. @@ -4140,9 +4254,9 @@ type JobCluster_SdkV2 struct { // A unique name for the job cluster. This field is required and must be // unique within the job. `JobTaskSettings` may refer to this field to // determine which cluster to launch for the task execution. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:""` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // If new_cluster, a description of a cluster that is created for each task. - NewCluster types.List `tfsdk:"new_cluster" tf:"object"` + NewCluster types.List `tfsdk:"new_cluster"` } func (newState *JobCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobCluster_SdkV2) { @@ -4151,12 +4265,12 @@ func (newState *JobCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan J func (newState *JobCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobCluster_SdkV2) { } -func (c JobCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_cluster_key")...) - cs.SetRequired(append(path, "new_cluster")...) - compute_tf.ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) +func (c JobCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetRequired() + attrs["new_cluster"] = attrs["new_cluster"].SetRequired() + attrs["new_cluster"] = attrs["new_cluster"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobCluster. @@ -4224,15 +4338,15 @@ func (o *JobCluster_SdkV2) SetNewCluster(ctx context.Context, v compute_tf.Clust type JobCompliance_SdkV2 struct { // Whether this job is in compliance with the latest version of its policy. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // Canonical unique identifier for a job. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. An identifier for the job cluster is prepended to the // path. The values indicate an error message describing the policy // validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *JobCompliance_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobCompliance_SdkV2) { @@ -4241,10 +4355,12 @@ func (newState *JobCompliance_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *JobCompliance_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobCompliance_SdkV2) { } -func (c JobCompliance_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) +func (c JobCompliance_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobCompliance. @@ -4316,9 +4432,9 @@ type JobDeployment_SdkV2 struct { // The kind of deployment that manages the job. // // * `BUNDLE`: The job is managed by Databricks Asset Bundle. - Kind types.String `tfsdk:"kind" tf:""` + Kind types.String `tfsdk:"kind"` // Path of the file that contains deployment metadata. - MetadataFilePath types.String `tfsdk:"metadata_file_path" tf:"optional"` + MetadataFilePath types.String `tfsdk:"metadata_file_path"` } func (newState *JobDeployment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobDeployment_SdkV2) { @@ -4327,10 +4443,11 @@ func (newState *JobDeployment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *JobDeployment_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobDeployment_SdkV2) { } -func (c JobDeployment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "kind")...) +func (c JobDeployment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kind"] = attrs["kind"].SetRequired() + attrs["metadata_file_path"] = attrs["metadata_file_path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobDeployment. @@ -4370,22 +4487,22 @@ type JobEmailNotifications_SdkV2 struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the // `notification_settings.no_alert_for_skipped_runs` field. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` // A list of email addresses to be notified when the duration of a run // exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in // the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is // specified in the `health` field for the job, notifications are not sent. - OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded" tf:"optional"` + OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded"` // A list of email addresses to be notified when a run unsuccessfully // completes. A run is considered to have completed unsuccessfully if it // ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. - OnFailure types.List `tfsdk:"on_failure" tf:"optional"` + OnFailure types.List `tfsdk:"on_failure"` // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnStart types.List `tfsdk:"on_start" tf:"optional"` + OnStart types.List `tfsdk:"on_start"` // A list of email addresses to notify when any streaming backlog thresholds // are exceeded for any stream. Streaming backlog thresholds can be set in // the `health` field using the following metrics: @@ -4393,13 +4510,13 @@ type JobEmailNotifications_SdkV2 struct { // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded" tf:"optional"` + OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded"` // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If // not specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnSuccess types.List `tfsdk:"on_success" tf:"optional"` + OnSuccess types.List `tfsdk:"on_success"` } func (newState *JobEmailNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobEmailNotifications_SdkV2) { @@ -4408,9 +4525,15 @@ func (newState *JobEmailNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *JobEmailNotifications_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobEmailNotifications_SdkV2) { } -func (c JobEmailNotifications_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobEmailNotifications_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() + attrs["on_duration_warning_threshold_exceeded"] = attrs["on_duration_warning_threshold_exceeded"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_start"] = attrs["on_start"].SetOptional() + attrs["on_streaming_backlog_exceeded"] = attrs["on_streaming_backlog_exceeded"].SetOptional() + attrs["on_success"] = attrs["on_success"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobEmailNotifications. @@ -4602,11 +4725,11 @@ func (o *JobEmailNotifications_SdkV2) SetOnSuccess(ctx context.Context, v []type type JobEnvironment_SdkV2 struct { // The key of an environment. It has to be unique within a job. - EnvironmentKey types.String `tfsdk:"environment_key" tf:""` + EnvironmentKey types.String `tfsdk:"environment_key"` // The environment entity used to preserve serverless environment side panel // and jobs' environment for non-notebook task. In this minimal environment // spec, only pip dependencies are supported. - Spec types.List `tfsdk:"spec" tf:"optional,object"` + Spec types.List `tfsdk:"spec"` } func (newState *JobEnvironment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobEnvironment_SdkV2) { @@ -4615,11 +4738,12 @@ func (newState *JobEnvironment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *JobEnvironment_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobEnvironment_SdkV2) { } -func (c JobEnvironment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "environment_key")...) - compute_tf.Environment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spec")...) +func (c JobEnvironment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["environment_key"] = attrs["environment_key"].SetRequired() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["spec"] = attrs["spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobEnvironment. @@ -4688,10 +4812,10 @@ func (o *JobEnvironment_SdkV2) SetSpec(ctx context.Context, v compute_tf.Environ type JobNotificationSettings_SdkV2 struct { // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. - NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs" tf:"optional"` + NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs"` // If true, do not send notifications to recipients specified in // `on_failure` if the run is skipped. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` } func (newState *JobNotificationSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobNotificationSettings_SdkV2) { @@ -4700,9 +4824,11 @@ func (newState *JobNotificationSettings_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *JobNotificationSettings_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobNotificationSettings_SdkV2) { } -func (c JobNotificationSettings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobNotificationSettings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["no_alert_for_canceled_runs"] = attrs["no_alert_for_canceled_runs"].SetOptional() + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobNotificationSettings. @@ -4740,11 +4866,11 @@ func (o JobNotificationSettings_SdkV2) Type(ctx context.Context) attr.Type { type JobParameter_SdkV2 struct { // The optional default value of the parameter - Default types.String `tfsdk:"default" tf:"optional"` + Default types.String `tfsdk:"default"` // The name of the parameter - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The value used in the run - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *JobParameter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobParameter_SdkV2) { @@ -4753,9 +4879,12 @@ func (newState *JobParameter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *JobParameter_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobParameter_SdkV2) { } -func (c JobParameter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobParameter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default"] = attrs["default"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobParameter. @@ -4795,10 +4924,10 @@ func (o JobParameter_SdkV2) Type(ctx context.Context) attr.Type { type JobParameterDefinition_SdkV2 struct { // Default value of the parameter. - Default types.String `tfsdk:"default" tf:""` + Default types.String `tfsdk:"default"` // The name of the defined parameter. May only contain alphanumeric // characters, `_`, `-`, and `.` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *JobParameterDefinition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobParameterDefinition_SdkV2) { @@ -4807,11 +4936,11 @@ func (newState *JobParameterDefinition_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *JobParameterDefinition_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobParameterDefinition_SdkV2) { } -func (c JobParameterDefinition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "default")...) - cs.SetRequired(append(path, "name")...) +func (c JobParameterDefinition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default"] = attrs["default"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobParameterDefinition. @@ -4848,11 +4977,11 @@ func (o JobParameterDefinition_SdkV2) Type(ctx context.Context) attr.Type { } type JobPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *JobPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPermission_SdkV2) { @@ -4861,9 +4990,12 @@ func (newState *JobPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *JobPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobPermission_SdkV2) { } -func (c JobPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermission. @@ -4932,11 +5064,11 @@ func (o *JobPermission_SdkV2) SetInheritedFromObject(ctx context.Context, v []ty } type JobPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *JobPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPermissions_SdkV2) { @@ -4945,10 +5077,12 @@ func (newState *JobPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *JobPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobPermissions_SdkV2) { } -func (c JobPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c JobPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermissions. @@ -5017,9 +5151,9 @@ func (o *JobPermissions_SdkV2) SetAccessControlList(ctx context.Context, v []Job } type JobPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *JobPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPermissionsDescription_SdkV2) { @@ -5028,9 +5162,11 @@ func (newState *JobPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *JobPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobPermissionsDescription_SdkV2) { } -func (c JobPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermissionsDescription. @@ -5067,7 +5203,7 @@ func (o JobPermissionsDescription_SdkV2) Type(ctx context.Context) attr.Type { } type JobPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The job for which to get or manage permissions. JobId types.String `tfsdk:"-"` } @@ -5078,11 +5214,11 @@ func (newState *JobPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *JobPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobPermissionsRequest_SdkV2) { } -func (c JobPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "job_id")...) +func (c JobPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermissionsRequest. @@ -5156,10 +5292,10 @@ func (o *JobPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Context, type JobRunAs_SdkV2 struct { // Application ID of an active service principal. Setting this field // requires the `servicePrincipal/user` role. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // The email of an active workspace user. Non-admin users can only set this // field to their own email. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *JobRunAs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobRunAs_SdkV2) { @@ -5168,9 +5304,11 @@ func (newState *JobRunAs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job func (newState *JobRunAs_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobRunAs_SdkV2) { } -func (c JobRunAs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobRunAs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobRunAs. @@ -5211,35 +5349,35 @@ type JobSettings_SdkV2 struct { // specified, a default budget policy may be applied when creating or // modifying the job. See `effective_budget_policy_id` for the budget policy // used by this workload. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. - Continuous types.List `tfsdk:"continuous" tf:"optional,object"` + Continuous types.List `tfsdk:"continuous"` // Deployment information for jobs managed by external sources. - Deployment types.List `tfsdk:"deployment" tf:"optional,object"` + Deployment types.List `tfsdk:"deployment"` // An optional description for the job. The maximum length is 27700 // characters in UTF-8 encoding. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. - EditMode types.String `tfsdk:"edit_mode" tf:"optional"` + EditMode types.String `tfsdk:"edit_mode"` // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. - EmailNotifications types.List `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.List `tfsdk:"email_notifications"` // A list of task execution environment specifications that can be // referenced by serverless tasks of this job. An environment is required to // be present for serverless tasks. For serverless notebook tasks, the // environment is accessible in the notebook environment panel. For other // serverless tasks, the task environment is required to be specified using // environment_key in the task settings. - Environments types.List `tfsdk:"environment" tf:"optional"` + Environments types.List `tfsdk:"environment"` // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -5250,13 +5388,13 @@ type JobSettings_SdkV2 struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.List `tfsdk:"git_source" tf:"optional,object"` + GitSource types.List `tfsdk:"git_source"` // An optional set of health rules that can be defined for this job. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_cluster" tf:"optional"` + JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same // job concurrently. This is useful for example if you trigger your job on a @@ -5268,45 +5406,45 @@ type JobSettings_SdkV2 struct { // runs. However, from then on, new runs are skipped unless there are fewer // than 3 active runs. This value cannot exceed 1000. Setting this value to // `0` causes all new runs to be skipped. - MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs" tf:"optional"` + MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs"` // An optional name for the job. The maximum length is 4096 bytes in UTF-8 // encoding. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // job. - NotificationSettings types.List `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.List `tfsdk:"notification_settings"` // Job-level parameter definitions - Parameters types.List `tfsdk:"parameter" tf:"optional"` + Parameters types.List `tfsdk:"parameter"` // The queue settings of the job. - Queue types.List `tfsdk:"queue" tf:"optional,object"` + Queue types.List `tfsdk:"queue"` // Write-only setting. Specifies the user or service principal that the job // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. - RunAs types.List `tfsdk:"run_as" tf:"optional,object"` + RunAs types.List `tfsdk:"run_as"` // An optional periodic schedule for this job. The default behavior is that // the job only runs when triggered by clicking “Run Now” in the Jobs UI // or sending an API request to `runNow`. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // A map of tags associated with the job. These are forwarded to the cluster // as cluster tags for jobs clusters, and are subject to the same // limitations as cluster tags. A maximum of 25 tags can be added to the // job. - Tags types.Map `tfsdk:"tags" tf:"optional"` + Tags types.Map `tfsdk:"tags"` // A list of task specifications to be executed by this job. - Tasks types.List `tfsdk:"task" tf:"optional"` + Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A configuration to trigger a run when certain conditions are met. The // default behavior is that the job runs only when triggered by clicking // “Run Now” in the Jobs UI or sending an API request to `runNow`. - Trigger types.List `tfsdk:"trigger" tf:"optional,object"` + Trigger types.List `tfsdk:"trigger"` // A collection of system notification IDs to notify when runs of this job // begin or complete. - WebhookNotifications types.List `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.List `tfsdk:"webhook_notifications"` } func (newState *JobSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSettings_SdkV2) { @@ -5315,24 +5453,43 @@ func (newState *JobSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *JobSettings_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobSettings_SdkV2) { } -func (c JobSettings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Continuous_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "continuous")...) - JobDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - JobEmailNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - JobEnvironment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "environment")...) - GitSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobsHealthRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - JobCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_cluster")...) - JobNotificationSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - JobParameterDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameter")...) - QueueSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "queue")...) - JobRunAs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_as")...) - CronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - Task_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "task")...) - TriggerSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - WebhookNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c JobSettings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["continuous"] = attrs["continuous"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment"] = attrs["deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["description"] = attrs["description"].SetOptional() + attrs["edit_mode"] = attrs["edit_mode"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["environment"] = attrs["environment"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["job_cluster"] = attrs["job_cluster"].SetOptional() + attrs["max_concurrent_runs"] = attrs["max_concurrent_runs"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parameter"] = attrs["parameter"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["queue"] = attrs["queue"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["run_as"] = attrs["run_as"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger"] = attrs["trigger"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSettings. @@ -5887,11 +6044,11 @@ type JobSource_SdkV2 struct { // disconnected from the remote job specification and is allowed for live // edit. Import the remote job specification again from UI to make the job // fully synced. - DirtyState types.String `tfsdk:"dirty_state" tf:"optional"` + DirtyState types.String `tfsdk:"dirty_state"` // Name of the branch which the job is imported from. - ImportFromGitBranch types.String `tfsdk:"import_from_git_branch" tf:""` + ImportFromGitBranch types.String `tfsdk:"import_from_git_branch"` // Path of the job YAML file that contains the job specification. - JobConfigPath types.String `tfsdk:"job_config_path" tf:""` + JobConfigPath types.String `tfsdk:"job_config_path"` } func (newState *JobSource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSource_SdkV2) { @@ -5900,11 +6057,12 @@ func (newState *JobSource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Jo func (newState *JobSource_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobSource_SdkV2) { } -func (c JobSource_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "import_from_git_branch")...) - cs.SetRequired(append(path, "job_config_path")...) +func (c JobSource_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dirty_state"] = attrs["dirty_state"].SetOptional() + attrs["import_from_git_branch"] = attrs["import_from_git_branch"].SetRequired() + attrs["job_config_path"] = attrs["job_config_path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSource. @@ -5955,13 +6113,13 @@ type JobsHealthRule_SdkV2 struct { // across all streams. This metric is in Public Preview. * // `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of // outstanding files across all streams. This metric is in Public Preview. - Metric types.String `tfsdk:"metric" tf:""` + Metric types.String `tfsdk:"metric"` // Specifies the operator used to compare the health metric value with the // specified threshold. - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // Specifies the threshold value that the health metric should obey to // satisfy the health rule. - Value types.Int64 `tfsdk:"value" tf:""` + Value types.Int64 `tfsdk:"value"` } func (newState *JobsHealthRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobsHealthRule_SdkV2) { @@ -5970,12 +6128,12 @@ func (newState *JobsHealthRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *JobsHealthRule_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobsHealthRule_SdkV2) { } -func (c JobsHealthRule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "metric")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "value")...) +func (c JobsHealthRule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metric"] = attrs["metric"].SetRequired() + attrs["op"] = attrs["op"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobsHealthRule. @@ -6015,7 +6173,7 @@ func (o JobsHealthRule_SdkV2) Type(ctx context.Context) attr.Type { // An optional set of health rules that can be defined for this job. type JobsHealthRules_SdkV2 struct { - Rules types.List `tfsdk:"rules" tf:"optional"` + Rules types.List `tfsdk:"rules"` } func (newState *JobsHealthRules_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobsHealthRules_SdkV2) { @@ -6024,10 +6182,10 @@ func (newState *JobsHealthRules_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *JobsHealthRules_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobsHealthRules_SdkV2) { } -func (c JobsHealthRules_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobsHealthRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "rules")...) +func (c JobsHealthRules_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["rules"] = attrs["rules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobsHealthRules. @@ -6093,15 +6251,15 @@ func (o *JobsHealthRules_SdkV2) SetRules(ctx context.Context, v []JobsHealthRule type ListJobComplianceForPolicyResponse_SdkV2 struct { // A list of jobs and their policy compliance statuses. - Jobs types.List `tfsdk:"jobs" tf:"optional"` + Jobs types.List `tfsdk:"jobs"` // This field represents the pagination token to retrieve the next page of // results. If this field is not in the response, it means no further // results for the request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // This field represents the pagination token to retrieve the previous page // of results. If this field is not in the response, it means no further // results for the request. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListJobComplianceForPolicyResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListJobComplianceForPolicyResponse_SdkV2) { @@ -6110,10 +6268,12 @@ func (newState *ListJobComplianceForPolicyResponse_SdkV2) SyncEffectiveFieldsDur func (newState *ListJobComplianceForPolicyResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListJobComplianceForPolicyResponse_SdkV2) { } -func (c ListJobComplianceForPolicyResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobCompliance_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "jobs")...) +func (c ListJobComplianceForPolicyResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["jobs"] = attrs["jobs"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListJobComplianceForPolicyResponse. @@ -6290,15 +6450,15 @@ func (o ListJobsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListJobsResponse_SdkV2 struct { // If true, additional jobs matching the provided filter are available for // listing. - HasMore types.Bool `tfsdk:"has_more" tf:"optional"` + HasMore types.Bool `tfsdk:"has_more"` // The list of jobs. Only included in the response if there are jobs to // list. - Jobs types.List `tfsdk:"jobs" tf:"optional"` + Jobs types.List `tfsdk:"jobs"` // A token that can be used to list the next page of jobs (if applicable). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // A token that can be used to list the previous page of jobs (if // applicable). - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListJobsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListJobsResponse_SdkV2) { @@ -6307,10 +6467,13 @@ func (newState *ListJobsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListJobsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListJobsResponse_SdkV2) { } -func (c ListJobsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BaseJob_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "jobs")...) +func (c ListJobsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_more"] = attrs["has_more"].SetOptional() + attrs["jobs"] = attrs["jobs"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListJobsResponse. @@ -6473,15 +6636,15 @@ func (o ListRunsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListRunsResponse_SdkV2 struct { // If true, additional runs matching the provided filter are available for // listing. - HasMore types.Bool `tfsdk:"has_more" tf:"optional"` + HasMore types.Bool `tfsdk:"has_more"` // A token that can be used to list the next page of runs (if applicable). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // A token that can be used to list the previous page of runs (if // applicable). - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` // A list of runs, from most recently started to least. Only included in the // response if there are runs to list. - Runs types.List `tfsdk:"runs" tf:"optional"` + Runs types.List `tfsdk:"runs"` } func (newState *ListRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRunsResponse_SdkV2) { @@ -6490,10 +6653,13 @@ func (newState *ListRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListRunsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListRunsResponse_SdkV2) { } -func (c ListRunsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BaseRun_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "runs")...) +func (c ListRunsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_more"] = attrs["has_more"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() + attrs["runs"] = attrs["runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRunsResponse. @@ -6570,9 +6736,9 @@ type NotebookOutput_SdkV2 struct { // a larger result, your job can store the results in a cloud storage // service. This field is absent if `dbutils.notebook.exit()` was never // called. - Result types.String `tfsdk:"result" tf:"optional"` + Result types.String `tfsdk:"result"` // Whether or not the result was truncated. - Truncated types.Bool `tfsdk:"truncated" tf:"optional"` + Truncated types.Bool `tfsdk:"truncated"` } func (newState *NotebookOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotebookOutput_SdkV2) { @@ -6581,9 +6747,11 @@ func (newState *NotebookOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *NotebookOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState NotebookOutput_SdkV2) { } -func (c NotebookOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NotebookOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["result"] = attrs["result"].SetOptional() + attrs["truncated"] = attrs["truncated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotebookOutput. @@ -6637,12 +6805,12 @@ type NotebookTask_SdkV2 struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-widgets - BaseParameters types.Map `tfsdk:"base_parameters" tf:"optional"` + BaseParameters types.Map `tfsdk:"base_parameters"` // The path of the notebook to be run in the Databricks workspace or remote // repository. For notebooks stored in the Databricks workspace, the path // must be absolute and begin with a slash. For notebooks stored in a remote // repository, the path must be relative. This field is required. - NotebookPath types.String `tfsdk:"notebook_path" tf:""` + NotebookPath types.String `tfsdk:"notebook_path"` // Optional location type of the notebook. When set to `WORKSPACE`, the // notebook will be retrieved from the local Databricks workspace. When set // to `GIT`, the notebook will be retrieved from a Git repository defined in @@ -6650,14 +6818,14 @@ type NotebookTask_SdkV2 struct { // `git_source` is defined and `WORKSPACE` otherwise. * `WORKSPACE`: // Notebook is located in Databricks workspace. * `GIT`: Notebook is located // in cloud Git provider. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Optional `warehouse_id` to run the notebook on a SQL warehouse. Classic // SQL warehouses are NOT supported, please use serverless or pro SQL // warehouses. // // Note that SQL warehouses only support SQL cells; if the notebook contains // non-SQL cells, the run will fail. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *NotebookTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotebookTask_SdkV2) { @@ -6666,10 +6834,13 @@ func (newState *NotebookTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *NotebookTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState NotebookTask_SdkV2) { } -func (c NotebookTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "notebook_path")...) +func (c NotebookTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["base_parameters"] = attrs["base_parameters"].SetOptional() + attrs["notebook_path"] = attrs["notebook_path"].SetRequired() + attrs["source"] = attrs["source"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotebookTask. @@ -6741,9 +6912,9 @@ func (o *NotebookTask_SdkV2) SetBaseParameters(ctx context.Context, v map[string type PeriodicTriggerConfiguration_SdkV2 struct { // The interval at which the trigger should run. - Interval types.Int64 `tfsdk:"interval" tf:""` + Interval types.Int64 `tfsdk:"interval"` // The unit of time for the interval. - Unit types.String `tfsdk:"unit" tf:""` + Unit types.String `tfsdk:"unit"` } func (newState *PeriodicTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PeriodicTriggerConfiguration_SdkV2) { @@ -6752,11 +6923,11 @@ func (newState *PeriodicTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringCre func (newState *PeriodicTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState PeriodicTriggerConfiguration_SdkV2) { } -func (c PeriodicTriggerConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "interval")...) - cs.SetRequired(append(path, "unit")...) +func (c PeriodicTriggerConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["interval"] = attrs["interval"].SetRequired() + attrs["unit"] = attrs["unit"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PeriodicTriggerConfiguration. @@ -6794,7 +6965,7 @@ func (o PeriodicTriggerConfiguration_SdkV2) Type(ctx context.Context) attr.Type type PipelineParams_SdkV2 struct { // If true, triggers a full refresh on the delta live table. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` } func (newState *PipelineParams_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineParams_SdkV2) { @@ -6803,9 +6974,10 @@ func (newState *PipelineParams_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *PipelineParams_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineParams_SdkV2) { } -func (c PipelineParams_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineParams_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineParams. @@ -6841,9 +7013,9 @@ func (o PipelineParams_SdkV2) Type(ctx context.Context) attr.Type { type PipelineTask_SdkV2 struct { // If true, triggers a full refresh on the delta live table. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` // The full name of the pipeline task to execute. - PipelineId types.String `tfsdk:"pipeline_id" tf:""` + PipelineId types.String `tfsdk:"pipeline_id"` } func (newState *PipelineTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineTask_SdkV2) { @@ -6852,10 +7024,11 @@ func (newState *PipelineTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PipelineTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineTask_SdkV2) { } -func (c PipelineTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "pipeline_id")...) +func (c PipelineTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineTask. @@ -6895,16 +7068,16 @@ type PythonWheelTask_SdkV2 struct { // Named entry point to use, if it does not exist in the metadata of the // package it executes the function from the package directly using // `$packageName.$entryPoint()` - EntryPoint types.String `tfsdk:"entry_point" tf:""` + EntryPoint types.String `tfsdk:"entry_point"` // Command-line parameters passed to Python wheel task in the form of // `["--name=task", "--data=dbfs:/path/to/data.json"]`. Leave it empty if // `parameters` is not null. - NamedParameters types.Map `tfsdk:"named_parameters" tf:"optional"` + NamedParameters types.Map `tfsdk:"named_parameters"` // Name of the package to execute - PackageName types.String `tfsdk:"package_name" tf:""` + PackageName types.String `tfsdk:"package_name"` // Command-line parameters passed to Python wheel task. Leave it empty if // `named_parameters` is not null. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *PythonWheelTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PythonWheelTask_SdkV2) { @@ -6913,11 +7086,13 @@ func (newState *PythonWheelTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PythonWheelTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState PythonWheelTask_SdkV2) { } -func (c PythonWheelTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "entry_point")...) - cs.SetRequired(append(path, "package_name")...) +func (c PythonWheelTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["entry_point"] = attrs["entry_point"].SetRequired() + attrs["named_parameters"] = attrs["named_parameters"].SetOptional() + attrs["package_name"] = attrs["package_name"].SetRequired() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PythonWheelTask. @@ -7023,10 +7198,10 @@ type QueueDetails_SdkV2 struct { // per-job limit of concurrent job runs. * // `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`: The run was queued due to reaching // the workspace limit of active run job tasks. - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // A descriptive message with the queuing details. This field is // unstructured, and its exact format is subject to change. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *QueueDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueueDetails_SdkV2) { @@ -7035,9 +7210,11 @@ func (newState *QueueDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QueueDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueueDetails_SdkV2) { } -func (c QueueDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c QueueDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueueDetails. @@ -7075,7 +7252,7 @@ func (o QueueDetails_SdkV2) Type(ctx context.Context) attr.Type { type QueueSettings_SdkV2 struct { // If true, enable queueing for the job. This is a required field. - Enabled types.Bool `tfsdk:"enabled" tf:""` + Enabled types.Bool `tfsdk:"enabled"` } func (newState *QueueSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueueSettings_SdkV2) { @@ -7084,10 +7261,10 @@ func (newState *QueueSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *QueueSettings_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueueSettings_SdkV2) { } -func (c QueueSettings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "enabled")...) +func (c QueueSettings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueueSettings. @@ -7123,22 +7300,22 @@ func (o QueueSettings_SdkV2) Type(ctx context.Context) attr.Type { type RepairHistoryItem_SdkV2 struct { // The end time of the (repaired) run. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The ID of the repair. Only returned for the items that represent a repair // in `repair_history`. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // The start time of the (repaired) run. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The current status of the run - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` // The run IDs of the task runs that ran as part of this repair history // item. - TaskRunIds types.List `tfsdk:"task_run_ids" tf:"optional"` + TaskRunIds types.List `tfsdk:"task_run_ids"` // The repair history item type. Indicates whether a run is the original run // or a repair run. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *RepairHistoryItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairHistoryItem_SdkV2) { @@ -7147,11 +7324,18 @@ func (newState *RepairHistoryItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *RepairHistoryItem_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepairHistoryItem_SdkV2) { } -func (c RepairHistoryItem_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) +func (c RepairHistoryItem_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["task_run_ids"] = attrs["task_run_ids"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepairHistoryItem. @@ -7289,7 +7473,7 @@ type RepairRun_SdkV2 struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -7302,14 +7486,14 @@ type RepairRun_SdkV2 struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // Job-level parameters used in the run. for example `"param": // "overriding_val"` - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` // The ID of the latest repair. This parameter is not required when // repairing a run for the first time, but must be provided on subsequent // requests to repair the same run. - LatestRepairId types.Int64 `tfsdk:"latest_repair_id" tf:"optional"` + LatestRepairId types.Int64 `tfsdk:"latest_repair_id"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -7329,11 +7513,11 @@ type RepairRun_SdkV2 struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.List `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.List `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -7351,18 +7535,18 @@ type RepairRun_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // If true, repair all failed tasks. Only one of `rerun_tasks` or // `rerun_all_failed_tasks` can be used. - RerunAllFailedTasks types.Bool `tfsdk:"rerun_all_failed_tasks" tf:"optional"` + RerunAllFailedTasks types.Bool `tfsdk:"rerun_all_failed_tasks"` // If true, repair all tasks that depend on the tasks in `rerun_tasks`, even // if they were previously successful. Can be also used in combination with // `rerun_all_failed_tasks`. - RerunDependentTasks types.Bool `tfsdk:"rerun_dependent_tasks" tf:"optional"` + RerunDependentTasks types.Bool `tfsdk:"rerun_dependent_tasks"` // The task keys of the task runs to repair. - RerunTasks types.List `tfsdk:"rerun_tasks" tf:"optional"` + RerunTasks types.List `tfsdk:"rerun_tasks"` // The job run ID of the run to repair. The run must not be in progress. - RunId types.Int64 `tfsdk:"run_id" tf:""` + RunId types.Int64 `tfsdk:"run_id"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -7381,11 +7565,11 @@ type RepairRun_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RepairRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairRun_SdkV2) { @@ -7394,11 +7578,24 @@ func (newState *RepairRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Re func (newState *RepairRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepairRun_SdkV2) { } -func (c RepairRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) - cs.SetRequired(append(path, "run_id")...) +func (c RepairRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["latest_repair_id"] = attrs["latest_repair_id"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["rerun_all_failed_tasks"] = attrs["rerun_all_failed_tasks"].SetOptional() + attrs["rerun_dependent_tasks"] = attrs["rerun_dependent_tasks"].SetOptional() + attrs["rerun_tasks"] = attrs["rerun_tasks"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetRequired() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepairRun. @@ -7753,7 +7950,7 @@ func (o *RepairRun_SdkV2) SetSqlParams(ctx context.Context, v map[string]types.S type RepairRunResponse_SdkV2 struct { // The ID of the repair. Must be provided in subsequent repairs using the // `latest_repair_id` field to ensure sequential repairs. - RepairId types.Int64 `tfsdk:"repair_id" tf:"optional"` + RepairId types.Int64 `tfsdk:"repair_id"` } func (newState *RepairRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairRunResponse_SdkV2) { @@ -7762,9 +7959,10 @@ func (newState *RepairRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *RepairRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepairRunResponse_SdkV2) { } -func (c RepairRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepairRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["repair_id"] = attrs["repair_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepairRunResponse. @@ -7800,13 +7998,13 @@ func (o RepairRunResponse_SdkV2) Type(ctx context.Context) attr.Type { type ResetJob_SdkV2 struct { // The canonical identifier of the job to reset. This field is required. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // The new settings of the job. These settings completely replace the old // settings. // // Changes to the field `JobBaseSettings.timeout_seconds` are applied to // active runs. Changes to other fields are applied to future runs only. - NewSettings types.List `tfsdk:"new_settings" tf:"object"` + NewSettings types.List `tfsdk:"new_settings"` } func (newState *ResetJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResetJob_SdkV2) { @@ -7815,12 +8013,12 @@ func (newState *ResetJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Res func (newState *ResetJob_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResetJob_SdkV2) { } -func (c ResetJob_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - cs.SetRequired(append(path, "new_settings")...) - JobSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_settings")...) +func (c ResetJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["new_settings"] = attrs["new_settings"].SetRequired() + attrs["new_settings"] = attrs["new_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResetJob. @@ -7917,9 +8115,9 @@ func (o ResetResponse_SdkV2) Type(ctx context.Context) attr.Type { } type ResolvedConditionTaskValues_SdkV2 struct { - Left types.String `tfsdk:"left" tf:"optional"` + Left types.String `tfsdk:"left"` - Right types.String `tfsdk:"right" tf:"optional"` + Right types.String `tfsdk:"right"` } func (newState *ResolvedConditionTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedConditionTaskValues_SdkV2) { @@ -7928,9 +8126,11 @@ func (newState *ResolvedConditionTaskValues_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *ResolvedConditionTaskValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedConditionTaskValues_SdkV2) { } -func (c ResolvedConditionTaskValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedConditionTaskValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["left"] = attrs["left"].SetOptional() + attrs["right"] = attrs["right"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedConditionTaskValues. @@ -7967,7 +8167,7 @@ func (o ResolvedConditionTaskValues_SdkV2) Type(ctx context.Context) attr.Type { } type ResolvedDbtTaskValues_SdkV2 struct { - Commands types.List `tfsdk:"commands" tf:"optional"` + Commands types.List `tfsdk:"commands"` } func (newState *ResolvedDbtTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedDbtTaskValues_SdkV2) { @@ -7976,9 +8176,10 @@ func (newState *ResolvedDbtTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ResolvedDbtTaskValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedDbtTaskValues_SdkV2) { } -func (c ResolvedDbtTaskValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedDbtTaskValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["commands"] = attrs["commands"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedDbtTaskValues. @@ -8043,7 +8244,7 @@ func (o *ResolvedDbtTaskValues_SdkV2) SetCommands(ctx context.Context, v []types } type ResolvedNotebookTaskValues_SdkV2 struct { - BaseParameters types.Map `tfsdk:"base_parameters" tf:"optional"` + BaseParameters types.Map `tfsdk:"base_parameters"` } func (newState *ResolvedNotebookTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedNotebookTaskValues_SdkV2) { @@ -8052,9 +8253,10 @@ func (newState *ResolvedNotebookTaskValues_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ResolvedNotebookTaskValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedNotebookTaskValues_SdkV2) { } -func (c ResolvedNotebookTaskValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedNotebookTaskValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["base_parameters"] = attrs["base_parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedNotebookTaskValues. @@ -8119,7 +8321,7 @@ func (o *ResolvedNotebookTaskValues_SdkV2) SetBaseParameters(ctx context.Context } type ResolvedParamPairValues_SdkV2 struct { - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` } func (newState *ResolvedParamPairValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedParamPairValues_SdkV2) { @@ -8128,9 +8330,10 @@ func (newState *ResolvedParamPairValues_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ResolvedParamPairValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedParamPairValues_SdkV2) { } -func (c ResolvedParamPairValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedParamPairValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedParamPairValues. @@ -8195,9 +8398,9 @@ func (o *ResolvedParamPairValues_SdkV2) SetParameters(ctx context.Context, v map } type ResolvedPythonWheelTaskValues_SdkV2 struct { - NamedParameters types.Map `tfsdk:"named_parameters" tf:"optional"` + NamedParameters types.Map `tfsdk:"named_parameters"` - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *ResolvedPythonWheelTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedPythonWheelTaskValues_SdkV2) { @@ -8206,9 +8409,11 @@ func (newState *ResolvedPythonWheelTaskValues_SdkV2) SyncEffectiveFieldsDuringCr func (newState *ResolvedPythonWheelTaskValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedPythonWheelTaskValues_SdkV2) { } -func (c ResolvedPythonWheelTaskValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedPythonWheelTaskValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["named_parameters"] = attrs["named_parameters"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedPythonWheelTaskValues. @@ -8304,9 +8509,9 @@ func (o *ResolvedPythonWheelTaskValues_SdkV2) SetParameters(ctx context.Context, } type ResolvedRunJobTaskValues_SdkV2 struct { - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` } func (newState *ResolvedRunJobTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedRunJobTaskValues_SdkV2) { @@ -8315,9 +8520,11 @@ func (newState *ResolvedRunJobTaskValues_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ResolvedRunJobTaskValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedRunJobTaskValues_SdkV2) { } -func (c ResolvedRunJobTaskValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedRunJobTaskValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedRunJobTaskValues. @@ -8413,7 +8620,7 @@ func (o *ResolvedRunJobTaskValues_SdkV2) SetParameters(ctx context.Context, v ma } type ResolvedStringParamsValues_SdkV2 struct { - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *ResolvedStringParamsValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedStringParamsValues_SdkV2) { @@ -8422,9 +8629,10 @@ func (newState *ResolvedStringParamsValues_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ResolvedStringParamsValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedStringParamsValues_SdkV2) { } -func (c ResolvedStringParamsValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedStringParamsValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedStringParamsValues. @@ -8489,25 +8697,25 @@ func (o *ResolvedStringParamsValues_SdkV2) SetParameters(ctx context.Context, v } type ResolvedValues_SdkV2 struct { - ConditionTask types.List `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.List `tfsdk:"condition_task"` - DbtTask types.List `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.List `tfsdk:"dbt_task"` - NotebookTask types.List `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.List `tfsdk:"notebook_task"` - PythonWheelTask types.List `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.List `tfsdk:"python_wheel_task"` - RunJobTask types.List `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.List `tfsdk:"run_job_task"` - SimulationTask types.List `tfsdk:"simulation_task" tf:"optional,object"` + SimulationTask types.List `tfsdk:"simulation_task"` - SparkJarTask types.List `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.List `tfsdk:"spark_jar_task"` - SparkPythonTask types.List `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.List `tfsdk:"spark_python_task"` - SparkSubmitTask types.List `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.List `tfsdk:"spark_submit_task"` - SqlTask types.List `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.List `tfsdk:"sql_task"` } func (newState *ResolvedValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedValues_SdkV2) { @@ -8516,19 +8724,29 @@ func (newState *ResolvedValues_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ResolvedValues_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResolvedValues_SdkV2) { } -func (c ResolvedValues_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ResolvedConditionTaskValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - ResolvedDbtTaskValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - ResolvedNotebookTaskValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - ResolvedPythonWheelTaskValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - ResolvedRunJobTaskValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - ResolvedParamPairValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "simulation_task")...) - ResolvedStringParamsValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - ResolvedStringParamsValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - ResolvedStringParamsValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - ResolvedParamPairValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - - return cs +func (c ResolvedValues_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["simulation_task"] = attrs["simulation_task"].SetOptional() + attrs["simulation_task"] = attrs["simulation_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedValues. @@ -8880,28 +9098,28 @@ type Run_SdkV2 struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + AttemptNumber types.Int64 `tfsdk:"attempt_number"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration types.Int64 `tfsdk:"cleanup_duration" tf:"optional"` + CleanupDuration types.Int64 `tfsdk:"cleanup_duration"` // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance types.List `tfsdk:"cluster_instance" tf:"optional,object"` + ClusterInstance types.List `tfsdk:"cluster_instance"` // A snapshot of the job’s cluster specification when this run was // created. - ClusterSpec types.List `tfsdk:"cluster_spec" tf:"optional,object"` + ClusterSpec types.List `tfsdk:"cluster_spec"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Description of the run - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -8909,7 +9127,7 @@ type Run_SdkV2 struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration types.Int64 `tfsdk:"execution_duration" tf:"optional"` + ExecutionDuration types.Int64 `tfsdk:"execution_duration"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -8920,58 +9138,58 @@ type Run_SdkV2 struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.List `tfsdk:"git_source" tf:"optional,object"` + GitSource types.List `tfsdk:"git_source"` // Only populated by for-each iterations. The parent for-each task is // located in tasks array. - Iterations types.List `tfsdk:"iterations" tf:"optional"` + Iterations types.List `tfsdk:"iterations"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_clusters" tf:"optional"` + JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used in the run - JobParameters types.List `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.List `tfsdk:"job_parameters"` // ID of the job run that this run belongs to. For legacy and single-task // job runs the field is populated with the job run ID. For task runs, the // field is populated with the ID of the job run that the task run belongs // to. - JobRunId types.Int64 `tfsdk:"job_run_id" tf:"optional"` + JobRunId types.Int64 `tfsdk:"job_run_id"` // A token that can be used to list the next page of sub-resources. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob types.Int64 `tfsdk:"number_in_job" tf:"optional"` + NumberInJob types.Int64 `tfsdk:"number_in_job"` // If this run is a retry of a prior run attempt, this field contains the // run_id of the original attempt; otherwise, it is the same as the run_id. - OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id" tf:"optional"` + OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id"` // The parameters used for this run. - OverridingParameters types.List `tfsdk:"overriding_parameters" tf:"optional,object"` + OverridingParameters types.List `tfsdk:"overriding_parameters"` // The time in milliseconds that the run has spent in the queue. - QueueDuration types.Int64 `tfsdk:"queue_duration" tf:"optional"` + QueueDuration types.Int64 `tfsdk:"queue_duration"` // The repair history of the run. - RepairHistory types.List `tfsdk:"repair_history" tf:"optional"` + RepairHistory types.List `tfsdk:"repair_history"` // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` // An optional name for the run. The maximum length is 4096 bytes in UTF-8 // encoding. - RunName types.String `tfsdk:"run_name" tf:"optional"` + RunName types.String `tfsdk:"run_name"` // The URL to the detail page of the run. - RunPageUrl types.String `tfsdk:"run_page_url" tf:"optional"` + RunPageUrl types.String `tfsdk:"run_page_url"` // The type of a run. * `JOB_RUN`: Normal job run. A run created with // :method:jobs/runNow. * `WORKFLOW_RUN`: Workflow run. A run created with // [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit run. A run created with // :method:jobs/submit. // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow - RunType types.String `tfsdk:"run_type" tf:"optional"` + RunType types.String `tfsdk:"run_type"` // The cron schedule that triggered this run if it was triggered by the // periodic scheduler. - Schedule types.List `tfsdk:"schedule" tf:"optional,object"` + Schedule types.List `tfsdk:"schedule"` // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -8979,19 +9197,19 @@ type Run_SdkV2 struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration types.Int64 `tfsdk:"setup_duration" tf:"optional"` + SetupDuration types.Int64 `tfsdk:"setup_duration"` // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The current status of the run - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` // which you can use to call `JobsGetOutput` to retrieve the run resutls. - Tasks types.List `tfsdk:"tasks" tf:"optional"` + Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // // * `PERIODIC`: Schedules that periodically trigger runs, such as a cron @@ -9004,9 +9222,9 @@ type Run_SdkV2 struct { // arrival. * `TABLE`: Indicates a run that is triggered by a table update. // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually // restart a continuous job run. - Trigger types.String `tfsdk:"trigger" tf:"optional"` + Trigger types.String `tfsdk:"trigger"` // Additional details about what triggered the run - TriggerInfo types.List `tfsdk:"trigger_info" tf:"optional,object"` + TriggerInfo types.List `tfsdk:"trigger_info"` } func (newState *Run_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run_SdkV2) { @@ -9015,22 +9233,50 @@ func (newState *Run_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run_SdkV func (newState *Run_SdkV2) SyncEffectiveFieldsDuringRead(existingState Run_SdkV2) { } -func (c Run_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterInstance_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_instance")...) - ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_spec")...) - GitSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - RunTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "iterations")...) - JobCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_clusters")...) - JobParameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_parameters")...) - RunParameters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "overriding_parameters")...) - RepairHistoryItem_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "repair_history")...) - CronSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - RunState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - RunTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tasks")...) - TriggerInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger_info")...) - - return cs +func (c Run_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attempt_number"] = attrs["attempt_number"].SetOptional() + attrs["cleanup_duration"] = attrs["cleanup_duration"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_spec"] = attrs["cluster_spec"].SetOptional() + attrs["cluster_spec"] = attrs["cluster_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["execution_duration"] = attrs["execution_duration"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["iterations"] = attrs["iterations"].SetOptional() + attrs["job_clusters"] = attrs["job_clusters"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["job_run_id"] = attrs["job_run_id"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["number_in_job"] = attrs["number_in_job"].SetOptional() + attrs["original_attempt_run_id"] = attrs["original_attempt_run_id"].SetOptional() + attrs["overriding_parameters"] = attrs["overriding_parameters"].SetOptional() + attrs["overriding_parameters"] = attrs["overriding_parameters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["queue_duration"] = attrs["queue_duration"].SetOptional() + attrs["repair_history"] = attrs["repair_history"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_name"] = attrs["run_name"].SetOptional() + attrs["run_page_url"] = attrs["run_page_url"].SetOptional() + attrs["run_type"] = attrs["run_type"].SetOptional() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["schedule"] = attrs["schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["setup_duration"] = attrs["setup_duration"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tasks"] = attrs["tasks"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger_info"] = attrs["trigger_info"].SetOptional() + attrs["trigger_info"] = attrs["trigger_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Run. @@ -9509,7 +9755,7 @@ func (o *Run_SdkV2) SetTriggerInfo(ctx context.Context, v TriggerInfo_SdkV2) { type RunConditionTask_SdkV2 struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. - Left types.String `tfsdk:"left" tf:""` + Left types.String `tfsdk:"left"` // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their // operands. This means that `“12.0” == “12”` will evaluate to // `false`. * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, @@ -9520,13 +9766,13 @@ type RunConditionTask_SdkV2 struct { // The boolean comparison to task values can be implemented with operators // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it // will be serialized to `“true”` or `“false”` for the comparison. - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // The condition expression evaluation result. Filled in if the task was // successfully completed. Can be `"true"` or `"false"` - Outcome types.String `tfsdk:"outcome" tf:"optional"` + Outcome types.String `tfsdk:"outcome"` // The right operand of the condition task. Can be either a string value or // a job state or parameter reference. - Right types.String `tfsdk:"right" tf:""` + Right types.String `tfsdk:"right"` } func (newState *RunConditionTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunConditionTask_SdkV2) { @@ -9535,12 +9781,13 @@ func (newState *RunConditionTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *RunConditionTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunConditionTask_SdkV2) { } -func (c RunConditionTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "left")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "right")...) +func (c RunConditionTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["left"] = attrs["left"].SetRequired() + attrs["op"] = attrs["op"].SetRequired() + attrs["outcome"] = attrs["outcome"].SetOptional() + attrs["right"] = attrs["right"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunConditionTask. @@ -9584,15 +9831,15 @@ type RunForEachTask_SdkV2 struct { // An optional maximum allowed number of concurrent runs of the task. Set // this value if you want to be able to execute multiple runs of the task // concurrently. - Concurrency types.Int64 `tfsdk:"concurrency" tf:"optional"` + Concurrency types.Int64 `tfsdk:"concurrency"` // Array for task to iterate on. This can be a JSON string or a reference to // an array parameter. - Inputs types.String `tfsdk:"inputs" tf:""` + Inputs types.String `tfsdk:"inputs"` // Read only field. Populated for GetRun and ListRuns RPC calls and stores // the execution stats of an For each task - Stats types.List `tfsdk:"stats" tf:"optional,object"` + Stats types.List `tfsdk:"stats"` // Configuration for the task that will be run for each element in the array - Task types.List `tfsdk:"task" tf:"object"` + Task types.List `tfsdk:"task"` } func (newState *RunForEachTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunForEachTask_SdkV2) { @@ -9601,13 +9848,15 @@ func (newState *RunForEachTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RunForEachTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunForEachTask_SdkV2) { } -func (c RunForEachTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "inputs")...) - ForEachStats_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "stats")...) - cs.SetRequired(append(path, "task")...) - Task_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "task")...) +func (c RunForEachTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["concurrency"] = attrs["concurrency"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetRequired() + attrs["stats"] = attrs["stats"].SetOptional() + attrs["stats"] = attrs["stats"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["task"] = attrs["task"].SetRequired() + attrs["task"] = attrs["task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunForEachTask. @@ -9708,7 +9957,7 @@ func (o *RunForEachTask_SdkV2) SetTask(ctx context.Context, v Task_SdkV2) { type RunJobOutput_SdkV2 struct { // The run id of the triggered job run - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *RunJobOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunJobOutput_SdkV2) { @@ -9717,9 +9966,10 @@ func (newState *RunJobOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RunJobOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunJobOutput_SdkV2) { } -func (c RunJobOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunJobOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunJobOutput. @@ -9757,7 +10007,7 @@ type RunJobTask_SdkV2 struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -9770,11 +10020,11 @@ type RunJobTask_SdkV2 struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // ID of the job to trigger. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used to trigger the job. - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -9794,11 +10044,11 @@ type RunJobTask_SdkV2 struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.List `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.List `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -9816,7 +10066,7 @@ type RunJobTask_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -9835,11 +10085,11 @@ type RunJobTask_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RunJobTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunJobTask_SdkV2) { @@ -9848,11 +10098,20 @@ func (newState *RunJobTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *RunJobTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunJobTask_SdkV2) { } -func (c RunJobTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - PipelineParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) +func (c RunJobTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunJobTask. @@ -10170,7 +10429,7 @@ type RunNow_SdkV2 struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // An optional token to guarantee the idempotency of job run requests. If a // run with the provided token already exists, the request does not create a // new run but returns the ID of the existing run instead. If a run with the @@ -10185,7 +10444,7 @@ type RunNow_SdkV2 struct { // For more information, see [How to ensure idempotency for jobs]. // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html - IdempotencyToken types.String `tfsdk:"idempotency_token" tf:"optional"` + IdempotencyToken types.String `tfsdk:"idempotency_token"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -10198,12 +10457,12 @@ type RunNow_SdkV2 struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // The ID of the job to be executed - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used in the run. for example `"param": // "overriding_val"` - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -10223,14 +10482,14 @@ type RunNow_SdkV2 struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // A list of task keys to run inside of the job. If this field is not // provided, all tasks in the job will be run. - Only types.List `tfsdk:"only" tf:"optional"` + Only types.List `tfsdk:"only"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.List `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.List `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -10248,9 +10507,9 @@ type RunNow_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // The queue settings of the run. - Queue types.List `tfsdk:"queue" tf:"optional,object"` + Queue types.List `tfsdk:"queue"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -10269,11 +10528,11 @@ type RunNow_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RunNow_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunNow_SdkV2) { @@ -10282,12 +10541,24 @@ func (newState *RunNow_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunNo func (newState *RunNow_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunNow_SdkV2) { } -func (c RunNow_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - PipelineParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) - QueueSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "queue")...) +func (c RunNow_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["idempotency_token"] = attrs["idempotency_token"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["only"] = attrs["only"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["queue"] = attrs["queue"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunNow. @@ -10669,9 +10940,9 @@ func (o *RunNow_SdkV2) SetSqlParams(ctx context.Context, v map[string]types.Stri type RunNowResponse_SdkV2 struct { // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob types.Int64 `tfsdk:"number_in_job" tf:"optional"` + NumberInJob types.Int64 `tfsdk:"number_in_job"` // The globally unique ID of the newly triggered run. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *RunNowResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunNowResponse_SdkV2) { @@ -10680,9 +10951,11 @@ func (newState *RunNowResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RunNowResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunNowResponse_SdkV2) { } -func (c RunNowResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunNowResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["number_in_job"] = attrs["number_in_job"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunNowResponse. @@ -10721,16 +10994,16 @@ func (o RunNowResponse_SdkV2) Type(ctx context.Context) attr.Type { // Run output was retrieved successfully. type RunOutput_SdkV2 struct { // The output of a dbt task, if available. - DbtOutput types.List `tfsdk:"dbt_output" tf:"optional,object"` + DbtOutput types.List `tfsdk:"dbt_output"` // An error message indicating why a task failed or why output is not // available. The message is unstructured, and its exact format is subject // to change. - Error types.String `tfsdk:"error" tf:"optional"` + Error types.String `tfsdk:"error"` // If there was an error executing the run, this field contains any // available stack traces. - ErrorTrace types.String `tfsdk:"error_trace" tf:"optional"` + ErrorTrace types.String `tfsdk:"error_trace"` - Info types.String `tfsdk:"info" tf:"optional"` + Info types.String `tfsdk:"info"` // The output from tasks that write to standard streams (stdout/stderr) such // as spark_jar_task, spark_python_task, python_wheel_task. // @@ -10738,11 +11011,11 @@ type RunOutput_SdkV2 struct { // spark_submit_task. // // Databricks restricts this API to return the last 5 MB of these logs. - Logs types.String `tfsdk:"logs" tf:"optional"` + Logs types.String `tfsdk:"logs"` // Whether the logs are truncated. - LogsTruncated types.Bool `tfsdk:"logs_truncated" tf:"optional"` + LogsTruncated types.Bool `tfsdk:"logs_truncated"` // All details of the run except for its output. - Metadata types.List `tfsdk:"metadata" tf:"optional,object"` + Metadata types.List `tfsdk:"metadata"` // The output of a notebook task, if available. A notebook task that // terminates (either successfully or with a failure) without calling // `dbutils.notebook.exit()` is considered to have an empty output. This @@ -10751,11 +11024,11 @@ type RunOutput_SdkV2 struct { // the [ClusterLogConf] field to configure log storage for the job cluster. // // [ClusterLogConf]: https://docs.databricks.com/dev-tools/api/latest/clusters.html#clusterlogconf - NotebookOutput types.List `tfsdk:"notebook_output" tf:"optional,object"` + NotebookOutput types.List `tfsdk:"notebook_output"` // The output of a run job task, if available - RunJobOutput types.List `tfsdk:"run_job_output" tf:"optional,object"` + RunJobOutput types.List `tfsdk:"run_job_output"` // The output of a SQL task, if available. - SqlOutput types.List `tfsdk:"sql_output" tf:"optional,object"` + SqlOutput types.List `tfsdk:"sql_output"` } func (newState *RunOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunOutput_SdkV2) { @@ -10764,14 +11037,24 @@ func (newState *RunOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ru func (newState *RunOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunOutput_SdkV2) { } -func (c RunOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DbtOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbt_output")...) - Run_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metadata")...) - NotebookOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook_output")...) - RunJobOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_job_output")...) - SqlOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_output")...) +func (c RunOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_output"] = attrs["dbt_output"].SetOptional() + attrs["dbt_output"] = attrs["dbt_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["error"] = attrs["error"].SetOptional() + attrs["error_trace"] = attrs["error_trace"].SetOptional() + attrs["info"] = attrs["info"].SetOptional() + attrs["logs"] = attrs["logs"].SetOptional() + attrs["logs_truncated"] = attrs["logs_truncated"].SetOptional() + attrs["metadata"] = attrs["metadata"].SetOptional() + attrs["metadata"] = attrs["metadata"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_output"] = attrs["notebook_output"].SetOptional() + attrs["notebook_output"] = attrs["notebook_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_job_output"] = attrs["run_job_output"].SetOptional() + attrs["run_job_output"] = attrs["run_job_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sql_output"] = attrs["sql_output"].SetOptional() + attrs["sql_output"] = attrs["sql_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunOutput. @@ -10973,7 +11256,7 @@ type RunParameters_SdkV2 struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -10986,7 +11269,7 @@ type RunParameters_SdkV2 struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -11006,11 +11289,11 @@ type RunParameters_SdkV2 struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.List `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.List `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -11028,7 +11311,7 @@ type RunParameters_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -11047,11 +11330,11 @@ type RunParameters_SdkV2 struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RunParameters_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunParameters_SdkV2) { @@ -11060,10 +11343,18 @@ func (newState *RunParameters_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RunParameters_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunParameters_SdkV2) { } -func (c RunParameters_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) +func (c RunParameters_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunParameters. @@ -11348,18 +11639,18 @@ func (o *RunParameters_SdkV2) SetSqlParams(ctx context.Context, v map[string]typ type RunState_SdkV2 struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. - LifeCycleState types.String `tfsdk:"life_cycle_state" tf:"optional"` + LifeCycleState types.String `tfsdk:"life_cycle_state"` // The reason indicating why the run was queued. - QueueReason types.String `tfsdk:"queue_reason" tf:"optional"` + QueueReason types.String `tfsdk:"queue_reason"` // A value indicating the run's result. This field is only available for // terminal lifecycle states. - ResultState types.String `tfsdk:"result_state" tf:"optional"` + ResultState types.String `tfsdk:"result_state"` // A descriptive message for the current state. This field is unstructured, // and its exact format is subject to change. - StateMessage types.String `tfsdk:"state_message" tf:"optional"` + StateMessage types.String `tfsdk:"state_message"` // A value indicating whether a run was canceled manually by a user or by // the scheduler because the run timed out. - UserCancelledOrTimedout types.Bool `tfsdk:"user_cancelled_or_timedout" tf:"optional"` + UserCancelledOrTimedout types.Bool `tfsdk:"user_cancelled_or_timedout"` } func (newState *RunState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunState_SdkV2) { @@ -11368,9 +11659,14 @@ func (newState *RunState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run func (newState *RunState_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunState_SdkV2) { } -func (c RunState_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunState_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["life_cycle_state"] = attrs["life_cycle_state"].SetOptional() + attrs["queue_reason"] = attrs["queue_reason"].SetOptional() + attrs["result_state"] = attrs["result_state"].SetOptional() + attrs["state_message"] = attrs["state_message"].SetOptional() + attrs["user_cancelled_or_timedout"] = attrs["user_cancelled_or_timedout"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunState. @@ -11415,12 +11711,12 @@ func (o RunState_SdkV2) Type(ctx context.Context) attr.Type { // The current status of the run type RunStatus_SdkV2 struct { // If the run was queued, details about the reason for queuing the run. - QueueDetails types.List `tfsdk:"queue_details" tf:"optional,object"` + QueueDetails types.List `tfsdk:"queue_details"` // The current state of the run. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // If the run is in a TERMINATING or TERMINATED state, details about the // reason for terminating the run. - TerminationDetails types.List `tfsdk:"termination_details" tf:"optional,object"` + TerminationDetails types.List `tfsdk:"termination_details"` } func (newState *RunStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunStatus_SdkV2) { @@ -11429,11 +11725,14 @@ func (newState *RunStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ru func (newState *RunStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunStatus_SdkV2) { } -func (c RunStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueueDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "queue_details")...) - TerminationDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "termination_details")...) +func (c RunStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["queue_details"] = attrs["queue_details"].SetOptional() + attrs["queue_details"] = attrs["queue_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["state"] = attrs["state"].SetOptional() + attrs["termination_details"] = attrs["termination_details"].SetOptional() + attrs["termination_details"] = attrs["termination_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunStatus. @@ -11539,48 +11838,48 @@ type RunTask_SdkV2 struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + AttemptNumber types.Int64 `tfsdk:"attempt_number"` // The task runs a [clean rooms] notebook when the // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration types.Int64 `tfsdk:"cleanup_duration" tf:"optional"` + CleanupDuration types.Int64 `tfsdk:"cleanup_duration"` // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance types.List `tfsdk:"cluster_instance" tf:"optional,object"` + ClusterInstance types.List `tfsdk:"cluster_instance"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask types.List `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.List `tfsdk:"condition_task"` // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask types.List `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.List `tfsdk:"dbt_task"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name // assigned to the dependent task. - DependsOn types.List `tfsdk:"depends_on" tf:"optional"` + DependsOn types.List `tfsdk:"depends_on"` // An optional description for this task. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. - EmailNotifications types.List `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.List `tfsdk:"email_notifications"` // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey types.String `tfsdk:"environment_key" tf:"optional"` + EnvironmentKey types.String `tfsdk:"environment_key"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -11588,15 +11887,15 @@ type RunTask_SdkV2 struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration types.Int64 `tfsdk:"execution_duration" tf:"optional"` + ExecutionDuration types.Int64 `tfsdk:"execution_duration"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask types.List `tfsdk:"for_each_task" tf:"optional,object"` + ForEachTask types.List `tfsdk:"for_each_task"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. If `git_source` is set, @@ -11605,46 +11904,46 @@ type RunTask_SdkV2 struct { // `WORKSPACE` on the task. Note: dbt and SQL File tasks support only // version-controlled sources. If dbt or SQL File tasks are used, // `git_source` must be defined on the job. - GitSource types.List `tfsdk:"git_source" tf:"optional,object"` + GitSource types.List `tfsdk:"git_source"` // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:"optional"` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.List `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.List `tfsdk:"new_cluster"` // The task runs a notebook when the `notebook_task` field is present. - NotebookTask types.List `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.List `tfsdk:"notebook_task"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task run. - NotificationSettings types.List `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.List `tfsdk:"notification_settings"` // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask types.List `tfsdk:"pipeline_task" tf:"optional,object"` + PipelineTask types.List `tfsdk:"pipeline_task"` // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask types.List `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.List `tfsdk:"python_wheel_task"` // The time in milliseconds that the run has spent in the queue. - QueueDuration types.Int64 `tfsdk:"queue_duration" tf:"optional"` + QueueDuration types.Int64 `tfsdk:"queue_duration"` // Parameter values including resolved references - ResolvedValues types.List `tfsdk:"resolved_values" tf:"optional,object"` + ResolvedValues types.List `tfsdk:"resolved_values"` // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // The ID of the task run. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` // An optional value indicating the condition that determines whether the // task should be run once its dependencies have been completed. When // omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of // possible values. - RunIf types.String `tfsdk:"run_if" tf:"optional"` + RunIf types.String `tfsdk:"run_if"` // The task triggers another job when the `run_job_task` field is present. - RunJobTask types.List `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.List `tfsdk:"run_job_task"` - RunPageUrl types.String `tfsdk:"run_page_url" tf:"optional"` + RunPageUrl types.String `tfsdk:"run_page_url"` // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -11652,12 +11951,12 @@ type RunTask_SdkV2 struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration types.Int64 `tfsdk:"setup_duration" tf:"optional"` + SetupDuration types.Int64 `tfsdk:"setup_duration"` // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask types.List `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.List `tfsdk:"spark_jar_task"` // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask types.List `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.List `tfsdk:"spark_python_task"` // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -11676,31 +11975,31 @@ type RunTask_SdkV2 struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask types.List `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.List `tfsdk:"spark_submit_task"` // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask types.List `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.List `tfsdk:"sql_task"` // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The current status of the run - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when the run begins or // completes. The default behavior is to not send any system notifications. // Task webhooks respect the task notification settings. - WebhookNotifications types.List `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.List `tfsdk:"webhook_notifications"` } func (newState *RunTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTask_SdkV2) { @@ -11709,32 +12008,70 @@ func (newState *RunTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunT func (newState *RunTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunTask_SdkV2) { } -func (c RunTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomsNotebookTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms_notebook_task")...) - ClusterInstance_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_instance")...) - RunConditionTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - DbtTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - TaskDependency_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "depends_on")...) - JobEmailNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - RunForEachTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "for_each_task")...) - GitSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - compute_tf.ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) - NotebookTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - TaskNotificationSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - PipelineTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_task")...) - PythonWheelTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - ResolvedValues_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "resolved_values")...) - RunJobTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - SparkJarTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - SparkPythonTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - SparkSubmitTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - SqlTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - RunState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) - cs.SetRequired(append(path, "task_key")...) - WebhookNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c RunTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attempt_number"] = attrs["attempt_number"].SetOptional() + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].SetOptional() + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cleanup_duration"] = attrs["cleanup_duration"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["depends_on"] = attrs["depends_on"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["environment_key"] = attrs["environment_key"].SetOptional() + attrs["execution_duration"] = attrs["execution_duration"].SetOptional() + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pipeline_task"] = attrs["pipeline_task"].SetOptional() + attrs["pipeline_task"] = attrs["pipeline_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["queue_duration"] = attrs["queue_duration"].SetOptional() + attrs["resolved_values"] = attrs["resolved_values"].SetOptional() + attrs["resolved_values"] = attrs["resolved_values"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_if"] = attrs["run_if"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_page_url"] = attrs["run_page_url"].SetOptional() + attrs["setup_duration"] = attrs["setup_duration"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["task_key"] = attrs["task_key"].SetRequired() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunTask. @@ -12517,20 +12854,20 @@ func (o *RunTask_SdkV2) SetWebhookNotifications(ctx context.Context, v WebhookNo type SparkJarTask_SdkV2 struct { // Deprecated since 04/2016. Provide a `jar` through the `libraries` field // instead. For an example, see :method:jobs/create. - JarUri types.String `tfsdk:"jar_uri" tf:"optional"` + JarUri types.String `tfsdk:"jar_uri"` // The full name of the class containing the main method to be executed. // This class must be contained in a JAR provided as a library. // // The code must use `SparkContext.getOrCreate` to obtain a Spark context; // otherwise, runs of the job fail. - MainClassName types.String `tfsdk:"main_class_name" tf:"optional"` + MainClassName types.String `tfsdk:"main_class_name"` // Parameters passed to the main method. // // Use [Task parameter variables] to set parameters containing information // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *SparkJarTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkJarTask_SdkV2) { @@ -12539,9 +12876,12 @@ func (newState *SparkJarTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SparkJarTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparkJarTask_SdkV2) { } -func (c SparkJarTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkJarTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["jar_uri"] = attrs["jar_uri"].SetOptional() + attrs["main_class_name"] = attrs["main_class_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkJarTask. @@ -12616,13 +12956,13 @@ type SparkPythonTask_SdkV2 struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, // adls:/, gcs:/) and workspace paths are supported. For python files stored // in the Databricks workspace, the path must be absolute and begin with // `/`. For files stored in a remote repository, the path must be relative. // This field is required. - PythonFile types.String `tfsdk:"python_file" tf:""` + PythonFile types.String `tfsdk:"python_file"` // Optional location type of the Python file. When set to `WORKSPACE` or not // specified, the file will be retrieved from the local Databricks workspace // or cloud location (if the `python_file` has a URI format). When set to @@ -12632,7 +12972,7 @@ type SparkPythonTask_SdkV2 struct { // * `WORKSPACE`: The Python file is located in a Databricks workspace or at // a cloud filesystem URI. * `GIT`: The Python file is located in a remote // Git repository. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` } func (newState *SparkPythonTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkPythonTask_SdkV2) { @@ -12641,10 +12981,12 @@ func (newState *SparkPythonTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *SparkPythonTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparkPythonTask_SdkV2) { } -func (c SparkPythonTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "python_file")...) +func (c SparkPythonTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["python_file"] = attrs["python_file"].SetRequired() + attrs["source"] = attrs["source"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkPythonTask. @@ -12719,7 +13061,7 @@ type SparkSubmitTask_SdkV2 struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *SparkSubmitTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkSubmitTask_SdkV2) { @@ -12728,9 +13070,10 @@ func (newState *SparkSubmitTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *SparkSubmitTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparkSubmitTask_SdkV2) { } -func (c SparkSubmitTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkSubmitTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkSubmitTask. @@ -12800,16 +13143,16 @@ type SqlAlertOutput_SdkV2 struct { // * UNKNOWN: alert yet to be evaluated * OK: alert evaluated and did not // fulfill trigger conditions * TRIGGERED: alert evaluated and fulfilled // trigger conditions - AlertState types.String `tfsdk:"alert_state" tf:"optional"` + AlertState types.String `tfsdk:"alert_state"` // The link to find the output results. - OutputLink types.String `tfsdk:"output_link" tf:"optional"` + OutputLink types.String `tfsdk:"output_link"` // The text of the SQL query. Can Run permission of the SQL query associated // with the SQL alert is required to view this field. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Information about SQL statements executed in the run. - SqlStatements types.List `tfsdk:"sql_statements" tf:"optional"` + SqlStatements types.List `tfsdk:"sql_statements"` // The canonical identifier of the SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *SqlAlertOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlAlertOutput_SdkV2) { @@ -12818,10 +13161,14 @@ func (newState *SqlAlertOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SqlAlertOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlAlertOutput_SdkV2) { } -func (c SqlAlertOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlStatementOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_statements")...) +func (c SqlAlertOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_state"] = attrs["alert_state"].SetOptional() + attrs["output_link"] = attrs["output_link"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["sql_statements"] = attrs["sql_statements"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlAlertOutput. @@ -12895,9 +13242,9 @@ func (o *SqlAlertOutput_SdkV2) SetSqlStatements(ctx context.Context, v []SqlStat type SqlDashboardOutput_SdkV2 struct { // The canonical identifier of the SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` // Widgets executed in the run. Only SQL query based widgets are listed. - Widgets types.List `tfsdk:"widgets" tf:"optional"` + Widgets types.List `tfsdk:"widgets"` } func (newState *SqlDashboardOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlDashboardOutput_SdkV2) { @@ -12906,10 +13253,11 @@ func (newState *SqlDashboardOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *SqlDashboardOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlDashboardOutput_SdkV2) { } -func (c SqlDashboardOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlDashboardWidgetOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "widgets")...) +func (c SqlDashboardOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + attrs["widgets"] = attrs["widgets"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlDashboardOutput. @@ -12977,19 +13325,19 @@ func (o *SqlDashboardOutput_SdkV2) SetWidgets(ctx context.Context, v []SqlDashbo type SqlDashboardWidgetOutput_SdkV2 struct { // Time (in epoch milliseconds) when execution of the SQL widget ends. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The information about the error when execution fails. - Error types.List `tfsdk:"error" tf:"optional,object"` + Error types.List `tfsdk:"error"` // The link to find the output results. - OutputLink types.String `tfsdk:"output_link" tf:"optional"` + OutputLink types.String `tfsdk:"output_link"` // Time (in epoch milliseconds) when execution of the SQL widget starts. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // The execution status of the SQL widget. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The canonical identifier of the SQL widget. - WidgetId types.String `tfsdk:"widget_id" tf:"optional"` + WidgetId types.String `tfsdk:"widget_id"` // The title of the SQL widget. - WidgetTitle types.String `tfsdk:"widget_title" tf:"optional"` + WidgetTitle types.String `tfsdk:"widget_title"` } func (newState *SqlDashboardWidgetOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlDashboardWidgetOutput_SdkV2) { @@ -12998,10 +13346,17 @@ func (newState *SqlDashboardWidgetOutput_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *SqlDashboardWidgetOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlDashboardWidgetOutput_SdkV2) { } -func (c SqlDashboardWidgetOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlOutputError_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "error")...) +func (c SqlDashboardWidgetOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["error"] = attrs["error"].SetOptional() + attrs["error"] = attrs["error"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["output_link"] = attrs["output_link"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["widget_id"] = attrs["widget_id"].SetOptional() + attrs["widget_title"] = attrs["widget_title"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlDashboardWidgetOutput. @@ -13079,11 +13434,11 @@ func (o *SqlDashboardWidgetOutput_SdkV2) SetError(ctx context.Context, v SqlOutp type SqlOutput_SdkV2 struct { // The output of a SQL alert task, if available. - AlertOutput types.List `tfsdk:"alert_output" tf:"optional,object"` + AlertOutput types.List `tfsdk:"alert_output"` // The output of a SQL dashboard task, if available. - DashboardOutput types.List `tfsdk:"dashboard_output" tf:"optional,object"` + DashboardOutput types.List `tfsdk:"dashboard_output"` // The output of a SQL query task, if available. - QueryOutput types.List `tfsdk:"query_output" tf:"optional,object"` + QueryOutput types.List `tfsdk:"query_output"` } func (newState *SqlOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlOutput_SdkV2) { @@ -13092,12 +13447,15 @@ func (newState *SqlOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sq func (newState *SqlOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlOutput_SdkV2) { } -func (c SqlOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlAlertOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert_output")...) - SqlDashboardOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dashboard_output")...) - SqlQueryOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query_output")...) +func (c SqlOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_output"] = attrs["alert_output"].SetOptional() + attrs["alert_output"] = attrs["alert_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dashboard_output"] = attrs["dashboard_output"].SetOptional() + attrs["dashboard_output"] = attrs["dashboard_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["query_output"] = attrs["query_output"].SetOptional() + attrs["query_output"] = attrs["query_output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlOutput. @@ -13225,7 +13583,7 @@ func (o *SqlOutput_SdkV2) SetQueryOutput(ctx context.Context, v SqlQueryOutput_S type SqlOutputError_SdkV2 struct { // The error message when execution fails. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *SqlOutputError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlOutputError_SdkV2) { @@ -13234,9 +13592,10 @@ func (newState *SqlOutputError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SqlOutputError_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlOutputError_SdkV2) { } -func (c SqlOutputError_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SqlOutputError_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlOutputError. @@ -13271,16 +13630,16 @@ func (o SqlOutputError_SdkV2) Type(ctx context.Context) attr.Type { } type SqlQueryOutput_SdkV2 struct { - EndpointId types.String `tfsdk:"endpoint_id" tf:"optional"` + EndpointId types.String `tfsdk:"endpoint_id"` // The link to find the output results. - OutputLink types.String `tfsdk:"output_link" tf:"optional"` + OutputLink types.String `tfsdk:"output_link"` // The text of the SQL query. Can Run permission of the SQL query is // required to view this field. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Information about SQL statements executed in the run. - SqlStatements types.List `tfsdk:"sql_statements" tf:"optional"` + SqlStatements types.List `tfsdk:"sql_statements"` // The canonical identifier of the SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *SqlQueryOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlQueryOutput_SdkV2) { @@ -13289,10 +13648,14 @@ func (newState *SqlQueryOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SqlQueryOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlQueryOutput_SdkV2) { } -func (c SqlQueryOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlStatementOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_statements")...) +func (c SqlQueryOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_id"] = attrs["endpoint_id"].SetOptional() + attrs["output_link"] = attrs["output_link"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["sql_statements"] = attrs["sql_statements"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlQueryOutput. @@ -13366,7 +13729,7 @@ func (o *SqlQueryOutput_SdkV2) SetSqlStatements(ctx context.Context, v []SqlStat type SqlStatementOutput_SdkV2 struct { // A key that can be used to look up query details. - LookupKey types.String `tfsdk:"lookup_key" tf:"optional"` + LookupKey types.String `tfsdk:"lookup_key"` } func (newState *SqlStatementOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlStatementOutput_SdkV2) { @@ -13375,9 +13738,10 @@ func (newState *SqlStatementOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *SqlStatementOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlStatementOutput_SdkV2) { } -func (c SqlStatementOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SqlStatementOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["lookup_key"] = attrs["lookup_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlStatementOutput. @@ -13413,22 +13777,22 @@ func (o SqlStatementOutput_SdkV2) Type(ctx context.Context) attr.Type { type SqlTask_SdkV2 struct { // If alert, indicates that this job must refresh a SQL alert. - Alert types.List `tfsdk:"alert" tf:"optional,object"` + Alert types.List `tfsdk:"alert"` // If dashboard, indicates that this job must refresh a SQL dashboard. - Dashboard types.List `tfsdk:"dashboard" tf:"optional,object"` + Dashboard types.List `tfsdk:"dashboard"` // If file, indicates that this job runs a SQL file in a remote Git // repository. - File types.List `tfsdk:"file" tf:"optional,object"` + File types.List `tfsdk:"file"` // Parameters to be used for each run of this job. The SQL alert task does // not support custom parameters. - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` // If query, indicates that this job must execute a SQL query. - Query types.List `tfsdk:"query" tf:"optional,object"` + Query types.List `tfsdk:"query"` // The canonical identifier of the SQL warehouse. Recommended to use with // serverless or pro SQL warehouses. Classic SQL warehouses are only // supported for SQL alert, dashboard and query tasks and are limited to // scheduled single-task jobs. - WarehouseId types.String `tfsdk:"warehouse_id" tf:""` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *SqlTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTask_SdkV2) { @@ -13437,14 +13801,19 @@ func (newState *SqlTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlT func (newState *SqlTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlTask_SdkV2) { } -func (c SqlTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlTaskAlert_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert")...) - SqlTaskDashboard_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dashboard")...) - SqlTaskFile_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file")...) - SqlTaskQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query")...) - cs.SetRequired(append(path, "warehouse_id")...) +func (c SqlTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert"] = attrs["alert"].SetOptional() + attrs["alert"] = attrs["alert"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dashboard"] = attrs["dashboard"].SetOptional() + attrs["dashboard"] = attrs["dashboard"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["file"] = attrs["file"].SetOptional() + attrs["file"] = attrs["file"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query"] = attrs["query"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["warehouse_id"] = attrs["warehouse_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTask. @@ -13636,11 +14005,11 @@ func (o *SqlTask_SdkV2) SetQuery(ctx context.Context, v SqlTaskQuery_SdkV2) { type SqlTaskAlert_SdkV2 struct { // The canonical identifier of the SQL alert. - AlertId types.String `tfsdk:"alert_id" tf:""` + AlertId types.String `tfsdk:"alert_id"` // If true, the alert notifications are not sent to subscribers. - PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions" tf:"optional"` + PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions"` // If specified, alert notifications are sent to subscribers. - Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` + Subscriptions types.List `tfsdk:"subscriptions"` } func (newState *SqlTaskAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskAlert_SdkV2) { @@ -13649,11 +14018,12 @@ func (newState *SqlTaskAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SqlTaskAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlTaskAlert_SdkV2) { } -func (c SqlTaskAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "alert_id")...) - SqlTaskSubscription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "subscriptions")...) +func (c SqlTaskAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_id"] = attrs["alert_id"].SetRequired() + attrs["pause_subscriptions"] = attrs["pause_subscriptions"].SetOptional() + attrs["subscriptions"] = attrs["subscriptions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskAlert. @@ -13723,14 +14093,14 @@ func (o *SqlTaskAlert_SdkV2) SetSubscriptions(ctx context.Context, v []SqlTaskSu type SqlTaskDashboard_SdkV2 struct { // Subject of the email sent to subscribers of this task. - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The canonical identifier of the SQL dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` // If true, the dashboard snapshot is not taken, and emails are not sent to // subscribers. - PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions" tf:"optional"` + PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions"` // If specified, dashboard snapshots are sent to subscriptions. - Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` + Subscriptions types.List `tfsdk:"subscriptions"` } func (newState *SqlTaskDashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskDashboard_SdkV2) { @@ -13739,11 +14109,13 @@ func (newState *SqlTaskDashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SqlTaskDashboard_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlTaskDashboard_SdkV2) { } -func (c SqlTaskDashboard_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - SqlTaskSubscription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "subscriptions")...) +func (c SqlTaskDashboard_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["pause_subscriptions"] = attrs["pause_subscriptions"].SetOptional() + attrs["subscriptions"] = attrs["subscriptions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskDashboard. @@ -13816,7 +14188,7 @@ func (o *SqlTaskDashboard_SdkV2) SetSubscriptions(ctx context.Context, v []SqlTa type SqlTaskFile_SdkV2 struct { // Path of the SQL file. Must be relative if the source is a remote Git // repository and absolute for workspace paths. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` // Optional location type of the SQL file. When set to `WORKSPACE`, the SQL // file will be retrieved from the local Databricks workspace. When set to // `GIT`, the SQL file will be retrieved from a Git repository defined in @@ -13825,7 +14197,7 @@ type SqlTaskFile_SdkV2 struct { // // * `WORKSPACE`: SQL file is located in Databricks workspace. * `GIT`: SQL // file is located in cloud Git provider. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` } func (newState *SqlTaskFile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskFile_SdkV2) { @@ -13834,10 +14206,11 @@ func (newState *SqlTaskFile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SqlTaskFile_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlTaskFile_SdkV2) { } -func (c SqlTaskFile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c SqlTaskFile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() + attrs["source"] = attrs["source"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskFile. @@ -13875,7 +14248,7 @@ func (o SqlTaskFile_SdkV2) Type(ctx context.Context) attr.Type { type SqlTaskQuery_SdkV2 struct { // The canonical identifier of the SQL query. - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` } func (newState *SqlTaskQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskQuery_SdkV2) { @@ -13884,10 +14257,10 @@ func (newState *SqlTaskQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SqlTaskQuery_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlTaskQuery_SdkV2) { } -func (c SqlTaskQuery_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "query_id")...) +func (c SqlTaskQuery_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query_id"] = attrs["query_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskQuery. @@ -13926,11 +14299,11 @@ type SqlTaskSubscription_SdkV2 struct { // notification. This parameter is mutually exclusive with user_name. You // cannot set both destination_id and user_name for subscription // notifications. - DestinationId types.String `tfsdk:"destination_id" tf:"optional"` + DestinationId types.String `tfsdk:"destination_id"` // The user name to receive the subscription email. This parameter is // mutually exclusive with destination_id. You cannot set both // destination_id and user_name for subscription notifications. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *SqlTaskSubscription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskSubscription_SdkV2) { @@ -13939,9 +14312,11 @@ func (newState *SqlTaskSubscription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *SqlTaskSubscription_SdkV2) SyncEffectiveFieldsDuringRead(existingState SqlTaskSubscription_SdkV2) { } -func (c SqlTaskSubscription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SqlTaskSubscription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_id"] = attrs["destination_id"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskSubscription. @@ -13979,16 +14354,16 @@ func (o SqlTaskSubscription_SdkV2) Type(ctx context.Context) attr.Type { type SubmitRun_SdkV2 struct { // List of permissions to set on the job. - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The user specified id of the budget policy to use for this one-time run. // If not specified, the run will be not be attributed to any budget policy. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // An optional set of email addresses notified when the run begins or // completes. - EmailNotifications types.List `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.List `tfsdk:"email_notifications"` // A list of task execution environment specifications that can be // referenced by tasks of this run. - Environments types.List `tfsdk:"environments" tf:"optional"` + Environments types.List `tfsdk:"environments"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -13999,9 +14374,9 @@ type SubmitRun_SdkV2 struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.List `tfsdk:"git_source" tf:"optional,object"` + GitSource types.List `tfsdk:"git_source"` // An optional set of health rules that can be defined for this job. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // An optional token that can be used to guarantee the idempotency of job // run requests. If a run with the provided token already exists, the // request does not create a new run but returns the ID of the existing run @@ -14017,26 +14392,26 @@ type SubmitRun_SdkV2 struct { // For more information, see [How to ensure idempotency for jobs]. // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html - IdempotencyToken types.String `tfsdk:"idempotency_token" tf:"optional"` + IdempotencyToken types.String `tfsdk:"idempotency_token"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // run. - NotificationSettings types.List `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.List `tfsdk:"notification_settings"` // The queue settings of the one-time run. - Queue types.List `tfsdk:"queue" tf:"optional,object"` + Queue types.List `tfsdk:"queue"` // Specifies the user or service principal that the job runs as. If not // specified, the job runs as the user who submits the request. - RunAs types.List `tfsdk:"run_as" tf:"optional,object"` + RunAs types.List `tfsdk:"run_as"` // An optional name for the run. The default value is `Untitled`. - RunName types.String `tfsdk:"run_name" tf:"optional"` + RunName types.String `tfsdk:"run_name"` - Tasks types.List `tfsdk:"tasks" tf:"optional"` + Tasks types.List `tfsdk:"tasks"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when the run begins or // completes. - WebhookNotifications types.List `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.List `tfsdk:"webhook_notifications"` } func (newState *SubmitRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitRun_SdkV2) { @@ -14045,19 +14420,30 @@ func (newState *SubmitRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Su func (newState *SubmitRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState SubmitRun_SdkV2) { } -func (c SubmitRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - JobEmailNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - JobEnvironment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "environments")...) - GitSource_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobsHealthRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - JobNotificationSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - QueueSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "queue")...) - JobRunAs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_as")...) - SubmitTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tasks")...) - WebhookNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c SubmitRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["environments"] = attrs["environments"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["idempotency_token"] = attrs["idempotency_token"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["queue"] = attrs["queue"].SetOptional() + attrs["queue"] = attrs["queue"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["run_as"] = attrs["run_as"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_name"] = attrs["run_name"].SetOptional() + attrs["tasks"] = attrs["tasks"].SetOptional() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubmitRun. @@ -14411,7 +14797,7 @@ func (o *SubmitRun_SdkV2) SetWebhookNotifications(ctx context.Context, v Webhook // Run was created and started successfully. type SubmitRunResponse_SdkV2 struct { // The canonical identifier for the newly submitted run. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *SubmitRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitRunResponse_SdkV2) { @@ -14420,9 +14806,10 @@ func (newState *SubmitRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *SubmitRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SubmitRunResponse_SdkV2) { } -func (c SubmitRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SubmitRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubmitRunResponse. @@ -14461,70 +14848,70 @@ type SubmitTask_SdkV2 struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask types.List `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.List `tfsdk:"condition_task"` // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask types.List `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.List `tfsdk:"dbt_task"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name // assigned to the dependent task. - DependsOn types.List `tfsdk:"depends_on" tf:"optional"` + DependsOn types.List `tfsdk:"depends_on"` // An optional description for this task. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. - EmailNotifications types.List `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.List `tfsdk:"email_notifications"` // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey types.String `tfsdk:"environment_key" tf:"optional"` + EnvironmentKey types.String `tfsdk:"environment_key"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask types.List `tfsdk:"for_each_task" tf:"optional,object"` + ForEachTask types.List `tfsdk:"for_each_task"` // An optional set of health rules that can be defined for this job. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.List `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.List `tfsdk:"new_cluster"` // The task runs a notebook when the `notebook_task` field is present. - NotebookTask types.List `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.List `tfsdk:"notebook_task"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task run. - NotificationSettings types.List `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.List `tfsdk:"notification_settings"` // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask types.List `tfsdk:"pipeline_task" tf:"optional,object"` + PipelineTask types.List `tfsdk:"pipeline_task"` // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask types.List `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.List `tfsdk:"python_wheel_task"` // An optional value indicating the condition that determines whether the // task should be run once its dependencies have been completed. When // omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of // possible values. - RunIf types.String `tfsdk:"run_if" tf:"optional"` + RunIf types.String `tfsdk:"run_if"` // The task triggers another job when the `run_job_task` field is present. - RunJobTask types.List `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.List `tfsdk:"run_job_task"` // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask types.List `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.List `tfsdk:"spark_jar_task"` // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask types.List `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.List `tfsdk:"spark_python_task"` // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -14543,22 +14930,22 @@ type SubmitTask_SdkV2 struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask types.List `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.List `tfsdk:"spark_submit_task"` // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask types.List `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.List `tfsdk:"sql_task"` // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when the run begins or // completes. The default behavior is to not send any system notifications. // Task webhooks respect the task notification settings. - WebhookNotifications types.List `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.List `tfsdk:"webhook_notifications"` } func (newState *SubmitTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitTask_SdkV2) { @@ -14567,28 +14954,51 @@ func (newState *SubmitTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SubmitTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState SubmitTask_SdkV2) { } -func (c SubmitTask_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomsNotebookTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms_notebook_task")...) - ConditionTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - DbtTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - TaskDependency_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "depends_on")...) - JobEmailNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - ForEachTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "for_each_task")...) - JobsHealthRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - compute_tf.ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) - NotebookTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - TaskNotificationSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - PipelineTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_task")...) - PythonWheelTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - RunJobTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - SparkJarTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - SparkPythonTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - SparkSubmitTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - SqlTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - cs.SetRequired(append(path, "task_key")...) - WebhookNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c SubmitTask_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].SetOptional() + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["depends_on"] = attrs["depends_on"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["environment_key"] = attrs["environment_key"].SetOptional() + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["library"] = attrs["library"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pipeline_task"] = attrs["pipeline_task"].SetOptional() + attrs["pipeline_task"] = attrs["pipeline_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_if"] = attrs["run_if"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["task_key"] = attrs["task_key"].SetRequired() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubmitTask. @@ -15224,19 +15634,19 @@ func (o *SubmitTask_SdkV2) SetWebhookNotifications(ctx context.Context, v Webhoo type TableUpdateTriggerConfiguration_SdkV2 struct { // The table(s) condition based on which to trigger a job run. - Condition types.String `tfsdk:"condition" tf:"optional"` + Condition types.String `tfsdk:"condition"` // If set, the trigger starts a run only after the specified amount of time // has passed since the last time the trigger fired. The minimum allowed // value is 60 seconds. - MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds" tf:"optional"` + MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds"` // A list of Delta tables to monitor for changes. The table name must be in // the format `catalog_name.schema_name.table_name`. - TableNames types.List `tfsdk:"table_names" tf:"optional"` + TableNames types.List `tfsdk:"table_names"` // If set, the trigger starts a run only after no table updates have // occurred for the specified time and can be used to wait for a series of // table updates before triggering a run. The minimum allowed value is 60 // seconds. - WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds" tf:"optional"` + WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds"` } func (newState *TableUpdateTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableUpdateTriggerConfiguration_SdkV2) { @@ -15245,9 +15655,13 @@ func (newState *TableUpdateTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuring func (newState *TableUpdateTriggerConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableUpdateTriggerConfiguration_SdkV2) { } -func (c TableUpdateTriggerConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableUpdateTriggerConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["min_time_between_triggers_seconds"] = attrs["min_time_between_triggers_seconds"].SetOptional() + attrs["table_names"] = attrs["table_names"].SetOptional() + attrs["wait_after_last_change_seconds"] = attrs["wait_after_last_change_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableUpdateTriggerConfiguration. @@ -15322,76 +15736,76 @@ type Task_SdkV2 struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask types.List `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.List `tfsdk:"condition_task"` // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask types.List `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.List `tfsdk:"dbt_task"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete before executing this // task. The task will run only if the `run_if` condition is true. The key // is `task_key`, and the value is the name assigned to the dependent task. - DependsOn types.List `tfsdk:"depends_on" tf:"optional"` + DependsOn types.List `tfsdk:"depends_on"` // An optional description for this task. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // An option to disable auto optimization in serverless - DisableAutoOptimization types.Bool `tfsdk:"disable_auto_optimization" tf:"optional"` + DisableAutoOptimization types.Bool `tfsdk:"disable_auto_optimization"` // An optional set of email addresses that is notified when runs of this // task begin or complete as well as when this task is deleted. The default // behavior is to not send any emails. - EmailNotifications types.List `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.List `tfsdk:"email_notifications"` // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey types.String `tfsdk:"environment_key" tf:"optional"` + EnvironmentKey types.String `tfsdk:"environment_key"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask types.List `tfsdk:"for_each_task" tf:"optional,object"` + ForEachTask types.List `tfsdk:"for_each_task"` // An optional set of health rules that can be defined for this job. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:"optional"` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // An optional maximum number of times to retry an unsuccessful run. A run // is considered to be unsuccessful if it completes with the `FAILED` // result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means // to retry indefinitely and the value `0` means to never retry. - MaxRetries types.Int64 `tfsdk:"max_retries" tf:"optional"` + MaxRetries types.Int64 `tfsdk:"max_retries"` // An optional minimal interval in milliseconds between the start of the // failed run and the subsequent retry run. The default behavior is that // unsuccessful runs are immediately retried. - MinRetryIntervalMillis types.Int64 `tfsdk:"min_retry_interval_millis" tf:"optional"` + MinRetryIntervalMillis types.Int64 `tfsdk:"min_retry_interval_millis"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.List `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.List `tfsdk:"new_cluster"` // The task runs a notebook when the `notebook_task` field is present. - NotebookTask types.List `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.List `tfsdk:"notebook_task"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task. - NotificationSettings types.List `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.List `tfsdk:"notification_settings"` // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask types.List `tfsdk:"pipeline_task" tf:"optional,object"` + PipelineTask types.List `tfsdk:"pipeline_task"` // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask types.List `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.List `tfsdk:"python_wheel_task"` // An optional policy to specify whether to retry a job when it times out. // The default behavior is to not retry on timeout. - RetryOnTimeout types.Bool `tfsdk:"retry_on_timeout" tf:"optional"` + RetryOnTimeout types.Bool `tfsdk:"retry_on_timeout"` // An optional value specifying the condition determining whether the task // is run once its dependencies have been completed. // @@ -15401,14 +15815,14 @@ type Task_SdkV2 struct { // executed * `ALL_DONE`: All dependencies have been completed * // `AT_LEAST_ONE_FAILED`: At least one dependency failed * `ALL_FAILED`: ALl // dependencies have failed - RunIf types.String `tfsdk:"run_if" tf:"optional"` + RunIf types.String `tfsdk:"run_if"` // The task triggers another job when the `run_job_task` field is present. - RunJobTask types.List `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.List `tfsdk:"run_job_task"` // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask types.List `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.List `tfsdk:"spark_jar_task"` // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask types.List `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.List `tfsdk:"spark_python_task"` // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -15427,22 +15841,22 @@ type Task_SdkV2 struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask types.List `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.List `tfsdk:"spark_submit_task"` // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask types.List `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.List `tfsdk:"sql_task"` // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when runs of this task // begin or complete. The default behavior is to not send any system // notifications. - WebhookNotifications types.List `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.List `tfsdk:"webhook_notifications"` } func (newState *Task_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Task_SdkV2) { @@ -15451,28 +15865,56 @@ func (newState *Task_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Task_Sd func (newState *Task_SdkV2) SyncEffectiveFieldsDuringRead(existingState Task_SdkV2) { } -func (c Task_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomsNotebookTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms_notebook_task")...) - ConditionTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - DbtTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - TaskDependency_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "depends_on")...) - TaskEmailNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - ForEachTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "for_each_task")...) - JobsHealthRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - compute_tf.ClusterSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) - NotebookTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - TaskNotificationSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - PipelineTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pipeline_task")...) - PythonWheelTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - RunJobTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - SparkJarTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - SparkPythonTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - SparkSubmitTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - SqlTask_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - cs.SetRequired(append(path, "task_key")...) - WebhookNotifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c Task_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].SetOptional() + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["depends_on"] = attrs["depends_on"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["disable_auto_optimization"] = attrs["disable_auto_optimization"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["environment_key"] = attrs["environment_key"].SetOptional() + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["max_retries"] = attrs["max_retries"].SetOptional() + attrs["min_retry_interval_millis"] = attrs["min_retry_interval_millis"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pipeline_task"] = attrs["pipeline_task"].SetOptional() + attrs["pipeline_task"] = attrs["pipeline_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["retry_on_timeout"] = attrs["retry_on_timeout"].SetOptional() + attrs["run_if"] = attrs["run_if"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["task_key"] = attrs["task_key"].SetRequired() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Task. @@ -16119,9 +16561,9 @@ func (o *Task_SdkV2) SetWebhookNotifications(ctx context.Context, v WebhookNotif type TaskDependency_SdkV2 struct { // Can only be specified on condition task dependencies. The outcome of the // dependent task that must be met for this task to run. - Outcome types.String `tfsdk:"outcome" tf:"optional"` + Outcome types.String `tfsdk:"outcome"` // The name of the task this task depends on. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` } func (newState *TaskDependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TaskDependency_SdkV2) { @@ -16130,10 +16572,11 @@ func (newState *TaskDependency_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *TaskDependency_SdkV2) SyncEffectiveFieldsDuringRead(existingState TaskDependency_SdkV2) { } -func (c TaskDependency_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "task_key")...) +func (c TaskDependency_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["outcome"] = attrs["outcome"].SetOptional() + attrs["task_key"] = attrs["task_key"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TaskDependency. @@ -16173,22 +16616,22 @@ type TaskEmailNotifications_SdkV2 struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the // `notification_settings.no_alert_for_skipped_runs` field. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` // A list of email addresses to be notified when the duration of a run // exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in // the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is // specified in the `health` field for the job, notifications are not sent. - OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded" tf:"optional"` + OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded"` // A list of email addresses to be notified when a run unsuccessfully // completes. A run is considered to have completed unsuccessfully if it // ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. - OnFailure types.List `tfsdk:"on_failure" tf:"optional"` + OnFailure types.List `tfsdk:"on_failure"` // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnStart types.List `tfsdk:"on_start" tf:"optional"` + OnStart types.List `tfsdk:"on_start"` // A list of email addresses to notify when any streaming backlog thresholds // are exceeded for any stream. Streaming backlog thresholds can be set in // the `health` field using the following metrics: @@ -16196,13 +16639,13 @@ type TaskEmailNotifications_SdkV2 struct { // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded" tf:"optional"` + OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded"` // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If // not specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnSuccess types.List `tfsdk:"on_success" tf:"optional"` + OnSuccess types.List `tfsdk:"on_success"` } func (newState *TaskEmailNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TaskEmailNotifications_SdkV2) { @@ -16211,9 +16654,15 @@ func (newState *TaskEmailNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *TaskEmailNotifications_SdkV2) SyncEffectiveFieldsDuringRead(existingState TaskEmailNotifications_SdkV2) { } -func (c TaskEmailNotifications_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TaskEmailNotifications_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() + attrs["on_duration_warning_threshold_exceeded"] = attrs["on_duration_warning_threshold_exceeded"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_start"] = attrs["on_start"].SetOptional() + attrs["on_streaming_backlog_exceeded"] = attrs["on_streaming_backlog_exceeded"].SetOptional() + attrs["on_success"] = attrs["on_success"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TaskEmailNotifications. @@ -16407,13 +16856,13 @@ type TaskNotificationSettings_SdkV2 struct { // If true, do not send notifications to recipients specified in `on_start` // for the retried runs and do not send notifications to recipients // specified in `on_failure` until the last retry of the run. - AlertOnLastAttempt types.Bool `tfsdk:"alert_on_last_attempt" tf:"optional"` + AlertOnLastAttempt types.Bool `tfsdk:"alert_on_last_attempt"` // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. - NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs" tf:"optional"` + NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs"` // If true, do not send notifications to recipients specified in // `on_failure` if the run is skipped. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` } func (newState *TaskNotificationSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TaskNotificationSettings_SdkV2) { @@ -16422,9 +16871,12 @@ func (newState *TaskNotificationSettings_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *TaskNotificationSettings_SdkV2) SyncEffectiveFieldsDuringRead(existingState TaskNotificationSettings_SdkV2) { } -func (c TaskNotificationSettings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TaskNotificationSettings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_on_last_attempt"] = attrs["alert_on_last_attempt"].SetOptional() + attrs["no_alert_for_canceled_runs"] = attrs["no_alert_for_canceled_runs"].SetOptional() + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TaskNotificationSettings. @@ -16508,10 +16960,10 @@ type TerminationDetails_SdkV2 struct { // The run was skipped due to reaching the job level queue size limit. // // [Link]: https://kb.databricks.com/en_US/notebooks/too-many-execution-contexts-are-open-right-now - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // A descriptive message with the termination details. This field is // unstructured and the format might change. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // * `SUCCESS`: The run terminated without any issues * `INTERNAL_ERROR`: An // error occurred in the Databricks platform. Please look at the [status // page] or contact support if the issue persists. * `CLIENT_ERROR`: The run @@ -16520,7 +16972,7 @@ type TerminationDetails_SdkV2 struct { // issue with your cloud provider. // // [status page]: https://status.databricks.com/ - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *TerminationDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TerminationDetails_SdkV2) { @@ -16529,9 +16981,12 @@ func (newState *TerminationDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *TerminationDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState TerminationDetails_SdkV2) { } -func (c TerminationDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TerminationDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TerminationDetails. @@ -16572,7 +17027,7 @@ func (o TerminationDetails_SdkV2) Type(ctx context.Context) attr.Type { // Additional details about what triggered the run type TriggerInfo_SdkV2 struct { // The run id of the Run Job task run - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *TriggerInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TriggerInfo_SdkV2) { @@ -16581,9 +17036,10 @@ func (newState *TriggerInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TriggerInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState TriggerInfo_SdkV2) { } -func (c TriggerInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TriggerInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TriggerInfo. @@ -16619,15 +17075,15 @@ func (o TriggerInfo_SdkV2) Type(ctx context.Context) attr.Type { type TriggerSettings_SdkV2 struct { // File arrival trigger settings. - FileArrival types.List `tfsdk:"file_arrival" tf:"optional,object"` + FileArrival types.List `tfsdk:"file_arrival"` // Whether this trigger is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // Periodic trigger settings. - Periodic types.List `tfsdk:"periodic" tf:"optional,object"` + Periodic types.List `tfsdk:"periodic"` // Old table trigger settings name. Deprecated in favor of `table_update`. - Table types.List `tfsdk:"table" tf:"optional,object"` + Table types.List `tfsdk:"table"` - TableUpdate types.List `tfsdk:"table_update" tf:"optional,object"` + TableUpdate types.List `tfsdk:"table_update"` } func (newState *TriggerSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TriggerSettings_SdkV2) { @@ -16636,13 +17092,18 @@ func (newState *TriggerSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *TriggerSettings_SdkV2) SyncEffectiveFieldsDuringRead(existingState TriggerSettings_SdkV2) { } -func (c TriggerSettings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileArrivalTriggerConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file_arrival")...) - PeriodicTriggerConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "periodic")...) - TableUpdateTriggerConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table")...) - TableUpdateTriggerConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_update")...) +func (c TriggerSettings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_arrival"] = attrs["file_arrival"].SetOptional() + attrs["file_arrival"] = attrs["file_arrival"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["periodic"] = attrs["periodic"].SetOptional() + attrs["periodic"] = attrs["periodic"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table"] = attrs["table"].SetOptional() + attrs["table"] = attrs["table"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table_update"] = attrs["table_update"].SetOptional() + attrs["table_update"] = attrs["table_update"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TriggerSettings. @@ -16805,9 +17266,9 @@ type UpdateJob_SdkV2 struct { // Remove top-level fields in the job settings. Removing nested fields is // not supported, except for tasks and job clusters (`tasks/task_1`). This // field is optional. - FieldsToRemove types.List `tfsdk:"fields_to_remove" tf:"optional"` + FieldsToRemove types.List `tfsdk:"fields_to_remove"` // The canonical identifier of the job to update. This field is required. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // The new settings for the job. // // Top-level fields specified in `new_settings` are completely replaced, @@ -16819,7 +17280,7 @@ type UpdateJob_SdkV2 struct { // // Changes to the field `JobSettings.timeout_seconds` are applied to active // runs. Changes to other fields are applied to future runs only. - NewSettings types.List `tfsdk:"new_settings" tf:"optional,object"` + NewSettings types.List `tfsdk:"new_settings"` } func (newState *UpdateJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateJob_SdkV2) { @@ -16828,11 +17289,13 @@ func (newState *UpdateJob_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Up func (newState *UpdateJob_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateJob_SdkV2) { } -func (c UpdateJob_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - JobSettings_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "new_settings")...) +func (c UpdateJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fields_to_remove"] = attrs["fields_to_remove"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["new_settings"] = attrs["new_settings"].SetOptional() + attrs["new_settings"] = attrs["new_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateJob. @@ -16961,13 +17424,13 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type ViewItem_SdkV2 struct { // Content of the view. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // Name of the view item. In the case of code view, it would be the // notebook’s name. In the case of dashboard view, it would be the // dashboard’s name. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Type of the view item. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *ViewItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ViewItem_SdkV2) { @@ -16976,9 +17439,12 @@ func (newState *ViewItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Vie func (newState *ViewItem_SdkV2) SyncEffectiveFieldsDuringRead(existingState ViewItem_SdkV2) { } -func (c ViewItem_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ViewItem_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ViewItem. @@ -17017,7 +17483,7 @@ func (o ViewItem_SdkV2) Type(ctx context.Context) attr.Type { } type Webhook_SdkV2 struct { - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *Webhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Webhook_SdkV2) { @@ -17026,10 +17492,10 @@ func (newState *Webhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Webh func (newState *Webhook_SdkV2) SyncEffectiveFieldsDuringRead(existingState Webhook_SdkV2) { } -func (c Webhook_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c Webhook_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Webhook. @@ -17068,13 +17534,13 @@ type WebhookNotifications_SdkV2 struct { // a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` // metric in the `health` field. A maximum of 3 destinations can be // specified for the `on_duration_warning_threshold_exceeded` property. - OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded" tf:"optional"` + OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded"` // An optional list of system notification IDs to call when the run fails. A // maximum of 3 destinations can be specified for the `on_failure` property. - OnFailure types.List `tfsdk:"on_failure" tf:"optional"` + OnFailure types.List `tfsdk:"on_failure"` // An optional list of system notification IDs to call when the run starts. // A maximum of 3 destinations can be specified for the `on_start` property. - OnStart types.List `tfsdk:"on_start" tf:"optional"` + OnStart types.List `tfsdk:"on_start"` // An optional list of system notification IDs to call when any streaming // backlog thresholds are exceeded for any stream. Streaming backlog // thresholds can be set in the `health` field using the following metrics: @@ -17083,11 +17549,11 @@ type WebhookNotifications_SdkV2 struct { // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. A maximum of 3 destinations // can be specified for the `on_streaming_backlog_exceeded` property. - OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded" tf:"optional"` + OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded"` // An optional list of system notification IDs to call when the run // completes successfully. A maximum of 3 destinations can be specified for // the `on_success` property. - OnSuccess types.List `tfsdk:"on_success" tf:"optional"` + OnSuccess types.List `tfsdk:"on_success"` } func (newState *WebhookNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WebhookNotifications_SdkV2) { @@ -17096,14 +17562,14 @@ func (newState *WebhookNotifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *WebhookNotifications_SdkV2) SyncEffectiveFieldsDuringRead(existingState WebhookNotifications_SdkV2) { } -func (c WebhookNotifications_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Webhook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_duration_warning_threshold_exceeded")...) - Webhook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_failure")...) - Webhook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_start")...) - Webhook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_streaming_backlog_exceeded")...) - Webhook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "on_success")...) +func (c WebhookNotifications_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["on_duration_warning_threshold_exceeded"] = attrs["on_duration_warning_threshold_exceeded"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_start"] = attrs["on_start"].SetOptional() + attrs["on_streaming_backlog_exceeded"] = attrs["on_streaming_backlog_exceeded"].SetOptional() + attrs["on_success"] = attrs["on_success"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WebhookNotifications. diff --git a/internal/service/jobs_tf/model.go b/internal/service/jobs_tf/model.go index 6bfb54655..89d3d2b07 100755 --- a/internal/service/jobs_tf/model.go +++ b/internal/service/jobs_tf/model.go @@ -26,22 +26,22 @@ import ( type BaseJob struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). - CreatedTime types.Int64 `tfsdk:"created_time" tf:"optional"` + CreatedTime types.Int64 `tfsdk:"created_time"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // The id of the budget policy used by this job for cost attribution // purposes. This may be set through (in order of precedence): 1. Budget // admins through the account or workspace console 2. Jobs UI in the job // details page and Jobs API using `budget_policy_id` 3. Inferred default // based on accessible budget policies of the run_as identity on job // creation or modification. - EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` // The canonical identifier for this job. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // Settings for this job and all of its runs. These settings can be updated // using the `resetJob` method. - Settings types.Object `tfsdk:"settings" tf:"optional,object"` + Settings types.Object `tfsdk:"settings"` } func (newState *BaseJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseJob) { @@ -50,11 +50,14 @@ func (newState *BaseJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseJob) { func (newState *BaseJob) SyncEffectiveFieldsDuringRead(existingState BaseJob) { } -func (c BaseJob) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "effective_budget_policy_id")...) - JobSettings{}.ApplySchemaCustomizations(cs, append(path, "settings")...) +func (c BaseJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_time"] = attrs["created_time"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["settings"] = attrs["settings"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BaseJob. @@ -134,28 +137,28 @@ type BaseRun struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + AttemptNumber types.Int64 `tfsdk:"attempt_number"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration types.Int64 `tfsdk:"cleanup_duration" tf:"optional"` + CleanupDuration types.Int64 `tfsdk:"cleanup_duration"` // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance types.Object `tfsdk:"cluster_instance" tf:"optional,object"` + ClusterInstance types.Object `tfsdk:"cluster_instance"` // A snapshot of the job’s cluster specification when this run was // created. - ClusterSpec types.Object `tfsdk:"cluster_spec" tf:"optional,object"` + ClusterSpec types.Object `tfsdk:"cluster_spec"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Description of the run - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -163,7 +166,7 @@ type BaseRun struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration types.Int64 `tfsdk:"execution_duration" tf:"optional"` + ExecutionDuration types.Int64 `tfsdk:"execution_duration"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -174,53 +177,53 @@ type BaseRun struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.Object `tfsdk:"git_source" tf:"optional,object"` + GitSource types.Object `tfsdk:"git_source"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_clusters" tf:"optional"` + JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used in the run - JobParameters types.List `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.List `tfsdk:"job_parameters"` // ID of the job run that this run belongs to. For legacy and single-task // job runs the field is populated with the job run ID. For task runs, the // field is populated with the ID of the job run that the task run belongs // to. - JobRunId types.Int64 `tfsdk:"job_run_id" tf:"optional"` + JobRunId types.Int64 `tfsdk:"job_run_id"` // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob types.Int64 `tfsdk:"number_in_job" tf:"optional"` + NumberInJob types.Int64 `tfsdk:"number_in_job"` // If this run is a retry of a prior run attempt, this field contains the // run_id of the original attempt; otherwise, it is the same as the run_id. - OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id" tf:"optional"` + OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id"` // The parameters used for this run. - OverridingParameters types.Object `tfsdk:"overriding_parameters" tf:"optional,object"` + OverridingParameters types.Object `tfsdk:"overriding_parameters"` // The time in milliseconds that the run has spent in the queue. - QueueDuration types.Int64 `tfsdk:"queue_duration" tf:"optional"` + QueueDuration types.Int64 `tfsdk:"queue_duration"` // The repair history of the run. - RepairHistory types.List `tfsdk:"repair_history" tf:"optional"` + RepairHistory types.List `tfsdk:"repair_history"` // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` // An optional name for the run. The maximum length is 4096 bytes in UTF-8 // encoding. - RunName types.String `tfsdk:"run_name" tf:"optional"` + RunName types.String `tfsdk:"run_name"` // The URL to the detail page of the run. - RunPageUrl types.String `tfsdk:"run_page_url" tf:"optional"` + RunPageUrl types.String `tfsdk:"run_page_url"` // The type of a run. * `JOB_RUN`: Normal job run. A run created with // :method:jobs/runNow. * `WORKFLOW_RUN`: Workflow run. A run created with // [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit run. A run created with // :method:jobs/submit. // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow - RunType types.String `tfsdk:"run_type" tf:"optional"` + RunType types.String `tfsdk:"run_type"` // The cron schedule that triggered this run if it was triggered by the // periodic scheduler. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -228,19 +231,19 @@ type BaseRun struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration types.Int64 `tfsdk:"setup_duration" tf:"optional"` + SetupDuration types.Int64 `tfsdk:"setup_duration"` // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The current status of the run - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` // which you can use to call `JobsGetOutput` to retrieve the run resutls. - Tasks types.List `tfsdk:"tasks" tf:"optional"` + Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // // * `PERIODIC`: Schedules that periodically trigger runs, such as a cron @@ -253,9 +256,9 @@ type BaseRun struct { // arrival. * `TABLE`: Indicates a run that is triggered by a table update. // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually // restart a continuous job run. - Trigger types.String `tfsdk:"trigger" tf:"optional"` + Trigger types.String `tfsdk:"trigger"` // Additional details about what triggered the run - TriggerInfo types.Object `tfsdk:"trigger_info" tf:"optional,object"` + TriggerInfo types.Object `tfsdk:"trigger_info"` } func (newState *BaseRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseRun) { @@ -264,21 +267,40 @@ func (newState *BaseRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseRun) { func (newState *BaseRun) SyncEffectiveFieldsDuringRead(existingState BaseRun) { } -func (c BaseRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterInstance{}.ApplySchemaCustomizations(cs, append(path, "cluster_instance")...) - ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "cluster_spec")...) - GitSource{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobCluster{}.ApplySchemaCustomizations(cs, append(path, "job_clusters")...) - JobParameter{}.ApplySchemaCustomizations(cs, append(path, "job_parameters")...) - RunParameters{}.ApplySchemaCustomizations(cs, append(path, "overriding_parameters")...) - RepairHistoryItem{}.ApplySchemaCustomizations(cs, append(path, "repair_history")...) - CronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - RunState{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - RunTask{}.ApplySchemaCustomizations(cs, append(path, "tasks")...) - TriggerInfo{}.ApplySchemaCustomizations(cs, append(path, "trigger_info")...) - - return cs +func (c BaseRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attempt_number"] = attrs["attempt_number"].SetOptional() + attrs["cleanup_duration"] = attrs["cleanup_duration"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].SetOptional() + attrs["cluster_spec"] = attrs["cluster_spec"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["execution_duration"] = attrs["execution_duration"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["job_clusters"] = attrs["job_clusters"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["job_run_id"] = attrs["job_run_id"].SetOptional() + attrs["number_in_job"] = attrs["number_in_job"].SetOptional() + attrs["original_attempt_run_id"] = attrs["original_attempt_run_id"].SetOptional() + attrs["overriding_parameters"] = attrs["overriding_parameters"].SetOptional() + attrs["queue_duration"] = attrs["queue_duration"].SetOptional() + attrs["repair_history"] = attrs["repair_history"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_name"] = attrs["run_name"].SetOptional() + attrs["run_page_url"] = attrs["run_page_url"].SetOptional() + attrs["run_type"] = attrs["run_type"].SetOptional() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["setup_duration"] = attrs["setup_duration"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["tasks"] = attrs["tasks"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger_info"] = attrs["trigger_info"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BaseRun. @@ -724,9 +746,9 @@ func (o *BaseRun) SetTriggerInfo(ctx context.Context, v TriggerInfo) { type CancelAllRuns struct { // Optional boolean parameter to cancel all queued runs. If no job_id is // provided, all queued runs in the workspace are canceled. - AllQueuedRuns types.Bool `tfsdk:"all_queued_runs" tf:"optional"` + AllQueuedRuns types.Bool `tfsdk:"all_queued_runs"` // The canonical identifier of the job to cancel all runs of. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` } func (newState *CancelAllRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelAllRuns) { @@ -735,9 +757,11 @@ func (newState *CancelAllRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan Canc func (newState *CancelAllRuns) SyncEffectiveFieldsDuringRead(existingState CancelAllRuns) { } -func (c CancelAllRuns) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CancelAllRuns) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_queued_runs"] = attrs["all_queued_runs"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CancelAllRuns. @@ -805,7 +829,7 @@ func (o CancelAllRunsResponse) Type(ctx context.Context) attr.Type { type CancelRun struct { // This field is required. - RunId types.Int64 `tfsdk:"run_id" tf:""` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *CancelRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelRun) { @@ -814,10 +838,10 @@ func (newState *CancelRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan CancelRu func (newState *CancelRun) SyncEffectiveFieldsDuringRead(existingState CancelRun) { } -func (c CancelRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c CancelRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CancelRun. @@ -885,10 +909,10 @@ func (o CancelRunResponse) Type(ctx context.Context) attr.Type { type CleanRoomTaskRunState struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. - LifeCycleState types.String `tfsdk:"life_cycle_state" tf:"optional"` + LifeCycleState types.String `tfsdk:"life_cycle_state"` // A value indicating the run's result. This field is only available for // terminal lifecycle states. - ResultState types.String `tfsdk:"result_state" tf:"optional"` + ResultState types.String `tfsdk:"result_state"` } func (newState *CleanRoomTaskRunState) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomTaskRunState) { @@ -897,9 +921,11 @@ func (newState *CleanRoomTaskRunState) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CleanRoomTaskRunState) SyncEffectiveFieldsDuringRead(existingState CleanRoomTaskRunState) { } -func (c CleanRoomTaskRunState) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CleanRoomTaskRunState) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["life_cycle_state"] = attrs["life_cycle_state"].SetOptional() + attrs["result_state"] = attrs["result_state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomTaskRunState. @@ -937,15 +963,15 @@ func (o CleanRoomTaskRunState) Type(ctx context.Context) attr.Type { type CleanRoomsNotebookTask struct { // The clean room that the notebook belongs to. - CleanRoomName types.String `tfsdk:"clean_room_name" tf:""` + CleanRoomName types.String `tfsdk:"clean_room_name"` // Checksum to validate the freshness of the notebook resource (i.e. the // notebook being run is the latest version). It can be fetched by calling // the :method:cleanroomassets/get API. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Base parameters to be used for the clean room notebook job. - NotebookBaseParameters types.Map `tfsdk:"notebook_base_parameters" tf:"optional"` + NotebookBaseParameters types.Map `tfsdk:"notebook_base_parameters"` // Name of the notebook being run. - NotebookName types.String `tfsdk:"notebook_name" tf:""` + NotebookName types.String `tfsdk:"notebook_name"` } func (newState *CleanRoomsNotebookTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomsNotebookTask) { @@ -954,11 +980,13 @@ func (newState *CleanRoomsNotebookTask) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CleanRoomsNotebookTask) SyncEffectiveFieldsDuringRead(existingState CleanRoomsNotebookTask) { } -func (c CleanRoomsNotebookTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "clean_room_name")...) - cs.SetRequired(append(path, "notebook_name")...) +func (c CleanRoomsNotebookTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_room_name"] = attrs["clean_room_name"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["notebook_base_parameters"] = attrs["notebook_base_parameters"].SetOptional() + attrs["notebook_name"] = attrs["notebook_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomsNotebookTask. @@ -1037,7 +1065,7 @@ type ClusterInstance struct { // // The response won’t include this field if the identifier is not // available yet. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The canonical identifier for the Spark context used by a run. This field // is filled in once the run begins execution. This value can be used to // view the Spark UI by browsing to @@ -1046,7 +1074,7 @@ type ClusterInstance struct { // // The response won’t include this field if the identifier is not // available yet. - SparkContextId types.String `tfsdk:"spark_context_id" tf:"optional"` + SparkContextId types.String `tfsdk:"spark_context_id"` } func (newState *ClusterInstance) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterInstance) { @@ -1055,9 +1083,11 @@ func (newState *ClusterInstance) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cl func (newState *ClusterInstance) SyncEffectiveFieldsDuringRead(existingState ClusterInstance) { } -func (c ClusterInstance) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterInstance) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["spark_context_id"] = attrs["spark_context_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterInstance. @@ -1098,16 +1128,16 @@ type ClusterSpec struct { // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:"optional"` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.Object `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.Object `tfsdk:"new_cluster"` } func (newState *ClusterSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterSpec) { @@ -1116,10 +1146,13 @@ func (newState *ClusterSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cluste func (newState *ClusterSpec) SyncEffectiveFieldsDuringRead(existingState ClusterSpec) { } -func (c ClusterSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - compute_tf.ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) +func (c ClusterSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterSpec. @@ -1221,7 +1254,7 @@ func (o *ClusterSpec) SetNewCluster(ctx context.Context, v compute_tf.ClusterSpe type ConditionTask struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. - Left types.String `tfsdk:"left" tf:""` + Left types.String `tfsdk:"left"` // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their // operands. This means that `“12.0” == “12”` will evaluate to // `false`. * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, @@ -1232,10 +1265,10 @@ type ConditionTask struct { // The boolean comparison to task values can be implemented with operators // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it // will be serialized to `“true”` or `“false”` for the comparison. - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // The right operand of the condition task. Can be either a string value or // a job state or parameter reference. - Right types.String `tfsdk:"right" tf:""` + Right types.String `tfsdk:"right"` } func (newState *ConditionTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan ConditionTask) { @@ -1244,12 +1277,12 @@ func (newState *ConditionTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cond func (newState *ConditionTask) SyncEffectiveFieldsDuringRead(existingState ConditionTask) { } -func (c ConditionTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "left")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "right")...) +func (c ConditionTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["left"] = attrs["left"].SetRequired() + attrs["op"] = attrs["op"].SetRequired() + attrs["right"] = attrs["right"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ConditionTask. @@ -1290,7 +1323,7 @@ func (o ConditionTask) Type(ctx context.Context) attr.Type { type Continuous struct { // Indicate whether the continuous execution of the job is paused or not. // Defaults to UNPAUSED. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` } func (newState *Continuous) SyncEffectiveFieldsDuringCreateOrUpdate(plan Continuous) { @@ -1299,9 +1332,10 @@ func (newState *Continuous) SyncEffectiveFieldsDuringCreateOrUpdate(plan Continu func (newState *Continuous) SyncEffectiveFieldsDuringRead(existingState Continuous) { } -func (c Continuous) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Continuous) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pause_status"] = attrs["pause_status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Continuous. @@ -1337,40 +1371,40 @@ func (o Continuous) Type(ctx context.Context) attr.Type { type CreateJob struct { // List of permissions to set on the job. - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The id of the user specified budget policy to use for this job. If not // specified, a default budget policy may be applied when creating or // modifying the job. See `effective_budget_policy_id` for the budget policy // used by this workload. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. - Continuous types.Object `tfsdk:"continuous" tf:"optional,object"` + Continuous types.Object `tfsdk:"continuous"` // Deployment information for jobs managed by external sources. - Deployment types.Object `tfsdk:"deployment" tf:"optional,object"` + Deployment types.Object `tfsdk:"deployment"` // An optional description for the job. The maximum length is 27700 // characters in UTF-8 encoding. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. - EditMode types.String `tfsdk:"edit_mode" tf:"optional"` + EditMode types.String `tfsdk:"edit_mode"` // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. - EmailNotifications types.Object `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.Object `tfsdk:"email_notifications"` // A list of task execution environment specifications that can be // referenced by serverless tasks of this job. An environment is required to // be present for serverless tasks. For serverless notebook tasks, the // environment is accessible in the notebook environment panel. For other // serverless tasks, the task environment is required to be specified using // environment_key in the task settings. - Environments types.List `tfsdk:"environment" tf:"optional"` + Environments types.List `tfsdk:"environment"` // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -1381,13 +1415,13 @@ type CreateJob struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.Object `tfsdk:"git_source" tf:"optional,object"` + GitSource types.Object `tfsdk:"git_source"` // An optional set of health rules that can be defined for this job. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_cluster" tf:"optional"` + JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same // job concurrently. This is useful for example if you trigger your job on a @@ -1399,45 +1433,45 @@ type CreateJob struct { // runs. However, from then on, new runs are skipped unless there are fewer // than 3 active runs. This value cannot exceed 1000. Setting this value to // `0` causes all new runs to be skipped. - MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs" tf:"optional"` + MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs"` // An optional name for the job. The maximum length is 4096 bytes in UTF-8 // encoding. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // job. - NotificationSettings types.Object `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.Object `tfsdk:"notification_settings"` // Job-level parameter definitions - Parameters types.List `tfsdk:"parameter" tf:"optional"` + Parameters types.List `tfsdk:"parameter"` // The queue settings of the job. - Queue types.Object `tfsdk:"queue" tf:"optional,object"` + Queue types.Object `tfsdk:"queue"` // Write-only setting. Specifies the user or service principal that the job // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. - RunAs types.Object `tfsdk:"run_as" tf:"optional,object"` + RunAs types.Object `tfsdk:"run_as"` // An optional periodic schedule for this job. The default behavior is that // the job only runs when triggered by clicking “Run Now” in the Jobs UI // or sending an API request to `runNow`. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // A map of tags associated with the job. These are forwarded to the cluster // as cluster tags for jobs clusters, and are subject to the same // limitations as cluster tags. A maximum of 25 tags can be added to the // job. - Tags types.Map `tfsdk:"tags" tf:"optional"` + Tags types.Map `tfsdk:"tags"` // A list of task specifications to be executed by this job. - Tasks types.List `tfsdk:"task" tf:"optional"` + Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A configuration to trigger a run when certain conditions are met. The // default behavior is that the job runs only when triggered by clicking // “Run Now” in the Jobs UI or sending an API request to `runNow`. - Trigger types.Object `tfsdk:"trigger" tf:"optional,object"` + Trigger types.Object `tfsdk:"trigger"` // A collection of system notification IDs to notify when runs of this job // begin or complete. - WebhookNotifications types.Object `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.Object `tfsdk:"webhook_notifications"` } func (newState *CreateJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateJob) { @@ -1446,25 +1480,33 @@ func (newState *CreateJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateJo func (newState *CreateJob) SyncEffectiveFieldsDuringRead(existingState CreateJob) { } -func (c CreateJob) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - Continuous{}.ApplySchemaCustomizations(cs, append(path, "continuous")...) - JobDeployment{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - JobEmailNotifications{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - JobEnvironment{}.ApplySchemaCustomizations(cs, append(path, "environment")...) - GitSource{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobsHealthRules{}.ApplySchemaCustomizations(cs, append(path, "health")...) - JobCluster{}.ApplySchemaCustomizations(cs, append(path, "job_cluster")...) - JobNotificationSettings{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - JobParameterDefinition{}.ApplySchemaCustomizations(cs, append(path, "parameter")...) - QueueSettings{}.ApplySchemaCustomizations(cs, append(path, "queue")...) - JobRunAs{}.ApplySchemaCustomizations(cs, append(path, "run_as")...) - CronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - Task{}.ApplySchemaCustomizations(cs, append(path, "task")...) - TriggerSettings{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - WebhookNotifications{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c CreateJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["edit_mode"] = attrs["edit_mode"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["environment"] = attrs["environment"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["job_cluster"] = attrs["job_cluster"].SetOptional() + attrs["max_concurrent_runs"] = attrs["max_concurrent_runs"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["parameter"] = attrs["parameter"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateJob. @@ -2041,7 +2083,7 @@ func (o *CreateJob) SetWebhookNotifications(ctx context.Context, v WebhookNotifi // Job was created successfully type CreateResponse struct { // The canonical identifier for the newly created job. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` } func (newState *CreateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateResponse) { @@ -2050,9 +2092,10 @@ func (newState *CreateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CreateResponse) SyncEffectiveFieldsDuringRead(existingState CreateResponse) { } -func (c CreateResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateResponse. @@ -2088,17 +2131,17 @@ func (o CreateResponse) Type(ctx context.Context) attr.Type { type CronSchedule struct { // Indicate whether this schedule is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // A Cron expression using Quartz syntax that describes the schedule for a // job. See [Cron Trigger] for details. This field is required. // // [Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html - QuartzCronExpression types.String `tfsdk:"quartz_cron_expression" tf:""` + QuartzCronExpression types.String `tfsdk:"quartz_cron_expression"` // A Java timezone ID. The schedule for a job is resolved with respect to // this timezone. See [Java TimeZone] for details. This field is required. // // [Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html - TimezoneId types.String `tfsdk:"timezone_id" tf:""` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *CronSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronSchedule) { @@ -2107,11 +2150,12 @@ func (newState *CronSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronS func (newState *CronSchedule) SyncEffectiveFieldsDuringRead(existingState CronSchedule) { } -func (c CronSchedule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "quartz_cron_expression")...) - cs.SetRequired(append(path, "timezone_id")...) +func (c CronSchedule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["quartz_cron_expression"] = attrs["quartz_cron_expression"].SetRequired() + attrs["timezone_id"] = attrs["timezone_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CronSchedule. @@ -2152,11 +2196,11 @@ func (o CronSchedule) Type(ctx context.Context) attr.Type { type DbtOutput struct { // An optional map of headers to send when retrieving the artifact from the // `artifacts_link`. - ArtifactsHeaders types.Map `tfsdk:"artifacts_headers" tf:"optional"` + ArtifactsHeaders types.Map `tfsdk:"artifacts_headers"` // A pre-signed URL to download the (compressed) dbt artifacts. This link is // valid for a limited time (30 minutes). This information is only available // after the run has finished. - ArtifactsLink types.String `tfsdk:"artifacts_link" tf:"optional"` + ArtifactsLink types.String `tfsdk:"artifacts_link"` } func (newState *DbtOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtOutput) { @@ -2165,9 +2209,11 @@ func (newState *DbtOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtOutpu func (newState *DbtOutput) SyncEffectiveFieldsDuringRead(existingState DbtOutput) { } -func (c DbtOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DbtOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifacts_headers"] = attrs["artifacts_headers"].SetOptional() + attrs["artifacts_link"] = attrs["artifacts_link"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DbtOutput. @@ -2238,22 +2284,22 @@ type DbtTask struct { // 3-level namespace of Unity Catalog (catalog / schema / relation). The // catalog value can only be specified if a warehouse_id is specified. // Requires dbt-databricks >= 1.1.1. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // A list of dbt commands to execute. All commands must start with `dbt`. // This parameter must not be empty. A maximum of up to 10 commands can be // provided. - Commands types.List `tfsdk:"commands" tf:""` + Commands types.List `tfsdk:"commands"` // Optional (relative) path to the profiles directory. Can only be specified // if no warehouse_id is specified. If no warehouse_id is specified and this // folder is unset, the root directory is used. - ProfilesDirectory types.String `tfsdk:"profiles_directory" tf:"optional"` + ProfilesDirectory types.String `tfsdk:"profiles_directory"` // Path to the project directory. Optional for Git sourced tasks, in which // case if no value is provided, the root of the Git repository is used. - ProjectDirectory types.String `tfsdk:"project_directory" tf:"optional"` + ProjectDirectory types.String `tfsdk:"project_directory"` // Optional schema to write to. This parameter is only used when a // warehouse_id is also provided. If not provided, the `default` schema is // used. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Optional location type of the project directory. When set to `WORKSPACE`, // the project will be retrieved from the local Databricks workspace. When // set to `GIT`, the project will be retrieved from a Git repository defined @@ -2262,12 +2308,12 @@ type DbtTask struct { // // * `WORKSPACE`: Project is located in Databricks workspace. * `GIT`: // Project is located in cloud Git provider. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // ID of the SQL warehouse to connect to. If provided, we automatically // generate and provide the profile and connection details to dbt. It can be // overridden on a per-command basis by using the `--profiles-dir` command // line argument. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *DbtTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtTask) { @@ -2276,10 +2322,16 @@ func (newState *DbtTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan DbtTask) { func (newState *DbtTask) SyncEffectiveFieldsDuringRead(existingState DbtTask) { } -func (c DbtTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "commands")...) +func (c DbtTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["commands"] = attrs["commands"].SetRequired() + attrs["profiles_directory"] = attrs["profiles_directory"].SetOptional() + attrs["project_directory"] = attrs["project_directory"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DbtTask. @@ -2357,7 +2409,7 @@ func (o *DbtTask) SetCommands(ctx context.Context, v []types.String) { type DeleteJob struct { // The canonical identifier of the job to delete. This field is required. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` } func (newState *DeleteJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteJob) { @@ -2366,10 +2418,10 @@ func (newState *DeleteJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteJo func (newState *DeleteJob) SyncEffectiveFieldsDuringRead(existingState DeleteJob) { } -func (c DeleteJob) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) +func (c DeleteJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteJob. @@ -2435,7 +2487,7 @@ func (o DeleteResponse) Type(ctx context.Context) attr.Type { type DeleteRun struct { // ID of the run to delete. - RunId types.Int64 `tfsdk:"run_id" tf:""` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *DeleteRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRun) { @@ -2444,10 +2496,10 @@ func (newState *DeleteRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRu func (newState *DeleteRun) SyncEffectiveFieldsDuringRead(existingState DeleteRun) { } -func (c DeleteRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c DeleteRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRun. @@ -2516,17 +2568,17 @@ func (o DeleteRunResponse) Type(ctx context.Context) attr.Type { type EnforcePolicyComplianceForJobResponseJobClusterSettingsChange struct { // The field where this change would be made, prepended with the job cluster // key. - Field types.String `tfsdk:"field" tf:"optional"` + Field types.String `tfsdk:"field"` // The new value of this field after enforcing policy compliance (either a // number, a boolean, or a string) converted to a string. This is intended // to be read by a human. The typed new value of this field can be retrieved // by reading the settings field in the API response. - NewValue types.String `tfsdk:"new_value" tf:"optional"` + NewValue types.String `tfsdk:"new_value"` // The previous value of this field before enforcing policy compliance // (either a number, a boolean, or a string) converted to a string. This is // intended to be read by a human. The type of the field can be retrieved by // reading the settings field in the API response. - PreviousValue types.String `tfsdk:"previous_value" tf:"optional"` + PreviousValue types.String `tfsdk:"previous_value"` } func (newState *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) { @@ -2535,9 +2587,12 @@ func (newState *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) S func (newState *EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) SyncEffectiveFieldsDuringRead(existingState EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) { } -func (c EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["field"] = attrs["field"].SetOptional() + attrs["new_value"] = attrs["new_value"].SetOptional() + attrs["previous_value"] = attrs["previous_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforcePolicyComplianceForJobResponseJobClusterSettingsChange. @@ -2577,10 +2632,10 @@ func (o EnforcePolicyComplianceForJobResponseJobClusterSettingsChange) Type(ctx type EnforcePolicyComplianceRequest struct { // The ID of the job you want to enforce policy compliance on. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // If set, previews changes made to the job to comply with its policy, but // does not update the job. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *EnforcePolicyComplianceRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforcePolicyComplianceRequest) { @@ -2589,10 +2644,11 @@ func (newState *EnforcePolicyComplianceRequest) SyncEffectiveFieldsDuringCreateO func (newState *EnforcePolicyComplianceRequest) SyncEffectiveFieldsDuringRead(existingState EnforcePolicyComplianceRequest) { } -func (c EnforcePolicyComplianceRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) +func (c EnforcePolicyComplianceRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforcePolicyComplianceRequest. @@ -2631,18 +2687,18 @@ func (o EnforcePolicyComplianceRequest) Type(ctx context.Context) attr.Type { type EnforcePolicyComplianceResponse struct { // Whether any changes have been made to the job cluster settings for the // job to become compliant with its policies. - HasChanges types.Bool `tfsdk:"has_changes" tf:"optional"` + HasChanges types.Bool `tfsdk:"has_changes"` // A list of job cluster changes that have been made to the job’s cluster // settings in order for all job clusters to become compliant with their // policies. - JobClusterChanges types.List `tfsdk:"job_cluster_changes" tf:"optional"` + JobClusterChanges types.List `tfsdk:"job_cluster_changes"` // Updated job settings after policy enforcement. Policy enforcement only // applies to job clusters that are created when running the job (which are // specified in new_cluster) and does not apply to existing all-purpose // clusters. Updated job settings are derived by applying policy default // values to the existing job clusters in order to satisfy policy // requirements. - Settings types.Object `tfsdk:"settings" tf:"optional,object"` + Settings types.Object `tfsdk:"settings"` } func (newState *EnforcePolicyComplianceResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnforcePolicyComplianceResponse) { @@ -2651,11 +2707,12 @@ func (newState *EnforcePolicyComplianceResponse) SyncEffectiveFieldsDuringCreate func (newState *EnforcePolicyComplianceResponse) SyncEffectiveFieldsDuringRead(existingState EnforcePolicyComplianceResponse) { } -func (c EnforcePolicyComplianceResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EnforcePolicyComplianceForJobResponseJobClusterSettingsChange{}.ApplySchemaCustomizations(cs, append(path, "job_cluster_changes")...) - JobSettings{}.ApplySchemaCustomizations(cs, append(path, "settings")...) +func (c EnforcePolicyComplianceResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_changes"] = attrs["has_changes"].SetOptional() + attrs["job_cluster_changes"] = attrs["job_cluster_changes"].SetOptional() + attrs["settings"] = attrs["settings"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnforcePolicyComplianceResponse. @@ -2759,7 +2816,7 @@ type ExportRunOutput struct { // script]. // // [Python script]: https://docs.databricks.com/en/_static/examples/extract.py - Views types.List `tfsdk:"views" tf:"optional"` + Views types.List `tfsdk:"views"` } func (newState *ExportRunOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExportRunOutput) { @@ -2768,10 +2825,10 @@ func (newState *ExportRunOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ex func (newState *ExportRunOutput) SyncEffectiveFieldsDuringRead(existingState ExportRunOutput) { } -func (c ExportRunOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ViewItem{}.ApplySchemaCustomizations(cs, append(path, "views")...) +func (c ExportRunOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["views"] = attrs["views"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExportRunOutput. @@ -2880,15 +2937,15 @@ type FileArrivalTriggerConfiguration struct { // If set, the trigger starts a run only after the specified amount of time // passed since the last time the trigger fired. The minimum allowed value // is 60 seconds - MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds" tf:"optional"` + MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds"` // URL to be monitored for file arrivals. The path must point to the root or // a subpath of the external location. - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` // If set, the trigger starts a run only after no file activity has occurred // for the specified amount of time. This makes it possible to wait for a // batch of incoming files to arrive before triggering a run. The minimum // allowed value is 60 seconds. - WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds" tf:"optional"` + WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds"` } func (newState *FileArrivalTriggerConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileArrivalTriggerConfiguration) { @@ -2897,10 +2954,12 @@ func (newState *FileArrivalTriggerConfiguration) SyncEffectiveFieldsDuringCreate func (newState *FileArrivalTriggerConfiguration) SyncEffectiveFieldsDuringRead(existingState FileArrivalTriggerConfiguration) { } -func (c FileArrivalTriggerConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "url")...) +func (c FileArrivalTriggerConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["min_time_between_triggers_seconds"] = attrs["min_time_between_triggers_seconds"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() + attrs["wait_after_last_change_seconds"] = attrs["wait_after_last_change_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileArrivalTriggerConfiguration. @@ -2940,9 +2999,9 @@ func (o FileArrivalTriggerConfiguration) Type(ctx context.Context) attr.Type { type ForEachStats struct { // Sample of 3 most common error messages occurred during the iteration. - ErrorMessageStats types.List `tfsdk:"error_message_stats" tf:"optional"` + ErrorMessageStats types.List `tfsdk:"error_message_stats"` // Describes stats of the iteration. Only latest retries are considered. - TaskRunStats types.Object `tfsdk:"task_run_stats" tf:"optional,object"` + TaskRunStats types.Object `tfsdk:"task_run_stats"` } func (newState *ForEachStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachStats) { @@ -2951,11 +3010,11 @@ func (newState *ForEachStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEa func (newState *ForEachStats) SyncEffectiveFieldsDuringRead(existingState ForEachStats) { } -func (c ForEachStats) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ForEachTaskErrorMessageStats{}.ApplySchemaCustomizations(cs, append(path, "error_message_stats")...) - ForEachTaskTaskRunStats{}.ApplySchemaCustomizations(cs, append(path, "task_run_stats")...) +func (c ForEachStats) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_message_stats"] = attrs["error_message_stats"].SetOptional() + attrs["task_run_stats"] = attrs["task_run_stats"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachStats. @@ -3054,12 +3113,12 @@ type ForEachTask struct { // An optional maximum allowed number of concurrent runs of the task. Set // this value if you want to be able to execute multiple runs of the task // concurrently. - Concurrency types.Int64 `tfsdk:"concurrency" tf:"optional"` + Concurrency types.Int64 `tfsdk:"concurrency"` // Array for task to iterate on. This can be a JSON string or a reference to // an array parameter. - Inputs types.String `tfsdk:"inputs" tf:""` + Inputs types.String `tfsdk:"inputs"` // Configuration for the task that will be run for each element in the array - Task types.Object `tfsdk:"task" tf:"object"` + Task types.Object `tfsdk:"task"` } func (newState *ForEachTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachTask) { @@ -3068,12 +3127,12 @@ func (newState *ForEachTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEac func (newState *ForEachTask) SyncEffectiveFieldsDuringRead(existingState ForEachTask) { } -func (c ForEachTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "inputs")...) - cs.SetRequired(append(path, "task")...) - Task{}.ApplySchemaCustomizations(cs, append(path, "task")...) +func (c ForEachTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["concurrency"] = attrs["concurrency"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetRequired() + attrs["task"] = attrs["task"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachTask. @@ -3144,11 +3203,11 @@ func (o *ForEachTask) SetTask(ctx context.Context, v Task) { type ForEachTaskErrorMessageStats struct { // Describes the count of such error message encountered during the // iterations. - Count types.Int64 `tfsdk:"count" tf:"optional"` + Count types.Int64 `tfsdk:"count"` // Describes the error message occured during the iterations. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // Describes the termination reason for the error message. - TerminationCategory types.String `tfsdk:"termination_category" tf:"optional"` + TerminationCategory types.String `tfsdk:"termination_category"` } func (newState *ForEachTaskErrorMessageStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachTaskErrorMessageStats) { @@ -3157,9 +3216,12 @@ func (newState *ForEachTaskErrorMessageStats) SyncEffectiveFieldsDuringCreateOrU func (newState *ForEachTaskErrorMessageStats) SyncEffectiveFieldsDuringRead(existingState ForEachTaskErrorMessageStats) { } -func (c ForEachTaskErrorMessageStats) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ForEachTaskErrorMessageStats) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["count"] = attrs["count"].SetOptional() + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["termination_category"] = attrs["termination_category"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachTaskErrorMessageStats. @@ -3200,17 +3262,17 @@ func (o ForEachTaskErrorMessageStats) Type(ctx context.Context) attr.Type { type ForEachTaskTaskRunStats struct { // Describes the iteration runs having an active lifecycle state or an // active run sub state. - ActiveIterations types.Int64 `tfsdk:"active_iterations" tf:"optional"` + ActiveIterations types.Int64 `tfsdk:"active_iterations"` // Describes the number of failed and succeeded iteration runs. - CompletedIterations types.Int64 `tfsdk:"completed_iterations" tf:"optional"` + CompletedIterations types.Int64 `tfsdk:"completed_iterations"` // Describes the number of failed iteration runs. - FailedIterations types.Int64 `tfsdk:"failed_iterations" tf:"optional"` + FailedIterations types.Int64 `tfsdk:"failed_iterations"` // Describes the number of iteration runs that have been scheduled. - ScheduledIterations types.Int64 `tfsdk:"scheduled_iterations" tf:"optional"` + ScheduledIterations types.Int64 `tfsdk:"scheduled_iterations"` // Describes the number of succeeded iteration runs. - SucceededIterations types.Int64 `tfsdk:"succeeded_iterations" tf:"optional"` + SucceededIterations types.Int64 `tfsdk:"succeeded_iterations"` // Describes the length of the list of items to iterate over. - TotalIterations types.Int64 `tfsdk:"total_iterations" tf:"optional"` + TotalIterations types.Int64 `tfsdk:"total_iterations"` } func (newState *ForEachTaskTaskRunStats) SyncEffectiveFieldsDuringCreateOrUpdate(plan ForEachTaskTaskRunStats) { @@ -3219,9 +3281,15 @@ func (newState *ForEachTaskTaskRunStats) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ForEachTaskTaskRunStats) SyncEffectiveFieldsDuringRead(existingState ForEachTaskTaskRunStats) { } -func (c ForEachTaskTaskRunStats) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ForEachTaskTaskRunStats) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["active_iterations"] = attrs["active_iterations"].SetOptional() + attrs["completed_iterations"] = attrs["completed_iterations"].SetOptional() + attrs["failed_iterations"] = attrs["failed_iterations"].SetOptional() + attrs["scheduled_iterations"] = attrs["scheduled_iterations"].SetOptional() + attrs["succeeded_iterations"] = attrs["succeeded_iterations"].SetOptional() + attrs["total_iterations"] = attrs["total_iterations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ForEachTaskTaskRunStats. @@ -3304,7 +3372,7 @@ func (o GetJobPermissionLevelsRequest) Type(ctx context.Context) attr.Type { type GetJobPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetJobPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetJobPermissionLevelsResponse) { @@ -3313,10 +3381,10 @@ func (newState *GetJobPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateO func (newState *GetJobPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetJobPermissionLevelsResponse) { } -func (c GetJobPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetJobPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetJobPermissionLevelsResponse. @@ -3497,13 +3565,13 @@ type GetPolicyComplianceResponse struct { // of compliance if a policy they are using was updated after the job was // last edited and some of its job clusters no longer comply with their // updated policies. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. An identifier for the job cluster is prepended to the // path. The values indicate an error message describing the policy // validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *GetPolicyComplianceResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPolicyComplianceResponse) { @@ -3512,9 +3580,11 @@ func (newState *GetPolicyComplianceResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *GetPolicyComplianceResponse) SyncEffectiveFieldsDuringRead(existingState GetPolicyComplianceResponse) { } -func (c GetPolicyComplianceResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetPolicyComplianceResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPolicyComplianceResponse. @@ -3674,7 +3744,7 @@ type GitSnapshot struct { // Commit that was used to execute the run. If git_branch was specified, // this points to the HEAD of the branch at the time of the run; if git_tag // was specified, this points to the commit the tag points to. - UsedCommit types.String `tfsdk:"used_commit" tf:"optional"` + UsedCommit types.String `tfsdk:"used_commit"` } func (newState *GitSnapshot) SyncEffectiveFieldsDuringCreateOrUpdate(plan GitSnapshot) { @@ -3683,9 +3753,10 @@ func (newState *GitSnapshot) SyncEffectiveFieldsDuringCreateOrUpdate(plan GitSna func (newState *GitSnapshot) SyncEffectiveFieldsDuringRead(existingState GitSnapshot) { } -func (c GitSnapshot) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GitSnapshot) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["used_commit"] = attrs["used_commit"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GitSnapshot. @@ -3732,24 +3803,24 @@ func (o GitSnapshot) Type(ctx context.Context) attr.Type { type GitSource struct { // Name of the branch to be checked out and used by this job. This field // cannot be specified in conjunction with git_tag or git_commit. - GitBranch types.String `tfsdk:"branch" tf:"optional"` + GitBranch types.String `tfsdk:"branch"` // Commit to be checked out and used by this job. This field cannot be // specified in conjunction with git_branch or git_tag. - GitCommit types.String `tfsdk:"commit" tf:"optional"` + GitCommit types.String `tfsdk:"commit"` // Unique identifier of the service used to host the Git repository. The // value is case insensitive. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // Read-only state of the remote repository at the time the job was run. // This field is only included on job runs. - GitSnapshot types.Object `tfsdk:"git_snapshot" tf:"optional,object"` + GitSnapshot types.Object `tfsdk:"git_snapshot"` // Name of the tag to be checked out and used by this job. This field cannot // be specified in conjunction with git_branch or git_commit. - GitTag types.String `tfsdk:"tag" tf:"optional"` + GitTag types.String `tfsdk:"tag"` // URL of the repository to be cloned by this job. - GitUrl types.String `tfsdk:"url" tf:""` + GitUrl types.String `tfsdk:"url"` // The source of the job specification in the remote repository when the job // is source controlled. - JobSource types.Object `tfsdk:"job_source" tf:"optional,object"` + JobSource types.Object `tfsdk:"job_source"` } func (newState *GitSource) SyncEffectiveFieldsDuringCreateOrUpdate(plan GitSource) { @@ -3758,13 +3829,16 @@ func (newState *GitSource) SyncEffectiveFieldsDuringCreateOrUpdate(plan GitSourc func (newState *GitSource) SyncEffectiveFieldsDuringRead(existingState GitSource) { } -func (c GitSource) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "git_provider")...) - GitSnapshot{}.ApplySchemaCustomizations(cs, append(path, "git_snapshot")...) - cs.SetRequired(append(path, "url")...) - JobSource{}.ApplySchemaCustomizations(cs, append(path, "job_source")...) +func (c GitSource) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["commit"] = attrs["commit"].SetOptional() + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_snapshot"] = attrs["git_snapshot"].SetOptional() + attrs["tag"] = attrs["tag"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() + attrs["job_source"] = attrs["job_source"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GitSource. @@ -3873,19 +3947,19 @@ func (o *GitSource) SetJobSource(ctx context.Context, v JobSource) { type Job struct { // The time at which this job was created in epoch milliseconds // (milliseconds since 1/1/1970 UTC). - CreatedTime types.Int64 `tfsdk:"created_time" tf:"optional"` + CreatedTime types.Int64 `tfsdk:"created_time"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // The id of the budget policy used by this job for cost attribution // purposes. This may be set through (in order of precedence): 1. Budget // admins through the account or workspace console 2. Jobs UI in the job // details page and Jobs API using `budget_policy_id` 3. Inferred default // based on accessible budget policies of the run_as identity on job // creation or modification. - EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` // The canonical identifier for this job. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // The email of an active workspace user or the application ID of a service // principal that the job runs as. This value can be changed by setting the // `run_as` field when creating or updating a job. @@ -3893,10 +3967,10 @@ type Job struct { // By default, `run_as_user_name` is based on the current job settings and // is set to the creator of the job if job access control is disabled or to // the user with the `is_owner` permission if job access control is enabled. - RunAsUserName types.String `tfsdk:"run_as_user_name" tf:"optional"` + RunAsUserName types.String `tfsdk:"run_as_user_name"` // Settings for this job and all of its runs. These settings can be updated // using the `resetJob` method. - Settings types.Object `tfsdk:"settings" tf:"optional,object"` + Settings types.Object `tfsdk:"settings"` } func (newState *Job) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job) { @@ -3905,11 +3979,15 @@ func (newState *Job) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job) { func (newState *Job) SyncEffectiveFieldsDuringRead(existingState Job) { } -func (c Job) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "effective_budget_policy_id")...) - JobSettings{}.ApplySchemaCustomizations(cs, append(path, "settings")...) +func (c Job) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_time"] = attrs["created_time"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() + attrs["settings"] = attrs["settings"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Job. @@ -3985,13 +4063,13 @@ func (o *Job) SetSettings(ctx context.Context, v JobSettings) { type JobAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *JobAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobAccessControlRequest) { @@ -4000,9 +4078,13 @@ func (newState *JobAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *JobAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState JobAccessControlRequest) { } -func (c JobAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobAccessControlRequest. @@ -4044,15 +4126,15 @@ func (o JobAccessControlRequest) Type(ctx context.Context) attr.Type { type JobAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *JobAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobAccessControlResponse) { @@ -4061,10 +4143,14 @@ func (newState *JobAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *JobAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState JobAccessControlResponse) { } -func (c JobAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c JobAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobAccessControlResponse. @@ -4140,9 +4226,9 @@ type JobCluster struct { // A unique name for the job cluster. This field is required and must be // unique within the job. `JobTaskSettings` may refer to this field to // determine which cluster to launch for the task execution. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:""` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // If new_cluster, a description of a cluster that is created for each task. - NewCluster types.Object `tfsdk:"new_cluster" tf:"object"` + NewCluster types.Object `tfsdk:"new_cluster"` } func (newState *JobCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobCluster) { @@ -4151,12 +4237,11 @@ func (newState *JobCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobClus func (newState *JobCluster) SyncEffectiveFieldsDuringRead(existingState JobCluster) { } -func (c JobCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_cluster_key")...) - cs.SetRequired(append(path, "new_cluster")...) - compute_tf.ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) +func (c JobCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetRequired() + attrs["new_cluster"] = attrs["new_cluster"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobCluster. @@ -4224,15 +4309,15 @@ func (o *JobCluster) SetNewCluster(ctx context.Context, v compute_tf.ClusterSpec type JobCompliance struct { // Whether this job is in compliance with the latest version of its policy. - IsCompliant types.Bool `tfsdk:"is_compliant" tf:"optional"` + IsCompliant types.Bool `tfsdk:"is_compliant"` // Canonical unique identifier for a job. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // An object containing key-value mappings representing the first 200 policy // validation errors. The keys indicate the path where the policy validation // error is occurring. An identifier for the job cluster is prepended to the // path. The values indicate an error message describing the policy // validation error. - Violations types.Map `tfsdk:"violations" tf:"optional"` + Violations types.Map `tfsdk:"violations"` } func (newState *JobCompliance) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobCompliance) { @@ -4241,10 +4326,12 @@ func (newState *JobCompliance) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobC func (newState *JobCompliance) SyncEffectiveFieldsDuringRead(existingState JobCompliance) { } -func (c JobCompliance) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) +func (c JobCompliance) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_compliant"] = attrs["is_compliant"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["violations"] = attrs["violations"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobCompliance. @@ -4316,9 +4403,9 @@ type JobDeployment struct { // The kind of deployment that manages the job. // // * `BUNDLE`: The job is managed by Databricks Asset Bundle. - Kind types.String `tfsdk:"kind" tf:""` + Kind types.String `tfsdk:"kind"` // Path of the file that contains deployment metadata. - MetadataFilePath types.String `tfsdk:"metadata_file_path" tf:"optional"` + MetadataFilePath types.String `tfsdk:"metadata_file_path"` } func (newState *JobDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobDeployment) { @@ -4327,10 +4414,11 @@ func (newState *JobDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobD func (newState *JobDeployment) SyncEffectiveFieldsDuringRead(existingState JobDeployment) { } -func (c JobDeployment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "kind")...) +func (c JobDeployment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kind"] = attrs["kind"].SetRequired() + attrs["metadata_file_path"] = attrs["metadata_file_path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobDeployment. @@ -4370,22 +4458,22 @@ type JobEmailNotifications struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the // `notification_settings.no_alert_for_skipped_runs` field. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` // A list of email addresses to be notified when the duration of a run // exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in // the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is // specified in the `health` field for the job, notifications are not sent. - OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded" tf:"optional"` + OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded"` // A list of email addresses to be notified when a run unsuccessfully // completes. A run is considered to have completed unsuccessfully if it // ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. - OnFailure types.List `tfsdk:"on_failure" tf:"optional"` + OnFailure types.List `tfsdk:"on_failure"` // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnStart types.List `tfsdk:"on_start" tf:"optional"` + OnStart types.List `tfsdk:"on_start"` // A list of email addresses to notify when any streaming backlog thresholds // are exceeded for any stream. Streaming backlog thresholds can be set in // the `health` field using the following metrics: @@ -4393,13 +4481,13 @@ type JobEmailNotifications struct { // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded" tf:"optional"` + OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded"` // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If // not specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnSuccess types.List `tfsdk:"on_success" tf:"optional"` + OnSuccess types.List `tfsdk:"on_success"` } func (newState *JobEmailNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobEmailNotifications) { @@ -4408,9 +4496,15 @@ func (newState *JobEmailNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *JobEmailNotifications) SyncEffectiveFieldsDuringRead(existingState JobEmailNotifications) { } -func (c JobEmailNotifications) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobEmailNotifications) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() + attrs["on_duration_warning_threshold_exceeded"] = attrs["on_duration_warning_threshold_exceeded"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_start"] = attrs["on_start"].SetOptional() + attrs["on_streaming_backlog_exceeded"] = attrs["on_streaming_backlog_exceeded"].SetOptional() + attrs["on_success"] = attrs["on_success"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobEmailNotifications. @@ -4602,11 +4696,11 @@ func (o *JobEmailNotifications) SetOnSuccess(ctx context.Context, v []types.Stri type JobEnvironment struct { // The key of an environment. It has to be unique within a job. - EnvironmentKey types.String `tfsdk:"environment_key" tf:""` + EnvironmentKey types.String `tfsdk:"environment_key"` // The environment entity used to preserve serverless environment side panel // and jobs' environment for non-notebook task. In this minimal environment // spec, only pip dependencies are supported. - Spec types.Object `tfsdk:"spec" tf:"optional,object"` + Spec types.Object `tfsdk:"spec"` } func (newState *JobEnvironment) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobEnvironment) { @@ -4615,11 +4709,11 @@ func (newState *JobEnvironment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job func (newState *JobEnvironment) SyncEffectiveFieldsDuringRead(existingState JobEnvironment) { } -func (c JobEnvironment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "environment_key")...) - compute_tf.Environment{}.ApplySchemaCustomizations(cs, append(path, "spec")...) +func (c JobEnvironment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["environment_key"] = attrs["environment_key"].SetRequired() + attrs["spec"] = attrs["spec"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobEnvironment. @@ -4688,10 +4782,10 @@ func (o *JobEnvironment) SetSpec(ctx context.Context, v compute_tf.Environment) type JobNotificationSettings struct { // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. - NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs" tf:"optional"` + NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs"` // If true, do not send notifications to recipients specified in // `on_failure` if the run is skipped. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` } func (newState *JobNotificationSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobNotificationSettings) { @@ -4700,9 +4794,11 @@ func (newState *JobNotificationSettings) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *JobNotificationSettings) SyncEffectiveFieldsDuringRead(existingState JobNotificationSettings) { } -func (c JobNotificationSettings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobNotificationSettings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["no_alert_for_canceled_runs"] = attrs["no_alert_for_canceled_runs"].SetOptional() + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobNotificationSettings. @@ -4740,11 +4836,11 @@ func (o JobNotificationSettings) Type(ctx context.Context) attr.Type { type JobParameter struct { // The optional default value of the parameter - Default types.String `tfsdk:"default" tf:"optional"` + Default types.String `tfsdk:"default"` // The name of the parameter - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The value used in the run - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *JobParameter) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobParameter) { @@ -4753,9 +4849,12 @@ func (newState *JobParameter) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPa func (newState *JobParameter) SyncEffectiveFieldsDuringRead(existingState JobParameter) { } -func (c JobParameter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobParameter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default"] = attrs["default"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobParameter. @@ -4795,10 +4894,10 @@ func (o JobParameter) Type(ctx context.Context) attr.Type { type JobParameterDefinition struct { // Default value of the parameter. - Default types.String `tfsdk:"default" tf:""` + Default types.String `tfsdk:"default"` // The name of the defined parameter. May only contain alphanumeric // characters, `_`, `-`, and `.` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *JobParameterDefinition) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobParameterDefinition) { @@ -4807,11 +4906,11 @@ func (newState *JobParameterDefinition) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *JobParameterDefinition) SyncEffectiveFieldsDuringRead(existingState JobParameterDefinition) { } -func (c JobParameterDefinition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "default")...) - cs.SetRequired(append(path, "name")...) +func (c JobParameterDefinition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default"] = attrs["default"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobParameterDefinition. @@ -4848,11 +4947,11 @@ func (o JobParameterDefinition) Type(ctx context.Context) attr.Type { } type JobPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *JobPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPermission) { @@ -4861,9 +4960,12 @@ func (newState *JobPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobP func (newState *JobPermission) SyncEffectiveFieldsDuringRead(existingState JobPermission) { } -func (c JobPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermission. @@ -4932,11 +5034,11 @@ func (o *JobPermission) SetInheritedFromObject(ctx context.Context, v []types.St } type JobPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *JobPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPermissions) { @@ -4945,10 +5047,12 @@ func (newState *JobPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job func (newState *JobPermissions) SyncEffectiveFieldsDuringRead(existingState JobPermissions) { } -func (c JobPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c JobPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermissions. @@ -5017,9 +5121,9 @@ func (o *JobPermissions) SetAccessControlList(ctx context.Context, v []JobAccess } type JobPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *JobPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobPermissionsDescription) { @@ -5028,9 +5132,11 @@ func (newState *JobPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpda func (newState *JobPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState JobPermissionsDescription) { } -func (c JobPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermissionsDescription. @@ -5067,7 +5173,7 @@ func (o JobPermissionsDescription) Type(ctx context.Context) attr.Type { } type JobPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The job for which to get or manage permissions. JobId types.String `tfsdk:"-"` } @@ -5078,11 +5184,11 @@ func (newState *JobPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *JobPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState JobPermissionsRequest) { } -func (c JobPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "job_id")...) +func (c JobPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobPermissionsRequest. @@ -5156,10 +5262,10 @@ func (o *JobPermissionsRequest) SetAccessControlList(ctx context.Context, v []Jo type JobRunAs struct { // Application ID of an active service principal. Setting this field // requires the `servicePrincipal/user` role. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // The email of an active workspace user. Non-admin users can only set this // field to their own email. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *JobRunAs) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobRunAs) { @@ -5168,9 +5274,11 @@ func (newState *JobRunAs) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobRunAs) func (newState *JobRunAs) SyncEffectiveFieldsDuringRead(existingState JobRunAs) { } -func (c JobRunAs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobRunAs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobRunAs. @@ -5211,35 +5319,35 @@ type JobSettings struct { // specified, a default budget policy may be applied when creating or // modifying the job. See `effective_budget_policy_id` for the budget policy // used by this workload. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // An optional continuous property for this job. The continuous property // will ensure that there is always one run executing. Only one of // `schedule` and `continuous` can be used. - Continuous types.Object `tfsdk:"continuous" tf:"optional,object"` + Continuous types.Object `tfsdk:"continuous"` // Deployment information for jobs managed by external sources. - Deployment types.Object `tfsdk:"deployment" tf:"optional,object"` + Deployment types.Object `tfsdk:"deployment"` // An optional description for the job. The maximum length is 27700 // characters in UTF-8 encoding. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Edit mode of the job. // // * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. * // `EDITABLE`: The job is in an editable state and can be modified. - EditMode types.String `tfsdk:"edit_mode" tf:"optional"` + EditMode types.String `tfsdk:"edit_mode"` // An optional set of email addresses that is notified when runs of this job // begin or complete as well as when this job is deleted. - EmailNotifications types.Object `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.Object `tfsdk:"email_notifications"` // A list of task execution environment specifications that can be // referenced by serverless tasks of this job. An environment is required to // be present for serverless tasks. For serverless notebook tasks, the // environment is accessible in the notebook environment panel. For other // serverless tasks, the task environment is required to be specified using // environment_key in the task settings. - Environments types.List `tfsdk:"environment" tf:"optional"` + Environments types.List `tfsdk:"environment"` // Used to tell what is the format of the job. This field is ignored in // Create/Update/Reset calls. When using the Jobs API 2.1 this value is // always set to `"MULTI_TASK"`. - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -5250,13 +5358,13 @@ type JobSettings struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.Object `tfsdk:"git_source" tf:"optional,object"` + GitSource types.Object `tfsdk:"git_source"` // An optional set of health rules that can be defined for this job. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_cluster" tf:"optional"` + JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same // job concurrently. This is useful for example if you trigger your job on a @@ -5268,45 +5376,45 @@ type JobSettings struct { // runs. However, from then on, new runs are skipped unless there are fewer // than 3 active runs. This value cannot exceed 1000. Setting this value to // `0` causes all new runs to be skipped. - MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs" tf:"optional"` + MaxConcurrentRuns types.Int64 `tfsdk:"max_concurrent_runs"` // An optional name for the job. The maximum length is 4096 bytes in UTF-8 // encoding. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // job. - NotificationSettings types.Object `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.Object `tfsdk:"notification_settings"` // Job-level parameter definitions - Parameters types.List `tfsdk:"parameter" tf:"optional"` + Parameters types.List `tfsdk:"parameter"` // The queue settings of the job. - Queue types.Object `tfsdk:"queue" tf:"optional,object"` + Queue types.Object `tfsdk:"queue"` // Write-only setting. Specifies the user or service principal that the job // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. - RunAs types.Object `tfsdk:"run_as" tf:"optional,object"` + RunAs types.Object `tfsdk:"run_as"` // An optional periodic schedule for this job. The default behavior is that // the job only runs when triggered by clicking “Run Now” in the Jobs UI // or sending an API request to `runNow`. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // A map of tags associated with the job. These are forwarded to the cluster // as cluster tags for jobs clusters, and are subject to the same // limitations as cluster tags. A maximum of 25 tags can be added to the // job. - Tags types.Map `tfsdk:"tags" tf:"optional"` + Tags types.Map `tfsdk:"tags"` // A list of task specifications to be executed by this job. - Tasks types.List `tfsdk:"task" tf:"optional"` + Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A configuration to trigger a run when certain conditions are met. The // default behavior is that the job runs only when triggered by clicking // “Run Now” in the Jobs UI or sending an API request to `runNow`. - Trigger types.Object `tfsdk:"trigger" tf:"optional,object"` + Trigger types.Object `tfsdk:"trigger"` // A collection of system notification IDs to notify when runs of this job // begin or complete. - WebhookNotifications types.Object `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.Object `tfsdk:"webhook_notifications"` } func (newState *JobSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSettings) { @@ -5315,24 +5423,32 @@ func (newState *JobSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSet func (newState *JobSettings) SyncEffectiveFieldsDuringRead(existingState JobSettings) { } -func (c JobSettings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Continuous{}.ApplySchemaCustomizations(cs, append(path, "continuous")...) - JobDeployment{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - JobEmailNotifications{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - JobEnvironment{}.ApplySchemaCustomizations(cs, append(path, "environment")...) - GitSource{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobsHealthRules{}.ApplySchemaCustomizations(cs, append(path, "health")...) - JobCluster{}.ApplySchemaCustomizations(cs, append(path, "job_cluster")...) - JobNotificationSettings{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - JobParameterDefinition{}.ApplySchemaCustomizations(cs, append(path, "parameter")...) - QueueSettings{}.ApplySchemaCustomizations(cs, append(path, "queue")...) - JobRunAs{}.ApplySchemaCustomizations(cs, append(path, "run_as")...) - CronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - Task{}.ApplySchemaCustomizations(cs, append(path, "task")...) - TriggerSettings{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - WebhookNotifications{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c JobSettings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["edit_mode"] = attrs["edit_mode"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["environment"] = attrs["environment"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["job_cluster"] = attrs["job_cluster"].SetOptional() + attrs["max_concurrent_runs"] = attrs["max_concurrent_runs"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["parameter"] = attrs["parameter"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSettings. @@ -5887,11 +6003,11 @@ type JobSource struct { // disconnected from the remote job specification and is allowed for live // edit. Import the remote job specification again from UI to make the job // fully synced. - DirtyState types.String `tfsdk:"dirty_state" tf:"optional"` + DirtyState types.String `tfsdk:"dirty_state"` // Name of the branch which the job is imported from. - ImportFromGitBranch types.String `tfsdk:"import_from_git_branch" tf:""` + ImportFromGitBranch types.String `tfsdk:"import_from_git_branch"` // Path of the job YAML file that contains the job specification. - JobConfigPath types.String `tfsdk:"job_config_path" tf:""` + JobConfigPath types.String `tfsdk:"job_config_path"` } func (newState *JobSource) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSource) { @@ -5900,11 +6016,12 @@ func (newState *JobSource) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSourc func (newState *JobSource) SyncEffectiveFieldsDuringRead(existingState JobSource) { } -func (c JobSource) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "import_from_git_branch")...) - cs.SetRequired(append(path, "job_config_path")...) +func (c JobSource) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dirty_state"] = attrs["dirty_state"].SetOptional() + attrs["import_from_git_branch"] = attrs["import_from_git_branch"].SetRequired() + attrs["job_config_path"] = attrs["job_config_path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSource. @@ -5955,13 +6072,13 @@ type JobsHealthRule struct { // across all streams. This metric is in Public Preview. * // `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of // outstanding files across all streams. This metric is in Public Preview. - Metric types.String `tfsdk:"metric" tf:""` + Metric types.String `tfsdk:"metric"` // Specifies the operator used to compare the health metric value with the // specified threshold. - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // Specifies the threshold value that the health metric should obey to // satisfy the health rule. - Value types.Int64 `tfsdk:"value" tf:""` + Value types.Int64 `tfsdk:"value"` } func (newState *JobsHealthRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobsHealthRule) { @@ -5970,12 +6087,12 @@ func (newState *JobsHealthRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job func (newState *JobsHealthRule) SyncEffectiveFieldsDuringRead(existingState JobsHealthRule) { } -func (c JobsHealthRule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "metric")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "value")...) +func (c JobsHealthRule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metric"] = attrs["metric"].SetRequired() + attrs["op"] = attrs["op"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobsHealthRule. @@ -6015,7 +6132,7 @@ func (o JobsHealthRule) Type(ctx context.Context) attr.Type { // An optional set of health rules that can be defined for this job. type JobsHealthRules struct { - Rules types.List `tfsdk:"rules" tf:"optional"` + Rules types.List `tfsdk:"rules"` } func (newState *JobsHealthRules) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobsHealthRules) { @@ -6024,10 +6141,10 @@ func (newState *JobsHealthRules) SyncEffectiveFieldsDuringCreateOrUpdate(plan Jo func (newState *JobsHealthRules) SyncEffectiveFieldsDuringRead(existingState JobsHealthRules) { } -func (c JobsHealthRules) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobsHealthRule{}.ApplySchemaCustomizations(cs, append(path, "rules")...) +func (c JobsHealthRules) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["rules"] = attrs["rules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobsHealthRules. @@ -6093,15 +6210,15 @@ func (o *JobsHealthRules) SetRules(ctx context.Context, v []JobsHealthRule) { type ListJobComplianceForPolicyResponse struct { // A list of jobs and their policy compliance statuses. - Jobs types.List `tfsdk:"jobs" tf:"optional"` + Jobs types.List `tfsdk:"jobs"` // This field represents the pagination token to retrieve the next page of // results. If this field is not in the response, it means no further // results for the request. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // This field represents the pagination token to retrieve the previous page // of results. If this field is not in the response, it means no further // results for the request. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListJobComplianceForPolicyResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListJobComplianceForPolicyResponse) { @@ -6110,10 +6227,12 @@ func (newState *ListJobComplianceForPolicyResponse) SyncEffectiveFieldsDuringCre func (newState *ListJobComplianceForPolicyResponse) SyncEffectiveFieldsDuringRead(existingState ListJobComplianceForPolicyResponse) { } -func (c ListJobComplianceForPolicyResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobCompliance{}.ApplySchemaCustomizations(cs, append(path, "jobs")...) +func (c ListJobComplianceForPolicyResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["jobs"] = attrs["jobs"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListJobComplianceForPolicyResponse. @@ -6290,15 +6409,15 @@ func (o ListJobsRequest) Type(ctx context.Context) attr.Type { type ListJobsResponse struct { // If true, additional jobs matching the provided filter are available for // listing. - HasMore types.Bool `tfsdk:"has_more" tf:"optional"` + HasMore types.Bool `tfsdk:"has_more"` // The list of jobs. Only included in the response if there are jobs to // list. - Jobs types.List `tfsdk:"jobs" tf:"optional"` + Jobs types.List `tfsdk:"jobs"` // A token that can be used to list the next page of jobs (if applicable). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // A token that can be used to list the previous page of jobs (if // applicable). - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListJobsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListJobsResponse) { @@ -6307,10 +6426,13 @@ func (newState *ListJobsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *ListJobsResponse) SyncEffectiveFieldsDuringRead(existingState ListJobsResponse) { } -func (c ListJobsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BaseJob{}.ApplySchemaCustomizations(cs, append(path, "jobs")...) +func (c ListJobsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_more"] = attrs["has_more"].SetOptional() + attrs["jobs"] = attrs["jobs"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListJobsResponse. @@ -6473,15 +6595,15 @@ func (o ListRunsRequest) Type(ctx context.Context) attr.Type { type ListRunsResponse struct { // If true, additional runs matching the provided filter are available for // listing. - HasMore types.Bool `tfsdk:"has_more" tf:"optional"` + HasMore types.Bool `tfsdk:"has_more"` // A token that can be used to list the next page of runs (if applicable). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // A token that can be used to list the previous page of runs (if // applicable). - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` // A list of runs, from most recently started to least. Only included in the // response if there are runs to list. - Runs types.List `tfsdk:"runs" tf:"optional"` + Runs types.List `tfsdk:"runs"` } func (newState *ListRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRunsResponse) { @@ -6490,10 +6612,13 @@ func (newState *ListRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *ListRunsResponse) SyncEffectiveFieldsDuringRead(existingState ListRunsResponse) { } -func (c ListRunsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BaseRun{}.ApplySchemaCustomizations(cs, append(path, "runs")...) +func (c ListRunsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_more"] = attrs["has_more"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() + attrs["runs"] = attrs["runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRunsResponse. @@ -6570,9 +6695,9 @@ type NotebookOutput struct { // a larger result, your job can store the results in a cloud storage // service. This field is absent if `dbutils.notebook.exit()` was never // called. - Result types.String `tfsdk:"result" tf:"optional"` + Result types.String `tfsdk:"result"` // Whether or not the result was truncated. - Truncated types.Bool `tfsdk:"truncated" tf:"optional"` + Truncated types.Bool `tfsdk:"truncated"` } func (newState *NotebookOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotebookOutput) { @@ -6581,9 +6706,11 @@ func (newState *NotebookOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan Not func (newState *NotebookOutput) SyncEffectiveFieldsDuringRead(existingState NotebookOutput) { } -func (c NotebookOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NotebookOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["result"] = attrs["result"].SetOptional() + attrs["truncated"] = attrs["truncated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotebookOutput. @@ -6637,12 +6764,12 @@ type NotebookTask struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-widgets - BaseParameters types.Map `tfsdk:"base_parameters" tf:"optional"` + BaseParameters types.Map `tfsdk:"base_parameters"` // The path of the notebook to be run in the Databricks workspace or remote // repository. For notebooks stored in the Databricks workspace, the path // must be absolute and begin with a slash. For notebooks stored in a remote // repository, the path must be relative. This field is required. - NotebookPath types.String `tfsdk:"notebook_path" tf:""` + NotebookPath types.String `tfsdk:"notebook_path"` // Optional location type of the notebook. When set to `WORKSPACE`, the // notebook will be retrieved from the local Databricks workspace. When set // to `GIT`, the notebook will be retrieved from a Git repository defined in @@ -6650,14 +6777,14 @@ type NotebookTask struct { // `git_source` is defined and `WORKSPACE` otherwise. * `WORKSPACE`: // Notebook is located in Databricks workspace. * `GIT`: Notebook is located // in cloud Git provider. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Optional `warehouse_id` to run the notebook on a SQL warehouse. Classic // SQL warehouses are NOT supported, please use serverless or pro SQL // warehouses. // // Note that SQL warehouses only support SQL cells; if the notebook contains // non-SQL cells, the run will fail. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *NotebookTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotebookTask) { @@ -6666,10 +6793,13 @@ func (newState *NotebookTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Noteb func (newState *NotebookTask) SyncEffectiveFieldsDuringRead(existingState NotebookTask) { } -func (c NotebookTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "notebook_path")...) +func (c NotebookTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["base_parameters"] = attrs["base_parameters"].SetOptional() + attrs["notebook_path"] = attrs["notebook_path"].SetRequired() + attrs["source"] = attrs["source"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotebookTask. @@ -6741,9 +6871,9 @@ func (o *NotebookTask) SetBaseParameters(ctx context.Context, v map[string]types type PeriodicTriggerConfiguration struct { // The interval at which the trigger should run. - Interval types.Int64 `tfsdk:"interval" tf:""` + Interval types.Int64 `tfsdk:"interval"` // The unit of time for the interval. - Unit types.String `tfsdk:"unit" tf:""` + Unit types.String `tfsdk:"unit"` } func (newState *PeriodicTriggerConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan PeriodicTriggerConfiguration) { @@ -6752,11 +6882,11 @@ func (newState *PeriodicTriggerConfiguration) SyncEffectiveFieldsDuringCreateOrU func (newState *PeriodicTriggerConfiguration) SyncEffectiveFieldsDuringRead(existingState PeriodicTriggerConfiguration) { } -func (c PeriodicTriggerConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "interval")...) - cs.SetRequired(append(path, "unit")...) +func (c PeriodicTriggerConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["interval"] = attrs["interval"].SetRequired() + attrs["unit"] = attrs["unit"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PeriodicTriggerConfiguration. @@ -6794,7 +6924,7 @@ func (o PeriodicTriggerConfiguration) Type(ctx context.Context) attr.Type { type PipelineParams struct { // If true, triggers a full refresh on the delta live table. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` } func (newState *PipelineParams) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineParams) { @@ -6803,9 +6933,10 @@ func (newState *PipelineParams) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pip func (newState *PipelineParams) SyncEffectiveFieldsDuringRead(existingState PipelineParams) { } -func (c PipelineParams) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineParams) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineParams. @@ -6841,9 +6972,9 @@ func (o PipelineParams) Type(ctx context.Context) attr.Type { type PipelineTask struct { // If true, triggers a full refresh on the delta live table. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` // The full name of the pipeline task to execute. - PipelineId types.String `tfsdk:"pipeline_id" tf:""` + PipelineId types.String `tfsdk:"pipeline_id"` } func (newState *PipelineTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineTask) { @@ -6852,10 +6983,11 @@ func (newState *PipelineTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pipel func (newState *PipelineTask) SyncEffectiveFieldsDuringRead(existingState PipelineTask) { } -func (c PipelineTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "pipeline_id")...) +func (c PipelineTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineTask. @@ -6895,16 +7027,16 @@ type PythonWheelTask struct { // Named entry point to use, if it does not exist in the metadata of the // package it executes the function from the package directly using // `$packageName.$entryPoint()` - EntryPoint types.String `tfsdk:"entry_point" tf:""` + EntryPoint types.String `tfsdk:"entry_point"` // Command-line parameters passed to Python wheel task in the form of // `["--name=task", "--data=dbfs:/path/to/data.json"]`. Leave it empty if // `parameters` is not null. - NamedParameters types.Map `tfsdk:"named_parameters" tf:"optional"` + NamedParameters types.Map `tfsdk:"named_parameters"` // Name of the package to execute - PackageName types.String `tfsdk:"package_name" tf:""` + PackageName types.String `tfsdk:"package_name"` // Command-line parameters passed to Python wheel task. Leave it empty if // `named_parameters` is not null. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *PythonWheelTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan PythonWheelTask) { @@ -6913,11 +7045,13 @@ func (newState *PythonWheelTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Py func (newState *PythonWheelTask) SyncEffectiveFieldsDuringRead(existingState PythonWheelTask) { } -func (c PythonWheelTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "entry_point")...) - cs.SetRequired(append(path, "package_name")...) +func (c PythonWheelTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["entry_point"] = attrs["entry_point"].SetRequired() + attrs["named_parameters"] = attrs["named_parameters"].SetOptional() + attrs["package_name"] = attrs["package_name"].SetRequired() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PythonWheelTask. @@ -7023,10 +7157,10 @@ type QueueDetails struct { // per-job limit of concurrent job runs. * // `ACTIVE_RUN_JOB_TASKS_LIMIT_REACHED`: The run was queued due to reaching // the workspace limit of active run job tasks. - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // A descriptive message with the queuing details. This field is // unstructured, and its exact format is subject to change. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *QueueDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueueDetails) { @@ -7035,9 +7169,11 @@ func (newState *QueueDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan Queue func (newState *QueueDetails) SyncEffectiveFieldsDuringRead(existingState QueueDetails) { } -func (c QueueDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c QueueDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueueDetails. @@ -7075,7 +7211,7 @@ func (o QueueDetails) Type(ctx context.Context) attr.Type { type QueueSettings struct { // If true, enable queueing for the job. This is a required field. - Enabled types.Bool `tfsdk:"enabled" tf:""` + Enabled types.Bool `tfsdk:"enabled"` } func (newState *QueueSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueueSettings) { @@ -7084,10 +7220,10 @@ func (newState *QueueSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan Queu func (newState *QueueSettings) SyncEffectiveFieldsDuringRead(existingState QueueSettings) { } -func (c QueueSettings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "enabled")...) +func (c QueueSettings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueueSettings. @@ -7123,22 +7259,22 @@ func (o QueueSettings) Type(ctx context.Context) attr.Type { type RepairHistoryItem struct { // The end time of the (repaired) run. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The ID of the repair. Only returned for the items that represent a repair // in `repair_history`. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // The start time of the (repaired) run. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The current status of the run - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` // The run IDs of the task runs that ran as part of this repair history // item. - TaskRunIds types.List `tfsdk:"task_run_ids" tf:"optional"` + TaskRunIds types.List `tfsdk:"task_run_ids"` // The repair history item type. Indicates whether a run is the original run // or a repair run. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *RepairHistoryItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairHistoryItem) { @@ -7147,11 +7283,16 @@ func (newState *RepairHistoryItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RepairHistoryItem) SyncEffectiveFieldsDuringRead(existingState RepairHistoryItem) { } -func (c RepairHistoryItem) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunState{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) +func (c RepairHistoryItem) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["task_run_ids"] = attrs["task_run_ids"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepairHistoryItem. @@ -7289,7 +7430,7 @@ type RepairRun struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -7302,14 +7443,14 @@ type RepairRun struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // Job-level parameters used in the run. for example `"param": // "overriding_val"` - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` // The ID of the latest repair. This parameter is not required when // repairing a run for the first time, but must be provided on subsequent // requests to repair the same run. - LatestRepairId types.Int64 `tfsdk:"latest_repair_id" tf:"optional"` + LatestRepairId types.Int64 `tfsdk:"latest_repair_id"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -7329,11 +7470,11 @@ type RepairRun struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.Object `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.Object `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -7351,18 +7492,18 @@ type RepairRun struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // If true, repair all failed tasks. Only one of `rerun_tasks` or // `rerun_all_failed_tasks` can be used. - RerunAllFailedTasks types.Bool `tfsdk:"rerun_all_failed_tasks" tf:"optional"` + RerunAllFailedTasks types.Bool `tfsdk:"rerun_all_failed_tasks"` // If true, repair all tasks that depend on the tasks in `rerun_tasks`, even // if they were previously successful. Can be also used in combination with // `rerun_all_failed_tasks`. - RerunDependentTasks types.Bool `tfsdk:"rerun_dependent_tasks" tf:"optional"` + RerunDependentTasks types.Bool `tfsdk:"rerun_dependent_tasks"` // The task keys of the task runs to repair. - RerunTasks types.List `tfsdk:"rerun_tasks" tf:"optional"` + RerunTasks types.List `tfsdk:"rerun_tasks"` // The job run ID of the run to repair. The run must not be in progress. - RunId types.Int64 `tfsdk:"run_id" tf:""` + RunId types.Int64 `tfsdk:"run_id"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -7381,11 +7522,11 @@ type RepairRun struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RepairRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairRun) { @@ -7394,11 +7535,23 @@ func (newState *RepairRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairRu func (newState *RepairRun) SyncEffectiveFieldsDuringRead(existingState RepairRun) { } -func (c RepairRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineParams{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) - cs.SetRequired(append(path, "run_id")...) +func (c RepairRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["latest_repair_id"] = attrs["latest_repair_id"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["rerun_all_failed_tasks"] = attrs["rerun_all_failed_tasks"].SetOptional() + attrs["rerun_dependent_tasks"] = attrs["rerun_dependent_tasks"].SetOptional() + attrs["rerun_tasks"] = attrs["rerun_tasks"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetRequired() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepairRun. @@ -7753,7 +7906,7 @@ func (o *RepairRun) SetSqlParams(ctx context.Context, v map[string]types.String) type RepairRunResponse struct { // The ID of the repair. Must be provided in subsequent repairs using the // `latest_repair_id` field to ensure sequential repairs. - RepairId types.Int64 `tfsdk:"repair_id" tf:"optional"` + RepairId types.Int64 `tfsdk:"repair_id"` } func (newState *RepairRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepairRunResponse) { @@ -7762,9 +7915,10 @@ func (newState *RepairRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RepairRunResponse) SyncEffectiveFieldsDuringRead(existingState RepairRunResponse) { } -func (c RepairRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepairRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["repair_id"] = attrs["repair_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepairRunResponse. @@ -7800,13 +7954,13 @@ func (o RepairRunResponse) Type(ctx context.Context) attr.Type { type ResetJob struct { // The canonical identifier of the job to reset. This field is required. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // The new settings of the job. These settings completely replace the old // settings. // // Changes to the field `JobBaseSettings.timeout_seconds` are applied to // active runs. Changes to other fields are applied to future runs only. - NewSettings types.Object `tfsdk:"new_settings" tf:"object"` + NewSettings types.Object `tfsdk:"new_settings"` } func (newState *ResetJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResetJob) { @@ -7815,12 +7969,11 @@ func (newState *ResetJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResetJob) func (newState *ResetJob) SyncEffectiveFieldsDuringRead(existingState ResetJob) { } -func (c ResetJob) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - cs.SetRequired(append(path, "new_settings")...) - JobSettings{}.ApplySchemaCustomizations(cs, append(path, "new_settings")...) +func (c ResetJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["new_settings"] = attrs["new_settings"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResetJob. @@ -7917,9 +8070,9 @@ func (o ResetResponse) Type(ctx context.Context) attr.Type { } type ResolvedConditionTaskValues struct { - Left types.String `tfsdk:"left" tf:"optional"` + Left types.String `tfsdk:"left"` - Right types.String `tfsdk:"right" tf:"optional"` + Right types.String `tfsdk:"right"` } func (newState *ResolvedConditionTaskValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedConditionTaskValues) { @@ -7928,9 +8081,11 @@ func (newState *ResolvedConditionTaskValues) SyncEffectiveFieldsDuringCreateOrUp func (newState *ResolvedConditionTaskValues) SyncEffectiveFieldsDuringRead(existingState ResolvedConditionTaskValues) { } -func (c ResolvedConditionTaskValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedConditionTaskValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["left"] = attrs["left"].SetOptional() + attrs["right"] = attrs["right"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedConditionTaskValues. @@ -7967,7 +8122,7 @@ func (o ResolvedConditionTaskValues) Type(ctx context.Context) attr.Type { } type ResolvedDbtTaskValues struct { - Commands types.List `tfsdk:"commands" tf:"optional"` + Commands types.List `tfsdk:"commands"` } func (newState *ResolvedDbtTaskValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedDbtTaskValues) { @@ -7976,9 +8131,10 @@ func (newState *ResolvedDbtTaskValues) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ResolvedDbtTaskValues) SyncEffectiveFieldsDuringRead(existingState ResolvedDbtTaskValues) { } -func (c ResolvedDbtTaskValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedDbtTaskValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["commands"] = attrs["commands"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedDbtTaskValues. @@ -8043,7 +8199,7 @@ func (o *ResolvedDbtTaskValues) SetCommands(ctx context.Context, v []types.Strin } type ResolvedNotebookTaskValues struct { - BaseParameters types.Map `tfsdk:"base_parameters" tf:"optional"` + BaseParameters types.Map `tfsdk:"base_parameters"` } func (newState *ResolvedNotebookTaskValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedNotebookTaskValues) { @@ -8052,9 +8208,10 @@ func (newState *ResolvedNotebookTaskValues) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ResolvedNotebookTaskValues) SyncEffectiveFieldsDuringRead(existingState ResolvedNotebookTaskValues) { } -func (c ResolvedNotebookTaskValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedNotebookTaskValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["base_parameters"] = attrs["base_parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedNotebookTaskValues. @@ -8119,7 +8276,7 @@ func (o *ResolvedNotebookTaskValues) SetBaseParameters(ctx context.Context, v ma } type ResolvedParamPairValues struct { - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` } func (newState *ResolvedParamPairValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedParamPairValues) { @@ -8128,9 +8285,10 @@ func (newState *ResolvedParamPairValues) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ResolvedParamPairValues) SyncEffectiveFieldsDuringRead(existingState ResolvedParamPairValues) { } -func (c ResolvedParamPairValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedParamPairValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedParamPairValues. @@ -8195,9 +8353,9 @@ func (o *ResolvedParamPairValues) SetParameters(ctx context.Context, v map[strin } type ResolvedPythonWheelTaskValues struct { - NamedParameters types.Map `tfsdk:"named_parameters" tf:"optional"` + NamedParameters types.Map `tfsdk:"named_parameters"` - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *ResolvedPythonWheelTaskValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedPythonWheelTaskValues) { @@ -8206,9 +8364,11 @@ func (newState *ResolvedPythonWheelTaskValues) SyncEffectiveFieldsDuringCreateOr func (newState *ResolvedPythonWheelTaskValues) SyncEffectiveFieldsDuringRead(existingState ResolvedPythonWheelTaskValues) { } -func (c ResolvedPythonWheelTaskValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedPythonWheelTaskValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["named_parameters"] = attrs["named_parameters"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedPythonWheelTaskValues. @@ -8304,9 +8464,9 @@ func (o *ResolvedPythonWheelTaskValues) SetParameters(ctx context.Context, v []t } type ResolvedRunJobTaskValues struct { - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` } func (newState *ResolvedRunJobTaskValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedRunJobTaskValues) { @@ -8315,9 +8475,11 @@ func (newState *ResolvedRunJobTaskValues) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ResolvedRunJobTaskValues) SyncEffectiveFieldsDuringRead(existingState ResolvedRunJobTaskValues) { } -func (c ResolvedRunJobTaskValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedRunJobTaskValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedRunJobTaskValues. @@ -8413,7 +8575,7 @@ func (o *ResolvedRunJobTaskValues) SetParameters(ctx context.Context, v map[stri } type ResolvedStringParamsValues struct { - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *ResolvedStringParamsValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedStringParamsValues) { @@ -8422,9 +8584,10 @@ func (newState *ResolvedStringParamsValues) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ResolvedStringParamsValues) SyncEffectiveFieldsDuringRead(existingState ResolvedStringParamsValues) { } -func (c ResolvedStringParamsValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResolvedStringParamsValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedStringParamsValues. @@ -8489,25 +8652,25 @@ func (o *ResolvedStringParamsValues) SetParameters(ctx context.Context, v []type } type ResolvedValues struct { - ConditionTask types.Object `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.Object `tfsdk:"condition_task"` - DbtTask types.Object `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.Object `tfsdk:"dbt_task"` - NotebookTask types.Object `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.Object `tfsdk:"notebook_task"` - PythonWheelTask types.Object `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.Object `tfsdk:"python_wheel_task"` - RunJobTask types.Object `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.Object `tfsdk:"run_job_task"` - SimulationTask types.Object `tfsdk:"simulation_task" tf:"optional,object"` + SimulationTask types.Object `tfsdk:"simulation_task"` - SparkJarTask types.Object `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.Object `tfsdk:"spark_jar_task"` - SparkPythonTask types.Object `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.Object `tfsdk:"spark_python_task"` - SparkSubmitTask types.Object `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.Object `tfsdk:"spark_submit_task"` - SqlTask types.Object `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.Object `tfsdk:"sql_task"` } func (newState *ResolvedValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResolvedValues) { @@ -8516,19 +8679,19 @@ func (newState *ResolvedValues) SyncEffectiveFieldsDuringCreateOrUpdate(plan Res func (newState *ResolvedValues) SyncEffectiveFieldsDuringRead(existingState ResolvedValues) { } -func (c ResolvedValues) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ResolvedConditionTaskValues{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - ResolvedDbtTaskValues{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - ResolvedNotebookTaskValues{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - ResolvedPythonWheelTaskValues{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - ResolvedRunJobTaskValues{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - ResolvedParamPairValues{}.ApplySchemaCustomizations(cs, append(path, "simulation_task")...) - ResolvedStringParamsValues{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - ResolvedStringParamsValues{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - ResolvedStringParamsValues{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - ResolvedParamPairValues{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) +func (c ResolvedValues) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["simulation_task"] = attrs["simulation_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResolvedValues. @@ -8880,28 +9043,28 @@ type Run struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + AttemptNumber types.Int64 `tfsdk:"attempt_number"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration types.Int64 `tfsdk:"cleanup_duration" tf:"optional"` + CleanupDuration types.Int64 `tfsdk:"cleanup_duration"` // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance types.Object `tfsdk:"cluster_instance" tf:"optional,object"` + ClusterInstance types.Object `tfsdk:"cluster_instance"` // A snapshot of the job’s cluster specification when this run was // created. - ClusterSpec types.Object `tfsdk:"cluster_spec" tf:"optional,object"` + ClusterSpec types.Object `tfsdk:"cluster_spec"` // The creator user name. This field won’t be included in the response if // the user has already been deleted. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Description of the run - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -8909,7 +9072,7 @@ type Run struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration types.Int64 `tfsdk:"execution_duration" tf:"optional"` + ExecutionDuration types.Int64 `tfsdk:"execution_duration"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -8920,58 +9083,58 @@ type Run struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.Object `tfsdk:"git_source" tf:"optional,object"` + GitSource types.Object `tfsdk:"git_source"` // Only populated by for-each iterations. The parent for-each task is // located in tasks array. - Iterations types.List `tfsdk:"iterations" tf:"optional"` + Iterations types.List `tfsdk:"iterations"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. // You must declare dependent libraries in task settings. - JobClusters types.List `tfsdk:"job_clusters" tf:"optional"` + JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. - JobId types.Int64 `tfsdk:"job_id" tf:"optional"` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used in the run - JobParameters types.List `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.List `tfsdk:"job_parameters"` // ID of the job run that this run belongs to. For legacy and single-task // job runs the field is populated with the job run ID. For task runs, the // field is populated with the ID of the job run that the task run belongs // to. - JobRunId types.Int64 `tfsdk:"job_run_id" tf:"optional"` + JobRunId types.Int64 `tfsdk:"job_run_id"` // A token that can be used to list the next page of sub-resources. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob types.Int64 `tfsdk:"number_in_job" tf:"optional"` + NumberInJob types.Int64 `tfsdk:"number_in_job"` // If this run is a retry of a prior run attempt, this field contains the // run_id of the original attempt; otherwise, it is the same as the run_id. - OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id" tf:"optional"` + OriginalAttemptRunId types.Int64 `tfsdk:"original_attempt_run_id"` // The parameters used for this run. - OverridingParameters types.Object `tfsdk:"overriding_parameters" tf:"optional,object"` + OverridingParameters types.Object `tfsdk:"overriding_parameters"` // The time in milliseconds that the run has spent in the queue. - QueueDuration types.Int64 `tfsdk:"queue_duration" tf:"optional"` + QueueDuration types.Int64 `tfsdk:"queue_duration"` // The repair history of the run. - RepairHistory types.List `tfsdk:"repair_history" tf:"optional"` + RepairHistory types.List `tfsdk:"repair_history"` // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // The canonical identifier of the run. This ID is unique across all runs of // all jobs. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` // An optional name for the run. The maximum length is 4096 bytes in UTF-8 // encoding. - RunName types.String `tfsdk:"run_name" tf:"optional"` + RunName types.String `tfsdk:"run_name"` // The URL to the detail page of the run. - RunPageUrl types.String `tfsdk:"run_page_url" tf:"optional"` + RunPageUrl types.String `tfsdk:"run_page_url"` // The type of a run. * `JOB_RUN`: Normal job run. A run created with // :method:jobs/runNow. * `WORKFLOW_RUN`: Workflow run. A run created with // [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit run. A run created with // :method:jobs/submit. // // [dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow - RunType types.String `tfsdk:"run_type" tf:"optional"` + RunType types.String `tfsdk:"run_type"` // The cron schedule that triggered this run if it was triggered by the // periodic scheduler. - Schedule types.Object `tfsdk:"schedule" tf:"optional,object"` + Schedule types.Object `tfsdk:"schedule"` // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -8979,19 +9142,19 @@ type Run struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration types.Int64 `tfsdk:"setup_duration" tf:"optional"` + SetupDuration types.Int64 `tfsdk:"setup_duration"` // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The current status of the run - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` // which you can use to call `JobsGetOutput` to retrieve the run resutls. - Tasks types.List `tfsdk:"tasks" tf:"optional"` + Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // // * `PERIODIC`: Schedules that periodically trigger runs, such as a cron @@ -9004,9 +9167,9 @@ type Run struct { // arrival. * `TABLE`: Indicates a run that is triggered by a table update. // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually // restart a continuous job run. - Trigger types.String `tfsdk:"trigger" tf:"optional"` + Trigger types.String `tfsdk:"trigger"` // Additional details about what triggered the run - TriggerInfo types.Object `tfsdk:"trigger_info" tf:"optional,object"` + TriggerInfo types.Object `tfsdk:"trigger_info"` } func (newState *Run) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run) { @@ -9015,22 +9178,42 @@ func (newState *Run) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run) { func (newState *Run) SyncEffectiveFieldsDuringRead(existingState Run) { } -func (c Run) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterInstance{}.ApplySchemaCustomizations(cs, append(path, "cluster_instance")...) - ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "cluster_spec")...) - GitSource{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - RunTask{}.ApplySchemaCustomizations(cs, append(path, "iterations")...) - JobCluster{}.ApplySchemaCustomizations(cs, append(path, "job_clusters")...) - JobParameter{}.ApplySchemaCustomizations(cs, append(path, "job_parameters")...) - RunParameters{}.ApplySchemaCustomizations(cs, append(path, "overriding_parameters")...) - RepairHistoryItem{}.ApplySchemaCustomizations(cs, append(path, "repair_history")...) - CronSchedule{}.ApplySchemaCustomizations(cs, append(path, "schedule")...) - RunState{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - RunTask{}.ApplySchemaCustomizations(cs, append(path, "tasks")...) - TriggerInfo{}.ApplySchemaCustomizations(cs, append(path, "trigger_info")...) - - return cs +func (c Run) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attempt_number"] = attrs["attempt_number"].SetOptional() + attrs["cleanup_duration"] = attrs["cleanup_duration"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].SetOptional() + attrs["cluster_spec"] = attrs["cluster_spec"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["execution_duration"] = attrs["execution_duration"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["iterations"] = attrs["iterations"].SetOptional() + attrs["job_clusters"] = attrs["job_clusters"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["job_run_id"] = attrs["job_run_id"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["number_in_job"] = attrs["number_in_job"].SetOptional() + attrs["original_attempt_run_id"] = attrs["original_attempt_run_id"].SetOptional() + attrs["overriding_parameters"] = attrs["overriding_parameters"].SetOptional() + attrs["queue_duration"] = attrs["queue_duration"].SetOptional() + attrs["repair_history"] = attrs["repair_history"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_name"] = attrs["run_name"].SetOptional() + attrs["run_page_url"] = attrs["run_page_url"].SetOptional() + attrs["run_type"] = attrs["run_type"].SetOptional() + attrs["schedule"] = attrs["schedule"].SetOptional() + attrs["setup_duration"] = attrs["setup_duration"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["tasks"] = attrs["tasks"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger_info"] = attrs["trigger_info"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Run. @@ -9509,7 +9692,7 @@ func (o *Run) SetTriggerInfo(ctx context.Context, v TriggerInfo) { type RunConditionTask struct { // The left operand of the condition task. Can be either a string value or a // job state or parameter reference. - Left types.String `tfsdk:"left" tf:""` + Left types.String `tfsdk:"left"` // * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their // operands. This means that `“12.0” == “12”` will evaluate to // `false`. * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, @@ -9520,13 +9703,13 @@ type RunConditionTask struct { // The boolean comparison to task values can be implemented with operators // `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it // will be serialized to `“true”` or `“false”` for the comparison. - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // The condition expression evaluation result. Filled in if the task was // successfully completed. Can be `"true"` or `"false"` - Outcome types.String `tfsdk:"outcome" tf:"optional"` + Outcome types.String `tfsdk:"outcome"` // The right operand of the condition task. Can be either a string value or // a job state or parameter reference. - Right types.String `tfsdk:"right" tf:""` + Right types.String `tfsdk:"right"` } func (newState *RunConditionTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunConditionTask) { @@ -9535,12 +9718,13 @@ func (newState *RunConditionTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *RunConditionTask) SyncEffectiveFieldsDuringRead(existingState RunConditionTask) { } -func (c RunConditionTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "left")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "right")...) +func (c RunConditionTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["left"] = attrs["left"].SetRequired() + attrs["op"] = attrs["op"].SetRequired() + attrs["outcome"] = attrs["outcome"].SetOptional() + attrs["right"] = attrs["right"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunConditionTask. @@ -9584,15 +9768,15 @@ type RunForEachTask struct { // An optional maximum allowed number of concurrent runs of the task. Set // this value if you want to be able to execute multiple runs of the task // concurrently. - Concurrency types.Int64 `tfsdk:"concurrency" tf:"optional"` + Concurrency types.Int64 `tfsdk:"concurrency"` // Array for task to iterate on. This can be a JSON string or a reference to // an array parameter. - Inputs types.String `tfsdk:"inputs" tf:""` + Inputs types.String `tfsdk:"inputs"` // Read only field. Populated for GetRun and ListRuns RPC calls and stores // the execution stats of an For each task - Stats types.Object `tfsdk:"stats" tf:"optional,object"` + Stats types.Object `tfsdk:"stats"` // Configuration for the task that will be run for each element in the array - Task types.Object `tfsdk:"task" tf:"object"` + Task types.Object `tfsdk:"task"` } func (newState *RunForEachTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunForEachTask) { @@ -9601,13 +9785,13 @@ func (newState *RunForEachTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run func (newState *RunForEachTask) SyncEffectiveFieldsDuringRead(existingState RunForEachTask) { } -func (c RunForEachTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "inputs")...) - ForEachStats{}.ApplySchemaCustomizations(cs, append(path, "stats")...) - cs.SetRequired(append(path, "task")...) - Task{}.ApplySchemaCustomizations(cs, append(path, "task")...) +func (c RunForEachTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["concurrency"] = attrs["concurrency"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetRequired() + attrs["stats"] = attrs["stats"].SetOptional() + attrs["task"] = attrs["task"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunForEachTask. @@ -9708,7 +9892,7 @@ func (o *RunForEachTask) SetTask(ctx context.Context, v Task) { type RunJobOutput struct { // The run id of the triggered job run - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *RunJobOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunJobOutput) { @@ -9717,9 +9901,10 @@ func (newState *RunJobOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunJo func (newState *RunJobOutput) SyncEffectiveFieldsDuringRead(existingState RunJobOutput) { } -func (c RunJobOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunJobOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunJobOutput. @@ -9757,7 +9942,7 @@ type RunJobTask struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -9770,11 +9955,11 @@ type RunJobTask struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // ID of the job to trigger. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used to trigger the job. - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -9794,11 +9979,11 @@ type RunJobTask struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.Object `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.Object `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -9816,7 +10001,7 @@ type RunJobTask struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -9835,11 +10020,11 @@ type RunJobTask struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RunJobTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunJobTask) { @@ -9848,11 +10033,19 @@ func (newState *RunJobTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunJobT func (newState *RunJobTask) SyncEffectiveFieldsDuringRead(existingState RunJobTask) { } -func (c RunJobTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - PipelineParams{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) +func (c RunJobTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunJobTask. @@ -10170,7 +10363,7 @@ type RunNow struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // An optional token to guarantee the idempotency of job run requests. If a // run with the provided token already exists, the request does not create a // new run but returns the ID of the existing run instead. If a run with the @@ -10185,7 +10378,7 @@ type RunNow struct { // For more information, see [How to ensure idempotency for jobs]. // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html - IdempotencyToken types.String `tfsdk:"idempotency_token" tf:"optional"` + IdempotencyToken types.String `tfsdk:"idempotency_token"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -10198,12 +10391,12 @@ type RunNow struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // The ID of the job to be executed - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // Job-level parameters used in the run. for example `"param": // "overriding_val"` - JobParameters types.Map `tfsdk:"job_parameters" tf:"optional"` + JobParameters types.Map `tfsdk:"job_parameters"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -10223,14 +10416,14 @@ type RunNow struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // A list of task keys to run inside of the job. If this field is not // provided, all tasks in the job will be run. - Only types.List `tfsdk:"only" tf:"optional"` + Only types.List `tfsdk:"only"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.Object `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.Object `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -10248,9 +10441,9 @@ type RunNow struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // The queue settings of the run. - Queue types.Object `tfsdk:"queue" tf:"optional,object"` + Queue types.Object `tfsdk:"queue"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -10269,11 +10462,11 @@ type RunNow struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RunNow) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunNow) { @@ -10282,12 +10475,22 @@ func (newState *RunNow) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunNow) { func (newState *RunNow) SyncEffectiveFieldsDuringRead(existingState RunNow) { } -func (c RunNow) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - PipelineParams{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) - QueueSettings{}.ApplySchemaCustomizations(cs, append(path, "queue")...) +func (c RunNow) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["idempotency_token"] = attrs["idempotency_token"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["job_parameters"] = attrs["job_parameters"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["only"] = attrs["only"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunNow. @@ -10669,9 +10872,9 @@ func (o *RunNow) SetSqlParams(ctx context.Context, v map[string]types.String) { type RunNowResponse struct { // A unique identifier for this job run. This is set to the same value as // `run_id`. - NumberInJob types.Int64 `tfsdk:"number_in_job" tf:"optional"` + NumberInJob types.Int64 `tfsdk:"number_in_job"` // The globally unique ID of the newly triggered run. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *RunNowResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunNowResponse) { @@ -10680,9 +10883,11 @@ func (newState *RunNowResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run func (newState *RunNowResponse) SyncEffectiveFieldsDuringRead(existingState RunNowResponse) { } -func (c RunNowResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunNowResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["number_in_job"] = attrs["number_in_job"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunNowResponse. @@ -10721,16 +10926,16 @@ func (o RunNowResponse) Type(ctx context.Context) attr.Type { // Run output was retrieved successfully. type RunOutput struct { // The output of a dbt task, if available. - DbtOutput types.Object `tfsdk:"dbt_output" tf:"optional,object"` + DbtOutput types.Object `tfsdk:"dbt_output"` // An error message indicating why a task failed or why output is not // available. The message is unstructured, and its exact format is subject // to change. - Error types.String `tfsdk:"error" tf:"optional"` + Error types.String `tfsdk:"error"` // If there was an error executing the run, this field contains any // available stack traces. - ErrorTrace types.String `tfsdk:"error_trace" tf:"optional"` + ErrorTrace types.String `tfsdk:"error_trace"` - Info types.String `tfsdk:"info" tf:"optional"` + Info types.String `tfsdk:"info"` // The output from tasks that write to standard streams (stdout/stderr) such // as spark_jar_task, spark_python_task, python_wheel_task. // @@ -10738,11 +10943,11 @@ type RunOutput struct { // spark_submit_task. // // Databricks restricts this API to return the last 5 MB of these logs. - Logs types.String `tfsdk:"logs" tf:"optional"` + Logs types.String `tfsdk:"logs"` // Whether the logs are truncated. - LogsTruncated types.Bool `tfsdk:"logs_truncated" tf:"optional"` + LogsTruncated types.Bool `tfsdk:"logs_truncated"` // All details of the run except for its output. - Metadata types.Object `tfsdk:"metadata" tf:"optional,object"` + Metadata types.Object `tfsdk:"metadata"` // The output of a notebook task, if available. A notebook task that // terminates (either successfully or with a failure) without calling // `dbutils.notebook.exit()` is considered to have an empty output. This @@ -10751,11 +10956,11 @@ type RunOutput struct { // the [ClusterLogConf] field to configure log storage for the job cluster. // // [ClusterLogConf]: https://docs.databricks.com/dev-tools/api/latest/clusters.html#clusterlogconf - NotebookOutput types.Object `tfsdk:"notebook_output" tf:"optional,object"` + NotebookOutput types.Object `tfsdk:"notebook_output"` // The output of a run job task, if available - RunJobOutput types.Object `tfsdk:"run_job_output" tf:"optional,object"` + RunJobOutput types.Object `tfsdk:"run_job_output"` // The output of a SQL task, if available. - SqlOutput types.Object `tfsdk:"sql_output" tf:"optional,object"` + SqlOutput types.Object `tfsdk:"sql_output"` } func (newState *RunOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunOutput) { @@ -10764,14 +10969,19 @@ func (newState *RunOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunOutpu func (newState *RunOutput) SyncEffectiveFieldsDuringRead(existingState RunOutput) { } -func (c RunOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DbtOutput{}.ApplySchemaCustomizations(cs, append(path, "dbt_output")...) - Run{}.ApplySchemaCustomizations(cs, append(path, "metadata")...) - NotebookOutput{}.ApplySchemaCustomizations(cs, append(path, "notebook_output")...) - RunJobOutput{}.ApplySchemaCustomizations(cs, append(path, "run_job_output")...) - SqlOutput{}.ApplySchemaCustomizations(cs, append(path, "sql_output")...) +func (c RunOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_output"] = attrs["dbt_output"].SetOptional() + attrs["error"] = attrs["error"].SetOptional() + attrs["error_trace"] = attrs["error_trace"].SetOptional() + attrs["info"] = attrs["info"].SetOptional() + attrs["logs"] = attrs["logs"].SetOptional() + attrs["logs_truncated"] = attrs["logs_truncated"].SetOptional() + attrs["metadata"] = attrs["metadata"].SetOptional() + attrs["notebook_output"] = attrs["notebook_output"].SetOptional() + attrs["run_job_output"] = attrs["run_job_output"].SetOptional() + attrs["sql_output"] = attrs["sql_output"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunOutput. @@ -10973,7 +11183,7 @@ type RunParameters struct { // An array of commands to execute for jobs with the dbt task, for example // `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt // run"]` - DbtCommands types.List `tfsdk:"dbt_commands" tf:"optional"` + DbtCommands types.List `tfsdk:"dbt_commands"` // A list of parameters for jobs with Spark JAR tasks, for example // `"jar_params": ["john doe", "35"]`. The parameters are used to invoke the // main function of the main class specified in the Spark JAR task. If not @@ -10986,7 +11196,7 @@ type RunParameters struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - JarParams types.List `tfsdk:"jar_params" tf:"optional"` + JarParams types.List `tfsdk:"jar_params"` // A map from keys to values for jobs with notebook task, for example // `"notebook_params": {"name": "john doe", "age": "35"}`. The map is passed // to the notebook and is accessible through the [dbutils.widgets.get] @@ -11006,11 +11216,11 @@ type RunParameters struct { // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables // [dbutils.widgets.get]: https://docs.databricks.com/dev-tools/databricks-utils.html - NotebookParams types.Map `tfsdk:"notebook_params" tf:"optional"` + NotebookParams types.Map `tfsdk:"notebook_params"` // Controls whether the pipeline should perform a full refresh - PipelineParams types.Object `tfsdk:"pipeline_params" tf:"optional,object"` + PipelineParams types.Object `tfsdk:"pipeline_params"` - PythonNamedParams types.Map `tfsdk:"python_named_params" tf:"optional"` + PythonNamedParams types.Map `tfsdk:"python_named_params"` // A list of parameters for jobs with Python tasks, for example // `"python_params": ["john doe", "35"]`. The parameters are passed to // Python file as command-line parameters. If specified upon `run-now`, it @@ -11028,7 +11238,7 @@ type RunParameters struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - PythonParams types.List `tfsdk:"python_params" tf:"optional"` + PythonParams types.List `tfsdk:"python_params"` // A list of parameters for jobs with spark submit task, for example // `"spark_submit_params": ["--class", // "org.apache.spark.examples.SparkPi"]`. The parameters are passed to @@ -11047,11 +11257,11 @@ type RunParameters struct { // non-ASCII characters are Chinese, Japanese kanjis, and emojis. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - SparkSubmitParams types.List `tfsdk:"spark_submit_params" tf:"optional"` + SparkSubmitParams types.List `tfsdk:"spark_submit_params"` // A map from keys to values for jobs with SQL task, for example // `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task // does not support custom parameters. - SqlParams types.Map `tfsdk:"sql_params" tf:"optional"` + SqlParams types.Map `tfsdk:"sql_params"` } func (newState *RunParameters) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunParameters) { @@ -11060,10 +11270,17 @@ func (newState *RunParameters) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunP func (newState *RunParameters) SyncEffectiveFieldsDuringRead(existingState RunParameters) { } -func (c RunParameters) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineParams{}.ApplySchemaCustomizations(cs, append(path, "pipeline_params")...) +func (c RunParameters) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbt_commands"] = attrs["dbt_commands"].SetOptional() + attrs["jar_params"] = attrs["jar_params"].SetOptional() + attrs["notebook_params"] = attrs["notebook_params"].SetOptional() + attrs["pipeline_params"] = attrs["pipeline_params"].SetOptional() + attrs["python_named_params"] = attrs["python_named_params"].SetOptional() + attrs["python_params"] = attrs["python_params"].SetOptional() + attrs["spark_submit_params"] = attrs["spark_submit_params"].SetOptional() + attrs["sql_params"] = attrs["sql_params"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunParameters. @@ -11348,18 +11565,18 @@ func (o *RunParameters) SetSqlParams(ctx context.Context, v map[string]types.Str type RunState struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. - LifeCycleState types.String `tfsdk:"life_cycle_state" tf:"optional"` + LifeCycleState types.String `tfsdk:"life_cycle_state"` // The reason indicating why the run was queued. - QueueReason types.String `tfsdk:"queue_reason" tf:"optional"` + QueueReason types.String `tfsdk:"queue_reason"` // A value indicating the run's result. This field is only available for // terminal lifecycle states. - ResultState types.String `tfsdk:"result_state" tf:"optional"` + ResultState types.String `tfsdk:"result_state"` // A descriptive message for the current state. This field is unstructured, // and its exact format is subject to change. - StateMessage types.String `tfsdk:"state_message" tf:"optional"` + StateMessage types.String `tfsdk:"state_message"` // A value indicating whether a run was canceled manually by a user or by // the scheduler because the run timed out. - UserCancelledOrTimedout types.Bool `tfsdk:"user_cancelled_or_timedout" tf:"optional"` + UserCancelledOrTimedout types.Bool `tfsdk:"user_cancelled_or_timedout"` } func (newState *RunState) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunState) { @@ -11368,9 +11585,14 @@ func (newState *RunState) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunState) func (newState *RunState) SyncEffectiveFieldsDuringRead(existingState RunState) { } -func (c RunState) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunState) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["life_cycle_state"] = attrs["life_cycle_state"].SetOptional() + attrs["queue_reason"] = attrs["queue_reason"].SetOptional() + attrs["result_state"] = attrs["result_state"].SetOptional() + attrs["state_message"] = attrs["state_message"].SetOptional() + attrs["user_cancelled_or_timedout"] = attrs["user_cancelled_or_timedout"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunState. @@ -11415,12 +11637,12 @@ func (o RunState) Type(ctx context.Context) attr.Type { // The current status of the run type RunStatus struct { // If the run was queued, details about the reason for queuing the run. - QueueDetails types.Object `tfsdk:"queue_details" tf:"optional,object"` + QueueDetails types.Object `tfsdk:"queue_details"` // The current state of the run. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // If the run is in a TERMINATING or TERMINATED state, details about the // reason for terminating the run. - TerminationDetails types.Object `tfsdk:"termination_details" tf:"optional,object"` + TerminationDetails types.Object `tfsdk:"termination_details"` } func (newState *RunStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunStatus) { @@ -11429,11 +11651,12 @@ func (newState *RunStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunStatu func (newState *RunStatus) SyncEffectiveFieldsDuringRead(existingState RunStatus) { } -func (c RunStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueueDetails{}.ApplySchemaCustomizations(cs, append(path, "queue_details")...) - TerminationDetails{}.ApplySchemaCustomizations(cs, append(path, "termination_details")...) +func (c RunStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["queue_details"] = attrs["queue_details"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["termination_details"] = attrs["termination_details"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunStatus. @@ -11539,48 +11762,48 @@ type RunTask struct { // original attempt’s ID and an incrementing `attempt_number`. Runs are // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. - AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + AttemptNumber types.Int64 `tfsdk:"attempt_number"` // The task runs a [clean rooms] notebook when the // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The // `cleanup_duration` field is set to 0 for multitask job runs. The total // duration of a multitask job run is the value of the `run_duration` field. - CleanupDuration types.Int64 `tfsdk:"cleanup_duration" tf:"optional"` + CleanupDuration types.Int64 `tfsdk:"cleanup_duration"` // The cluster used for this run. If the run is specified to use a new // cluster, this field is set once the Jobs service has requested a cluster // for the run. - ClusterInstance types.Object `tfsdk:"cluster_instance" tf:"optional,object"` + ClusterInstance types.Object `tfsdk:"cluster_instance"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask types.Object `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.Object `tfsdk:"condition_task"` // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask types.Object `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.Object `tfsdk:"dbt_task"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name // assigned to the dependent task. - DependsOn types.List `tfsdk:"depends_on" tf:"optional"` + DependsOn types.List `tfsdk:"depends_on"` // An optional description for this task. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. - EmailNotifications types.Object `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.Object `tfsdk:"email_notifications"` // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey types.String `tfsdk:"environment_key" tf:"optional"` + EnvironmentKey types.String `tfsdk:"environment_key"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -11588,15 +11811,15 @@ type RunTask struct { // The `execution_duration` field is set to 0 for multitask job runs. The // total duration of a multitask job run is the value of the `run_duration` // field. - ExecutionDuration types.Int64 `tfsdk:"execution_duration" tf:"optional"` + ExecutionDuration types.Int64 `tfsdk:"execution_duration"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask types.Object `tfsdk:"for_each_task" tf:"optional,object"` + ForEachTask types.Object `tfsdk:"for_each_task"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. If `git_source` is set, @@ -11605,46 +11828,46 @@ type RunTask struct { // `WORKSPACE` on the task. Note: dbt and SQL File tasks support only // version-controlled sources. If dbt or SQL File tasks are used, // `git_source` must be defined on the job. - GitSource types.Object `tfsdk:"git_source" tf:"optional,object"` + GitSource types.Object `tfsdk:"git_source"` // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:"optional"` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.Object `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.Object `tfsdk:"new_cluster"` // The task runs a notebook when the `notebook_task` field is present. - NotebookTask types.Object `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.Object `tfsdk:"notebook_task"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task run. - NotificationSettings types.Object `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.Object `tfsdk:"notification_settings"` // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask types.Object `tfsdk:"pipeline_task" tf:"optional,object"` + PipelineTask types.Object `tfsdk:"pipeline_task"` // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask types.Object `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.Object `tfsdk:"python_wheel_task"` // The time in milliseconds that the run has spent in the queue. - QueueDuration types.Int64 `tfsdk:"queue_duration" tf:"optional"` + QueueDuration types.Int64 `tfsdk:"queue_duration"` // Parameter values including resolved references - ResolvedValues types.Object `tfsdk:"resolved_values" tf:"optional,object"` + ResolvedValues types.Object `tfsdk:"resolved_values"` // The time in milliseconds it took the job run and all of its repairs to // finish. - RunDuration types.Int64 `tfsdk:"run_duration" tf:"optional"` + RunDuration types.Int64 `tfsdk:"run_duration"` // The ID of the task run. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` // An optional value indicating the condition that determines whether the // task should be run once its dependencies have been completed. When // omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of // possible values. - RunIf types.String `tfsdk:"run_if" tf:"optional"` + RunIf types.String `tfsdk:"run_if"` // The task triggers another job when the `run_job_task` field is present. - RunJobTask types.Object `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.Object `tfsdk:"run_job_task"` - RunPageUrl types.String `tfsdk:"run_page_url" tf:"optional"` + RunPageUrl types.String `tfsdk:"run_page_url"` // The time in milliseconds it took to set up the cluster. For runs that run // on new clusters this is the cluster creation time, for runs that run on // existing clusters this time should be very short. The duration of a task @@ -11652,12 +11875,12 @@ type RunTask struct { // `cleanup_duration`. The `setup_duration` field is set to 0 for multitask // job runs. The total duration of a multitask job run is the value of the // `run_duration` field. - SetupDuration types.Int64 `tfsdk:"setup_duration" tf:"optional"` + SetupDuration types.Int64 `tfsdk:"setup_duration"` // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask types.Object `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.Object `tfsdk:"spark_jar_task"` // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask types.Object `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.Object `tfsdk:"spark_python_task"` // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -11676,31 +11899,31 @@ type RunTask struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask types.Object `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.Object `tfsdk:"spark_submit_task"` // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask types.Object `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.Object `tfsdk:"sql_task"` // The time at which this run was started in epoch milliseconds // (milliseconds since 1/1/1970 UTC). This may not be the time when the job // task starts executing, for example, if the job is scheduled to run on a // new cluster, this is the time the cluster creation call is issued. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Deprecated. Please use the `status` field instead. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The current status of the run - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when the run begins or // completes. The default behavior is to not send any system notifications. // Task webhooks respect the task notification settings. - WebhookNotifications types.Object `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.Object `tfsdk:"webhook_notifications"` } func (newState *RunTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTask) { @@ -11709,32 +11932,49 @@ func (newState *RunTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTask) { func (newState *RunTask) SyncEffectiveFieldsDuringRead(existingState RunTask) { } -func (c RunTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomsNotebookTask{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms_notebook_task")...) - ClusterInstance{}.ApplySchemaCustomizations(cs, append(path, "cluster_instance")...) - RunConditionTask{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - DbtTask{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - TaskDependency{}.ApplySchemaCustomizations(cs, append(path, "depends_on")...) - JobEmailNotifications{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - RunForEachTask{}.ApplySchemaCustomizations(cs, append(path, "for_each_task")...) - GitSource{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - compute_tf.ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) - NotebookTask{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - TaskNotificationSettings{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - PipelineTask{}.ApplySchemaCustomizations(cs, append(path, "pipeline_task")...) - PythonWheelTask{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - ResolvedValues{}.ApplySchemaCustomizations(cs, append(path, "resolved_values")...) - RunJobTask{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - SparkJarTask{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - SparkPythonTask{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - SparkSubmitTask{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - SqlTask{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - RunState{}.ApplySchemaCustomizations(cs, append(path, "state")...) - RunStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) - cs.SetRequired(append(path, "task_key")...) - WebhookNotifications{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c RunTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["attempt_number"] = attrs["attempt_number"].SetOptional() + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].SetOptional() + attrs["cleanup_duration"] = attrs["cleanup_duration"].SetOptional() + attrs["cluster_instance"] = attrs["cluster_instance"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["depends_on"] = attrs["depends_on"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["environment_key"] = attrs["environment_key"].SetOptional() + attrs["execution_duration"] = attrs["execution_duration"].SetOptional() + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["pipeline_task"] = attrs["pipeline_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["queue_duration"] = attrs["queue_duration"].SetOptional() + attrs["resolved_values"] = attrs["resolved_values"].SetOptional() + attrs["run_duration"] = attrs["run_duration"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_if"] = attrs["run_if"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["run_page_url"] = attrs["run_page_url"].SetOptional() + attrs["setup_duration"] = attrs["setup_duration"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["task_key"] = attrs["task_key"].SetRequired() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunTask. @@ -12517,20 +12757,20 @@ func (o *RunTask) SetWebhookNotifications(ctx context.Context, v WebhookNotifica type SparkJarTask struct { // Deprecated since 04/2016. Provide a `jar` through the `libraries` field // instead. For an example, see :method:jobs/create. - JarUri types.String `tfsdk:"jar_uri" tf:"optional"` + JarUri types.String `tfsdk:"jar_uri"` // The full name of the class containing the main method to be executed. // This class must be contained in a JAR provided as a library. // // The code must use `SparkContext.getOrCreate` to obtain a Spark context; // otherwise, runs of the job fail. - MainClassName types.String `tfsdk:"main_class_name" tf:"optional"` + MainClassName types.String `tfsdk:"main_class_name"` // Parameters passed to the main method. // // Use [Task parameter variables] to set parameters containing information // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *SparkJarTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkJarTask) { @@ -12539,9 +12779,12 @@ func (newState *SparkJarTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Spark func (newState *SparkJarTask) SyncEffectiveFieldsDuringRead(existingState SparkJarTask) { } -func (c SparkJarTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkJarTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["jar_uri"] = attrs["jar_uri"].SetOptional() + attrs["main_class_name"] = attrs["main_class_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkJarTask. @@ -12616,13 +12859,13 @@ type SparkPythonTask struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, // adls:/, gcs:/) and workspace paths are supported. For python files stored // in the Databricks workspace, the path must be absolute and begin with // `/`. For files stored in a remote repository, the path must be relative. // This field is required. - PythonFile types.String `tfsdk:"python_file" tf:""` + PythonFile types.String `tfsdk:"python_file"` // Optional location type of the Python file. When set to `WORKSPACE` or not // specified, the file will be retrieved from the local Databricks workspace // or cloud location (if the `python_file` has a URI format). When set to @@ -12632,7 +12875,7 @@ type SparkPythonTask struct { // * `WORKSPACE`: The Python file is located in a Databricks workspace or at // a cloud filesystem URI. * `GIT`: The Python file is located in a remote // Git repository. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` } func (newState *SparkPythonTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkPythonTask) { @@ -12641,10 +12884,12 @@ func (newState *SparkPythonTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sp func (newState *SparkPythonTask) SyncEffectiveFieldsDuringRead(existingState SparkPythonTask) { } -func (c SparkPythonTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "python_file")...) +func (c SparkPythonTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["python_file"] = attrs["python_file"].SetRequired() + attrs["source"] = attrs["source"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkPythonTask. @@ -12719,7 +12964,7 @@ type SparkSubmitTask struct { // about job runs. // // [Task parameter variables]: https://docs.databricks.com/jobs.html#parameter-variables - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` } func (newState *SparkSubmitTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparkSubmitTask) { @@ -12728,9 +12973,10 @@ func (newState *SparkSubmitTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sp func (newState *SparkSubmitTask) SyncEffectiveFieldsDuringRead(existingState SparkSubmitTask) { } -func (c SparkSubmitTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparkSubmitTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["parameters"] = attrs["parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparkSubmitTask. @@ -12800,16 +13046,16 @@ type SqlAlertOutput struct { // * UNKNOWN: alert yet to be evaluated * OK: alert evaluated and did not // fulfill trigger conditions * TRIGGERED: alert evaluated and fulfilled // trigger conditions - AlertState types.String `tfsdk:"alert_state" tf:"optional"` + AlertState types.String `tfsdk:"alert_state"` // The link to find the output results. - OutputLink types.String `tfsdk:"output_link" tf:"optional"` + OutputLink types.String `tfsdk:"output_link"` // The text of the SQL query. Can Run permission of the SQL query associated // with the SQL alert is required to view this field. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Information about SQL statements executed in the run. - SqlStatements types.List `tfsdk:"sql_statements" tf:"optional"` + SqlStatements types.List `tfsdk:"sql_statements"` // The canonical identifier of the SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *SqlAlertOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlAlertOutput) { @@ -12818,10 +13064,14 @@ func (newState *SqlAlertOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sql func (newState *SqlAlertOutput) SyncEffectiveFieldsDuringRead(existingState SqlAlertOutput) { } -func (c SqlAlertOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlStatementOutput{}.ApplySchemaCustomizations(cs, append(path, "sql_statements")...) +func (c SqlAlertOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_state"] = attrs["alert_state"].SetOptional() + attrs["output_link"] = attrs["output_link"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["sql_statements"] = attrs["sql_statements"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlAlertOutput. @@ -12895,9 +13145,9 @@ func (o *SqlAlertOutput) SetSqlStatements(ctx context.Context, v []SqlStatementO type SqlDashboardOutput struct { // The canonical identifier of the SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` // Widgets executed in the run. Only SQL query based widgets are listed. - Widgets types.List `tfsdk:"widgets" tf:"optional"` + Widgets types.List `tfsdk:"widgets"` } func (newState *SqlDashboardOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlDashboardOutput) { @@ -12906,10 +13156,11 @@ func (newState *SqlDashboardOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SqlDashboardOutput) SyncEffectiveFieldsDuringRead(existingState SqlDashboardOutput) { } -func (c SqlDashboardOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlDashboardWidgetOutput{}.ApplySchemaCustomizations(cs, append(path, "widgets")...) +func (c SqlDashboardOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + attrs["widgets"] = attrs["widgets"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlDashboardOutput. @@ -12977,19 +13228,19 @@ func (o *SqlDashboardOutput) SetWidgets(ctx context.Context, v []SqlDashboardWid type SqlDashboardWidgetOutput struct { // Time (in epoch milliseconds) when execution of the SQL widget ends. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The information about the error when execution fails. - Error types.Object `tfsdk:"error" tf:"optional,object"` + Error types.Object `tfsdk:"error"` // The link to find the output results. - OutputLink types.String `tfsdk:"output_link" tf:"optional"` + OutputLink types.String `tfsdk:"output_link"` // Time (in epoch milliseconds) when execution of the SQL widget starts. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // The execution status of the SQL widget. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The canonical identifier of the SQL widget. - WidgetId types.String `tfsdk:"widget_id" tf:"optional"` + WidgetId types.String `tfsdk:"widget_id"` // The title of the SQL widget. - WidgetTitle types.String `tfsdk:"widget_title" tf:"optional"` + WidgetTitle types.String `tfsdk:"widget_title"` } func (newState *SqlDashboardWidgetOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlDashboardWidgetOutput) { @@ -12998,10 +13249,16 @@ func (newState *SqlDashboardWidgetOutput) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *SqlDashboardWidgetOutput) SyncEffectiveFieldsDuringRead(existingState SqlDashboardWidgetOutput) { } -func (c SqlDashboardWidgetOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlOutputError{}.ApplySchemaCustomizations(cs, append(path, "error")...) +func (c SqlDashboardWidgetOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["error"] = attrs["error"].SetOptional() + attrs["output_link"] = attrs["output_link"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["widget_id"] = attrs["widget_id"].SetOptional() + attrs["widget_title"] = attrs["widget_title"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlDashboardWidgetOutput. @@ -13079,11 +13336,11 @@ func (o *SqlDashboardWidgetOutput) SetError(ctx context.Context, v SqlOutputErro type SqlOutput struct { // The output of a SQL alert task, if available. - AlertOutput types.Object `tfsdk:"alert_output" tf:"optional,object"` + AlertOutput types.Object `tfsdk:"alert_output"` // The output of a SQL dashboard task, if available. - DashboardOutput types.Object `tfsdk:"dashboard_output" tf:"optional,object"` + DashboardOutput types.Object `tfsdk:"dashboard_output"` // The output of a SQL query task, if available. - QueryOutput types.Object `tfsdk:"query_output" tf:"optional,object"` + QueryOutput types.Object `tfsdk:"query_output"` } func (newState *SqlOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlOutput) { @@ -13092,12 +13349,12 @@ func (newState *SqlOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlOutpu func (newState *SqlOutput) SyncEffectiveFieldsDuringRead(existingState SqlOutput) { } -func (c SqlOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlAlertOutput{}.ApplySchemaCustomizations(cs, append(path, "alert_output")...) - SqlDashboardOutput{}.ApplySchemaCustomizations(cs, append(path, "dashboard_output")...) - SqlQueryOutput{}.ApplySchemaCustomizations(cs, append(path, "query_output")...) +func (c SqlOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_output"] = attrs["alert_output"].SetOptional() + attrs["dashboard_output"] = attrs["dashboard_output"].SetOptional() + attrs["query_output"] = attrs["query_output"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlOutput. @@ -13225,7 +13482,7 @@ func (o *SqlOutput) SetQueryOutput(ctx context.Context, v SqlQueryOutput) { type SqlOutputError struct { // The error message when execution fails. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *SqlOutputError) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlOutputError) { @@ -13234,9 +13491,10 @@ func (newState *SqlOutputError) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sql func (newState *SqlOutputError) SyncEffectiveFieldsDuringRead(existingState SqlOutputError) { } -func (c SqlOutputError) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SqlOutputError) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlOutputError. @@ -13271,16 +13529,16 @@ func (o SqlOutputError) Type(ctx context.Context) attr.Type { } type SqlQueryOutput struct { - EndpointId types.String `tfsdk:"endpoint_id" tf:"optional"` + EndpointId types.String `tfsdk:"endpoint_id"` // The link to find the output results. - OutputLink types.String `tfsdk:"output_link" tf:"optional"` + OutputLink types.String `tfsdk:"output_link"` // The text of the SQL query. Can Run permission of the SQL query is // required to view this field. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Information about SQL statements executed in the run. - SqlStatements types.List `tfsdk:"sql_statements" tf:"optional"` + SqlStatements types.List `tfsdk:"sql_statements"` // The canonical identifier of the SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *SqlQueryOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlQueryOutput) { @@ -13289,10 +13547,14 @@ func (newState *SqlQueryOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sql func (newState *SqlQueryOutput) SyncEffectiveFieldsDuringRead(existingState SqlQueryOutput) { } -func (c SqlQueryOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlStatementOutput{}.ApplySchemaCustomizations(cs, append(path, "sql_statements")...) +func (c SqlQueryOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_id"] = attrs["endpoint_id"].SetOptional() + attrs["output_link"] = attrs["output_link"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["sql_statements"] = attrs["sql_statements"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlQueryOutput. @@ -13366,7 +13628,7 @@ func (o *SqlQueryOutput) SetSqlStatements(ctx context.Context, v []SqlStatementO type SqlStatementOutput struct { // A key that can be used to look up query details. - LookupKey types.String `tfsdk:"lookup_key" tf:"optional"` + LookupKey types.String `tfsdk:"lookup_key"` } func (newState *SqlStatementOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlStatementOutput) { @@ -13375,9 +13637,10 @@ func (newState *SqlStatementOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SqlStatementOutput) SyncEffectiveFieldsDuringRead(existingState SqlStatementOutput) { } -func (c SqlStatementOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SqlStatementOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["lookup_key"] = attrs["lookup_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlStatementOutput. @@ -13413,22 +13676,22 @@ func (o SqlStatementOutput) Type(ctx context.Context) attr.Type { type SqlTask struct { // If alert, indicates that this job must refresh a SQL alert. - Alert types.Object `tfsdk:"alert" tf:"optional,object"` + Alert types.Object `tfsdk:"alert"` // If dashboard, indicates that this job must refresh a SQL dashboard. - Dashboard types.Object `tfsdk:"dashboard" tf:"optional,object"` + Dashboard types.Object `tfsdk:"dashboard"` // If file, indicates that this job runs a SQL file in a remote Git // repository. - File types.Object `tfsdk:"file" tf:"optional,object"` + File types.Object `tfsdk:"file"` // Parameters to be used for each run of this job. The SQL alert task does // not support custom parameters. - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` // If query, indicates that this job must execute a SQL query. - Query types.Object `tfsdk:"query" tf:"optional,object"` + Query types.Object `tfsdk:"query"` // The canonical identifier of the SQL warehouse. Recommended to use with // serverless or pro SQL warehouses. Classic SQL warehouses are only // supported for SQL alert, dashboard and query tasks and are limited to // scheduled single-task jobs. - WarehouseId types.String `tfsdk:"warehouse_id" tf:""` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *SqlTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTask) { @@ -13437,14 +13700,15 @@ func (newState *SqlTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTask) { func (newState *SqlTask) SyncEffectiveFieldsDuringRead(existingState SqlTask) { } -func (c SqlTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SqlTaskAlert{}.ApplySchemaCustomizations(cs, append(path, "alert")...) - SqlTaskDashboard{}.ApplySchemaCustomizations(cs, append(path, "dashboard")...) - SqlTaskFile{}.ApplySchemaCustomizations(cs, append(path, "file")...) - SqlTaskQuery{}.ApplySchemaCustomizations(cs, append(path, "query")...) - cs.SetRequired(append(path, "warehouse_id")...) +func (c SqlTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert"] = attrs["alert"].SetOptional() + attrs["dashboard"] = attrs["dashboard"].SetOptional() + attrs["file"] = attrs["file"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTask. @@ -13636,11 +13900,11 @@ func (o *SqlTask) SetQuery(ctx context.Context, v SqlTaskQuery) { type SqlTaskAlert struct { // The canonical identifier of the SQL alert. - AlertId types.String `tfsdk:"alert_id" tf:""` + AlertId types.String `tfsdk:"alert_id"` // If true, the alert notifications are not sent to subscribers. - PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions" tf:"optional"` + PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions"` // If specified, alert notifications are sent to subscribers. - Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` + Subscriptions types.List `tfsdk:"subscriptions"` } func (newState *SqlTaskAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskAlert) { @@ -13649,11 +13913,12 @@ func (newState *SqlTaskAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTa func (newState *SqlTaskAlert) SyncEffectiveFieldsDuringRead(existingState SqlTaskAlert) { } -func (c SqlTaskAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "alert_id")...) - SqlTaskSubscription{}.ApplySchemaCustomizations(cs, append(path, "subscriptions")...) +func (c SqlTaskAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_id"] = attrs["alert_id"].SetRequired() + attrs["pause_subscriptions"] = attrs["pause_subscriptions"].SetOptional() + attrs["subscriptions"] = attrs["subscriptions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskAlert. @@ -13723,14 +13988,14 @@ func (o *SqlTaskAlert) SetSubscriptions(ctx context.Context, v []SqlTaskSubscrip type SqlTaskDashboard struct { // Subject of the email sent to subscribers of this task. - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The canonical identifier of the SQL dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` // If true, the dashboard snapshot is not taken, and emails are not sent to // subscribers. - PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions" tf:"optional"` + PauseSubscriptions types.Bool `tfsdk:"pause_subscriptions"` // If specified, dashboard snapshots are sent to subscriptions. - Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` + Subscriptions types.List `tfsdk:"subscriptions"` } func (newState *SqlTaskDashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskDashboard) { @@ -13739,11 +14004,13 @@ func (newState *SqlTaskDashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SqlTaskDashboard) SyncEffectiveFieldsDuringRead(existingState SqlTaskDashboard) { } -func (c SqlTaskDashboard) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - SqlTaskSubscription{}.ApplySchemaCustomizations(cs, append(path, "subscriptions")...) +func (c SqlTaskDashboard) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["pause_subscriptions"] = attrs["pause_subscriptions"].SetOptional() + attrs["subscriptions"] = attrs["subscriptions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskDashboard. @@ -13816,7 +14083,7 @@ func (o *SqlTaskDashboard) SetSubscriptions(ctx context.Context, v []SqlTaskSubs type SqlTaskFile struct { // Path of the SQL file. Must be relative if the source is a remote Git // repository and absolute for workspace paths. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` // Optional location type of the SQL file. When set to `WORKSPACE`, the SQL // file will be retrieved from the local Databricks workspace. When set to // `GIT`, the SQL file will be retrieved from a Git repository defined in @@ -13825,7 +14092,7 @@ type SqlTaskFile struct { // // * `WORKSPACE`: SQL file is located in Databricks workspace. * `GIT`: SQL // file is located in cloud Git provider. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` } func (newState *SqlTaskFile) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskFile) { @@ -13834,10 +14101,11 @@ func (newState *SqlTaskFile) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTas func (newState *SqlTaskFile) SyncEffectiveFieldsDuringRead(existingState SqlTaskFile) { } -func (c SqlTaskFile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c SqlTaskFile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() + attrs["source"] = attrs["source"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskFile. @@ -13875,7 +14143,7 @@ func (o SqlTaskFile) Type(ctx context.Context) attr.Type { type SqlTaskQuery struct { // The canonical identifier of the SQL query. - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` } func (newState *SqlTaskQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskQuery) { @@ -13884,10 +14152,10 @@ func (newState *SqlTaskQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTa func (newState *SqlTaskQuery) SyncEffectiveFieldsDuringRead(existingState SqlTaskQuery) { } -func (c SqlTaskQuery) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "query_id")...) +func (c SqlTaskQuery) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query_id"] = attrs["query_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskQuery. @@ -13926,11 +14194,11 @@ type SqlTaskSubscription struct { // notification. This parameter is mutually exclusive with user_name. You // cannot set both destination_id and user_name for subscription // notifications. - DestinationId types.String `tfsdk:"destination_id" tf:"optional"` + DestinationId types.String `tfsdk:"destination_id"` // The user name to receive the subscription email. This parameter is // mutually exclusive with destination_id. You cannot set both // destination_id and user_name for subscription notifications. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *SqlTaskSubscription) SyncEffectiveFieldsDuringCreateOrUpdate(plan SqlTaskSubscription) { @@ -13939,9 +14207,11 @@ func (newState *SqlTaskSubscription) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *SqlTaskSubscription) SyncEffectiveFieldsDuringRead(existingState SqlTaskSubscription) { } -func (c SqlTaskSubscription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SqlTaskSubscription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_id"] = attrs["destination_id"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SqlTaskSubscription. @@ -13979,16 +14249,16 @@ func (o SqlTaskSubscription) Type(ctx context.Context) attr.Type { type SubmitRun struct { // List of permissions to set on the job. - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The user specified id of the budget policy to use for this one-time run. // If not specified, the run will be not be attributed to any budget policy. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // An optional set of email addresses notified when the run begins or // completes. - EmailNotifications types.Object `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.Object `tfsdk:"email_notifications"` // A list of task execution environment specifications that can be // referenced by tasks of this run. - Environments types.List `tfsdk:"environments" tf:"optional"` + Environments types.List `tfsdk:"environments"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -13999,9 +14269,9 @@ type SubmitRun struct { // // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. - GitSource types.Object `tfsdk:"git_source" tf:"optional,object"` + GitSource types.Object `tfsdk:"git_source"` // An optional set of health rules that can be defined for this job. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // An optional token that can be used to guarantee the idempotency of job // run requests. If a run with the provided token already exists, the // request does not create a new run but returns the ID of the existing run @@ -14017,26 +14287,26 @@ type SubmitRun struct { // For more information, see [How to ensure idempotency for jobs]. // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html - IdempotencyToken types.String `tfsdk:"idempotency_token" tf:"optional"` + IdempotencyToken types.String `tfsdk:"idempotency_token"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // run. - NotificationSettings types.Object `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.Object `tfsdk:"notification_settings"` // The queue settings of the one-time run. - Queue types.Object `tfsdk:"queue" tf:"optional,object"` + Queue types.Object `tfsdk:"queue"` // Specifies the user or service principal that the job runs as. If not // specified, the job runs as the user who submits the request. - RunAs types.Object `tfsdk:"run_as" tf:"optional,object"` + RunAs types.Object `tfsdk:"run_as"` // An optional name for the run. The default value is `Untitled`. - RunName types.String `tfsdk:"run_name" tf:"optional"` + RunName types.String `tfsdk:"run_name"` - Tasks types.List `tfsdk:"tasks" tf:"optional"` + Tasks types.List `tfsdk:"tasks"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when the run begins or // completes. - WebhookNotifications types.Object `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.Object `tfsdk:"webhook_notifications"` } func (newState *SubmitRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitRun) { @@ -14045,19 +14315,23 @@ func (newState *SubmitRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitRu func (newState *SubmitRun) SyncEffectiveFieldsDuringRead(existingState SubmitRun) { } -func (c SubmitRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - JobAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - JobEmailNotifications{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - JobEnvironment{}.ApplySchemaCustomizations(cs, append(path, "environments")...) - GitSource{}.ApplySchemaCustomizations(cs, append(path, "git_source")...) - JobsHealthRules{}.ApplySchemaCustomizations(cs, append(path, "health")...) - JobNotificationSettings{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - QueueSettings{}.ApplySchemaCustomizations(cs, append(path, "queue")...) - JobRunAs{}.ApplySchemaCustomizations(cs, append(path, "run_as")...) - SubmitTask{}.ApplySchemaCustomizations(cs, append(path, "tasks")...) - WebhookNotifications{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) +func (c SubmitRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["environments"] = attrs["environments"].SetOptional() + attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["idempotency_token"] = attrs["idempotency_token"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["queue"] = attrs["queue"].SetOptional() + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["run_name"] = attrs["run_name"].SetOptional() + attrs["tasks"] = attrs["tasks"].SetOptional() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubmitRun. @@ -14411,7 +14685,7 @@ func (o *SubmitRun) SetWebhookNotifications(ctx context.Context, v WebhookNotifi // Run was created and started successfully. type SubmitRunResponse struct { // The canonical identifier for the newly submitted run. - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *SubmitRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitRunResponse) { @@ -14420,9 +14694,10 @@ func (newState *SubmitRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SubmitRunResponse) SyncEffectiveFieldsDuringRead(existingState SubmitRunResponse) { } -func (c SubmitRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SubmitRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubmitRunResponse. @@ -14461,70 +14736,70 @@ type SubmitTask struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask types.Object `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.Object `tfsdk:"condition_task"` // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask types.Object `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.Object `tfsdk:"dbt_task"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name // assigned to the dependent task. - DependsOn types.List `tfsdk:"depends_on" tf:"optional"` + DependsOn types.List `tfsdk:"depends_on"` // An optional description for this task. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. - EmailNotifications types.Object `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.Object `tfsdk:"email_notifications"` // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey types.String `tfsdk:"environment_key" tf:"optional"` + EnvironmentKey types.String `tfsdk:"environment_key"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask types.Object `tfsdk:"for_each_task" tf:"optional,object"` + ForEachTask types.Object `tfsdk:"for_each_task"` // An optional set of health rules that can be defined for this job. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.Object `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.Object `tfsdk:"new_cluster"` // The task runs a notebook when the `notebook_task` field is present. - NotebookTask types.Object `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.Object `tfsdk:"notebook_task"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task run. - NotificationSettings types.Object `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.Object `tfsdk:"notification_settings"` // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask types.Object `tfsdk:"pipeline_task" tf:"optional,object"` + PipelineTask types.Object `tfsdk:"pipeline_task"` // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask types.Object `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.Object `tfsdk:"python_wheel_task"` // An optional value indicating the condition that determines whether the // task should be run once its dependencies have been completed. When // omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of // possible values. - RunIf types.String `tfsdk:"run_if" tf:"optional"` + RunIf types.String `tfsdk:"run_if"` // The task triggers another job when the `run_job_task` field is present. - RunJobTask types.Object `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.Object `tfsdk:"run_job_task"` // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask types.Object `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.Object `tfsdk:"spark_jar_task"` // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask types.Object `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.Object `tfsdk:"spark_python_task"` // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -14543,22 +14818,22 @@ type SubmitTask struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask types.Object `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.Object `tfsdk:"spark_submit_task"` // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask types.Object `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.Object `tfsdk:"sql_task"` // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when the run begins or // completes. The default behavior is to not send any system notifications. // Task webhooks respect the task notification settings. - WebhookNotifications types.Object `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.Object `tfsdk:"webhook_notifications"` } func (newState *SubmitTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitTask) { @@ -14567,28 +14842,34 @@ func (newState *SubmitTask) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubmitT func (newState *SubmitTask) SyncEffectiveFieldsDuringRead(existingState SubmitTask) { } -func (c SubmitTask) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomsNotebookTask{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms_notebook_task")...) - ConditionTask{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - DbtTask{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - TaskDependency{}.ApplySchemaCustomizations(cs, append(path, "depends_on")...) - JobEmailNotifications{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - ForEachTask{}.ApplySchemaCustomizations(cs, append(path, "for_each_task")...) - JobsHealthRules{}.ApplySchemaCustomizations(cs, append(path, "health")...) - compute_tf.ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) - NotebookTask{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - TaskNotificationSettings{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - PipelineTask{}.ApplySchemaCustomizations(cs, append(path, "pipeline_task")...) - PythonWheelTask{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - RunJobTask{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - SparkJarTask{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - SparkPythonTask{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - SparkSubmitTask{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - SqlTask{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - cs.SetRequired(append(path, "task_key")...) - WebhookNotifications{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c SubmitTask) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["depends_on"] = attrs["depends_on"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["environment_key"] = attrs["environment_key"].SetOptional() + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["pipeline_task"] = attrs["pipeline_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["run_if"] = attrs["run_if"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["task_key"] = attrs["task_key"].SetRequired() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SubmitTask. @@ -15224,19 +15505,19 @@ func (o *SubmitTask) SetWebhookNotifications(ctx context.Context, v WebhookNotif type TableUpdateTriggerConfiguration struct { // The table(s) condition based on which to trigger a job run. - Condition types.String `tfsdk:"condition" tf:"optional"` + Condition types.String `tfsdk:"condition"` // If set, the trigger starts a run only after the specified amount of time // has passed since the last time the trigger fired. The minimum allowed // value is 60 seconds. - MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds" tf:"optional"` + MinTimeBetweenTriggersSeconds types.Int64 `tfsdk:"min_time_between_triggers_seconds"` // A list of Delta tables to monitor for changes. The table name must be in // the format `catalog_name.schema_name.table_name`. - TableNames types.List `tfsdk:"table_names" tf:"optional"` + TableNames types.List `tfsdk:"table_names"` // If set, the trigger starts a run only after no table updates have // occurred for the specified time and can be used to wait for a series of // table updates before triggering a run. The minimum allowed value is 60 // seconds. - WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds" tf:"optional"` + WaitAfterLastChangeSeconds types.Int64 `tfsdk:"wait_after_last_change_seconds"` } func (newState *TableUpdateTriggerConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableUpdateTriggerConfiguration) { @@ -15245,9 +15526,13 @@ func (newState *TableUpdateTriggerConfiguration) SyncEffectiveFieldsDuringCreate func (newState *TableUpdateTriggerConfiguration) SyncEffectiveFieldsDuringRead(existingState TableUpdateTriggerConfiguration) { } -func (c TableUpdateTriggerConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableUpdateTriggerConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["min_time_between_triggers_seconds"] = attrs["min_time_between_triggers_seconds"].SetOptional() + attrs["table_names"] = attrs["table_names"].SetOptional() + attrs["wait_after_last_change_seconds"] = attrs["wait_after_last_change_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableUpdateTriggerConfiguration. @@ -15322,76 +15607,76 @@ type Task struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries // or notifications. - ConditionTask types.Object `tfsdk:"condition_task" tf:"optional,object"` + ConditionTask types.Object `tfsdk:"condition_task"` // The task runs one or more dbt commands when the `dbt_task` field is // present. The dbt task requires both Databricks SQL and the ability to use // a serverless or a pro SQL warehouse. - DbtTask types.Object `tfsdk:"dbt_task" tf:"optional,object"` + DbtTask types.Object `tfsdk:"dbt_task"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete before executing this // task. The task will run only if the `run_if` condition is true. The key // is `task_key`, and the value is the name assigned to the dependent task. - DependsOn types.List `tfsdk:"depends_on" tf:"optional"` + DependsOn types.List `tfsdk:"depends_on"` // An optional description for this task. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // An option to disable auto optimization in serverless - DisableAutoOptimization types.Bool `tfsdk:"disable_auto_optimization" tf:"optional"` + DisableAutoOptimization types.Bool `tfsdk:"disable_auto_optimization"` // An optional set of email addresses that is notified when runs of this // task begin or complete as well as when this task is deleted. The default // behavior is to not send any emails. - EmailNotifications types.Object `tfsdk:"email_notifications" tf:"optional,object"` + EmailNotifications types.Object `tfsdk:"email_notifications"` // The key that references an environment spec in a job. This field is // required for Python script, Python wheel and dbt tasks when using // serverless compute. - EnvironmentKey types.String `tfsdk:"environment_key" tf:"optional"` + EnvironmentKey types.String `tfsdk:"environment_key"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest // running jobs and tasks on new clusters for greater reliability - ExistingClusterId types.String `tfsdk:"existing_cluster_id" tf:"optional"` + ExistingClusterId types.String `tfsdk:"existing_cluster_id"` // The task executes a nested task for every input provided when the // `for_each_task` field is present. - ForEachTask types.Object `tfsdk:"for_each_task" tf:"optional,object"` + ForEachTask types.Object `tfsdk:"for_each_task"` // An optional set of health rules that can be defined for this job. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // If job_cluster_key, this task is executed reusing the cluster specified // in `job.settings.job_clusters`. - JobClusterKey types.String `tfsdk:"job_cluster_key" tf:"optional"` + JobClusterKey types.String `tfsdk:"job_cluster_key"` // An optional list of libraries to be installed on the cluster. The default // value is an empty list. - Libraries types.List `tfsdk:"library" tf:"optional"` + Libraries types.List `tfsdk:"library"` // An optional maximum number of times to retry an unsuccessful run. A run // is considered to be unsuccessful if it completes with the `FAILED` // result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means // to retry indefinitely and the value `0` means to never retry. - MaxRetries types.Int64 `tfsdk:"max_retries" tf:"optional"` + MaxRetries types.Int64 `tfsdk:"max_retries"` // An optional minimal interval in milliseconds between the start of the // failed run and the subsequent retry run. The default behavior is that // unsuccessful runs are immediately retried. - MinRetryIntervalMillis types.Int64 `tfsdk:"min_retry_interval_millis" tf:"optional"` + MinRetryIntervalMillis types.Int64 `tfsdk:"min_retry_interval_millis"` // If new_cluster, a description of a new cluster that is created for each // run. - NewCluster types.Object `tfsdk:"new_cluster" tf:"optional,object"` + NewCluster types.Object `tfsdk:"new_cluster"` // The task runs a notebook when the `notebook_task` field is present. - NotebookTask types.Object `tfsdk:"notebook_task" tf:"optional,object"` + NotebookTask types.Object `tfsdk:"notebook_task"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // task. - NotificationSettings types.Object `tfsdk:"notification_settings" tf:"optional,object"` + NotificationSettings types.Object `tfsdk:"notification_settings"` // The task triggers a pipeline update when the `pipeline_task` field is // present. Only pipelines configured to use triggered more are supported. - PipelineTask types.Object `tfsdk:"pipeline_task" tf:"optional,object"` + PipelineTask types.Object `tfsdk:"pipeline_task"` // The task runs a Python wheel when the `python_wheel_task` field is // present. - PythonWheelTask types.Object `tfsdk:"python_wheel_task" tf:"optional,object"` + PythonWheelTask types.Object `tfsdk:"python_wheel_task"` // An optional policy to specify whether to retry a job when it times out. // The default behavior is to not retry on timeout. - RetryOnTimeout types.Bool `tfsdk:"retry_on_timeout" tf:"optional"` + RetryOnTimeout types.Bool `tfsdk:"retry_on_timeout"` // An optional value specifying the condition determining whether the task // is run once its dependencies have been completed. // @@ -15401,14 +15686,14 @@ type Task struct { // executed * `ALL_DONE`: All dependencies have been completed * // `AT_LEAST_ONE_FAILED`: At least one dependency failed * `ALL_FAILED`: ALl // dependencies have failed - RunIf types.String `tfsdk:"run_if" tf:"optional"` + RunIf types.String `tfsdk:"run_if"` // The task triggers another job when the `run_job_task` field is present. - RunJobTask types.Object `tfsdk:"run_job_task" tf:"optional,object"` + RunJobTask types.Object `tfsdk:"run_job_task"` // The task runs a JAR when the `spark_jar_task` field is present. - SparkJarTask types.Object `tfsdk:"spark_jar_task" tf:"optional,object"` + SparkJarTask types.Object `tfsdk:"spark_jar_task"` // The task runs a Python file when the `spark_python_task` field is // present. - SparkPythonTask types.Object `tfsdk:"spark_python_task" tf:"optional,object"` + SparkPythonTask types.Object `tfsdk:"spark_python_task"` // (Legacy) The task runs the spark-submit script when the // `spark_submit_task` field is present. This task can run only on new // clusters and is not compatible with serverless compute. @@ -15427,22 +15712,22 @@ type Task struct { // // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 // paths. - SparkSubmitTask types.Object `tfsdk:"spark_submit_task" tf:"optional,object"` + SparkSubmitTask types.Object `tfsdk:"spark_submit_task"` // The task runs a SQL query or file, or it refreshes a SQL alert or a // legacy SQL dashboard when the `sql_task` field is present. - SqlTask types.Object `tfsdk:"sql_task" tf:"optional,object"` + SqlTask types.Object `tfsdk:"sql_task"` // A unique name for the task. This field is used to refer to this task from // other tasks. This field is required and must be unique within its parent // job. On Update or Reset, this field is used to reference the tasks to be // updated or reset. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` // An optional timeout applied to each run of this job task. A value of `0` // means no timeout. - TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds" tf:"optional"` + TimeoutSeconds types.Int64 `tfsdk:"timeout_seconds"` // A collection of system notification IDs to notify when runs of this task // begin or complete. The default behavior is to not send any system // notifications. - WebhookNotifications types.Object `tfsdk:"webhook_notifications" tf:"optional,object"` + WebhookNotifications types.Object `tfsdk:"webhook_notifications"` } func (newState *Task) SyncEffectiveFieldsDuringCreateOrUpdate(plan Task) { @@ -15451,28 +15736,39 @@ func (newState *Task) SyncEffectiveFieldsDuringCreateOrUpdate(plan Task) { func (newState *Task) SyncEffectiveFieldsDuringRead(existingState Task) { } -func (c Task) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CleanRoomsNotebookTask{}.ApplySchemaCustomizations(cs, append(path, "clean_rooms_notebook_task")...) - ConditionTask{}.ApplySchemaCustomizations(cs, append(path, "condition_task")...) - DbtTask{}.ApplySchemaCustomizations(cs, append(path, "dbt_task")...) - TaskDependency{}.ApplySchemaCustomizations(cs, append(path, "depends_on")...) - TaskEmailNotifications{}.ApplySchemaCustomizations(cs, append(path, "email_notifications")...) - ForEachTask{}.ApplySchemaCustomizations(cs, append(path, "for_each_task")...) - JobsHealthRules{}.ApplySchemaCustomizations(cs, append(path, "health")...) - compute_tf.ClusterSpec{}.ApplySchemaCustomizations(cs, append(path, "new_cluster")...) - NotebookTask{}.ApplySchemaCustomizations(cs, append(path, "notebook_task")...) - TaskNotificationSettings{}.ApplySchemaCustomizations(cs, append(path, "notification_settings")...) - PipelineTask{}.ApplySchemaCustomizations(cs, append(path, "pipeline_task")...) - PythonWheelTask{}.ApplySchemaCustomizations(cs, append(path, "python_wheel_task")...) - RunJobTask{}.ApplySchemaCustomizations(cs, append(path, "run_job_task")...) - SparkJarTask{}.ApplySchemaCustomizations(cs, append(path, "spark_jar_task")...) - SparkPythonTask{}.ApplySchemaCustomizations(cs, append(path, "spark_python_task")...) - SparkSubmitTask{}.ApplySchemaCustomizations(cs, append(path, "spark_submit_task")...) - SqlTask{}.ApplySchemaCustomizations(cs, append(path, "sql_task")...) - cs.SetRequired(append(path, "task_key")...) - WebhookNotifications{}.ApplySchemaCustomizations(cs, append(path, "webhook_notifications")...) - - return cs +func (c Task) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["clean_rooms_notebook_task"] = attrs["clean_rooms_notebook_task"].SetOptional() + attrs["condition_task"] = attrs["condition_task"].SetOptional() + attrs["dbt_task"] = attrs["dbt_task"].SetOptional() + attrs["depends_on"] = attrs["depends_on"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["disable_auto_optimization"] = attrs["disable_auto_optimization"].SetOptional() + attrs["email_notifications"] = attrs["email_notifications"].SetOptional() + attrs["environment_key"] = attrs["environment_key"].SetOptional() + attrs["existing_cluster_id"] = attrs["existing_cluster_id"].SetOptional() + attrs["for_each_task"] = attrs["for_each_task"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["job_cluster_key"] = attrs["job_cluster_key"].SetOptional() + attrs["library"] = attrs["library"].SetOptional() + attrs["max_retries"] = attrs["max_retries"].SetOptional() + attrs["min_retry_interval_millis"] = attrs["min_retry_interval_millis"].SetOptional() + attrs["new_cluster"] = attrs["new_cluster"].SetOptional() + attrs["notebook_task"] = attrs["notebook_task"].SetOptional() + attrs["notification_settings"] = attrs["notification_settings"].SetOptional() + attrs["pipeline_task"] = attrs["pipeline_task"].SetOptional() + attrs["python_wheel_task"] = attrs["python_wheel_task"].SetOptional() + attrs["retry_on_timeout"] = attrs["retry_on_timeout"].SetOptional() + attrs["run_if"] = attrs["run_if"].SetOptional() + attrs["run_job_task"] = attrs["run_job_task"].SetOptional() + attrs["spark_jar_task"] = attrs["spark_jar_task"].SetOptional() + attrs["spark_python_task"] = attrs["spark_python_task"].SetOptional() + attrs["spark_submit_task"] = attrs["spark_submit_task"].SetOptional() + attrs["sql_task"] = attrs["sql_task"].SetOptional() + attrs["task_key"] = attrs["task_key"].SetRequired() + attrs["timeout_seconds"] = attrs["timeout_seconds"].SetOptional() + attrs["webhook_notifications"] = attrs["webhook_notifications"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Task. @@ -16119,9 +16415,9 @@ func (o *Task) SetWebhookNotifications(ctx context.Context, v WebhookNotificatio type TaskDependency struct { // Can only be specified on condition task dependencies. The outcome of the // dependent task that must be met for this task to run. - Outcome types.String `tfsdk:"outcome" tf:"optional"` + Outcome types.String `tfsdk:"outcome"` // The name of the task this task depends on. - TaskKey types.String `tfsdk:"task_key" tf:""` + TaskKey types.String `tfsdk:"task_key"` } func (newState *TaskDependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan TaskDependency) { @@ -16130,10 +16426,11 @@ func (newState *TaskDependency) SyncEffectiveFieldsDuringCreateOrUpdate(plan Tas func (newState *TaskDependency) SyncEffectiveFieldsDuringRead(existingState TaskDependency) { } -func (c TaskDependency) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "task_key")...) +func (c TaskDependency) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["outcome"] = attrs["outcome"].SetOptional() + attrs["task_key"] = attrs["task_key"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TaskDependency. @@ -16173,22 +16470,22 @@ type TaskEmailNotifications struct { // If true, do not send email to recipients specified in `on_failure` if the // run is skipped. This field is `deprecated`. Please use the // `notification_settings.no_alert_for_skipped_runs` field. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` // A list of email addresses to be notified when the duration of a run // exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in // the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is // specified in the `health` field for the job, notifications are not sent. - OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded" tf:"optional"` + OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded"` // A list of email addresses to be notified when a run unsuccessfully // completes. A run is considered to have completed unsuccessfully if it // ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or // `TIMED_OUT` result_state. If this is not specified on job creation, // reset, or update the list is empty, and notifications are not sent. - OnFailure types.List `tfsdk:"on_failure" tf:"optional"` + OnFailure types.List `tfsdk:"on_failure"` // A list of email addresses to be notified when a run begins. If not // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnStart types.List `tfsdk:"on_start" tf:"optional"` + OnStart types.List `tfsdk:"on_start"` // A list of email addresses to notify when any streaming backlog thresholds // are exceeded for any stream. Streaming backlog thresholds can be set in // the `health` field using the following metrics: @@ -16196,13 +16493,13 @@ type TaskEmailNotifications struct { // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded" tf:"optional"` + OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded"` // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If // not specified on job creation, reset, or update, the list is empty, and // notifications are not sent. - OnSuccess types.List `tfsdk:"on_success" tf:"optional"` + OnSuccess types.List `tfsdk:"on_success"` } func (newState *TaskEmailNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(plan TaskEmailNotifications) { @@ -16211,9 +16508,15 @@ func (newState *TaskEmailNotifications) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *TaskEmailNotifications) SyncEffectiveFieldsDuringRead(existingState TaskEmailNotifications) { } -func (c TaskEmailNotifications) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TaskEmailNotifications) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() + attrs["on_duration_warning_threshold_exceeded"] = attrs["on_duration_warning_threshold_exceeded"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_start"] = attrs["on_start"].SetOptional() + attrs["on_streaming_backlog_exceeded"] = attrs["on_streaming_backlog_exceeded"].SetOptional() + attrs["on_success"] = attrs["on_success"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TaskEmailNotifications. @@ -16407,13 +16710,13 @@ type TaskNotificationSettings struct { // If true, do not send notifications to recipients specified in `on_start` // for the retried runs and do not send notifications to recipients // specified in `on_failure` until the last retry of the run. - AlertOnLastAttempt types.Bool `tfsdk:"alert_on_last_attempt" tf:"optional"` + AlertOnLastAttempt types.Bool `tfsdk:"alert_on_last_attempt"` // If true, do not send notifications to recipients specified in // `on_failure` if the run is canceled. - NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs" tf:"optional"` + NoAlertForCanceledRuns types.Bool `tfsdk:"no_alert_for_canceled_runs"` // If true, do not send notifications to recipients specified in // `on_failure` if the run is skipped. - NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs" tf:"optional"` + NoAlertForSkippedRuns types.Bool `tfsdk:"no_alert_for_skipped_runs"` } func (newState *TaskNotificationSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan TaskNotificationSettings) { @@ -16422,9 +16725,12 @@ func (newState *TaskNotificationSettings) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *TaskNotificationSettings) SyncEffectiveFieldsDuringRead(existingState TaskNotificationSettings) { } -func (c TaskNotificationSettings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TaskNotificationSettings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_on_last_attempt"] = attrs["alert_on_last_attempt"].SetOptional() + attrs["no_alert_for_canceled_runs"] = attrs["no_alert_for_canceled_runs"].SetOptional() + attrs["no_alert_for_skipped_runs"] = attrs["no_alert_for_skipped_runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TaskNotificationSettings. @@ -16508,10 +16814,10 @@ type TerminationDetails struct { // The run was skipped due to reaching the job level queue size limit. // // [Link]: https://kb.databricks.com/en_US/notebooks/too-many-execution-contexts-are-open-right-now - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // A descriptive message with the termination details. This field is // unstructured and the format might change. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // * `SUCCESS`: The run terminated without any issues * `INTERNAL_ERROR`: An // error occurred in the Databricks platform. Please look at the [status // page] or contact support if the issue persists. * `CLIENT_ERROR`: The run @@ -16520,7 +16826,7 @@ type TerminationDetails struct { // issue with your cloud provider. // // [status page]: https://status.databricks.com/ - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *TerminationDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan TerminationDetails) { @@ -16529,9 +16835,12 @@ func (newState *TerminationDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TerminationDetails) SyncEffectiveFieldsDuringRead(existingState TerminationDetails) { } -func (c TerminationDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TerminationDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TerminationDetails. @@ -16572,7 +16881,7 @@ func (o TerminationDetails) Type(ctx context.Context) attr.Type { // Additional details about what triggered the run type TriggerInfo struct { // The run id of the Run Job task run - RunId types.Int64 `tfsdk:"run_id" tf:"optional"` + RunId types.Int64 `tfsdk:"run_id"` } func (newState *TriggerInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TriggerInfo) { @@ -16581,9 +16890,10 @@ func (newState *TriggerInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Trigge func (newState *TriggerInfo) SyncEffectiveFieldsDuringRead(existingState TriggerInfo) { } -func (c TriggerInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TriggerInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TriggerInfo. @@ -16619,15 +16929,15 @@ func (o TriggerInfo) Type(ctx context.Context) attr.Type { type TriggerSettings struct { // File arrival trigger settings. - FileArrival types.Object `tfsdk:"file_arrival" tf:"optional,object"` + FileArrival types.Object `tfsdk:"file_arrival"` // Whether this trigger is paused or not. - PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` + PauseStatus types.String `tfsdk:"pause_status"` // Periodic trigger settings. - Periodic types.Object `tfsdk:"periodic" tf:"optional,object"` + Periodic types.Object `tfsdk:"periodic"` // Old table trigger settings name. Deprecated in favor of `table_update`. - Table types.Object `tfsdk:"table" tf:"optional,object"` + Table types.Object `tfsdk:"table"` - TableUpdate types.Object `tfsdk:"table_update" tf:"optional,object"` + TableUpdate types.Object `tfsdk:"table_update"` } func (newState *TriggerSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan TriggerSettings) { @@ -16636,13 +16946,14 @@ func (newState *TriggerSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan Tr func (newState *TriggerSettings) SyncEffectiveFieldsDuringRead(existingState TriggerSettings) { } -func (c TriggerSettings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileArrivalTriggerConfiguration{}.ApplySchemaCustomizations(cs, append(path, "file_arrival")...) - PeriodicTriggerConfiguration{}.ApplySchemaCustomizations(cs, append(path, "periodic")...) - TableUpdateTriggerConfiguration{}.ApplySchemaCustomizations(cs, append(path, "table")...) - TableUpdateTriggerConfiguration{}.ApplySchemaCustomizations(cs, append(path, "table_update")...) +func (c TriggerSettings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_arrival"] = attrs["file_arrival"].SetOptional() + attrs["pause_status"] = attrs["pause_status"].SetOptional() + attrs["periodic"] = attrs["periodic"].SetOptional() + attrs["table"] = attrs["table"].SetOptional() + attrs["table_update"] = attrs["table_update"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TriggerSettings. @@ -16805,9 +17116,9 @@ type UpdateJob struct { // Remove top-level fields in the job settings. Removing nested fields is // not supported, except for tasks and job clusters (`tasks/task_1`). This // field is optional. - FieldsToRemove types.List `tfsdk:"fields_to_remove" tf:"optional"` + FieldsToRemove types.List `tfsdk:"fields_to_remove"` // The canonical identifier of the job to update. This field is required. - JobId types.Int64 `tfsdk:"job_id" tf:""` + JobId types.Int64 `tfsdk:"job_id"` // The new settings for the job. // // Top-level fields specified in `new_settings` are completely replaced, @@ -16819,7 +17130,7 @@ type UpdateJob struct { // // Changes to the field `JobSettings.timeout_seconds` are applied to active // runs. Changes to other fields are applied to future runs only. - NewSettings types.Object `tfsdk:"new_settings" tf:"optional,object"` + NewSettings types.Object `tfsdk:"new_settings"` } func (newState *UpdateJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateJob) { @@ -16828,11 +17139,12 @@ func (newState *UpdateJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateJo func (newState *UpdateJob) SyncEffectiveFieldsDuringRead(existingState UpdateJob) { } -func (c UpdateJob) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "job_id")...) - JobSettings{}.ApplySchemaCustomizations(cs, append(path, "new_settings")...) +func (c UpdateJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fields_to_remove"] = attrs["fields_to_remove"].SetOptional() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["new_settings"] = attrs["new_settings"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateJob. @@ -16961,13 +17273,13 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type ViewItem struct { // Content of the view. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // Name of the view item. In the case of code view, it would be the // notebook’s name. In the case of dashboard view, it would be the // dashboard’s name. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Type of the view item. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *ViewItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan ViewItem) { @@ -16976,9 +17288,12 @@ func (newState *ViewItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan ViewItem) func (newState *ViewItem) SyncEffectiveFieldsDuringRead(existingState ViewItem) { } -func (c ViewItem) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ViewItem) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ViewItem. @@ -17017,7 +17332,7 @@ func (o ViewItem) Type(ctx context.Context) attr.Type { } type Webhook struct { - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *Webhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan Webhook) { @@ -17026,10 +17341,10 @@ func (newState *Webhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan Webhook) { func (newState *Webhook) SyncEffectiveFieldsDuringRead(existingState Webhook) { } -func (c Webhook) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c Webhook) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Webhook. @@ -17068,13 +17383,13 @@ type WebhookNotifications struct { // a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` // metric in the `health` field. A maximum of 3 destinations can be // specified for the `on_duration_warning_threshold_exceeded` property. - OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded" tf:"optional"` + OnDurationWarningThresholdExceeded types.List `tfsdk:"on_duration_warning_threshold_exceeded"` // An optional list of system notification IDs to call when the run fails. A // maximum of 3 destinations can be specified for the `on_failure` property. - OnFailure types.List `tfsdk:"on_failure" tf:"optional"` + OnFailure types.List `tfsdk:"on_failure"` // An optional list of system notification IDs to call when the run starts. // A maximum of 3 destinations can be specified for the `on_start` property. - OnStart types.List `tfsdk:"on_start" tf:"optional"` + OnStart types.List `tfsdk:"on_start"` // An optional list of system notification IDs to call when any streaming // backlog thresholds are exceeded for any stream. Streaming backlog // thresholds can be set in the `health` field using the following metrics: @@ -17083,11 +17398,11 @@ type WebhookNotifications struct { // based on the 10-minute average of these metrics. If the issue persists, // notifications are resent every 30 minutes. A maximum of 3 destinations // can be specified for the `on_streaming_backlog_exceeded` property. - OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded" tf:"optional"` + OnStreamingBacklogExceeded types.List `tfsdk:"on_streaming_backlog_exceeded"` // An optional list of system notification IDs to call when the run // completes successfully. A maximum of 3 destinations can be specified for // the `on_success` property. - OnSuccess types.List `tfsdk:"on_success" tf:"optional"` + OnSuccess types.List `tfsdk:"on_success"` } func (newState *WebhookNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(plan WebhookNotifications) { @@ -17096,14 +17411,14 @@ func (newState *WebhookNotifications) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *WebhookNotifications) SyncEffectiveFieldsDuringRead(existingState WebhookNotifications) { } -func (c WebhookNotifications) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Webhook{}.ApplySchemaCustomizations(cs, append(path, "on_duration_warning_threshold_exceeded")...) - Webhook{}.ApplySchemaCustomizations(cs, append(path, "on_failure")...) - Webhook{}.ApplySchemaCustomizations(cs, append(path, "on_start")...) - Webhook{}.ApplySchemaCustomizations(cs, append(path, "on_streaming_backlog_exceeded")...) - Webhook{}.ApplySchemaCustomizations(cs, append(path, "on_success")...) +func (c WebhookNotifications) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["on_duration_warning_threshold_exceeded"] = attrs["on_duration_warning_threshold_exceeded"].SetOptional() + attrs["on_failure"] = attrs["on_failure"].SetOptional() + attrs["on_start"] = attrs["on_start"].SetOptional() + attrs["on_streaming_backlog_exceeded"] = attrs["on_streaming_backlog_exceeded"].SetOptional() + attrs["on_success"] = attrs["on_success"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WebhookNotifications. diff --git a/internal/service/marketplace_tf/legacy_model.go b/internal/service/marketplace_tf/legacy_model.go index d9fe883a9..c5ebd7e61 100755 --- a/internal/service/marketplace_tf/legacy_model.go +++ b/internal/service/marketplace_tf/legacy_model.go @@ -17,15 +17,16 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) type AddExchangeForListingRequest_SdkV2 struct { - ExchangeId types.String `tfsdk:"exchange_id" tf:""` + ExchangeId types.String `tfsdk:"exchange_id"` - ListingId types.String `tfsdk:"listing_id" tf:""` + ListingId types.String `tfsdk:"listing_id"` } func (newState *AddExchangeForListingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddExchangeForListingRequest_SdkV2) { @@ -34,11 +35,11 @@ func (newState *AddExchangeForListingRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *AddExchangeForListingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState AddExchangeForListingRequest_SdkV2) { } -func (c AddExchangeForListingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange_id")...) - cs.SetRequired(append(path, "listing_id")...) +func (c AddExchangeForListingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_id"] = attrs["exchange_id"].SetRequired() + attrs["listing_id"] = attrs["listing_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddExchangeForListingRequest. @@ -75,7 +76,7 @@ func (o AddExchangeForListingRequest_SdkV2) Type(ctx context.Context) attr.Type } type AddExchangeForListingResponse_SdkV2 struct { - ExchangeForListing types.List `tfsdk:"exchange_for_listing" tf:"optional,object"` + ExchangeForListing types.List `tfsdk:"exchange_for_listing"` } func (newState *AddExchangeForListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddExchangeForListingResponse_SdkV2) { @@ -84,10 +85,11 @@ func (newState *AddExchangeForListingResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *AddExchangeForListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState AddExchangeForListingResponse_SdkV2) { } -func (c AddExchangeForListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeListing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange_for_listing")...) +func (c AddExchangeForListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_for_listing"] = attrs["exchange_for_listing"].SetOptional() + attrs["exchange_for_listing"] = attrs["exchange_for_listing"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddExchangeForListingResponse. @@ -218,7 +220,7 @@ func (o *BatchGetListingsRequest_SdkV2) SetIds(ctx context.Context, v []types.St } type BatchGetListingsResponse_SdkV2 struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` } func (newState *BatchGetListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BatchGetListingsResponse_SdkV2) { @@ -227,10 +229,10 @@ func (newState *BatchGetListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *BatchGetListingsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState BatchGetListingsResponse_SdkV2) { } -func (c BatchGetListingsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c BatchGetListingsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BatchGetListingsResponse. @@ -361,7 +363,7 @@ func (o *BatchGetProvidersRequest_SdkV2) SetIds(ctx context.Context, v []types.S } type BatchGetProvidersResponse_SdkV2 struct { - Providers types.List `tfsdk:"providers" tf:"optional"` + Providers types.List `tfsdk:"providers"` } func (newState *BatchGetProvidersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BatchGetProvidersResponse_SdkV2) { @@ -370,10 +372,10 @@ func (newState *BatchGetProvidersResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *BatchGetProvidersResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState BatchGetProvidersResponse_SdkV2) { } -func (c BatchGetProvidersResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "providers")...) +func (c BatchGetProvidersResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["providers"] = attrs["providers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BatchGetProvidersResponse. @@ -438,7 +440,7 @@ func (o *BatchGetProvidersResponse_SdkV2) SetProviders(ctx context.Context, v [] } type ConsumerTerms_SdkV2 struct { - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *ConsumerTerms_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ConsumerTerms_SdkV2) { @@ -447,10 +449,10 @@ func (newState *ConsumerTerms_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ConsumerTerms_SdkV2) SyncEffectiveFieldsDuringRead(existingState ConsumerTerms_SdkV2) { } -func (c ConsumerTerms_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "version")...) +func (c ConsumerTerms_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ConsumerTerms. @@ -487,13 +489,13 @@ func (o ConsumerTerms_SdkV2) Type(ctx context.Context) attr.Type { // contact info for the consumer requesting data or performing a listing // installation type ContactInfo_SdkV2 struct { - Company types.String `tfsdk:"company" tf:"optional"` + Company types.String `tfsdk:"company"` - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` - FirstName types.String `tfsdk:"first_name" tf:"optional"` + FirstName types.String `tfsdk:"first_name"` - LastName types.String `tfsdk:"last_name" tf:"optional"` + LastName types.String `tfsdk:"last_name"` } func (newState *ContactInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ContactInfo_SdkV2) { @@ -502,9 +504,13 @@ func (newState *ContactInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ContactInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ContactInfo_SdkV2) { } -func (c ContactInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ContactInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["company"] = attrs["company"].SetOptional() + attrs["email"] = attrs["email"].SetOptional() + attrs["first_name"] = attrs["first_name"].SetOptional() + attrs["last_name"] = attrs["last_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ContactInfo. @@ -545,7 +551,7 @@ func (o ContactInfo_SdkV2) Type(ctx context.Context) attr.Type { } type CreateExchangeFilterRequest_SdkV2 struct { - Filter types.List `tfsdk:"filter" tf:"object"` + Filter types.List `tfsdk:"filter"` } func (newState *CreateExchangeFilterRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeFilterRequest_SdkV2) { @@ -554,11 +560,11 @@ func (newState *CreateExchangeFilterRequest_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *CreateExchangeFilterRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExchangeFilterRequest_SdkV2) { } -func (c CreateExchangeFilterRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "filter")...) - ExchangeFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c CreateExchangeFilterRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetRequired() + attrs["filter"] = attrs["filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeFilterRequest. @@ -623,7 +629,7 @@ func (o *CreateExchangeFilterRequest_SdkV2) SetFilter(ctx context.Context, v Exc } type CreateExchangeFilterResponse_SdkV2 struct { - FilterId types.String `tfsdk:"filter_id" tf:"optional"` + FilterId types.String `tfsdk:"filter_id"` } func (newState *CreateExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeFilterResponse_SdkV2) { @@ -632,9 +638,10 @@ func (newState *CreateExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *CreateExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExchangeFilterResponse_SdkV2) { } -func (c CreateExchangeFilterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateExchangeFilterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter_id"] = attrs["filter_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeFilterResponse. @@ -669,7 +676,7 @@ func (o CreateExchangeFilterResponse_SdkV2) Type(ctx context.Context) attr.Type } type CreateExchangeRequest_SdkV2 struct { - Exchange types.List `tfsdk:"exchange" tf:"object"` + Exchange types.List `tfsdk:"exchange"` } func (newState *CreateExchangeRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeRequest_SdkV2) { @@ -678,11 +685,11 @@ func (newState *CreateExchangeRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateExchangeRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExchangeRequest_SdkV2) { } -func (c CreateExchangeRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange")...) - Exchange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) +func (c CreateExchangeRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetRequired() + attrs["exchange"] = attrs["exchange"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeRequest. @@ -747,7 +754,7 @@ func (o *CreateExchangeRequest_SdkV2) SetExchange(ctx context.Context, v Exchang } type CreateExchangeResponse_SdkV2 struct { - ExchangeId types.String `tfsdk:"exchange_id" tf:"optional"` + ExchangeId types.String `tfsdk:"exchange_id"` } func (newState *CreateExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeResponse_SdkV2) { @@ -756,9 +763,10 @@ func (newState *CreateExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateExchangeResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExchangeResponse_SdkV2) { } -func (c CreateExchangeResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateExchangeResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_id"] = attrs["exchange_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeResponse. @@ -793,13 +801,13 @@ func (o CreateExchangeResponse_SdkV2) Type(ctx context.Context) attr.Type { } type CreateFileRequest_SdkV2 struct { - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` - FileParent types.List `tfsdk:"file_parent" tf:"object"` + FileParent types.List `tfsdk:"file_parent"` - MarketplaceFileType types.String `tfsdk:"marketplace_file_type" tf:""` + MarketplaceFileType types.String `tfsdk:"marketplace_file_type"` - MimeType types.String `tfsdk:"mime_type" tf:""` + MimeType types.String `tfsdk:"mime_type"` } func (newState *CreateFileRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFileRequest_SdkV2) { @@ -808,13 +816,14 @@ func (newState *CreateFileRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateFileRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateFileRequest_SdkV2) { } -func (c CreateFileRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "file_parent")...) - FileParent_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file_parent")...) - cs.SetRequired(append(path, "marketplace_file_type")...) - cs.SetRequired(append(path, "mime_type")...) +func (c CreateFileRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["file_parent"] = attrs["file_parent"].SetRequired() + attrs["file_parent"] = attrs["file_parent"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["marketplace_file_type"] = attrs["marketplace_file_type"].SetRequired() + attrs["mime_type"] = attrs["mime_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFileRequest. @@ -885,9 +894,9 @@ func (o *CreateFileRequest_SdkV2) SetFileParent(ctx context.Context, v FileParen } type CreateFileResponse_SdkV2 struct { - FileInfo types.List `tfsdk:"file_info" tf:"optional,object"` + FileInfo types.List `tfsdk:"file_info"` // Pre-signed POST URL to blob storage - UploadUrl types.String `tfsdk:"upload_url" tf:"optional"` + UploadUrl types.String `tfsdk:"upload_url"` } func (newState *CreateFileResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFileResponse_SdkV2) { @@ -896,10 +905,12 @@ func (newState *CreateFileResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateFileResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateFileResponse_SdkV2) { } -func (c CreateFileResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file_info")...) +func (c CreateFileResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_info"] = attrs["file_info"].SetOptional() + attrs["file_info"] = attrs["file_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["upload_url"] = attrs["upload_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFileResponse. @@ -966,17 +977,17 @@ func (o *CreateFileResponse_SdkV2) SetFileInfo(ctx context.Context, v FileInfo_S } type CreateInstallationRequest_SdkV2 struct { - AcceptedConsumerTerms types.List `tfsdk:"accepted_consumer_terms" tf:"optional,object"` + AcceptedConsumerTerms types.List `tfsdk:"accepted_consumer_terms"` - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` ListingId types.String `tfsdk:"-"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` // for git repo installations - RepoDetail types.List `tfsdk:"repo_detail" tf:"optional,object"` + RepoDetail types.List `tfsdk:"repo_detail"` - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` } func (newState *CreateInstallationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateInstallationRequest_SdkV2) { @@ -985,12 +996,17 @@ func (newState *CreateInstallationRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *CreateInstallationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateInstallationRequest_SdkV2) { } -func (c CreateInstallationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ConsumerTerms_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "accepted_consumer_terms")...) - cs.SetRequired(append(path, "listing_id")...) - RepoInstallation_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "repo_detail")...) +func (c CreateInstallationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["accepted_consumer_terms"] = attrs["accepted_consumer_terms"].SetOptional() + attrs["accepted_consumer_terms"] = attrs["accepted_consumer_terms"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["repo_detail"] = attrs["repo_detail"].SetOptional() + attrs["repo_detail"] = attrs["repo_detail"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["share_name"] = attrs["share_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateInstallationRequest. @@ -1094,7 +1110,7 @@ func (o *CreateInstallationRequest_SdkV2) SetRepoDetail(ctx context.Context, v R } type CreateListingRequest_SdkV2 struct { - Listing types.List `tfsdk:"listing" tf:"object"` + Listing types.List `tfsdk:"listing"` } func (newState *CreateListingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateListingRequest_SdkV2) { @@ -1103,11 +1119,11 @@ func (newState *CreateListingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateListingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateListingRequest_SdkV2) { } -func (c CreateListingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "listing")...) - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c CreateListingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing"] = attrs["listing"].SetRequired() + attrs["listing"] = attrs["listing"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateListingRequest. @@ -1172,7 +1188,7 @@ func (o *CreateListingRequest_SdkV2) SetListing(ctx context.Context, v Listing_S } type CreateListingResponse_SdkV2 struct { - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` } func (newState *CreateListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateListingResponse_SdkV2) { @@ -1181,9 +1197,10 @@ func (newState *CreateListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateListingResponse_SdkV2) { } -func (c CreateListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing_id"] = attrs["listing_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateListingResponse. @@ -1219,23 +1236,23 @@ func (o CreateListingResponse_SdkV2) Type(ctx context.Context) attr.Type { // Data request messages also creates a lead (maybe) type CreatePersonalizationRequest_SdkV2 struct { - AcceptedConsumerTerms types.List `tfsdk:"accepted_consumer_terms" tf:"object"` + AcceptedConsumerTerms types.List `tfsdk:"accepted_consumer_terms"` - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - Company types.String `tfsdk:"company" tf:"optional"` + Company types.String `tfsdk:"company"` - FirstName types.String `tfsdk:"first_name" tf:"optional"` + FirstName types.String `tfsdk:"first_name"` - IntendedUse types.String `tfsdk:"intended_use" tf:""` + IntendedUse types.String `tfsdk:"intended_use"` - IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse" tf:"optional"` + IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse"` - LastName types.String `tfsdk:"last_name" tf:"optional"` + LastName types.String `tfsdk:"last_name"` ListingId types.String `tfsdk:"-"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` } func (newState *CreatePersonalizationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePersonalizationRequest_SdkV2) { @@ -1244,13 +1261,19 @@ func (newState *CreatePersonalizationRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *CreatePersonalizationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePersonalizationRequest_SdkV2) { } -func (c CreatePersonalizationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "accepted_consumer_terms")...) - ConsumerTerms_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "accepted_consumer_terms")...) - cs.SetRequired(append(path, "intended_use")...) - cs.SetRequired(append(path, "listing_id")...) +func (c CreatePersonalizationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["accepted_consumer_terms"] = attrs["accepted_consumer_terms"].SetRequired() + attrs["accepted_consumer_terms"] = attrs["accepted_consumer_terms"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["comment"] = attrs["comment"].SetOptional() + attrs["company"] = attrs["company"].SetOptional() + attrs["first_name"] = attrs["first_name"].SetOptional() + attrs["intended_use"] = attrs["intended_use"].SetRequired() + attrs["is_from_lighthouse"] = attrs["is_from_lighthouse"].SetOptional() + attrs["last_name"] = attrs["last_name"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePersonalizationRequest. @@ -1331,7 +1354,7 @@ func (o *CreatePersonalizationRequest_SdkV2) SetAcceptedConsumerTerms(ctx contex } type CreatePersonalizationRequestResponse_SdkV2 struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *CreatePersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePersonalizationRequestResponse_SdkV2) { @@ -1340,9 +1363,10 @@ func (newState *CreatePersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsD func (newState *CreatePersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePersonalizationRequestResponse_SdkV2) { } -func (c CreatePersonalizationRequestResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreatePersonalizationRequestResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePersonalizationRequestResponse. @@ -1377,7 +1401,7 @@ func (o CreatePersonalizationRequestResponse_SdkV2) Type(ctx context.Context) at } type CreateProviderRequest_SdkV2 struct { - Provider types.List `tfsdk:"provider" tf:"object"` + Provider types.List `tfsdk:"provider"` } func (newState *CreateProviderRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateProviderRequest_SdkV2) { @@ -1386,11 +1410,11 @@ func (newState *CreateProviderRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateProviderRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateProviderRequest_SdkV2) { } -func (c CreateProviderRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "provider")...) - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c CreateProviderRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["provider"] = attrs["provider"].SetRequired() + attrs["provider"] = attrs["provider"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateProviderRequest. @@ -1455,7 +1479,7 @@ func (o *CreateProviderRequest_SdkV2) SetProvider(ctx context.Context, v Provide } type CreateProviderResponse_SdkV2 struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *CreateProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateProviderResponse_SdkV2) { @@ -1464,9 +1488,10 @@ func (newState *CreateProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateProviderResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateProviderResponse_SdkV2) { } -func (c CreateProviderResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateProviderResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateProviderResponse. @@ -1501,9 +1526,9 @@ func (o CreateProviderResponse_SdkV2) Type(ctx context.Context) attr.Type { } type DataRefreshInfo_SdkV2 struct { - Interval types.Int64 `tfsdk:"interval" tf:""` + Interval types.Int64 `tfsdk:"interval"` - Unit types.String `tfsdk:"unit" tf:""` + Unit types.String `tfsdk:"unit"` } func (newState *DataRefreshInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataRefreshInfo_SdkV2) { @@ -1512,11 +1537,11 @@ func (newState *DataRefreshInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DataRefreshInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataRefreshInfo_SdkV2) { } -func (c DataRefreshInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "interval")...) - cs.SetRequired(append(path, "unit")...) +func (c DataRefreshInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["interval"] = attrs["interval"].SetRequired() + attrs["unit"] = attrs["unit"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataRefreshInfo. @@ -1597,9 +1622,9 @@ func (newState *DeleteExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *DeleteExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteExchangeFilterResponse_SdkV2) { } -func (c DeleteExchangeFilterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteExchangeFilterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExchangeFilterResponse. @@ -1674,9 +1699,9 @@ func (newState *DeleteExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *DeleteExchangeResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteExchangeResponse_SdkV2) { } -func (c DeleteExchangeResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteExchangeResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExchangeResponse. @@ -1751,9 +1776,9 @@ func (newState *DeleteFileResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *DeleteFileResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteFileResponse_SdkV2) { } -func (c DeleteFileResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteFileResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteFileResponse. @@ -1832,9 +1857,9 @@ func (newState *DeleteInstallationResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *DeleteInstallationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteInstallationResponse_SdkV2) { } -func (c DeleteInstallationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteInstallationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteInstallationResponse. @@ -1909,9 +1934,9 @@ func (newState *DeleteListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *DeleteListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteListingResponse_SdkV2) { } -func (c DeleteListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteListingResponse. @@ -1986,9 +2011,9 @@ func (newState *DeleteProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *DeleteProviderResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteProviderResponse_SdkV2) { } -func (c DeleteProviderResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteProviderResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteProviderResponse. @@ -2019,23 +2044,23 @@ func (o DeleteProviderResponse_SdkV2) Type(ctx context.Context) attr.Type { } type Exchange_SdkV2 struct { - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - Filters types.List `tfsdk:"filters" tf:"optional"` + Filters types.List `tfsdk:"filters"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - LinkedListings types.List `tfsdk:"linked_listings" tf:"optional"` + LinkedListings types.List `tfsdk:"linked_listings"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *Exchange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exchange_SdkV2) { @@ -2044,12 +2069,18 @@ func (newState *Exchange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exc func (newState *Exchange_SdkV2) SyncEffectiveFieldsDuringRead(existingState Exchange_SdkV2) { } -func (c Exchange_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - ExchangeListing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "linked_listings")...) - cs.SetRequired(append(path, "name")...) +func (c Exchange_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["linked_listings"] = attrs["linked_listings"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Exchange. @@ -2159,23 +2190,23 @@ func (o *Exchange_SdkV2) SetLinkedListings(ctx context.Context, v []ExchangeList } type ExchangeFilter_SdkV2 struct { - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - ExchangeId types.String `tfsdk:"exchange_id" tf:""` + ExchangeId types.String `tfsdk:"exchange_id"` - FilterType types.String `tfsdk:"filter_type" tf:""` + FilterType types.String `tfsdk:"filter_type"` - FilterValue types.String `tfsdk:"filter_value" tf:""` + FilterValue types.String `tfsdk:"filter_value"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *ExchangeFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeFilter_SdkV2) { @@ -2184,12 +2215,18 @@ func (newState *ExchangeFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ExchangeFilter_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExchangeFilter_SdkV2) { } -func (c ExchangeFilter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange_id")...) - cs.SetRequired(append(path, "filter_type")...) - cs.SetRequired(append(path, "filter_value")...) +func (c ExchangeFilter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["exchange_id"] = attrs["exchange_id"].SetRequired() + attrs["filter_type"] = attrs["filter_type"].SetRequired() + attrs["filter_value"] = attrs["filter_value"].SetRequired() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeFilter. @@ -2240,19 +2277,19 @@ func (o ExchangeFilter_SdkV2) Type(ctx context.Context) attr.Type { } type ExchangeListing_SdkV2 struct { - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - ExchangeId types.String `tfsdk:"exchange_id" tf:"optional"` + ExchangeId types.String `tfsdk:"exchange_id"` - ExchangeName types.String `tfsdk:"exchange_name" tf:"optional"` + ExchangeName types.String `tfsdk:"exchange_name"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` - ListingName types.String `tfsdk:"listing_name" tf:"optional"` + ListingName types.String `tfsdk:"listing_name"` } func (newState *ExchangeListing_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeListing_SdkV2) { @@ -2261,9 +2298,16 @@ func (newState *ExchangeListing_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ExchangeListing_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExchangeListing_SdkV2) { } -func (c ExchangeListing_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExchangeListing_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["exchange_id"] = attrs["exchange_id"].SetOptional() + attrs["exchange_name"] = attrs["exchange_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetOptional() + attrs["listing_name"] = attrs["listing_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeListing. @@ -2310,26 +2354,26 @@ func (o ExchangeListing_SdkV2) Type(ctx context.Context) attr.Type { } type FileInfo_SdkV2 struct { - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Name displayed to users for applicable files, e.g. embedded notebooks - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` - DownloadLink types.String `tfsdk:"download_link" tf:"optional"` + DownloadLink types.String `tfsdk:"download_link"` - FileParent types.List `tfsdk:"file_parent" tf:"optional,object"` + FileParent types.List `tfsdk:"file_parent"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - MarketplaceFileType types.String `tfsdk:"marketplace_file_type" tf:"optional"` + MarketplaceFileType types.String `tfsdk:"marketplace_file_type"` - MimeType types.String `tfsdk:"mime_type" tf:"optional"` + MimeType types.String `tfsdk:"mime_type"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // Populated if status is in a failed state with more information on reason // for the failure. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` } func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo_SdkV2) { @@ -2338,10 +2382,20 @@ func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Fil func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState FileInfo_SdkV2) { } -func (c FileInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileParent_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file_parent")...) +func (c FileInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["download_link"] = attrs["download_link"].SetOptional() + attrs["file_parent"] = attrs["file_parent"].SetOptional() + attrs["file_parent"] = attrs["file_parent"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["marketplace_file_type"] = attrs["marketplace_file_type"].SetOptional() + attrs["mime_type"] = attrs["mime_type"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileInfo. @@ -2424,9 +2478,9 @@ func (o *FileInfo_SdkV2) SetFileParent(ctx context.Context, v FileParent_SdkV2) } type FileParent_SdkV2 struct { - FileParentType types.String `tfsdk:"file_parent_type" tf:"optional"` + FileParentType types.String `tfsdk:"file_parent_type"` // TODO make the following fields required - ParentId types.String `tfsdk:"parent_id" tf:"optional"` + ParentId types.String `tfsdk:"parent_id"` } func (newState *FileParent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileParent_SdkV2) { @@ -2435,9 +2489,11 @@ func (newState *FileParent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan F func (newState *FileParent_SdkV2) SyncEffectiveFieldsDuringRead(existingState FileParent_SdkV2) { } -func (c FileParent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileParent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_parent_type"] = attrs["file_parent_type"].SetOptional() + attrs["parent_id"] = attrs["parent_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileParent. @@ -2510,7 +2566,7 @@ func (o GetExchangeRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetExchangeResponse_SdkV2 struct { - Exchange types.List `tfsdk:"exchange" tf:"optional,object"` + Exchange types.List `tfsdk:"exchange"` } func (newState *GetExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetExchangeResponse_SdkV2) { @@ -2519,10 +2575,11 @@ func (newState *GetExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *GetExchangeResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetExchangeResponse_SdkV2) { } -func (c GetExchangeResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Exchange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) +func (c GetExchangeResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetOptional() + attrs["exchange"] = attrs["exchange"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetExchangeResponse. @@ -2623,7 +2680,7 @@ func (o GetFileRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetFileResponse_SdkV2 struct { - FileInfo types.List `tfsdk:"file_info" tf:"optional,object"` + FileInfo types.List `tfsdk:"file_info"` } func (newState *GetFileResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetFileResponse_SdkV2) { @@ -2632,10 +2689,11 @@ func (newState *GetFileResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *GetFileResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetFileResponse_SdkV2) { } -func (c GetFileResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file_info")...) +func (c GetFileResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_info"] = attrs["file_info"].SetOptional() + attrs["file_info"] = attrs["file_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetFileResponse. @@ -2701,7 +2759,7 @@ func (o *GetFileResponse_SdkV2) SetFileInfo(ctx context.Context, v FileInfo_SdkV type GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2 struct { // version here is latest logical version of the dashboard template - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) { @@ -2710,9 +2768,10 @@ func (newState *GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) SyncEf func (newState *GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) { } -func (c GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetLatestVersionProviderAnalyticsDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetLatestVersionProviderAnalyticsDashboardResponse. @@ -2791,9 +2850,9 @@ func (o GetListingContentMetadataRequest_SdkV2) Type(ctx context.Context) attr.T } type GetListingContentMetadataResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - SharedDataObjects types.List `tfsdk:"shared_data_objects" tf:"optional"` + SharedDataObjects types.List `tfsdk:"shared_data_objects"` } func (newState *GetListingContentMetadataResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetListingContentMetadataResponse_SdkV2) { @@ -2802,10 +2861,11 @@ func (newState *GetListingContentMetadataResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *GetListingContentMetadataResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetListingContentMetadataResponse_SdkV2) { } -func (c GetListingContentMetadataResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SharedDataObject_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "shared_data_objects")...) +func (c GetListingContentMetadataResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["shared_data_objects"] = attrs["shared_data_objects"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetListingContentMetadataResponse. @@ -2908,7 +2968,7 @@ func (o GetListingRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetListingResponse_SdkV2 struct { - Listing types.List `tfsdk:"listing" tf:"optional,object"` + Listing types.List `tfsdk:"listing"` } func (newState *GetListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetListingResponse_SdkV2) { @@ -2917,10 +2977,11 @@ func (newState *GetListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *GetListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetListingResponse_SdkV2) { } -func (c GetListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c GetListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing"] = attrs["listing"].SetOptional() + attrs["listing"] = attrs["listing"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetListingResponse. @@ -3025,9 +3086,9 @@ func (o GetListingsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetListingsResponse_SdkV2 struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetListingsResponse_SdkV2) { @@ -3036,10 +3097,11 @@ func (newState *GetListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *GetListingsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetListingsResponse_SdkV2) { } -func (c GetListingsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c GetListingsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetListingsResponse. @@ -3142,7 +3204,7 @@ func (o GetPersonalizationRequestRequest_SdkV2) Type(ctx context.Context) attr.T } type GetPersonalizationRequestResponse_SdkV2 struct { - PersonalizationRequests types.List `tfsdk:"personalization_requests" tf:"optional"` + PersonalizationRequests types.List `tfsdk:"personalization_requests"` } func (newState *GetPersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPersonalizationRequestResponse_SdkV2) { @@ -3151,10 +3213,10 @@ func (newState *GetPersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *GetPersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPersonalizationRequestResponse_SdkV2) { } -func (c GetPersonalizationRequestResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PersonalizationRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "personalization_requests")...) +func (c GetPersonalizationRequestResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["personalization_requests"] = attrs["personalization_requests"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPersonalizationRequestResponse. @@ -3255,7 +3317,7 @@ func (o GetProviderRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetProviderResponse_SdkV2 struct { - Provider types.List `tfsdk:"provider" tf:"optional,object"` + Provider types.List `tfsdk:"provider"` } func (newState *GetProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetProviderResponse_SdkV2) { @@ -3264,10 +3326,11 @@ func (newState *GetProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *GetProviderResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetProviderResponse_SdkV2) { } -func (c GetProviderResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c GetProviderResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["provider"] = attrs["provider"].SetOptional() + attrs["provider"] = attrs["provider"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetProviderResponse. @@ -3332,7 +3395,7 @@ func (o *GetProviderResponse_SdkV2) SetProvider(ctx context.Context, v ProviderI } type Installation_SdkV2 struct { - Installation types.List `tfsdk:"installation" tf:"optional,object"` + Installation types.List `tfsdk:"installation"` } func (newState *Installation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Installation_SdkV2) { @@ -3341,10 +3404,11 @@ func (newState *Installation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *Installation_SdkV2) SyncEffectiveFieldsDuringRead(existingState Installation_SdkV2) { } -func (c Installation_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "installation")...) +func (c Installation_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installation"] = attrs["installation"].SetOptional() + attrs["installation"] = attrs["installation"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Installation. @@ -3409,31 +3473,31 @@ func (o *Installation_SdkV2) SetInstallation(ctx context.Context, v Installation } type InstallationDetail_SdkV2 struct { - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - InstalledOn types.Int64 `tfsdk:"installed_on" tf:"optional"` + InstalledOn types.Int64 `tfsdk:"installed_on"` - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` - ListingName types.String `tfsdk:"listing_name" tf:"optional"` + ListingName types.String `tfsdk:"listing_name"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` - RepoName types.String `tfsdk:"repo_name" tf:"optional"` + RepoName types.String `tfsdk:"repo_name"` - RepoPath types.String `tfsdk:"repo_path" tf:"optional"` + RepoPath types.String `tfsdk:"repo_path"` - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` - TokenDetail types.List `tfsdk:"token_detail" tf:"optional,object"` + TokenDetail types.List `tfsdk:"token_detail"` - Tokens types.List `tfsdk:"tokens" tf:"optional"` + Tokens types.List `tfsdk:"tokens"` } func (newState *InstallationDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstallationDetail_SdkV2) { @@ -3442,11 +3506,23 @@ func (newState *InstallationDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *InstallationDetail_SdkV2) SyncEffectiveFieldsDuringRead(existingState InstallationDetail_SdkV2) { } -func (c InstallationDetail_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_detail")...) - TokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tokens")...) +func (c InstallationDetail_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["installed_on"] = attrs["installed_on"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetOptional() + attrs["listing_name"] = attrs["listing_name"].SetOptional() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["repo_name"] = attrs["repo_name"].SetOptional() + attrs["repo_path"] = attrs["repo_path"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["token_detail"] = attrs["token_detail"].SetOptional() + attrs["token_detail"] = attrs["token_detail"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tokens"] = attrs["tokens"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstallationDetail. @@ -3604,9 +3680,9 @@ func (o ListAllInstallationsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListAllInstallationsResponse_SdkV2 struct { - Installations types.List `tfsdk:"installations" tf:"optional"` + Installations types.List `tfsdk:"installations"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListAllInstallationsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAllInstallationsResponse_SdkV2) { @@ -3615,10 +3691,11 @@ func (newState *ListAllInstallationsResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ListAllInstallationsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAllInstallationsResponse_SdkV2) { } -func (c ListAllInstallationsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "installations")...) +func (c ListAllInstallationsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installations"] = attrs["installations"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAllInstallationsResponse. @@ -3725,9 +3802,9 @@ func (o ListAllPersonalizationRequestsRequest_SdkV2) Type(ctx context.Context) a } type ListAllPersonalizationRequestsResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - PersonalizationRequests types.List `tfsdk:"personalization_requests" tf:"optional"` + PersonalizationRequests types.List `tfsdk:"personalization_requests"` } func (newState *ListAllPersonalizationRequestsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAllPersonalizationRequestsResponse_SdkV2) { @@ -3736,10 +3813,11 @@ func (newState *ListAllPersonalizationRequestsResponse_SdkV2) SyncEffectiveField func (newState *ListAllPersonalizationRequestsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAllPersonalizationRequestsResponse_SdkV2) { } -func (c ListAllPersonalizationRequestsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PersonalizationRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "personalization_requests")...) +func (c ListAllPersonalizationRequestsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["personalization_requests"] = attrs["personalization_requests"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAllPersonalizationRequestsResponse. @@ -3850,9 +3928,9 @@ func (o ListExchangeFiltersRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListExchangeFiltersResponse_SdkV2 struct { - Filters types.List `tfsdk:"filters" tf:"optional"` + Filters types.List `tfsdk:"filters"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExchangeFiltersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExchangeFiltersResponse_SdkV2) { @@ -3861,10 +3939,11 @@ func (newState *ListExchangeFiltersResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *ListExchangeFiltersResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListExchangeFiltersResponse_SdkV2) { } -func (c ListExchangeFiltersResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filters")...) +func (c ListExchangeFiltersResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filters"] = attrs["filters"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExchangeFiltersResponse. @@ -3975,9 +4054,9 @@ func (o ListExchangesForListingRequest_SdkV2) Type(ctx context.Context) attr.Typ } type ListExchangesForListingResponse_SdkV2 struct { - ExchangeListing types.List `tfsdk:"exchange_listing" tf:"optional"` + ExchangeListing types.List `tfsdk:"exchange_listing"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExchangesForListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExchangesForListingResponse_SdkV2) { @@ -3986,10 +4065,11 @@ func (newState *ListExchangesForListingResponse_SdkV2) SyncEffectiveFieldsDuring func (newState *ListExchangesForListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListExchangesForListingResponse_SdkV2) { } -func (c ListExchangesForListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeListing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange_listing")...) +func (c ListExchangesForListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_listing"] = attrs["exchange_listing"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExchangesForListingResponse. @@ -4096,9 +4176,9 @@ func (o ListExchangesRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListExchangesResponse_SdkV2 struct { - Exchanges types.List `tfsdk:"exchanges" tf:"optional"` + Exchanges types.List `tfsdk:"exchanges"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExchangesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExchangesResponse_SdkV2) { @@ -4107,10 +4187,11 @@ func (newState *ListExchangesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListExchangesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListExchangesResponse_SdkV2) { } -func (c ListExchangesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Exchange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchanges")...) +func (c ListExchangesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchanges"] = attrs["exchanges"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExchangesResponse. @@ -4251,9 +4332,9 @@ func (o *ListFilesRequest_SdkV2) SetFileParent(ctx context.Context, v FileParent } type ListFilesResponse_SdkV2 struct { - FileInfos types.List `tfsdk:"file_infos" tf:"optional"` + FileInfos types.List `tfsdk:"file_infos"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListFilesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFilesResponse_SdkV2) { @@ -4262,10 +4343,11 @@ func (newState *ListFilesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListFilesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListFilesResponse_SdkV2) { } -func (c ListFilesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file_infos")...) +func (c ListFilesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_infos"] = attrs["file_infos"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFilesResponse. @@ -4376,9 +4458,9 @@ func (o ListFulfillmentsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListFulfillmentsResponse_SdkV2 struct { - Fulfillments types.List `tfsdk:"fulfillments" tf:"optional"` + Fulfillments types.List `tfsdk:"fulfillments"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListFulfillmentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFulfillmentsResponse_SdkV2) { @@ -4387,10 +4469,11 @@ func (newState *ListFulfillmentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ListFulfillmentsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListFulfillmentsResponse_SdkV2) { } -func (c ListFulfillmentsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListingFulfillment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "fulfillments")...) +func (c ListFulfillmentsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fulfillments"] = attrs["fulfillments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFulfillmentsResponse. @@ -4501,9 +4584,9 @@ func (o ListInstallationsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListInstallationsResponse_SdkV2 struct { - Installations types.List `tfsdk:"installations" tf:"optional"` + Installations types.List `tfsdk:"installations"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListInstallationsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListInstallationsResponse_SdkV2) { @@ -4512,10 +4595,11 @@ func (newState *ListInstallationsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ListInstallationsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListInstallationsResponse_SdkV2) { } -func (c ListInstallationsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "installations")...) +func (c ListInstallationsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installations"] = attrs["installations"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListInstallationsResponse. @@ -4626,9 +4710,9 @@ func (o ListListingsForExchangeRequest_SdkV2) Type(ctx context.Context) attr.Typ } type ListListingsForExchangeResponse_SdkV2 struct { - ExchangeListings types.List `tfsdk:"exchange_listings" tf:"optional"` + ExchangeListings types.List `tfsdk:"exchange_listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListListingsForExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListListingsForExchangeResponse_SdkV2) { @@ -4637,10 +4721,11 @@ func (newState *ListListingsForExchangeResponse_SdkV2) SyncEffectiveFieldsDuring func (newState *ListListingsForExchangeResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListListingsForExchangeResponse_SdkV2) { } -func (c ListListingsForExchangeResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeListing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange_listings")...) +func (c ListListingsForExchangeResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_listings"] = attrs["exchange_listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListListingsForExchangeResponse. @@ -4893,9 +4978,9 @@ func (o *ListListingsRequest_SdkV2) SetTags(ctx context.Context, v []ListingTag_ } type ListListingsResponse_SdkV2 struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListListingsResponse_SdkV2) { @@ -4904,10 +4989,11 @@ func (newState *ListListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListListingsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListListingsResponse_SdkV2) { } -func (c ListListingsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c ListListingsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListListingsResponse. @@ -4975,11 +5061,11 @@ func (o *ListListingsResponse_SdkV2) SetListings(ctx context.Context, v []Listin type ListProviderAnalyticsDashboardResponse_SdkV2 struct { // dashboard_id will be used to open Lakeview dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *ListProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProviderAnalyticsDashboardResponse_SdkV2) { @@ -4988,11 +5074,12 @@ func (newState *ListProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveField func (newState *ListProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListProviderAnalyticsDashboardResponse_SdkV2) { } -func (c ListProviderAnalyticsDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - cs.SetRequired(append(path, "id")...) +func (c ListProviderAnalyticsDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProviderAnalyticsDashboardResponse. @@ -5075,9 +5162,9 @@ func (o ListProvidersRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListProvidersResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Providers types.List `tfsdk:"providers" tf:"optional"` + Providers types.List `tfsdk:"providers"` } func (newState *ListProvidersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProvidersResponse_SdkV2) { @@ -5086,10 +5173,11 @@ func (newState *ListProvidersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListProvidersResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListProvidersResponse_SdkV2) { } -func (c ListProvidersResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "providers")...) +func (c ListProvidersResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["providers"] = attrs["providers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProvidersResponse. @@ -5156,11 +5244,11 @@ func (o *ListProvidersResponse_SdkV2) SetProviders(ctx context.Context, v []Prov } type Listing_SdkV2 struct { - Detail types.List `tfsdk:"detail" tf:"optional,object"` + Detail types.List `tfsdk:"detail"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Next Number: 26 - Summary types.List `tfsdk:"summary" tf:"object"` + Summary types.List `tfsdk:"summary"` } func (newState *Listing_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Listing_SdkV2) { @@ -5169,12 +5257,14 @@ func (newState *Listing_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan List func (newState *Listing_SdkV2) SyncEffectiveFieldsDuringRead(existingState Listing_SdkV2) { } -func (c Listing_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListingDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "detail")...) - cs.SetRequired(append(path, "summary")...) - ListingSummary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "summary")...) +func (c Listing_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["detail"] = attrs["detail"].SetOptional() + attrs["detail"] = attrs["detail"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["summary"] = attrs["summary"].SetRequired() + attrs["summary"] = attrs["summary"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Listing. @@ -5274,40 +5364,40 @@ func (o *Listing_SdkV2) SetSummary(ctx context.Context, v ListingSummary_SdkV2) type ListingDetail_SdkV2 struct { // Type of assets included in the listing. eg. GIT_REPO, DATA_TABLE, MODEL, // NOTEBOOK - Assets types.List `tfsdk:"assets" tf:"optional"` + Assets types.List `tfsdk:"assets"` // The ending date timestamp for when the data spans - CollectionDateEnd types.Int64 `tfsdk:"collection_date_end" tf:"optional"` + CollectionDateEnd types.Int64 `tfsdk:"collection_date_end"` // The starting date timestamp for when the data spans - CollectionDateStart types.Int64 `tfsdk:"collection_date_start" tf:"optional"` + CollectionDateStart types.Int64 `tfsdk:"collection_date_start"` // Smallest unit of time in the dataset - CollectionGranularity types.List `tfsdk:"collection_granularity" tf:"optional,object"` + CollectionGranularity types.List `tfsdk:"collection_granularity"` // Whether the dataset is free or paid - Cost types.String `tfsdk:"cost" tf:"optional"` + Cost types.String `tfsdk:"cost"` // Where/how the data is sourced - DataSource types.String `tfsdk:"data_source" tf:"optional"` + DataSource types.String `tfsdk:"data_source"` - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - DocumentationLink types.String `tfsdk:"documentation_link" tf:"optional"` + DocumentationLink types.String `tfsdk:"documentation_link"` - EmbeddedNotebookFileInfos types.List `tfsdk:"embedded_notebook_file_infos" tf:"optional"` + EmbeddedNotebookFileInfos types.List `tfsdk:"embedded_notebook_file_infos"` - FileIds types.List `tfsdk:"file_ids" tf:"optional"` + FileIds types.List `tfsdk:"file_ids"` // Which geo region the listing data is collected from - GeographicalCoverage types.String `tfsdk:"geographical_coverage" tf:"optional"` + GeographicalCoverage types.String `tfsdk:"geographical_coverage"` // ID 20, 21 removed don't use License of the data asset - Required for // listings with model based assets - License types.String `tfsdk:"license" tf:"optional"` + License types.String `tfsdk:"license"` // What the pricing model is (e.g. paid, subscription, paid upfront); should // only be present if cost is paid TODO: Not used yet, should deprecate if // we will never use it - PricingModel types.String `tfsdk:"pricing_model" tf:"optional"` + PricingModel types.String `tfsdk:"pricing_model"` - PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link" tf:"optional"` + PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link"` // size of the dataset in GB - Size types.Float64 `tfsdk:"size" tf:"optional"` + Size types.Float64 `tfsdk:"size"` - SupportLink types.String `tfsdk:"support_link" tf:"optional"` + SupportLink types.String `tfsdk:"support_link"` // Listing tags - Simple key value pair to annotate listings. When should I // use tags vs dedicated fields? Using tags avoids the need to add new // columns in the database for new annotations. However, this should be used @@ -5315,11 +5405,11 @@ type ListingDetail_SdkV2 struct { // the field is optional and won't need to have NOT NULL integrity check 2. // The value is fairly fixed, static and low cardinality (eg. enums). 3. The // value won't be used in filters or joins with other tables. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` - TermsOfService types.String `tfsdk:"terms_of_service" tf:"optional"` + TermsOfService types.String `tfsdk:"terms_of_service"` // How often data is updated - UpdateFrequency types.List `tfsdk:"update_frequency" tf:"optional,object"` + UpdateFrequency types.List `tfsdk:"update_frequency"` } func (newState *ListingDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingDetail_SdkV2) { @@ -5328,13 +5418,30 @@ func (newState *ListingDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ListingDetail_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListingDetail_SdkV2) { } -func (c ListingDetail_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DataRefreshInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "collection_granularity")...) - FileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedded_notebook_file_infos")...) - ListingTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - DataRefreshInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "update_frequency")...) - - return cs +func (c ListingDetail_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets"] = attrs["assets"].SetOptional() + attrs["collection_date_end"] = attrs["collection_date_end"].SetOptional() + attrs["collection_date_start"] = attrs["collection_date_start"].SetOptional() + attrs["collection_granularity"] = attrs["collection_granularity"].SetOptional() + attrs["collection_granularity"] = attrs["collection_granularity"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cost"] = attrs["cost"].SetOptional() + attrs["data_source"] = attrs["data_source"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["documentation_link"] = attrs["documentation_link"].SetOptional() + attrs["embedded_notebook_file_infos"] = attrs["embedded_notebook_file_infos"].SetOptional() + attrs["file_ids"] = attrs["file_ids"].SetOptional() + attrs["geographical_coverage"] = attrs["geographical_coverage"].SetOptional() + attrs["license"] = attrs["license"].SetOptional() + attrs["pricing_model"] = attrs["pricing_model"].SetOptional() + attrs["privacy_policy_link"] = attrs["privacy_policy_link"].SetOptional() + attrs["size"] = attrs["size"].SetOptional() + attrs["support_link"] = attrs["support_link"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["terms_of_service"] = attrs["terms_of_service"].SetOptional() + attrs["update_frequency"] = attrs["update_frequency"].SetOptional() + attrs["update_frequency"] = attrs["update_frequency"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingDetail. @@ -5580,15 +5687,15 @@ func (o *ListingDetail_SdkV2) SetUpdateFrequency(ctx context.Context, v DataRefr } type ListingFulfillment_SdkV2 struct { - FulfillmentType types.String `tfsdk:"fulfillment_type" tf:"optional"` + FulfillmentType types.String `tfsdk:"fulfillment_type"` - ListingId types.String `tfsdk:"listing_id" tf:""` + ListingId types.String `tfsdk:"listing_id"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` - RepoInfo types.List `tfsdk:"repo_info" tf:"optional,object"` + RepoInfo types.List `tfsdk:"repo_info"` - ShareInfo types.List `tfsdk:"share_info" tf:"optional,object"` + ShareInfo types.List `tfsdk:"share_info"` } func (newState *ListingFulfillment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingFulfillment_SdkV2) { @@ -5597,12 +5704,16 @@ func (newState *ListingFulfillment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListingFulfillment_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListingFulfillment_SdkV2) { } -func (c ListingFulfillment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "listing_id")...) - RepoInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "repo_info")...) - ShareInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "share_info")...) +func (c ListingFulfillment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fulfillment_type"] = attrs["fulfillment_type"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["repo_info"] = attrs["repo_info"].SetOptional() + attrs["repo_info"] = attrs["repo_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["share_info"] = attrs["share_info"].SetOptional() + attrs["share_info"] = attrs["share_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingFulfillment. @@ -5704,7 +5815,7 @@ func (o *ListingFulfillment_SdkV2) SetShareInfo(ctx context.Context, v ShareInfo } type ListingSetting_SdkV2 struct { - Visibility types.String `tfsdk:"visibility" tf:"optional"` + Visibility types.String `tfsdk:"visibility"` } func (newState *ListingSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingSetting_SdkV2) { @@ -5713,9 +5824,10 @@ func (newState *ListingSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListingSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListingSetting_SdkV2) { } -func (c ListingSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListingSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["visibility"] = attrs["visibility"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingSetting. @@ -5751,44 +5863,44 @@ func (o ListingSetting_SdkV2) Type(ctx context.Context) attr.Type { // Next Number: 26 type ListingSummary_SdkV2 struct { - Categories types.List `tfsdk:"categories" tf:"optional"` + Categories types.List `tfsdk:"categories"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - CreatedById types.Int64 `tfsdk:"created_by_id" tf:"optional"` + CreatedById types.Int64 `tfsdk:"created_by_id"` - ExchangeIds types.List `tfsdk:"exchange_ids" tf:"optional"` + ExchangeIds types.List `tfsdk:"exchange_ids"` // if a git repo is being created, a listing will be initialized with this // field as opposed to a share - GitRepo types.List `tfsdk:"git_repo" tf:"optional,object"` + GitRepo types.List `tfsdk:"git_repo"` - ListingType types.String `tfsdk:"listingType" tf:""` + ListingType types.String `tfsdk:"listingType"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - ProviderId types.String `tfsdk:"provider_id" tf:"optional"` + ProviderId types.String `tfsdk:"provider_id"` - ProviderRegion types.List `tfsdk:"provider_region" tf:"optional,object"` + ProviderRegion types.List `tfsdk:"provider_region"` - PublishedAt types.Int64 `tfsdk:"published_at" tf:"optional"` + PublishedAt types.Int64 `tfsdk:"published_at"` - PublishedBy types.String `tfsdk:"published_by" tf:"optional"` + PublishedBy types.String `tfsdk:"published_by"` - Setting types.List `tfsdk:"setting" tf:"optional,object"` + Setting types.List `tfsdk:"setting"` - Share types.List `tfsdk:"share" tf:"optional,object"` + Share types.List `tfsdk:"share"` // Enums - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` - Subtitle types.String `tfsdk:"subtitle" tf:"optional"` + Subtitle types.String `tfsdk:"subtitle"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` - UpdatedById types.Int64 `tfsdk:"updated_by_id" tf:"optional"` + UpdatedById types.Int64 `tfsdk:"updated_by_id"` } func (newState *ListingSummary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingSummary_SdkV2) { @@ -5797,15 +5909,32 @@ func (newState *ListingSummary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListingSummary_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListingSummary_SdkV2) { } -func (c ListingSummary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "git_repo")...) - cs.SetRequired(append(path, "listingType")...) - cs.SetRequired(append(path, "name")...) - RegionInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provider_region")...) - ListingSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) - ShareInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "share")...) - - return cs +func (c ListingSummary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["categories"] = attrs["categories"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["created_by_id"] = attrs["created_by_id"].SetOptional() + attrs["exchange_ids"] = attrs["exchange_ids"].SetOptional() + attrs["git_repo"] = attrs["git_repo"].SetOptional() + attrs["git_repo"] = attrs["git_repo"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["listingType"] = attrs["listingType"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["provider_id"] = attrs["provider_id"].SetOptional() + attrs["provider_region"] = attrs["provider_region"].SetOptional() + attrs["provider_region"] = attrs["provider_region"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["published_at"] = attrs["published_at"].SetOptional() + attrs["published_by"] = attrs["published_by"].SetOptional() + attrs["setting"] = attrs["setting"].SetOptional() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["share"] = attrs["share"].SetOptional() + attrs["share"] = attrs["share"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["subtitle"] = attrs["subtitle"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["updated_by_id"] = attrs["updated_by_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingSummary. @@ -6052,10 +6181,10 @@ func (o *ListingSummary_SdkV2) SetShare(ctx context.Context, v ShareInfo_SdkV2) type ListingTag_SdkV2 struct { // Tag name (enum) - TagName types.String `tfsdk:"tag_name" tf:"optional"` + TagName types.String `tfsdk:"tag_name"` // String representation of the tag value. Values should be string literals // (no complex types) - TagValues types.List `tfsdk:"tag_values" tf:"optional"` + TagValues types.List `tfsdk:"tag_values"` } func (newState *ListingTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingTag_SdkV2) { @@ -6064,9 +6193,11 @@ func (newState *ListingTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *ListingTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListingTag_SdkV2) { } -func (c ListingTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListingTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["tag_name"] = attrs["tag_name"].SetOptional() + attrs["tag_values"] = attrs["tag_values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingTag. @@ -6133,38 +6264,38 @@ func (o *ListingTag_SdkV2) SetTagValues(ctx context.Context, v []types.String) { } type PersonalizationRequest_SdkV2 struct { - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - ConsumerRegion types.List `tfsdk:"consumer_region" tf:"object"` + ConsumerRegion types.List `tfsdk:"consumer_region"` // contact info for the consumer requesting data or performing a listing // installation - ContactInfo types.List `tfsdk:"contact_info" tf:"optional,object"` + ContactInfo types.List `tfsdk:"contact_info"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - IntendedUse types.String `tfsdk:"intended_use" tf:"optional"` + IntendedUse types.String `tfsdk:"intended_use"` - IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse" tf:"optional"` + IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse"` - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` - ListingName types.String `tfsdk:"listing_name" tf:"optional"` + ListingName types.String `tfsdk:"listing_name"` - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` - ProviderId types.String `tfsdk:"provider_id" tf:"optional"` + ProviderId types.String `tfsdk:"provider_id"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` - Share types.List `tfsdk:"share" tf:"optional,object"` + Share types.List `tfsdk:"share"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` } func (newState *PersonalizationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PersonalizationRequest_SdkV2) { @@ -6173,13 +6304,28 @@ func (newState *PersonalizationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *PersonalizationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PersonalizationRequest_SdkV2) { } -func (c PersonalizationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "consumer_region")...) - RegionInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "consumer_region")...) - ContactInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "contact_info")...) - ShareInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "share")...) - - return cs +func (c PersonalizationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["consumer_region"] = attrs["consumer_region"].SetRequired() + attrs["consumer_region"] = attrs["consumer_region"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["contact_info"] = attrs["contact_info"].SetOptional() + attrs["contact_info"] = attrs["contact_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["intended_use"] = attrs["intended_use"].SetOptional() + attrs["is_from_lighthouse"] = attrs["is_from_lighthouse"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetOptional() + attrs["listing_name"] = attrs["listing_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["provider_id"] = attrs["provider_id"].SetOptional() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["share"] = attrs["share"].SetOptional() + attrs["share"] = attrs["share"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PersonalizationRequest. @@ -6332,7 +6478,7 @@ func (o *PersonalizationRequest_SdkV2) SetShare(ctx context.Context, v ShareInfo } type ProviderAnalyticsDashboard_SdkV2 struct { - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *ProviderAnalyticsDashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderAnalyticsDashboard_SdkV2) { @@ -6341,10 +6487,10 @@ func (newState *ProviderAnalyticsDashboard_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ProviderAnalyticsDashboard_SdkV2) SyncEffectiveFieldsDuringRead(existingState ProviderAnalyticsDashboard_SdkV2) { } -func (c ProviderAnalyticsDashboard_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c ProviderAnalyticsDashboard_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderAnalyticsDashboard. @@ -6379,33 +6525,33 @@ func (o ProviderAnalyticsDashboard_SdkV2) Type(ctx context.Context) attr.Type { } type ProviderInfo_SdkV2 struct { - BusinessContactEmail types.String `tfsdk:"business_contact_email" tf:""` + BusinessContactEmail types.String `tfsdk:"business_contact_email"` - CompanyWebsiteLink types.String `tfsdk:"company_website_link" tf:"optional"` + CompanyWebsiteLink types.String `tfsdk:"company_website_link"` - DarkModeIconFileId types.String `tfsdk:"dark_mode_icon_file_id" tf:"optional"` + DarkModeIconFileId types.String `tfsdk:"dark_mode_icon_file_id"` - DarkModeIconFilePath types.String `tfsdk:"dark_mode_icon_file_path" tf:"optional"` + DarkModeIconFilePath types.String `tfsdk:"dark_mode_icon_file_path"` - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - IconFileId types.String `tfsdk:"icon_file_id" tf:"optional"` + IconFileId types.String `tfsdk:"icon_file_id"` - IconFilePath types.String `tfsdk:"icon_file_path" tf:"optional"` + IconFilePath types.String `tfsdk:"icon_file_path"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // is_featured is accessible by consumers only - IsFeatured types.Bool `tfsdk:"is_featured" tf:"optional"` + IsFeatured types.Bool `tfsdk:"is_featured"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link" tf:""` + PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link"` // published_by is only applicable to data aggregators (e.g. Crux) - PublishedBy types.String `tfsdk:"published_by" tf:"optional"` + PublishedBy types.String `tfsdk:"published_by"` - SupportContactEmail types.String `tfsdk:"support_contact_email" tf:"optional"` + SupportContactEmail types.String `tfsdk:"support_contact_email"` - TermOfServiceLink types.String `tfsdk:"term_of_service_link" tf:""` + TermOfServiceLink types.String `tfsdk:"term_of_service_link"` } func (newState *ProviderInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderInfo_SdkV2) { @@ -6414,13 +6560,23 @@ func (newState *ProviderInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ProviderInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ProviderInfo_SdkV2) { } -func (c ProviderInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "business_contact_email")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "privacy_policy_link")...) - cs.SetRequired(append(path, "term_of_service_link")...) +func (c ProviderInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["business_contact_email"] = attrs["business_contact_email"].SetRequired() + attrs["company_website_link"] = attrs["company_website_link"].SetOptional() + attrs["dark_mode_icon_file_id"] = attrs["dark_mode_icon_file_id"].SetOptional() + attrs["dark_mode_icon_file_path"] = attrs["dark_mode_icon_file_path"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["icon_file_id"] = attrs["icon_file_id"].SetOptional() + attrs["icon_file_path"] = attrs["icon_file_path"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_featured"] = attrs["is_featured"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["privacy_policy_link"] = attrs["privacy_policy_link"].SetRequired() + attrs["published_by"] = attrs["published_by"].SetOptional() + attrs["support_contact_email"] = attrs["support_contact_email"].SetOptional() + attrs["term_of_service_link"] = attrs["term_of_service_link"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderInfo. @@ -6481,9 +6637,9 @@ func (o ProviderInfo_SdkV2) Type(ctx context.Context) attr.Type { } type RegionInfo_SdkV2 struct { - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *RegionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegionInfo_SdkV2) { @@ -6492,9 +6648,11 @@ func (newState *RegionInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *RegionInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegionInfo_SdkV2) { } -func (c RegionInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegionInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegionInfo. @@ -6575,9 +6733,9 @@ func (newState *RemoveExchangeForListingResponse_SdkV2) SyncEffectiveFieldsDurin func (newState *RemoveExchangeForListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RemoveExchangeForListingResponse_SdkV2) { } -func (c RemoveExchangeForListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RemoveExchangeForListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RemoveExchangeForListingResponse. @@ -6609,7 +6767,7 @@ func (o RemoveExchangeForListingResponse_SdkV2) Type(ctx context.Context) attr.T type RepoInfo_SdkV2 struct { // the git repo url e.g. https://github.com/databrickslabs/dolly.git - GitRepoUrl types.String `tfsdk:"git_repo_url" tf:""` + GitRepoUrl types.String `tfsdk:"git_repo_url"` } func (newState *RepoInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInfo_SdkV2) { @@ -6618,10 +6776,10 @@ func (newState *RepoInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Rep func (newState *RepoInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoInfo_SdkV2) { } -func (c RepoInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "git_repo_url")...) +func (c RepoInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["git_repo_url"] = attrs["git_repo_url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoInfo. @@ -6657,11 +6815,11 @@ func (o RepoInfo_SdkV2) Type(ctx context.Context) attr.Type { type RepoInstallation_SdkV2 struct { // the user-specified repo name for their installed git repo listing - RepoName types.String `tfsdk:"repo_name" tf:""` + RepoName types.String `tfsdk:"repo_name"` // refers to the full url file path that navigates the user to the repo's // entrypoint (e.g. a README.md file, or the repo file view in the unified // UI) should just be a relative path - RepoPath types.String `tfsdk:"repo_path" tf:""` + RepoPath types.String `tfsdk:"repo_path"` } func (newState *RepoInstallation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInstallation_SdkV2) { @@ -6670,11 +6828,11 @@ func (newState *RepoInstallation_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *RepoInstallation_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoInstallation_SdkV2) { } -func (c RepoInstallation_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "repo_name")...) - cs.SetRequired(append(path, "repo_path")...) +func (c RepoInstallation_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["repo_name"] = attrs["repo_name"].SetRequired() + attrs["repo_path"] = attrs["repo_path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoInstallation. @@ -6864,9 +7022,9 @@ func (o *SearchListingsRequest_SdkV2) SetProviderIds(ctx context.Context, v []ty } type SearchListingsResponse_SdkV2 struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *SearchListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchListingsResponse_SdkV2) { @@ -6875,10 +7033,11 @@ func (newState *SearchListingsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *SearchListingsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchListingsResponse_SdkV2) { } -func (c SearchListingsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c SearchListingsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchListingsResponse. @@ -6945,9 +7104,9 @@ func (o *SearchListingsResponse_SdkV2) SetListings(ctx context.Context, v []List } type ShareInfo_SdkV2 struct { - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - Type_ types.String `tfsdk:"type" tf:""` + Type_ types.String `tfsdk:"type"` } func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo_SdkV2) { @@ -6956,11 +7115,11 @@ func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sh func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ShareInfo_SdkV2) { } -func (c ShareInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "type")...) +func (c ShareInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["type"] = attrs["type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ShareInfo. @@ -6999,9 +7158,9 @@ func (o ShareInfo_SdkV2) Type(ctx context.Context) attr.Type { type SharedDataObject_SdkV2 struct { // The type of the data object. Could be one of: TABLE, SCHEMA, // NOTEBOOK_FILE, MODEL, VOLUME - DataObjectType types.String `tfsdk:"data_object_type" tf:"optional"` + DataObjectType types.String `tfsdk:"data_object_type"` // Name of the shared object - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *SharedDataObject_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SharedDataObject_SdkV2) { @@ -7010,9 +7169,11 @@ func (newState *SharedDataObject_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SharedDataObject_SdkV2) SyncEffectiveFieldsDuringRead(existingState SharedDataObject_SdkV2) { } -func (c SharedDataObject_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SharedDataObject_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_object_type"] = attrs["data_object_type"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SharedDataObject. @@ -7049,15 +7210,15 @@ func (o SharedDataObject_SdkV2) Type(ctx context.Context) attr.Type { } type TokenDetail_SdkV2 struct { - BearerToken types.String `tfsdk:"bearerToken" tf:"optional"` + BearerToken types.String `tfsdk:"bearerToken"` - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` - ExpirationTime types.String `tfsdk:"expirationTime" tf:"optional"` + ExpirationTime types.String `tfsdk:"expirationTime"` // These field names must follow the delta sharing protocol. Original // message: RetrieveToken.Response in // managed-catalog/api/messages/recipient.proto - ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion" tf:"optional"` + ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion"` } func (newState *TokenDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenDetail_SdkV2) { @@ -7066,9 +7227,13 @@ func (newState *TokenDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TokenDetail_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenDetail_SdkV2) { } -func (c TokenDetail_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenDetail_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bearerToken"] = attrs["bearerToken"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["expirationTime"] = attrs["expirationTime"].SetOptional() + attrs["shareCredentialsVersion"] = attrs["shareCredentialsVersion"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenDetail. @@ -7111,19 +7276,19 @@ func (o TokenDetail_SdkV2) Type(ctx context.Context) attr.Type { type TokenInfo_SdkV2 struct { // Full activation url to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl types.String `tfsdk:"activation_url" tf:"optional"` + ActivationUrl types.String `tfsdk:"activation_url"` // Time at which this Recipient Token was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of Recipient Token creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // Unique id of the Recipient Token. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time at which this Recipient Token was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of Recipient Token updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *TokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenInfo_SdkV2) { @@ -7132,9 +7297,16 @@ func (newState *TokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan To func (newState *TokenInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenInfo_SdkV2) { } -func (c TokenInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activation_url"] = attrs["activation_url"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenInfo. @@ -7181,7 +7353,7 @@ func (o TokenInfo_SdkV2) Type(ctx context.Context) attr.Type { } type UpdateExchangeFilterRequest_SdkV2 struct { - Filter types.List `tfsdk:"filter" tf:"object"` + Filter types.List `tfsdk:"filter"` Id types.String `tfsdk:"-"` } @@ -7192,12 +7364,12 @@ func (newState *UpdateExchangeFilterRequest_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *UpdateExchangeFilterRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeFilterRequest_SdkV2) { } -func (c UpdateExchangeFilterRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "filter")...) - ExchangeFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filter")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateExchangeFilterRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetRequired() + attrs["filter"] = attrs["filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeFilterRequest. @@ -7264,7 +7436,7 @@ func (o *UpdateExchangeFilterRequest_SdkV2) SetFilter(ctx context.Context, v Exc } type UpdateExchangeFilterResponse_SdkV2 struct { - Filter types.List `tfsdk:"filter" tf:"optional,object"` + Filter types.List `tfsdk:"filter"` } func (newState *UpdateExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExchangeFilterResponse_SdkV2) { @@ -7273,10 +7445,11 @@ func (newState *UpdateExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *UpdateExchangeFilterResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeFilterResponse_SdkV2) { } -func (c UpdateExchangeFilterResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeFilter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c UpdateExchangeFilterResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetOptional() + attrs["filter"] = attrs["filter"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeFilterResponse. @@ -7341,7 +7514,7 @@ func (o *UpdateExchangeFilterResponse_SdkV2) SetFilter(ctx context.Context, v Ex } type UpdateExchangeRequest_SdkV2 struct { - Exchange types.List `tfsdk:"exchange" tf:"object"` + Exchange types.List `tfsdk:"exchange"` Id types.String `tfsdk:"-"` } @@ -7352,12 +7525,12 @@ func (newState *UpdateExchangeRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateExchangeRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeRequest_SdkV2) { } -func (c UpdateExchangeRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange")...) - Exchange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateExchangeRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetRequired() + attrs["exchange"] = attrs["exchange"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeRequest. @@ -7424,7 +7597,7 @@ func (o *UpdateExchangeRequest_SdkV2) SetExchange(ctx context.Context, v Exchang } type UpdateExchangeResponse_SdkV2 struct { - Exchange types.List `tfsdk:"exchange" tf:"optional,object"` + Exchange types.List `tfsdk:"exchange"` } func (newState *UpdateExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExchangeResponse_SdkV2) { @@ -7433,10 +7606,11 @@ func (newState *UpdateExchangeResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateExchangeResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeResponse_SdkV2) { } -func (c UpdateExchangeResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Exchange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) +func (c UpdateExchangeResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetOptional() + attrs["exchange"] = attrs["exchange"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeResponse. @@ -7501,13 +7675,13 @@ func (o *UpdateExchangeResponse_SdkV2) SetExchange(ctx context.Context, v Exchan } type UpdateInstallationRequest_SdkV2 struct { - Installation types.List `tfsdk:"installation" tf:"object"` + Installation types.List `tfsdk:"installation"` InstallationId types.String `tfsdk:"-"` ListingId types.String `tfsdk:"-"` - RotateToken types.Bool `tfsdk:"rotate_token" tf:"optional"` + RotateToken types.Bool `tfsdk:"rotate_token"` } func (newState *UpdateInstallationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateInstallationRequest_SdkV2) { @@ -7516,13 +7690,14 @@ func (newState *UpdateInstallationRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *UpdateInstallationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateInstallationRequest_SdkV2) { } -func (c UpdateInstallationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "installation")...) - InstallationDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "installation")...) - cs.SetRequired(append(path, "installation_id")...) - cs.SetRequired(append(path, "listing_id")...) +func (c UpdateInstallationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installation"] = attrs["installation"].SetRequired() + attrs["installation"] = attrs["installation"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["installation_id"] = attrs["installation_id"].SetRequired() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["rotate_token"] = attrs["rotate_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateInstallationRequest. @@ -7593,7 +7768,7 @@ func (o *UpdateInstallationRequest_SdkV2) SetInstallation(ctx context.Context, v } type UpdateInstallationResponse_SdkV2 struct { - Installation types.List `tfsdk:"installation" tf:"optional,object"` + Installation types.List `tfsdk:"installation"` } func (newState *UpdateInstallationResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateInstallationResponse_SdkV2) { @@ -7602,10 +7777,11 @@ func (newState *UpdateInstallationResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UpdateInstallationResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateInstallationResponse_SdkV2) { } -func (c UpdateInstallationResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "installation")...) +func (c UpdateInstallationResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installation"] = attrs["installation"].SetOptional() + attrs["installation"] = attrs["installation"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateInstallationResponse. @@ -7672,7 +7848,7 @@ func (o *UpdateInstallationResponse_SdkV2) SetInstallation(ctx context.Context, type UpdateListingRequest_SdkV2 struct { Id types.String `tfsdk:"-"` - Listing types.List `tfsdk:"listing" tf:"object"` + Listing types.List `tfsdk:"listing"` } func (newState *UpdateListingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateListingRequest_SdkV2) { @@ -7681,12 +7857,12 @@ func (newState *UpdateListingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateListingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateListingRequest_SdkV2) { } -func (c UpdateListingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "listing")...) - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c UpdateListingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["listing"] = attrs["listing"].SetRequired() + attrs["listing"] = attrs["listing"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateListingRequest. @@ -7753,7 +7929,7 @@ func (o *UpdateListingRequest_SdkV2) SetListing(ctx context.Context, v Listing_S } type UpdateListingResponse_SdkV2 struct { - Listing types.List `tfsdk:"listing" tf:"optional,object"` + Listing types.List `tfsdk:"listing"` } func (newState *UpdateListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateListingResponse_SdkV2) { @@ -7762,10 +7938,11 @@ func (newState *UpdateListingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateListingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateListingResponse_SdkV2) { } -func (c UpdateListingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c UpdateListingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing"] = attrs["listing"].SetOptional() + attrs["listing"] = attrs["listing"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateListingResponse. @@ -7832,13 +8009,13 @@ func (o *UpdateListingResponse_SdkV2) SetListing(ctx context.Context, v Listing_ type UpdatePersonalizationRequestRequest_SdkV2 struct { ListingId types.String `tfsdk:"-"` - Reason types.String `tfsdk:"reason" tf:"optional"` + Reason types.String `tfsdk:"reason"` RequestId types.String `tfsdk:"-"` - Share types.List `tfsdk:"share" tf:"optional,object"` + Share types.List `tfsdk:"share"` - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` } func (newState *UpdatePersonalizationRequestRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePersonalizationRequestRequest_SdkV2) { @@ -7847,13 +8024,15 @@ func (newState *UpdatePersonalizationRequestRequest_SdkV2) SyncEffectiveFieldsDu func (newState *UpdatePersonalizationRequestRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdatePersonalizationRequestRequest_SdkV2) { } -func (c UpdatePersonalizationRequestRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "listing_id")...) - cs.SetRequired(append(path, "request_id")...) - ShareInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "share")...) - cs.SetRequired(append(path, "status")...) +func (c UpdatePersonalizationRequestRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["reason"] = attrs["reason"].SetOptional() + attrs["request_id"] = attrs["request_id"].SetRequired() + attrs["share"] = attrs["share"].SetOptional() + attrs["share"] = attrs["share"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePersonalizationRequestRequest. @@ -7926,7 +8105,7 @@ func (o *UpdatePersonalizationRequestRequest_SdkV2) SetShare(ctx context.Context } type UpdatePersonalizationRequestResponse_SdkV2 struct { - Request types.List `tfsdk:"request" tf:"optional,object"` + Request types.List `tfsdk:"request"` } func (newState *UpdatePersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePersonalizationRequestResponse_SdkV2) { @@ -7935,10 +8114,11 @@ func (newState *UpdatePersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsD func (newState *UpdatePersonalizationRequestResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdatePersonalizationRequestResponse_SdkV2) { } -func (c UpdatePersonalizationRequestResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PersonalizationRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "request")...) +func (c UpdatePersonalizationRequestResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["request"] = attrs["request"].SetOptional() + attrs["request"] = attrs["request"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePersonalizationRequestResponse. @@ -8008,7 +8188,7 @@ type UpdateProviderAnalyticsDashboardRequest_SdkV2 struct { // this is the version of the dashboard template we want to update our user // to current expectation is that it should be equal to latest version of // the dashboard template - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *UpdateProviderAnalyticsDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderAnalyticsDashboardRequest_SdkV2) { @@ -8017,10 +8197,11 @@ func (newState *UpdateProviderAnalyticsDashboardRequest_SdkV2) SyncEffectiveFiel func (newState *UpdateProviderAnalyticsDashboardRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateProviderAnalyticsDashboardRequest_SdkV2) { } -func (c UpdateProviderAnalyticsDashboardRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c UpdateProviderAnalyticsDashboardRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderAnalyticsDashboardRequest. @@ -8058,11 +8239,11 @@ func (o UpdateProviderAnalyticsDashboardRequest_SdkV2) Type(ctx context.Context) type UpdateProviderAnalyticsDashboardResponse_SdkV2 struct { // this is newly created Lakeview dashboard for the user - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` // id & version should be the same as the request - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *UpdateProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderAnalyticsDashboardResponse_SdkV2) { @@ -8071,11 +8252,12 @@ func (newState *UpdateProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFie func (newState *UpdateProviderAnalyticsDashboardResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateProviderAnalyticsDashboardResponse_SdkV2) { } -func (c UpdateProviderAnalyticsDashboardResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateProviderAnalyticsDashboardResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderAnalyticsDashboardResponse. @@ -8116,7 +8298,7 @@ func (o UpdateProviderAnalyticsDashboardResponse_SdkV2) Type(ctx context.Context type UpdateProviderRequest_SdkV2 struct { Id types.String `tfsdk:"-"` - Provider types.List `tfsdk:"provider" tf:"object"` + Provider types.List `tfsdk:"provider"` } func (newState *UpdateProviderRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderRequest_SdkV2) { @@ -8125,12 +8307,12 @@ func (newState *UpdateProviderRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateProviderRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateProviderRequest_SdkV2) { } -func (c UpdateProviderRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "provider")...) - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c UpdateProviderRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["provider"] = attrs["provider"].SetRequired() + attrs["provider"] = attrs["provider"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderRequest. @@ -8197,7 +8379,7 @@ func (o *UpdateProviderRequest_SdkV2) SetProvider(ctx context.Context, v Provide } type UpdateProviderResponse_SdkV2 struct { - Provider types.List `tfsdk:"provider" tf:"optional,object"` + Provider types.List `tfsdk:"provider"` } func (newState *UpdateProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderResponse_SdkV2) { @@ -8206,10 +8388,11 @@ func (newState *UpdateProviderResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateProviderResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateProviderResponse_SdkV2) { } -func (c UpdateProviderResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c UpdateProviderResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["provider"] = attrs["provider"].SetOptional() + attrs["provider"] = attrs["provider"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderResponse. diff --git a/internal/service/marketplace_tf/model.go b/internal/service/marketplace_tf/model.go index 10e2974cf..f773be2a1 100755 --- a/internal/service/marketplace_tf/model.go +++ b/internal/service/marketplace_tf/model.go @@ -23,9 +23,9 @@ import ( ) type AddExchangeForListingRequest struct { - ExchangeId types.String `tfsdk:"exchange_id" tf:""` + ExchangeId types.String `tfsdk:"exchange_id"` - ListingId types.String `tfsdk:"listing_id" tf:""` + ListingId types.String `tfsdk:"listing_id"` } func (newState *AddExchangeForListingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddExchangeForListingRequest) { @@ -34,11 +34,11 @@ func (newState *AddExchangeForListingRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *AddExchangeForListingRequest) SyncEffectiveFieldsDuringRead(existingState AddExchangeForListingRequest) { } -func (c AddExchangeForListingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange_id")...) - cs.SetRequired(append(path, "listing_id")...) +func (c AddExchangeForListingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_id"] = attrs["exchange_id"].SetRequired() + attrs["listing_id"] = attrs["listing_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddExchangeForListingRequest. @@ -75,7 +75,7 @@ func (o AddExchangeForListingRequest) Type(ctx context.Context) attr.Type { } type AddExchangeForListingResponse struct { - ExchangeForListing types.Object `tfsdk:"exchange_for_listing" tf:"optional,object"` + ExchangeForListing types.Object `tfsdk:"exchange_for_listing"` } func (newState *AddExchangeForListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan AddExchangeForListingResponse) { @@ -84,10 +84,10 @@ func (newState *AddExchangeForListingResponse) SyncEffectiveFieldsDuringCreateOr func (newState *AddExchangeForListingResponse) SyncEffectiveFieldsDuringRead(existingState AddExchangeForListingResponse) { } -func (c AddExchangeForListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeListing{}.ApplySchemaCustomizations(cs, append(path, "exchange_for_listing")...) +func (c AddExchangeForListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_for_listing"] = attrs["exchange_for_listing"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AddExchangeForListingResponse. @@ -218,7 +218,7 @@ func (o *BatchGetListingsRequest) SetIds(ctx context.Context, v []types.String) } type BatchGetListingsResponse struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` } func (newState *BatchGetListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan BatchGetListingsResponse) { @@ -227,10 +227,10 @@ func (newState *BatchGetListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *BatchGetListingsResponse) SyncEffectiveFieldsDuringRead(existingState BatchGetListingsResponse) { } -func (c BatchGetListingsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c BatchGetListingsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BatchGetListingsResponse. @@ -361,7 +361,7 @@ func (o *BatchGetProvidersRequest) SetIds(ctx context.Context, v []types.String) } type BatchGetProvidersResponse struct { - Providers types.List `tfsdk:"providers" tf:"optional"` + Providers types.List `tfsdk:"providers"` } func (newState *BatchGetProvidersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan BatchGetProvidersResponse) { @@ -370,10 +370,10 @@ func (newState *BatchGetProvidersResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *BatchGetProvidersResponse) SyncEffectiveFieldsDuringRead(existingState BatchGetProvidersResponse) { } -func (c BatchGetProvidersResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "providers")...) +func (c BatchGetProvidersResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["providers"] = attrs["providers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BatchGetProvidersResponse. @@ -438,7 +438,7 @@ func (o *BatchGetProvidersResponse) SetProviders(ctx context.Context, v []Provid } type ConsumerTerms struct { - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *ConsumerTerms) SyncEffectiveFieldsDuringCreateOrUpdate(plan ConsumerTerms) { @@ -447,10 +447,10 @@ func (newState *ConsumerTerms) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cons func (newState *ConsumerTerms) SyncEffectiveFieldsDuringRead(existingState ConsumerTerms) { } -func (c ConsumerTerms) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "version")...) +func (c ConsumerTerms) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ConsumerTerms. @@ -487,13 +487,13 @@ func (o ConsumerTerms) Type(ctx context.Context) attr.Type { // contact info for the consumer requesting data or performing a listing // installation type ContactInfo struct { - Company types.String `tfsdk:"company" tf:"optional"` + Company types.String `tfsdk:"company"` - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` - FirstName types.String `tfsdk:"first_name" tf:"optional"` + FirstName types.String `tfsdk:"first_name"` - LastName types.String `tfsdk:"last_name" tf:"optional"` + LastName types.String `tfsdk:"last_name"` } func (newState *ContactInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ContactInfo) { @@ -502,9 +502,13 @@ func (newState *ContactInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Contac func (newState *ContactInfo) SyncEffectiveFieldsDuringRead(existingState ContactInfo) { } -func (c ContactInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ContactInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["company"] = attrs["company"].SetOptional() + attrs["email"] = attrs["email"].SetOptional() + attrs["first_name"] = attrs["first_name"].SetOptional() + attrs["last_name"] = attrs["last_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ContactInfo. @@ -545,7 +549,7 @@ func (o ContactInfo) Type(ctx context.Context) attr.Type { } type CreateExchangeFilterRequest struct { - Filter types.Object `tfsdk:"filter" tf:"object"` + Filter types.Object `tfsdk:"filter"` } func (newState *CreateExchangeFilterRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeFilterRequest) { @@ -554,11 +558,10 @@ func (newState *CreateExchangeFilterRequest) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateExchangeFilterRequest) SyncEffectiveFieldsDuringRead(existingState CreateExchangeFilterRequest) { } -func (c CreateExchangeFilterRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "filter")...) - ExchangeFilter{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c CreateExchangeFilterRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeFilterRequest. @@ -623,7 +626,7 @@ func (o *CreateExchangeFilterRequest) SetFilter(ctx context.Context, v ExchangeF } type CreateExchangeFilterResponse struct { - FilterId types.String `tfsdk:"filter_id" tf:"optional"` + FilterId types.String `tfsdk:"filter_id"` } func (newState *CreateExchangeFilterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeFilterResponse) { @@ -632,9 +635,10 @@ func (newState *CreateExchangeFilterResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateExchangeFilterResponse) SyncEffectiveFieldsDuringRead(existingState CreateExchangeFilterResponse) { } -func (c CreateExchangeFilterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateExchangeFilterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter_id"] = attrs["filter_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeFilterResponse. @@ -669,7 +673,7 @@ func (o CreateExchangeFilterResponse) Type(ctx context.Context) attr.Type { } type CreateExchangeRequest struct { - Exchange types.Object `tfsdk:"exchange" tf:"object"` + Exchange types.Object `tfsdk:"exchange"` } func (newState *CreateExchangeRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeRequest) { @@ -678,11 +682,10 @@ func (newState *CreateExchangeRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateExchangeRequest) SyncEffectiveFieldsDuringRead(existingState CreateExchangeRequest) { } -func (c CreateExchangeRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange")...) - Exchange{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) +func (c CreateExchangeRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeRequest. @@ -747,7 +750,7 @@ func (o *CreateExchangeRequest) SetExchange(ctx context.Context, v Exchange) { } type CreateExchangeResponse struct { - ExchangeId types.String `tfsdk:"exchange_id" tf:"optional"` + ExchangeId types.String `tfsdk:"exchange_id"` } func (newState *CreateExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExchangeResponse) { @@ -756,9 +759,10 @@ func (newState *CreateExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateExchangeResponse) SyncEffectiveFieldsDuringRead(existingState CreateExchangeResponse) { } -func (c CreateExchangeResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateExchangeResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_id"] = attrs["exchange_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExchangeResponse. @@ -793,13 +797,13 @@ func (o CreateExchangeResponse) Type(ctx context.Context) attr.Type { } type CreateFileRequest struct { - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` - FileParent types.Object `tfsdk:"file_parent" tf:"object"` + FileParent types.Object `tfsdk:"file_parent"` - MarketplaceFileType types.String `tfsdk:"marketplace_file_type" tf:""` + MarketplaceFileType types.String `tfsdk:"marketplace_file_type"` - MimeType types.String `tfsdk:"mime_type" tf:""` + MimeType types.String `tfsdk:"mime_type"` } func (newState *CreateFileRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFileRequest) { @@ -808,13 +812,13 @@ func (newState *CreateFileRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateFileRequest) SyncEffectiveFieldsDuringRead(existingState CreateFileRequest) { } -func (c CreateFileRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "file_parent")...) - FileParent{}.ApplySchemaCustomizations(cs, append(path, "file_parent")...) - cs.SetRequired(append(path, "marketplace_file_type")...) - cs.SetRequired(append(path, "mime_type")...) +func (c CreateFileRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["file_parent"] = attrs["file_parent"].SetRequired() + attrs["marketplace_file_type"] = attrs["marketplace_file_type"].SetRequired() + attrs["mime_type"] = attrs["mime_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFileRequest. @@ -885,9 +889,9 @@ func (o *CreateFileRequest) SetFileParent(ctx context.Context, v FileParent) { } type CreateFileResponse struct { - FileInfo types.Object `tfsdk:"file_info" tf:"optional,object"` + FileInfo types.Object `tfsdk:"file_info"` // Pre-signed POST URL to blob storage - UploadUrl types.String `tfsdk:"upload_url" tf:"optional"` + UploadUrl types.String `tfsdk:"upload_url"` } func (newState *CreateFileResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateFileResponse) { @@ -896,10 +900,11 @@ func (newState *CreateFileResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateFileResponse) SyncEffectiveFieldsDuringRead(existingState CreateFileResponse) { } -func (c CreateFileResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo{}.ApplySchemaCustomizations(cs, append(path, "file_info")...) +func (c CreateFileResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_info"] = attrs["file_info"].SetOptional() + attrs["upload_url"] = attrs["upload_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateFileResponse. @@ -966,17 +971,17 @@ func (o *CreateFileResponse) SetFileInfo(ctx context.Context, v FileInfo) { } type CreateInstallationRequest struct { - AcceptedConsumerTerms types.Object `tfsdk:"accepted_consumer_terms" tf:"optional,object"` + AcceptedConsumerTerms types.Object `tfsdk:"accepted_consumer_terms"` - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` ListingId types.String `tfsdk:"-"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` // for git repo installations - RepoDetail types.Object `tfsdk:"repo_detail" tf:"optional,object"` + RepoDetail types.Object `tfsdk:"repo_detail"` - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` } func (newState *CreateInstallationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateInstallationRequest) { @@ -985,12 +990,15 @@ func (newState *CreateInstallationRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateInstallationRequest) SyncEffectiveFieldsDuringRead(existingState CreateInstallationRequest) { } -func (c CreateInstallationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ConsumerTerms{}.ApplySchemaCustomizations(cs, append(path, "accepted_consumer_terms")...) - cs.SetRequired(append(path, "listing_id")...) - RepoInstallation{}.ApplySchemaCustomizations(cs, append(path, "repo_detail")...) +func (c CreateInstallationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["accepted_consumer_terms"] = attrs["accepted_consumer_terms"].SetOptional() + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["repo_detail"] = attrs["repo_detail"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateInstallationRequest. @@ -1094,7 +1102,7 @@ func (o *CreateInstallationRequest) SetRepoDetail(ctx context.Context, v RepoIns } type CreateListingRequest struct { - Listing types.Object `tfsdk:"listing" tf:"object"` + Listing types.Object `tfsdk:"listing"` } func (newState *CreateListingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateListingRequest) { @@ -1103,11 +1111,10 @@ func (newState *CreateListingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateListingRequest) SyncEffectiveFieldsDuringRead(existingState CreateListingRequest) { } -func (c CreateListingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "listing")...) - Listing{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c CreateListingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing"] = attrs["listing"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateListingRequest. @@ -1172,7 +1179,7 @@ func (o *CreateListingRequest) SetListing(ctx context.Context, v Listing) { } type CreateListingResponse struct { - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` } func (newState *CreateListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateListingResponse) { @@ -1181,9 +1188,10 @@ func (newState *CreateListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateListingResponse) SyncEffectiveFieldsDuringRead(existingState CreateListingResponse) { } -func (c CreateListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing_id"] = attrs["listing_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateListingResponse. @@ -1219,23 +1227,23 @@ func (o CreateListingResponse) Type(ctx context.Context) attr.Type { // Data request messages also creates a lead (maybe) type CreatePersonalizationRequest struct { - AcceptedConsumerTerms types.Object `tfsdk:"accepted_consumer_terms" tf:"object"` + AcceptedConsumerTerms types.Object `tfsdk:"accepted_consumer_terms"` - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - Company types.String `tfsdk:"company" tf:"optional"` + Company types.String `tfsdk:"company"` - FirstName types.String `tfsdk:"first_name" tf:"optional"` + FirstName types.String `tfsdk:"first_name"` - IntendedUse types.String `tfsdk:"intended_use" tf:""` + IntendedUse types.String `tfsdk:"intended_use"` - IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse" tf:"optional"` + IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse"` - LastName types.String `tfsdk:"last_name" tf:"optional"` + LastName types.String `tfsdk:"last_name"` ListingId types.String `tfsdk:"-"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` } func (newState *CreatePersonalizationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePersonalizationRequest) { @@ -1244,13 +1252,18 @@ func (newState *CreatePersonalizationRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *CreatePersonalizationRequest) SyncEffectiveFieldsDuringRead(existingState CreatePersonalizationRequest) { } -func (c CreatePersonalizationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "accepted_consumer_terms")...) - ConsumerTerms{}.ApplySchemaCustomizations(cs, append(path, "accepted_consumer_terms")...) - cs.SetRequired(append(path, "intended_use")...) - cs.SetRequired(append(path, "listing_id")...) +func (c CreatePersonalizationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["accepted_consumer_terms"] = attrs["accepted_consumer_terms"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["company"] = attrs["company"].SetOptional() + attrs["first_name"] = attrs["first_name"].SetOptional() + attrs["intended_use"] = attrs["intended_use"].SetRequired() + attrs["is_from_lighthouse"] = attrs["is_from_lighthouse"].SetOptional() + attrs["last_name"] = attrs["last_name"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePersonalizationRequest. @@ -1331,7 +1344,7 @@ func (o *CreatePersonalizationRequest) SetAcceptedConsumerTerms(ctx context.Cont } type CreatePersonalizationRequestResponse struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *CreatePersonalizationRequestResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePersonalizationRequestResponse) { @@ -1340,9 +1353,10 @@ func (newState *CreatePersonalizationRequestResponse) SyncEffectiveFieldsDuringC func (newState *CreatePersonalizationRequestResponse) SyncEffectiveFieldsDuringRead(existingState CreatePersonalizationRequestResponse) { } -func (c CreatePersonalizationRequestResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreatePersonalizationRequestResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePersonalizationRequestResponse. @@ -1377,7 +1391,7 @@ func (o CreatePersonalizationRequestResponse) Type(ctx context.Context) attr.Typ } type CreateProviderRequest struct { - Provider types.Object `tfsdk:"provider" tf:"object"` + Provider types.Object `tfsdk:"provider"` } func (newState *CreateProviderRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateProviderRequest) { @@ -1386,11 +1400,10 @@ func (newState *CreateProviderRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateProviderRequest) SyncEffectiveFieldsDuringRead(existingState CreateProviderRequest) { } -func (c CreateProviderRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "provider")...) - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c CreateProviderRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["provider"] = attrs["provider"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateProviderRequest. @@ -1455,7 +1468,7 @@ func (o *CreateProviderRequest) SetProvider(ctx context.Context, v ProviderInfo) } type CreateProviderResponse struct { - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *CreateProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateProviderResponse) { @@ -1464,9 +1477,10 @@ func (newState *CreateProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateProviderResponse) SyncEffectiveFieldsDuringRead(existingState CreateProviderResponse) { } -func (c CreateProviderResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateProviderResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateProviderResponse. @@ -1501,9 +1515,9 @@ func (o CreateProviderResponse) Type(ctx context.Context) attr.Type { } type DataRefreshInfo struct { - Interval types.Int64 `tfsdk:"interval" tf:""` + Interval types.Int64 `tfsdk:"interval"` - Unit types.String `tfsdk:"unit" tf:""` + Unit types.String `tfsdk:"unit"` } func (newState *DataRefreshInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataRefreshInfo) { @@ -1512,11 +1526,11 @@ func (newState *DataRefreshInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Da func (newState *DataRefreshInfo) SyncEffectiveFieldsDuringRead(existingState DataRefreshInfo) { } -func (c DataRefreshInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "interval")...) - cs.SetRequired(append(path, "unit")...) +func (c DataRefreshInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["interval"] = attrs["interval"].SetRequired() + attrs["unit"] = attrs["unit"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataRefreshInfo. @@ -1597,9 +1611,9 @@ func (newState *DeleteExchangeFilterResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *DeleteExchangeFilterResponse) SyncEffectiveFieldsDuringRead(existingState DeleteExchangeFilterResponse) { } -func (c DeleteExchangeFilterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteExchangeFilterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExchangeFilterResponse. @@ -1674,9 +1688,9 @@ func (newState *DeleteExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *DeleteExchangeResponse) SyncEffectiveFieldsDuringRead(existingState DeleteExchangeResponse) { } -func (c DeleteExchangeResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteExchangeResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExchangeResponse. @@ -1751,9 +1765,9 @@ func (newState *DeleteFileResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteFileResponse) SyncEffectiveFieldsDuringRead(existingState DeleteFileResponse) { } -func (c DeleteFileResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteFileResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteFileResponse. @@ -1832,9 +1846,9 @@ func (newState *DeleteInstallationResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *DeleteInstallationResponse) SyncEffectiveFieldsDuringRead(existingState DeleteInstallationResponse) { } -func (c DeleteInstallationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteInstallationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteInstallationResponse. @@ -1909,9 +1923,9 @@ func (newState *DeleteListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DeleteListingResponse) SyncEffectiveFieldsDuringRead(existingState DeleteListingResponse) { } -func (c DeleteListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteListingResponse. @@ -1986,9 +2000,9 @@ func (newState *DeleteProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *DeleteProviderResponse) SyncEffectiveFieldsDuringRead(existingState DeleteProviderResponse) { } -func (c DeleteProviderResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteProviderResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteProviderResponse. @@ -2019,23 +2033,23 @@ func (o DeleteProviderResponse) Type(ctx context.Context) attr.Type { } type Exchange struct { - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - Filters types.List `tfsdk:"filters" tf:"optional"` + Filters types.List `tfsdk:"filters"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - LinkedListings types.List `tfsdk:"linked_listings" tf:"optional"` + LinkedListings types.List `tfsdk:"linked_listings"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *Exchange) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exchange) { @@ -2044,12 +2058,18 @@ func (newState *Exchange) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exchange) func (newState *Exchange) SyncEffectiveFieldsDuringRead(existingState Exchange) { } -func (c Exchange) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeFilter{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - ExchangeListing{}.ApplySchemaCustomizations(cs, append(path, "linked_listings")...) - cs.SetRequired(append(path, "name")...) +func (c Exchange) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["linked_listings"] = attrs["linked_listings"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Exchange. @@ -2159,23 +2179,23 @@ func (o *Exchange) SetLinkedListings(ctx context.Context, v []ExchangeListing) { } type ExchangeFilter struct { - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - ExchangeId types.String `tfsdk:"exchange_id" tf:""` + ExchangeId types.String `tfsdk:"exchange_id"` - FilterType types.String `tfsdk:"filter_type" tf:""` + FilterType types.String `tfsdk:"filter_type"` - FilterValue types.String `tfsdk:"filter_value" tf:""` + FilterValue types.String `tfsdk:"filter_value"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *ExchangeFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeFilter) { @@ -2184,12 +2204,18 @@ func (newState *ExchangeFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exc func (newState *ExchangeFilter) SyncEffectiveFieldsDuringRead(existingState ExchangeFilter) { } -func (c ExchangeFilter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange_id")...) - cs.SetRequired(append(path, "filter_type")...) - cs.SetRequired(append(path, "filter_value")...) +func (c ExchangeFilter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["exchange_id"] = attrs["exchange_id"].SetRequired() + attrs["filter_type"] = attrs["filter_type"].SetRequired() + attrs["filter_value"] = attrs["filter_value"].SetRequired() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeFilter. @@ -2240,19 +2266,19 @@ func (o ExchangeFilter) Type(ctx context.Context) attr.Type { } type ExchangeListing struct { - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - ExchangeId types.String `tfsdk:"exchange_id" tf:"optional"` + ExchangeId types.String `tfsdk:"exchange_id"` - ExchangeName types.String `tfsdk:"exchange_name" tf:"optional"` + ExchangeName types.String `tfsdk:"exchange_name"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` - ListingName types.String `tfsdk:"listing_name" tf:"optional"` + ListingName types.String `tfsdk:"listing_name"` } func (newState *ExchangeListing) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeListing) { @@ -2261,9 +2287,16 @@ func (newState *ExchangeListing) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ex func (newState *ExchangeListing) SyncEffectiveFieldsDuringRead(existingState ExchangeListing) { } -func (c ExchangeListing) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExchangeListing) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["exchange_id"] = attrs["exchange_id"].SetOptional() + attrs["exchange_name"] = attrs["exchange_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetOptional() + attrs["listing_name"] = attrs["listing_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeListing. @@ -2310,26 +2343,26 @@ func (o ExchangeListing) Type(ctx context.Context) attr.Type { } type FileInfo struct { - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Name displayed to users for applicable files, e.g. embedded notebooks - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` - DownloadLink types.String `tfsdk:"download_link" tf:"optional"` + DownloadLink types.String `tfsdk:"download_link"` - FileParent types.Object `tfsdk:"file_parent" tf:"optional,object"` + FileParent types.Object `tfsdk:"file_parent"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - MarketplaceFileType types.String `tfsdk:"marketplace_file_type" tf:"optional"` + MarketplaceFileType types.String `tfsdk:"marketplace_file_type"` - MimeType types.String `tfsdk:"mime_type" tf:"optional"` + MimeType types.String `tfsdk:"mime_type"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // Populated if status is in a failed state with more information on reason // for the failure. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` } func (newState *FileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo) { @@ -2338,10 +2371,19 @@ func (newState *FileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo) func (newState *FileInfo) SyncEffectiveFieldsDuringRead(existingState FileInfo) { } -func (c FileInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileParent{}.ApplySchemaCustomizations(cs, append(path, "file_parent")...) +func (c FileInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["download_link"] = attrs["download_link"].SetOptional() + attrs["file_parent"] = attrs["file_parent"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["marketplace_file_type"] = attrs["marketplace_file_type"].SetOptional() + attrs["mime_type"] = attrs["mime_type"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileInfo. @@ -2424,9 +2466,9 @@ func (o *FileInfo) SetFileParent(ctx context.Context, v FileParent) { } type FileParent struct { - FileParentType types.String `tfsdk:"file_parent_type" tf:"optional"` + FileParentType types.String `tfsdk:"file_parent_type"` // TODO make the following fields required - ParentId types.String `tfsdk:"parent_id" tf:"optional"` + ParentId types.String `tfsdk:"parent_id"` } func (newState *FileParent) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileParent) { @@ -2435,9 +2477,11 @@ func (newState *FileParent) SyncEffectiveFieldsDuringCreateOrUpdate(plan FilePar func (newState *FileParent) SyncEffectiveFieldsDuringRead(existingState FileParent) { } -func (c FileParent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileParent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_parent_type"] = attrs["file_parent_type"].SetOptional() + attrs["parent_id"] = attrs["parent_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileParent. @@ -2510,7 +2554,7 @@ func (o GetExchangeRequest) Type(ctx context.Context) attr.Type { } type GetExchangeResponse struct { - Exchange types.Object `tfsdk:"exchange" tf:"optional,object"` + Exchange types.Object `tfsdk:"exchange"` } func (newState *GetExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetExchangeResponse) { @@ -2519,10 +2563,10 @@ func (newState *GetExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *GetExchangeResponse) SyncEffectiveFieldsDuringRead(existingState GetExchangeResponse) { } -func (c GetExchangeResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Exchange{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) +func (c GetExchangeResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetExchangeResponse. @@ -2623,7 +2667,7 @@ func (o GetFileRequest) Type(ctx context.Context) attr.Type { } type GetFileResponse struct { - FileInfo types.Object `tfsdk:"file_info" tf:"optional,object"` + FileInfo types.Object `tfsdk:"file_info"` } func (newState *GetFileResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetFileResponse) { @@ -2632,10 +2676,10 @@ func (newState *GetFileResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ge func (newState *GetFileResponse) SyncEffectiveFieldsDuringRead(existingState GetFileResponse) { } -func (c GetFileResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo{}.ApplySchemaCustomizations(cs, append(path, "file_info")...) +func (c GetFileResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_info"] = attrs["file_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetFileResponse. @@ -2701,7 +2745,7 @@ func (o *GetFileResponse) SetFileInfo(ctx context.Context, v FileInfo) { type GetLatestVersionProviderAnalyticsDashboardResponse struct { // version here is latest logical version of the dashboard template - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *GetLatestVersionProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetLatestVersionProviderAnalyticsDashboardResponse) { @@ -2710,9 +2754,10 @@ func (newState *GetLatestVersionProviderAnalyticsDashboardResponse) SyncEffectiv func (newState *GetLatestVersionProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDuringRead(existingState GetLatestVersionProviderAnalyticsDashboardResponse) { } -func (c GetLatestVersionProviderAnalyticsDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetLatestVersionProviderAnalyticsDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetLatestVersionProviderAnalyticsDashboardResponse. @@ -2791,9 +2836,9 @@ func (o GetListingContentMetadataRequest) Type(ctx context.Context) attr.Type { } type GetListingContentMetadataResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - SharedDataObjects types.List `tfsdk:"shared_data_objects" tf:"optional"` + SharedDataObjects types.List `tfsdk:"shared_data_objects"` } func (newState *GetListingContentMetadataResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetListingContentMetadataResponse) { @@ -2802,10 +2847,11 @@ func (newState *GetListingContentMetadataResponse) SyncEffectiveFieldsDuringCrea func (newState *GetListingContentMetadataResponse) SyncEffectiveFieldsDuringRead(existingState GetListingContentMetadataResponse) { } -func (c GetListingContentMetadataResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SharedDataObject{}.ApplySchemaCustomizations(cs, append(path, "shared_data_objects")...) +func (c GetListingContentMetadataResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["shared_data_objects"] = attrs["shared_data_objects"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetListingContentMetadataResponse. @@ -2908,7 +2954,7 @@ func (o GetListingRequest) Type(ctx context.Context) attr.Type { } type GetListingResponse struct { - Listing types.Object `tfsdk:"listing" tf:"optional,object"` + Listing types.Object `tfsdk:"listing"` } func (newState *GetListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetListingResponse) { @@ -2917,10 +2963,10 @@ func (newState *GetListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GetListingResponse) SyncEffectiveFieldsDuringRead(existingState GetListingResponse) { } -func (c GetListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c GetListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing"] = attrs["listing"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetListingResponse. @@ -3025,9 +3071,9 @@ func (o GetListingsRequest) Type(ctx context.Context) attr.Type { } type GetListingsResponse struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetListingsResponse) { @@ -3036,10 +3082,11 @@ func (newState *GetListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *GetListingsResponse) SyncEffectiveFieldsDuringRead(existingState GetListingsResponse) { } -func (c GetListingsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c GetListingsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetListingsResponse. @@ -3142,7 +3189,7 @@ func (o GetPersonalizationRequestRequest) Type(ctx context.Context) attr.Type { } type GetPersonalizationRequestResponse struct { - PersonalizationRequests types.List `tfsdk:"personalization_requests" tf:"optional"` + PersonalizationRequests types.List `tfsdk:"personalization_requests"` } func (newState *GetPersonalizationRequestResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPersonalizationRequestResponse) { @@ -3151,10 +3198,10 @@ func (newState *GetPersonalizationRequestResponse) SyncEffectiveFieldsDuringCrea func (newState *GetPersonalizationRequestResponse) SyncEffectiveFieldsDuringRead(existingState GetPersonalizationRequestResponse) { } -func (c GetPersonalizationRequestResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PersonalizationRequest{}.ApplySchemaCustomizations(cs, append(path, "personalization_requests")...) +func (c GetPersonalizationRequestResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["personalization_requests"] = attrs["personalization_requests"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPersonalizationRequestResponse. @@ -3255,7 +3302,7 @@ func (o GetProviderRequest) Type(ctx context.Context) attr.Type { } type GetProviderResponse struct { - Provider types.Object `tfsdk:"provider" tf:"optional,object"` + Provider types.Object `tfsdk:"provider"` } func (newState *GetProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetProviderResponse) { @@ -3264,10 +3311,10 @@ func (newState *GetProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *GetProviderResponse) SyncEffectiveFieldsDuringRead(existingState GetProviderResponse) { } -func (c GetProviderResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c GetProviderResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["provider"] = attrs["provider"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetProviderResponse. @@ -3332,7 +3379,7 @@ func (o *GetProviderResponse) SetProvider(ctx context.Context, v ProviderInfo) { } type Installation struct { - Installation types.Object `tfsdk:"installation" tf:"optional,object"` + Installation types.Object `tfsdk:"installation"` } func (newState *Installation) SyncEffectiveFieldsDuringCreateOrUpdate(plan Installation) { @@ -3341,10 +3388,10 @@ func (newState *Installation) SyncEffectiveFieldsDuringCreateOrUpdate(plan Insta func (newState *Installation) SyncEffectiveFieldsDuringRead(existingState Installation) { } -func (c Installation) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail{}.ApplySchemaCustomizations(cs, append(path, "installation")...) +func (c Installation) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installation"] = attrs["installation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Installation. @@ -3409,31 +3456,31 @@ func (o *Installation) SetInstallation(ctx context.Context, v InstallationDetail } type InstallationDetail struct { - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - InstalledOn types.Int64 `tfsdk:"installed_on" tf:"optional"` + InstalledOn types.Int64 `tfsdk:"installed_on"` - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` - ListingName types.String `tfsdk:"listing_name" tf:"optional"` + ListingName types.String `tfsdk:"listing_name"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` - RepoName types.String `tfsdk:"repo_name" tf:"optional"` + RepoName types.String `tfsdk:"repo_name"` - RepoPath types.String `tfsdk:"repo_path" tf:"optional"` + RepoPath types.String `tfsdk:"repo_path"` - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` - TokenDetail types.Object `tfsdk:"token_detail" tf:"optional,object"` + TokenDetail types.Object `tfsdk:"token_detail"` - Tokens types.List `tfsdk:"tokens" tf:"optional"` + Tokens types.List `tfsdk:"tokens"` } func (newState *InstallationDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan InstallationDetail) { @@ -3442,11 +3489,22 @@ func (newState *InstallationDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *InstallationDetail) SyncEffectiveFieldsDuringRead(existingState InstallationDetail) { } -func (c InstallationDetail) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenDetail{}.ApplySchemaCustomizations(cs, append(path, "token_detail")...) - TokenInfo{}.ApplySchemaCustomizations(cs, append(path, "tokens")...) +func (c InstallationDetail) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["installed_on"] = attrs["installed_on"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetOptional() + attrs["listing_name"] = attrs["listing_name"].SetOptional() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["repo_name"] = attrs["repo_name"].SetOptional() + attrs["repo_path"] = attrs["repo_path"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["token_detail"] = attrs["token_detail"].SetOptional() + attrs["tokens"] = attrs["tokens"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InstallationDetail. @@ -3604,9 +3662,9 @@ func (o ListAllInstallationsRequest) Type(ctx context.Context) attr.Type { } type ListAllInstallationsResponse struct { - Installations types.List `tfsdk:"installations" tf:"optional"` + Installations types.List `tfsdk:"installations"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListAllInstallationsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAllInstallationsResponse) { @@ -3615,10 +3673,11 @@ func (newState *ListAllInstallationsResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *ListAllInstallationsResponse) SyncEffectiveFieldsDuringRead(existingState ListAllInstallationsResponse) { } -func (c ListAllInstallationsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail{}.ApplySchemaCustomizations(cs, append(path, "installations")...) +func (c ListAllInstallationsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installations"] = attrs["installations"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAllInstallationsResponse. @@ -3725,9 +3784,9 @@ func (o ListAllPersonalizationRequestsRequest) Type(ctx context.Context) attr.Ty } type ListAllPersonalizationRequestsResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - PersonalizationRequests types.List `tfsdk:"personalization_requests" tf:"optional"` + PersonalizationRequests types.List `tfsdk:"personalization_requests"` } func (newState *ListAllPersonalizationRequestsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAllPersonalizationRequestsResponse) { @@ -3736,10 +3795,11 @@ func (newState *ListAllPersonalizationRequestsResponse) SyncEffectiveFieldsDurin func (newState *ListAllPersonalizationRequestsResponse) SyncEffectiveFieldsDuringRead(existingState ListAllPersonalizationRequestsResponse) { } -func (c ListAllPersonalizationRequestsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PersonalizationRequest{}.ApplySchemaCustomizations(cs, append(path, "personalization_requests")...) +func (c ListAllPersonalizationRequestsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["personalization_requests"] = attrs["personalization_requests"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAllPersonalizationRequestsResponse. @@ -3850,9 +3910,9 @@ func (o ListExchangeFiltersRequest) Type(ctx context.Context) attr.Type { } type ListExchangeFiltersResponse struct { - Filters types.List `tfsdk:"filters" tf:"optional"` + Filters types.List `tfsdk:"filters"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExchangeFiltersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExchangeFiltersResponse) { @@ -3861,10 +3921,11 @@ func (newState *ListExchangeFiltersResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListExchangeFiltersResponse) SyncEffectiveFieldsDuringRead(existingState ListExchangeFiltersResponse) { } -func (c ListExchangeFiltersResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeFilter{}.ApplySchemaCustomizations(cs, append(path, "filters")...) +func (c ListExchangeFiltersResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filters"] = attrs["filters"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExchangeFiltersResponse. @@ -3975,9 +4036,9 @@ func (o ListExchangesForListingRequest) Type(ctx context.Context) attr.Type { } type ListExchangesForListingResponse struct { - ExchangeListing types.List `tfsdk:"exchange_listing" tf:"optional"` + ExchangeListing types.List `tfsdk:"exchange_listing"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExchangesForListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExchangesForListingResponse) { @@ -3986,10 +4047,11 @@ func (newState *ListExchangesForListingResponse) SyncEffectiveFieldsDuringCreate func (newState *ListExchangesForListingResponse) SyncEffectiveFieldsDuringRead(existingState ListExchangesForListingResponse) { } -func (c ListExchangesForListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeListing{}.ApplySchemaCustomizations(cs, append(path, "exchange_listing")...) +func (c ListExchangesForListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_listing"] = attrs["exchange_listing"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExchangesForListingResponse. @@ -4096,9 +4158,9 @@ func (o ListExchangesRequest) Type(ctx context.Context) attr.Type { } type ListExchangesResponse struct { - Exchanges types.List `tfsdk:"exchanges" tf:"optional"` + Exchanges types.List `tfsdk:"exchanges"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExchangesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExchangesResponse) { @@ -4107,10 +4169,11 @@ func (newState *ListExchangesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListExchangesResponse) SyncEffectiveFieldsDuringRead(existingState ListExchangesResponse) { } -func (c ListExchangesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Exchange{}.ApplySchemaCustomizations(cs, append(path, "exchanges")...) +func (c ListExchangesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchanges"] = attrs["exchanges"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExchangesResponse. @@ -4251,9 +4314,9 @@ func (o *ListFilesRequest) SetFileParent(ctx context.Context, v FileParent) { } type ListFilesResponse struct { - FileInfos types.List `tfsdk:"file_infos" tf:"optional"` + FileInfos types.List `tfsdk:"file_infos"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListFilesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFilesResponse) { @@ -4262,10 +4325,11 @@ func (newState *ListFilesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListFilesResponse) SyncEffectiveFieldsDuringRead(existingState ListFilesResponse) { } -func (c ListFilesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo{}.ApplySchemaCustomizations(cs, append(path, "file_infos")...) +func (c ListFilesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_infos"] = attrs["file_infos"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFilesResponse. @@ -4376,9 +4440,9 @@ func (o ListFulfillmentsRequest) Type(ctx context.Context) attr.Type { } type ListFulfillmentsResponse struct { - Fulfillments types.List `tfsdk:"fulfillments" tf:"optional"` + Fulfillments types.List `tfsdk:"fulfillments"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListFulfillmentsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFulfillmentsResponse) { @@ -4387,10 +4451,11 @@ func (newState *ListFulfillmentsResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListFulfillmentsResponse) SyncEffectiveFieldsDuringRead(existingState ListFulfillmentsResponse) { } -func (c ListFulfillmentsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListingFulfillment{}.ApplySchemaCustomizations(cs, append(path, "fulfillments")...) +func (c ListFulfillmentsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fulfillments"] = attrs["fulfillments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFulfillmentsResponse. @@ -4501,9 +4566,9 @@ func (o ListInstallationsRequest) Type(ctx context.Context) attr.Type { } type ListInstallationsResponse struct { - Installations types.List `tfsdk:"installations" tf:"optional"` + Installations types.List `tfsdk:"installations"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListInstallationsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListInstallationsResponse) { @@ -4512,10 +4577,11 @@ func (newState *ListInstallationsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListInstallationsResponse) SyncEffectiveFieldsDuringRead(existingState ListInstallationsResponse) { } -func (c ListInstallationsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail{}.ApplySchemaCustomizations(cs, append(path, "installations")...) +func (c ListInstallationsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installations"] = attrs["installations"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListInstallationsResponse. @@ -4626,9 +4692,9 @@ func (o ListListingsForExchangeRequest) Type(ctx context.Context) attr.Type { } type ListListingsForExchangeResponse struct { - ExchangeListings types.List `tfsdk:"exchange_listings" tf:"optional"` + ExchangeListings types.List `tfsdk:"exchange_listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListListingsForExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListListingsForExchangeResponse) { @@ -4637,10 +4703,11 @@ func (newState *ListListingsForExchangeResponse) SyncEffectiveFieldsDuringCreate func (newState *ListListingsForExchangeResponse) SyncEffectiveFieldsDuringRead(existingState ListListingsForExchangeResponse) { } -func (c ListListingsForExchangeResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeListing{}.ApplySchemaCustomizations(cs, append(path, "exchange_listings")...) +func (c ListListingsForExchangeResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange_listings"] = attrs["exchange_listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListListingsForExchangeResponse. @@ -4893,9 +4960,9 @@ func (o *ListListingsRequest) SetTags(ctx context.Context, v []ListingTag) { } type ListListingsResponse struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListListingsResponse) { @@ -4904,10 +4971,11 @@ func (newState *ListListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListListingsResponse) SyncEffectiveFieldsDuringRead(existingState ListListingsResponse) { } -func (c ListListingsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c ListListingsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListListingsResponse. @@ -4975,11 +5043,11 @@ func (o *ListListingsResponse) SetListings(ctx context.Context, v []Listing) { type ListProviderAnalyticsDashboardResponse struct { // dashboard_id will be used to open Lakeview dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *ListProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProviderAnalyticsDashboardResponse) { @@ -4988,11 +5056,12 @@ func (newState *ListProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDurin func (newState *ListProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDuringRead(existingState ListProviderAnalyticsDashboardResponse) { } -func (c ListProviderAnalyticsDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - cs.SetRequired(append(path, "id")...) +func (c ListProviderAnalyticsDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProviderAnalyticsDashboardResponse. @@ -5075,9 +5144,9 @@ func (o ListProvidersRequest) Type(ctx context.Context) attr.Type { } type ListProvidersResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Providers types.List `tfsdk:"providers" tf:"optional"` + Providers types.List `tfsdk:"providers"` } func (newState *ListProvidersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProvidersResponse) { @@ -5086,10 +5155,11 @@ func (newState *ListProvidersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListProvidersResponse) SyncEffectiveFieldsDuringRead(existingState ListProvidersResponse) { } -func (c ListProvidersResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "providers")...) +func (c ListProvidersResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["providers"] = attrs["providers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProvidersResponse. @@ -5156,11 +5226,11 @@ func (o *ListProvidersResponse) SetProviders(ctx context.Context, v []ProviderIn } type Listing struct { - Detail types.Object `tfsdk:"detail" tf:"optional,object"` + Detail types.Object `tfsdk:"detail"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Next Number: 26 - Summary types.Object `tfsdk:"summary" tf:"object"` + Summary types.Object `tfsdk:"summary"` } func (newState *Listing) SyncEffectiveFieldsDuringCreateOrUpdate(plan Listing) { @@ -5169,12 +5239,12 @@ func (newState *Listing) SyncEffectiveFieldsDuringCreateOrUpdate(plan Listing) { func (newState *Listing) SyncEffectiveFieldsDuringRead(existingState Listing) { } -func (c Listing) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListingDetail{}.ApplySchemaCustomizations(cs, append(path, "detail")...) - cs.SetRequired(append(path, "summary")...) - ListingSummary{}.ApplySchemaCustomizations(cs, append(path, "summary")...) +func (c Listing) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["detail"] = attrs["detail"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["summary"] = attrs["summary"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Listing. @@ -5274,40 +5344,40 @@ func (o *Listing) SetSummary(ctx context.Context, v ListingSummary) { type ListingDetail struct { // Type of assets included in the listing. eg. GIT_REPO, DATA_TABLE, MODEL, // NOTEBOOK - Assets types.List `tfsdk:"assets" tf:"optional"` + Assets types.List `tfsdk:"assets"` // The ending date timestamp for when the data spans - CollectionDateEnd types.Int64 `tfsdk:"collection_date_end" tf:"optional"` + CollectionDateEnd types.Int64 `tfsdk:"collection_date_end"` // The starting date timestamp for when the data spans - CollectionDateStart types.Int64 `tfsdk:"collection_date_start" tf:"optional"` + CollectionDateStart types.Int64 `tfsdk:"collection_date_start"` // Smallest unit of time in the dataset - CollectionGranularity types.Object `tfsdk:"collection_granularity" tf:"optional,object"` + CollectionGranularity types.Object `tfsdk:"collection_granularity"` // Whether the dataset is free or paid - Cost types.String `tfsdk:"cost" tf:"optional"` + Cost types.String `tfsdk:"cost"` // Where/how the data is sourced - DataSource types.String `tfsdk:"data_source" tf:"optional"` + DataSource types.String `tfsdk:"data_source"` - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - DocumentationLink types.String `tfsdk:"documentation_link" tf:"optional"` + DocumentationLink types.String `tfsdk:"documentation_link"` - EmbeddedNotebookFileInfos types.List `tfsdk:"embedded_notebook_file_infos" tf:"optional"` + EmbeddedNotebookFileInfos types.List `tfsdk:"embedded_notebook_file_infos"` - FileIds types.List `tfsdk:"file_ids" tf:"optional"` + FileIds types.List `tfsdk:"file_ids"` // Which geo region the listing data is collected from - GeographicalCoverage types.String `tfsdk:"geographical_coverage" tf:"optional"` + GeographicalCoverage types.String `tfsdk:"geographical_coverage"` // ID 20, 21 removed don't use License of the data asset - Required for // listings with model based assets - License types.String `tfsdk:"license" tf:"optional"` + License types.String `tfsdk:"license"` // What the pricing model is (e.g. paid, subscription, paid upfront); should // only be present if cost is paid TODO: Not used yet, should deprecate if // we will never use it - PricingModel types.String `tfsdk:"pricing_model" tf:"optional"` + PricingModel types.String `tfsdk:"pricing_model"` - PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link" tf:"optional"` + PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link"` // size of the dataset in GB - Size types.Float64 `tfsdk:"size" tf:"optional"` + Size types.Float64 `tfsdk:"size"` - SupportLink types.String `tfsdk:"support_link" tf:"optional"` + SupportLink types.String `tfsdk:"support_link"` // Listing tags - Simple key value pair to annotate listings. When should I // use tags vs dedicated fields? Using tags avoids the need to add new // columns in the database for new annotations. However, this should be used @@ -5315,11 +5385,11 @@ type ListingDetail struct { // the field is optional and won't need to have NOT NULL integrity check 2. // The value is fairly fixed, static and low cardinality (eg. enums). 3. The // value won't be used in filters or joins with other tables. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` - TermsOfService types.String `tfsdk:"terms_of_service" tf:"optional"` + TermsOfService types.String `tfsdk:"terms_of_service"` // How often data is updated - UpdateFrequency types.Object `tfsdk:"update_frequency" tf:"optional,object"` + UpdateFrequency types.Object `tfsdk:"update_frequency"` } func (newState *ListingDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingDetail) { @@ -5328,13 +5398,28 @@ func (newState *ListingDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan List func (newState *ListingDetail) SyncEffectiveFieldsDuringRead(existingState ListingDetail) { } -func (c ListingDetail) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DataRefreshInfo{}.ApplySchemaCustomizations(cs, append(path, "collection_granularity")...) - FileInfo{}.ApplySchemaCustomizations(cs, append(path, "embedded_notebook_file_infos")...) - ListingTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - DataRefreshInfo{}.ApplySchemaCustomizations(cs, append(path, "update_frequency")...) - - return cs +func (c ListingDetail) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["assets"] = attrs["assets"].SetOptional() + attrs["collection_date_end"] = attrs["collection_date_end"].SetOptional() + attrs["collection_date_start"] = attrs["collection_date_start"].SetOptional() + attrs["collection_granularity"] = attrs["collection_granularity"].SetOptional() + attrs["cost"] = attrs["cost"].SetOptional() + attrs["data_source"] = attrs["data_source"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["documentation_link"] = attrs["documentation_link"].SetOptional() + attrs["embedded_notebook_file_infos"] = attrs["embedded_notebook_file_infos"].SetOptional() + attrs["file_ids"] = attrs["file_ids"].SetOptional() + attrs["geographical_coverage"] = attrs["geographical_coverage"].SetOptional() + attrs["license"] = attrs["license"].SetOptional() + attrs["pricing_model"] = attrs["pricing_model"].SetOptional() + attrs["privacy_policy_link"] = attrs["privacy_policy_link"].SetOptional() + attrs["size"] = attrs["size"].SetOptional() + attrs["support_link"] = attrs["support_link"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["terms_of_service"] = attrs["terms_of_service"].SetOptional() + attrs["update_frequency"] = attrs["update_frequency"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingDetail. @@ -5580,15 +5665,15 @@ func (o *ListingDetail) SetUpdateFrequency(ctx context.Context, v DataRefreshInf } type ListingFulfillment struct { - FulfillmentType types.String `tfsdk:"fulfillment_type" tf:"optional"` + FulfillmentType types.String `tfsdk:"fulfillment_type"` - ListingId types.String `tfsdk:"listing_id" tf:""` + ListingId types.String `tfsdk:"listing_id"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` - RepoInfo types.Object `tfsdk:"repo_info" tf:"optional,object"` + RepoInfo types.Object `tfsdk:"repo_info"` - ShareInfo types.Object `tfsdk:"share_info" tf:"optional,object"` + ShareInfo types.Object `tfsdk:"share_info"` } func (newState *ListingFulfillment) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingFulfillment) { @@ -5597,12 +5682,14 @@ func (newState *ListingFulfillment) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListingFulfillment) SyncEffectiveFieldsDuringRead(existingState ListingFulfillment) { } -func (c ListingFulfillment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "listing_id")...) - RepoInfo{}.ApplySchemaCustomizations(cs, append(path, "repo_info")...) - ShareInfo{}.ApplySchemaCustomizations(cs, append(path, "share_info")...) +func (c ListingFulfillment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fulfillment_type"] = attrs["fulfillment_type"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["repo_info"] = attrs["repo_info"].SetOptional() + attrs["share_info"] = attrs["share_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingFulfillment. @@ -5704,7 +5791,7 @@ func (o *ListingFulfillment) SetShareInfo(ctx context.Context, v ShareInfo) { } type ListingSetting struct { - Visibility types.String `tfsdk:"visibility" tf:"optional"` + Visibility types.String `tfsdk:"visibility"` } func (newState *ListingSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingSetting) { @@ -5713,9 +5800,10 @@ func (newState *ListingSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan Lis func (newState *ListingSetting) SyncEffectiveFieldsDuringRead(existingState ListingSetting) { } -func (c ListingSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListingSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["visibility"] = attrs["visibility"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingSetting. @@ -5751,44 +5839,44 @@ func (o ListingSetting) Type(ctx context.Context) attr.Type { // Next Number: 26 type ListingSummary struct { - Categories types.List `tfsdk:"categories" tf:"optional"` + Categories types.List `tfsdk:"categories"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` - CreatedById types.Int64 `tfsdk:"created_by_id" tf:"optional"` + CreatedById types.Int64 `tfsdk:"created_by_id"` - ExchangeIds types.List `tfsdk:"exchange_ids" tf:"optional"` + ExchangeIds types.List `tfsdk:"exchange_ids"` // if a git repo is being created, a listing will be initialized with this // field as opposed to a share - GitRepo types.Object `tfsdk:"git_repo" tf:"optional,object"` + GitRepo types.Object `tfsdk:"git_repo"` - ListingType types.String `tfsdk:"listingType" tf:""` + ListingType types.String `tfsdk:"listingType"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - ProviderId types.String `tfsdk:"provider_id" tf:"optional"` + ProviderId types.String `tfsdk:"provider_id"` - ProviderRegion types.Object `tfsdk:"provider_region" tf:"optional,object"` + ProviderRegion types.Object `tfsdk:"provider_region"` - PublishedAt types.Int64 `tfsdk:"published_at" tf:"optional"` + PublishedAt types.Int64 `tfsdk:"published_at"` - PublishedBy types.String `tfsdk:"published_by" tf:"optional"` + PublishedBy types.String `tfsdk:"published_by"` - Setting types.Object `tfsdk:"setting" tf:"optional,object"` + Setting types.Object `tfsdk:"setting"` - Share types.Object `tfsdk:"share" tf:"optional,object"` + Share types.Object `tfsdk:"share"` // Enums - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` - Subtitle types.String `tfsdk:"subtitle" tf:"optional"` + Subtitle types.String `tfsdk:"subtitle"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` - UpdatedById types.Int64 `tfsdk:"updated_by_id" tf:"optional"` + UpdatedById types.Int64 `tfsdk:"updated_by_id"` } func (newState *ListingSummary) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingSummary) { @@ -5797,15 +5885,28 @@ func (newState *ListingSummary) SyncEffectiveFieldsDuringCreateOrUpdate(plan Lis func (newState *ListingSummary) SyncEffectiveFieldsDuringRead(existingState ListingSummary) { } -func (c ListingSummary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoInfo{}.ApplySchemaCustomizations(cs, append(path, "git_repo")...) - cs.SetRequired(append(path, "listingType")...) - cs.SetRequired(append(path, "name")...) - RegionInfo{}.ApplySchemaCustomizations(cs, append(path, "provider_region")...) - ListingSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) - ShareInfo{}.ApplySchemaCustomizations(cs, append(path, "share")...) - - return cs +func (c ListingSummary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["categories"] = attrs["categories"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["created_by_id"] = attrs["created_by_id"].SetOptional() + attrs["exchange_ids"] = attrs["exchange_ids"].SetOptional() + attrs["git_repo"] = attrs["git_repo"].SetOptional() + attrs["listingType"] = attrs["listingType"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["provider_id"] = attrs["provider_id"].SetOptional() + attrs["provider_region"] = attrs["provider_region"].SetOptional() + attrs["published_at"] = attrs["published_at"].SetOptional() + attrs["published_by"] = attrs["published_by"].SetOptional() + attrs["setting"] = attrs["setting"].SetOptional() + attrs["share"] = attrs["share"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["subtitle"] = attrs["subtitle"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + attrs["updated_by_id"] = attrs["updated_by_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingSummary. @@ -6052,10 +6153,10 @@ func (o *ListingSummary) SetShare(ctx context.Context, v ShareInfo) { type ListingTag struct { // Tag name (enum) - TagName types.String `tfsdk:"tag_name" tf:"optional"` + TagName types.String `tfsdk:"tag_name"` // String representation of the tag value. Values should be string literals // (no complex types) - TagValues types.List `tfsdk:"tag_values" tf:"optional"` + TagValues types.List `tfsdk:"tag_values"` } func (newState *ListingTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListingTag) { @@ -6064,9 +6165,11 @@ func (newState *ListingTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan Listing func (newState *ListingTag) SyncEffectiveFieldsDuringRead(existingState ListingTag) { } -func (c ListingTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListingTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["tag_name"] = attrs["tag_name"].SetOptional() + attrs["tag_values"] = attrs["tag_values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListingTag. @@ -6133,38 +6236,38 @@ func (o *ListingTag) SetTagValues(ctx context.Context, v []types.String) { } type PersonalizationRequest struct { - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` - ConsumerRegion types.Object `tfsdk:"consumer_region" tf:"object"` + ConsumerRegion types.Object `tfsdk:"consumer_region"` // contact info for the consumer requesting data or performing a listing // installation - ContactInfo types.Object `tfsdk:"contact_info" tf:"optional,object"` + ContactInfo types.Object `tfsdk:"contact_info"` - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - IntendedUse types.String `tfsdk:"intended_use" tf:"optional"` + IntendedUse types.String `tfsdk:"intended_use"` - IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse" tf:"optional"` + IsFromLighthouse types.Bool `tfsdk:"is_from_lighthouse"` - ListingId types.String `tfsdk:"listing_id" tf:"optional"` + ListingId types.String `tfsdk:"listing_id"` - ListingName types.String `tfsdk:"listing_name" tf:"optional"` + ListingName types.String `tfsdk:"listing_name"` - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` - ProviderId types.String `tfsdk:"provider_id" tf:"optional"` + ProviderId types.String `tfsdk:"provider_id"` - RecipientType types.String `tfsdk:"recipient_type" tf:"optional"` + RecipientType types.String `tfsdk:"recipient_type"` - Share types.Object `tfsdk:"share" tf:"optional,object"` + Share types.Object `tfsdk:"share"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` } func (newState *PersonalizationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan PersonalizationRequest) { @@ -6173,13 +6276,25 @@ func (newState *PersonalizationRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PersonalizationRequest) SyncEffectiveFieldsDuringRead(existingState PersonalizationRequest) { } -func (c PersonalizationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "consumer_region")...) - RegionInfo{}.ApplySchemaCustomizations(cs, append(path, "consumer_region")...) - ContactInfo{}.ApplySchemaCustomizations(cs, append(path, "contact_info")...) - ShareInfo{}.ApplySchemaCustomizations(cs, append(path, "share")...) +func (c PersonalizationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["consumer_region"] = attrs["consumer_region"].SetRequired() + attrs["contact_info"] = attrs["contact_info"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["intended_use"] = attrs["intended_use"].SetOptional() + attrs["is_from_lighthouse"] = attrs["is_from_lighthouse"].SetOptional() + attrs["listing_id"] = attrs["listing_id"].SetOptional() + attrs["listing_name"] = attrs["listing_name"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["provider_id"] = attrs["provider_id"].SetOptional() + attrs["recipient_type"] = attrs["recipient_type"].SetOptional() + attrs["share"] = attrs["share"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PersonalizationRequest. @@ -6332,7 +6447,7 @@ func (o *PersonalizationRequest) SetShare(ctx context.Context, v ShareInfo) { } type ProviderAnalyticsDashboard struct { - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *ProviderAnalyticsDashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderAnalyticsDashboard) { @@ -6341,10 +6456,10 @@ func (newState *ProviderAnalyticsDashboard) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ProviderAnalyticsDashboard) SyncEffectiveFieldsDuringRead(existingState ProviderAnalyticsDashboard) { } -func (c ProviderAnalyticsDashboard) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c ProviderAnalyticsDashboard) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderAnalyticsDashboard. @@ -6379,33 +6494,33 @@ func (o ProviderAnalyticsDashboard) Type(ctx context.Context) attr.Type { } type ProviderInfo struct { - BusinessContactEmail types.String `tfsdk:"business_contact_email" tf:""` + BusinessContactEmail types.String `tfsdk:"business_contact_email"` - CompanyWebsiteLink types.String `tfsdk:"company_website_link" tf:"optional"` + CompanyWebsiteLink types.String `tfsdk:"company_website_link"` - DarkModeIconFileId types.String `tfsdk:"dark_mode_icon_file_id" tf:"optional"` + DarkModeIconFileId types.String `tfsdk:"dark_mode_icon_file_id"` - DarkModeIconFilePath types.String `tfsdk:"dark_mode_icon_file_path" tf:"optional"` + DarkModeIconFilePath types.String `tfsdk:"dark_mode_icon_file_path"` - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` - IconFileId types.String `tfsdk:"icon_file_id" tf:"optional"` + IconFileId types.String `tfsdk:"icon_file_id"` - IconFilePath types.String `tfsdk:"icon_file_path" tf:"optional"` + IconFilePath types.String `tfsdk:"icon_file_path"` - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // is_featured is accessible by consumers only - IsFeatured types.Bool `tfsdk:"is_featured" tf:"optional"` + IsFeatured types.Bool `tfsdk:"is_featured"` - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link" tf:""` + PrivacyPolicyLink types.String `tfsdk:"privacy_policy_link"` // published_by is only applicable to data aggregators (e.g. Crux) - PublishedBy types.String `tfsdk:"published_by" tf:"optional"` + PublishedBy types.String `tfsdk:"published_by"` - SupportContactEmail types.String `tfsdk:"support_contact_email" tf:"optional"` + SupportContactEmail types.String `tfsdk:"support_contact_email"` - TermOfServiceLink types.String `tfsdk:"term_of_service_link" tf:""` + TermOfServiceLink types.String `tfsdk:"term_of_service_link"` } func (newState *ProviderInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderInfo) { @@ -6414,13 +6529,23 @@ func (newState *ProviderInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Provi func (newState *ProviderInfo) SyncEffectiveFieldsDuringRead(existingState ProviderInfo) { } -func (c ProviderInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "business_contact_email")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "privacy_policy_link")...) - cs.SetRequired(append(path, "term_of_service_link")...) +func (c ProviderInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["business_contact_email"] = attrs["business_contact_email"].SetRequired() + attrs["company_website_link"] = attrs["company_website_link"].SetOptional() + attrs["dark_mode_icon_file_id"] = attrs["dark_mode_icon_file_id"].SetOptional() + attrs["dark_mode_icon_file_path"] = attrs["dark_mode_icon_file_path"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["icon_file_id"] = attrs["icon_file_id"].SetOptional() + attrs["icon_file_path"] = attrs["icon_file_path"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_featured"] = attrs["is_featured"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["privacy_policy_link"] = attrs["privacy_policy_link"].SetRequired() + attrs["published_by"] = attrs["published_by"].SetOptional() + attrs["support_contact_email"] = attrs["support_contact_email"].SetOptional() + attrs["term_of_service_link"] = attrs["term_of_service_link"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderInfo. @@ -6481,9 +6606,9 @@ func (o ProviderInfo) Type(ctx context.Context) attr.Type { } type RegionInfo struct { - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *RegionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegionInfo) { @@ -6492,9 +6617,11 @@ func (newState *RegionInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegionI func (newState *RegionInfo) SyncEffectiveFieldsDuringRead(existingState RegionInfo) { } -func (c RegionInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegionInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegionInfo. @@ -6575,9 +6702,9 @@ func (newState *RemoveExchangeForListingResponse) SyncEffectiveFieldsDuringCreat func (newState *RemoveExchangeForListingResponse) SyncEffectiveFieldsDuringRead(existingState RemoveExchangeForListingResponse) { } -func (c RemoveExchangeForListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RemoveExchangeForListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RemoveExchangeForListingResponse. @@ -6609,7 +6736,7 @@ func (o RemoveExchangeForListingResponse) Type(ctx context.Context) attr.Type { type RepoInfo struct { // the git repo url e.g. https://github.com/databrickslabs/dolly.git - GitRepoUrl types.String `tfsdk:"git_repo_url" tf:""` + GitRepoUrl types.String `tfsdk:"git_repo_url"` } func (newState *RepoInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInfo) { @@ -6618,10 +6745,10 @@ func (newState *RepoInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInfo) func (newState *RepoInfo) SyncEffectiveFieldsDuringRead(existingState RepoInfo) { } -func (c RepoInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "git_repo_url")...) +func (c RepoInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["git_repo_url"] = attrs["git_repo_url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoInfo. @@ -6657,11 +6784,11 @@ func (o RepoInfo) Type(ctx context.Context) attr.Type { type RepoInstallation struct { // the user-specified repo name for their installed git repo listing - RepoName types.String `tfsdk:"repo_name" tf:""` + RepoName types.String `tfsdk:"repo_name"` // refers to the full url file path that navigates the user to the repo's // entrypoint (e.g. a README.md file, or the repo file view in the unified // UI) should just be a relative path - RepoPath types.String `tfsdk:"repo_path" tf:""` + RepoPath types.String `tfsdk:"repo_path"` } func (newState *RepoInstallation) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInstallation) { @@ -6670,11 +6797,11 @@ func (newState *RepoInstallation) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *RepoInstallation) SyncEffectiveFieldsDuringRead(existingState RepoInstallation) { } -func (c RepoInstallation) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "repo_name")...) - cs.SetRequired(append(path, "repo_path")...) +func (c RepoInstallation) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["repo_name"] = attrs["repo_name"].SetRequired() + attrs["repo_path"] = attrs["repo_path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoInstallation. @@ -6864,9 +6991,9 @@ func (o *SearchListingsRequest) SetProviderIds(ctx context.Context, v []types.St } type SearchListingsResponse struct { - Listings types.List `tfsdk:"listings" tf:"optional"` + Listings types.List `tfsdk:"listings"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *SearchListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchListingsResponse) { @@ -6875,10 +7002,11 @@ func (newState *SearchListingsResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SearchListingsResponse) SyncEffectiveFieldsDuringRead(existingState SearchListingsResponse) { } -func (c SearchListingsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing{}.ApplySchemaCustomizations(cs, append(path, "listings")...) +func (c SearchListingsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listings"] = attrs["listings"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchListingsResponse. @@ -6945,9 +7073,9 @@ func (o *SearchListingsResponse) SetListings(ctx context.Context, v []Listing) { } type ShareInfo struct { - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` - Type_ types.String `tfsdk:"type" tf:""` + Type_ types.String `tfsdk:"type"` } func (newState *ShareInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo) { @@ -6956,11 +7084,11 @@ func (newState *ShareInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInf func (newState *ShareInfo) SyncEffectiveFieldsDuringRead(existingState ShareInfo) { } -func (c ShareInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "type")...) +func (c ShareInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["type"] = attrs["type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ShareInfo. @@ -6999,9 +7127,9 @@ func (o ShareInfo) Type(ctx context.Context) attr.Type { type SharedDataObject struct { // The type of the data object. Could be one of: TABLE, SCHEMA, // NOTEBOOK_FILE, MODEL, VOLUME - DataObjectType types.String `tfsdk:"data_object_type" tf:"optional"` + DataObjectType types.String `tfsdk:"data_object_type"` // Name of the shared object - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *SharedDataObject) SyncEffectiveFieldsDuringCreateOrUpdate(plan SharedDataObject) { @@ -7010,9 +7138,11 @@ func (newState *SharedDataObject) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SharedDataObject) SyncEffectiveFieldsDuringRead(existingState SharedDataObject) { } -func (c SharedDataObject) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SharedDataObject) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_object_type"] = attrs["data_object_type"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SharedDataObject. @@ -7049,15 +7179,15 @@ func (o SharedDataObject) Type(ctx context.Context) attr.Type { } type TokenDetail struct { - BearerToken types.String `tfsdk:"bearerToken" tf:"optional"` + BearerToken types.String `tfsdk:"bearerToken"` - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` - ExpirationTime types.String `tfsdk:"expirationTime" tf:"optional"` + ExpirationTime types.String `tfsdk:"expirationTime"` // These field names must follow the delta sharing protocol. Original // message: RetrieveToken.Response in // managed-catalog/api/messages/recipient.proto - ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion" tf:"optional"` + ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion"` } func (newState *TokenDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenDetail) { @@ -7066,9 +7196,13 @@ func (newState *TokenDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenD func (newState *TokenDetail) SyncEffectiveFieldsDuringRead(existingState TokenDetail) { } -func (c TokenDetail) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenDetail) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bearerToken"] = attrs["bearerToken"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["expirationTime"] = attrs["expirationTime"].SetOptional() + attrs["shareCredentialsVersion"] = attrs["shareCredentialsVersion"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenDetail. @@ -7111,19 +7245,19 @@ func (o TokenDetail) Type(ctx context.Context) attr.Type { type TokenInfo struct { // Full activation url to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl types.String `tfsdk:"activation_url" tf:"optional"` + ActivationUrl types.String `tfsdk:"activation_url"` // Time at which this Recipient Token was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of Recipient Token creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // Unique id of the Recipient Token. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time at which this Recipient Token was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of Recipient Token updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *TokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenInfo) { @@ -7132,9 +7266,16 @@ func (newState *TokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenInf func (newState *TokenInfo) SyncEffectiveFieldsDuringRead(existingState TokenInfo) { } -func (c TokenInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activation_url"] = attrs["activation_url"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenInfo. @@ -7181,7 +7322,7 @@ func (o TokenInfo) Type(ctx context.Context) attr.Type { } type UpdateExchangeFilterRequest struct { - Filter types.Object `tfsdk:"filter" tf:"object"` + Filter types.Object `tfsdk:"filter"` Id types.String `tfsdk:"-"` } @@ -7192,12 +7333,11 @@ func (newState *UpdateExchangeFilterRequest) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateExchangeFilterRequest) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeFilterRequest) { } -func (c UpdateExchangeFilterRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "filter")...) - ExchangeFilter{}.ApplySchemaCustomizations(cs, append(path, "filter")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateExchangeFilterRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeFilterRequest. @@ -7264,7 +7404,7 @@ func (o *UpdateExchangeFilterRequest) SetFilter(ctx context.Context, v ExchangeF } type UpdateExchangeFilterResponse struct { - Filter types.Object `tfsdk:"filter" tf:"optional,object"` + Filter types.Object `tfsdk:"filter"` } func (newState *UpdateExchangeFilterResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExchangeFilterResponse) { @@ -7273,10 +7413,10 @@ func (newState *UpdateExchangeFilterResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateExchangeFilterResponse) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeFilterResponse) { } -func (c UpdateExchangeFilterResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeFilter{}.ApplySchemaCustomizations(cs, append(path, "filter")...) +func (c UpdateExchangeFilterResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeFilterResponse. @@ -7341,7 +7481,7 @@ func (o *UpdateExchangeFilterResponse) SetFilter(ctx context.Context, v Exchange } type UpdateExchangeRequest struct { - Exchange types.Object `tfsdk:"exchange" tf:"object"` + Exchange types.Object `tfsdk:"exchange"` Id types.String `tfsdk:"-"` } @@ -7352,12 +7492,11 @@ func (newState *UpdateExchangeRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateExchangeRequest) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeRequest) { } -func (c UpdateExchangeRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "exchange")...) - Exchange{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateExchangeRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeRequest. @@ -7424,7 +7563,7 @@ func (o *UpdateExchangeRequest) SetExchange(ctx context.Context, v Exchange) { } type UpdateExchangeResponse struct { - Exchange types.Object `tfsdk:"exchange" tf:"optional,object"` + Exchange types.Object `tfsdk:"exchange"` } func (newState *UpdateExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExchangeResponse) { @@ -7433,10 +7572,10 @@ func (newState *UpdateExchangeResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateExchangeResponse) SyncEffectiveFieldsDuringRead(existingState UpdateExchangeResponse) { } -func (c UpdateExchangeResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Exchange{}.ApplySchemaCustomizations(cs, append(path, "exchange")...) +func (c UpdateExchangeResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exchange"] = attrs["exchange"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExchangeResponse. @@ -7501,13 +7640,13 @@ func (o *UpdateExchangeResponse) SetExchange(ctx context.Context, v Exchange) { } type UpdateInstallationRequest struct { - Installation types.Object `tfsdk:"installation" tf:"object"` + Installation types.Object `tfsdk:"installation"` InstallationId types.String `tfsdk:"-"` ListingId types.String `tfsdk:"-"` - RotateToken types.Bool `tfsdk:"rotate_token" tf:"optional"` + RotateToken types.Bool `tfsdk:"rotate_token"` } func (newState *UpdateInstallationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateInstallationRequest) { @@ -7516,13 +7655,13 @@ func (newState *UpdateInstallationRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *UpdateInstallationRequest) SyncEffectiveFieldsDuringRead(existingState UpdateInstallationRequest) { } -func (c UpdateInstallationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "installation")...) - InstallationDetail{}.ApplySchemaCustomizations(cs, append(path, "installation")...) - cs.SetRequired(append(path, "installation_id")...) - cs.SetRequired(append(path, "listing_id")...) +func (c UpdateInstallationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installation"] = attrs["installation"].SetRequired() + attrs["installation_id"] = attrs["installation_id"].SetRequired() + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["rotate_token"] = attrs["rotate_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateInstallationRequest. @@ -7593,7 +7732,7 @@ func (o *UpdateInstallationRequest) SetInstallation(ctx context.Context, v Insta } type UpdateInstallationResponse struct { - Installation types.Object `tfsdk:"installation" tf:"optional,object"` + Installation types.Object `tfsdk:"installation"` } func (newState *UpdateInstallationResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateInstallationResponse) { @@ -7602,10 +7741,10 @@ func (newState *UpdateInstallationResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateInstallationResponse) SyncEffectiveFieldsDuringRead(existingState UpdateInstallationResponse) { } -func (c UpdateInstallationResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - InstallationDetail{}.ApplySchemaCustomizations(cs, append(path, "installation")...) +func (c UpdateInstallationResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["installation"] = attrs["installation"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateInstallationResponse. @@ -7672,7 +7811,7 @@ func (o *UpdateInstallationResponse) SetInstallation(ctx context.Context, v Inst type UpdateListingRequest struct { Id types.String `tfsdk:"-"` - Listing types.Object `tfsdk:"listing" tf:"object"` + Listing types.Object `tfsdk:"listing"` } func (newState *UpdateListingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateListingRequest) { @@ -7681,12 +7820,11 @@ func (newState *UpdateListingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *UpdateListingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateListingRequest) { } -func (c UpdateListingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "listing")...) - Listing{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c UpdateListingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["listing"] = attrs["listing"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateListingRequest. @@ -7753,7 +7891,7 @@ func (o *UpdateListingRequest) SetListing(ctx context.Context, v Listing) { } type UpdateListingResponse struct { - Listing types.Object `tfsdk:"listing" tf:"optional,object"` + Listing types.Object `tfsdk:"listing"` } func (newState *UpdateListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateListingResponse) { @@ -7762,10 +7900,10 @@ func (newState *UpdateListingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateListingResponse) SyncEffectiveFieldsDuringRead(existingState UpdateListingResponse) { } -func (c UpdateListingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Listing{}.ApplySchemaCustomizations(cs, append(path, "listing")...) +func (c UpdateListingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing"] = attrs["listing"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateListingResponse. @@ -7832,13 +7970,13 @@ func (o *UpdateListingResponse) SetListing(ctx context.Context, v Listing) { type UpdatePersonalizationRequestRequest struct { ListingId types.String `tfsdk:"-"` - Reason types.String `tfsdk:"reason" tf:"optional"` + Reason types.String `tfsdk:"reason"` RequestId types.String `tfsdk:"-"` - Share types.Object `tfsdk:"share" tf:"optional,object"` + Share types.Object `tfsdk:"share"` - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` } func (newState *UpdatePersonalizationRequestRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePersonalizationRequestRequest) { @@ -7847,13 +7985,14 @@ func (newState *UpdatePersonalizationRequestRequest) SyncEffectiveFieldsDuringCr func (newState *UpdatePersonalizationRequestRequest) SyncEffectiveFieldsDuringRead(existingState UpdatePersonalizationRequestRequest) { } -func (c UpdatePersonalizationRequestRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "listing_id")...) - cs.SetRequired(append(path, "request_id")...) - ShareInfo{}.ApplySchemaCustomizations(cs, append(path, "share")...) - cs.SetRequired(append(path, "status")...) +func (c UpdatePersonalizationRequestRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["listing_id"] = attrs["listing_id"].SetRequired() + attrs["reason"] = attrs["reason"].SetOptional() + attrs["request_id"] = attrs["request_id"].SetRequired() + attrs["share"] = attrs["share"].SetOptional() + attrs["status"] = attrs["status"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePersonalizationRequestRequest. @@ -7926,7 +8065,7 @@ func (o *UpdatePersonalizationRequestRequest) SetShare(ctx context.Context, v Sh } type UpdatePersonalizationRequestResponse struct { - Request types.Object `tfsdk:"request" tf:"optional,object"` + Request types.Object `tfsdk:"request"` } func (newState *UpdatePersonalizationRequestResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePersonalizationRequestResponse) { @@ -7935,10 +8074,10 @@ func (newState *UpdatePersonalizationRequestResponse) SyncEffectiveFieldsDuringC func (newState *UpdatePersonalizationRequestResponse) SyncEffectiveFieldsDuringRead(existingState UpdatePersonalizationRequestResponse) { } -func (c UpdatePersonalizationRequestResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PersonalizationRequest{}.ApplySchemaCustomizations(cs, append(path, "request")...) +func (c UpdatePersonalizationRequestResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["request"] = attrs["request"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePersonalizationRequestResponse. @@ -8008,7 +8147,7 @@ type UpdateProviderAnalyticsDashboardRequest struct { // this is the version of the dashboard template we want to update our user // to current expectation is that it should be equal to latest version of // the dashboard template - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *UpdateProviderAnalyticsDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderAnalyticsDashboardRequest) { @@ -8017,10 +8156,11 @@ func (newState *UpdateProviderAnalyticsDashboardRequest) SyncEffectiveFieldsDuri func (newState *UpdateProviderAnalyticsDashboardRequest) SyncEffectiveFieldsDuringRead(existingState UpdateProviderAnalyticsDashboardRequest) { } -func (c UpdateProviderAnalyticsDashboardRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c UpdateProviderAnalyticsDashboardRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderAnalyticsDashboardRequest. @@ -8058,11 +8198,11 @@ func (o UpdateProviderAnalyticsDashboardRequest) Type(ctx context.Context) attr. type UpdateProviderAnalyticsDashboardResponse struct { // this is newly created Lakeview dashboard for the user - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` // id & version should be the same as the request - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version" tf:"optional"` + Version types.Int64 `tfsdk:"version"` } func (newState *UpdateProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderAnalyticsDashboardResponse) { @@ -8071,11 +8211,12 @@ func (newState *UpdateProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDur func (newState *UpdateProviderAnalyticsDashboardResponse) SyncEffectiveFieldsDuringRead(existingState UpdateProviderAnalyticsDashboardResponse) { } -func (c UpdateProviderAnalyticsDashboardResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateProviderAnalyticsDashboardResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderAnalyticsDashboardResponse. @@ -8116,7 +8257,7 @@ func (o UpdateProviderAnalyticsDashboardResponse) Type(ctx context.Context) attr type UpdateProviderRequest struct { Id types.String `tfsdk:"-"` - Provider types.Object `tfsdk:"provider" tf:"object"` + Provider types.Object `tfsdk:"provider"` } func (newState *UpdateProviderRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderRequest) { @@ -8125,12 +8266,11 @@ func (newState *UpdateProviderRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateProviderRequest) SyncEffectiveFieldsDuringRead(existingState UpdateProviderRequest) { } -func (c UpdateProviderRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "provider")...) - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c UpdateProviderRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["provider"] = attrs["provider"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderRequest. @@ -8197,7 +8337,7 @@ func (o *UpdateProviderRequest) SetProvider(ctx context.Context, v ProviderInfo) } type UpdateProviderResponse struct { - Provider types.Object `tfsdk:"provider" tf:"optional,object"` + Provider types.Object `tfsdk:"provider"` } func (newState *UpdateProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProviderResponse) { @@ -8206,10 +8346,10 @@ func (newState *UpdateProviderResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateProviderResponse) SyncEffectiveFieldsDuringRead(existingState UpdateProviderResponse) { } -func (c UpdateProviderResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "provider")...) +func (c UpdateProviderResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["provider"] = attrs["provider"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProviderResponse. diff --git a/internal/service/ml_tf/legacy_model.go b/internal/service/ml_tf/legacy_model.go index 22d93c082..5823352cd 100755 --- a/internal/service/ml_tf/legacy_model.go +++ b/internal/service/ml_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -38,11 +39,11 @@ type Activity_SdkV2 struct { // // * `SYSTEM_TRANSITION`: For events performed as a side effect, such as // archiving existing model versions in a stage. - ActivityType types.String `tfsdk:"activity_type" tf:"optional"` + ActivityType types.String `tfsdk:"activity_type"` // User-provided comment associated with the activity. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Source stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -53,16 +54,16 @@ type Activity_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - FromStage types.String `tfsdk:"from_stage" tf:"optional"` + FromStage types.String `tfsdk:"from_stage"` // Unique identifier for the object. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Comment made by system, for example explaining an activity of type // `SYSTEM_TRANSITION`. It usually describes a side effect, such as a // version being archived as part of another version's stage transition, and // may not be returned for some activity types. - SystemComment types.String `tfsdk:"system_comment" tf:"optional"` + SystemComment types.String `tfsdk:"system_comment"` // Target stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -73,9 +74,9 @@ type Activity_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - ToStage types.String `tfsdk:"to_stage" tf:"optional"` + ToStage types.String `tfsdk:"to_stage"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *Activity_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Activity_SdkV2) { @@ -84,9 +85,18 @@ func (newState *Activity_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Act func (newState *Activity_SdkV2) SyncEffectiveFieldsDuringRead(existingState Activity_SdkV2) { } -func (c Activity_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Activity_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activity_type"] = attrs["activity_type"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["from_stage"] = attrs["from_stage"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["system_comment"] = attrs["system_comment"].SetOptional() + attrs["to_stage"] = attrs["to_stage"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Activity. @@ -139,11 +149,11 @@ func (o Activity_SdkV2) Type(ctx context.Context) attr.Type { type ApproveTransitionRequest_SdkV2 struct { // Specifies whether to archive all current model versions in the target // stage. - ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions" tf:""` + ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions"` // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -153,9 +163,9 @@ type ApproveTransitionRequest_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *ApproveTransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ApproveTransitionRequest_SdkV2) { @@ -164,13 +174,14 @@ func (newState *ApproveTransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ApproveTransitionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ApproveTransitionRequest_SdkV2) { } -func (c ApproveTransitionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "archive_existing_versions")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c ApproveTransitionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["archive_existing_versions"] = attrs["archive_existing_versions"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ApproveTransitionRequest. @@ -214,7 +225,7 @@ func (o ApproveTransitionRequest_SdkV2) Type(ctx context.Context) attr.Type { type ApproveTransitionRequestResponse_SdkV2 struct { // Activity recorded for the action. - Activity types.List `tfsdk:"activity" tf:"optional,object"` + Activity types.List `tfsdk:"activity"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ApproveTransitionRequestResponse. @@ -281,17 +292,17 @@ func (o *ApproveTransitionRequestResponse_SdkV2) SetActivity(ctx context.Context // Comment details. type CommentObject_SdkV2 struct { // Array of actions on the activity allowed for the current viewer. - AvailableActions types.List `tfsdk:"available_actions" tf:"optional"` + AvailableActions types.List `tfsdk:"available_actions"` // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Comment ID - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *CommentObject_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CommentObject_SdkV2) { @@ -300,9 +311,15 @@ func (newState *CommentObject_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CommentObject_SdkV2) SyncEffectiveFieldsDuringRead(existingState CommentObject_SdkV2) { } -func (c CommentObject_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CommentObject_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["available_actions"] = attrs["available_actions"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CommentObject. @@ -378,11 +395,11 @@ func (o *CommentObject_SdkV2) SetAvailableActions(ctx context.Context, v []types type CreateComment_SdkV2 struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:""` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *CreateComment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateComment_SdkV2) { @@ -391,12 +408,12 @@ func (newState *CreateComment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateComment_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateComment_SdkV2) { } -func (c CreateComment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "comment")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "version")...) +func (c CreateComment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateComment. @@ -436,7 +453,7 @@ func (o CreateComment_SdkV2) Type(ctx context.Context) attr.Type { type CreateCommentResponse_SdkV2 struct { // Comment details. - Comment types.List `tfsdk:"comment" tf:"optional,object"` + Comment types.List `tfsdk:"comment"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCommentResponse. @@ -503,15 +520,15 @@ func (o *CreateCommentResponse_SdkV2) SetComment(ctx context.Context, v CommentO type CreateExperiment_SdkV2 struct { // Location where all artifacts for the experiment are stored. If not // provided, the remote server will select an appropriate default. - ArtifactLocation types.String `tfsdk:"artifact_location" tf:"optional"` + ArtifactLocation types.String `tfsdk:"artifact_location"` // Experiment name. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A collection of tags to set on the experiment. Maximum tag size and // number of tags per request depends on the storage backend. All storage // backends are guaranteed to support tag keys up to 250 bytes in size and // tag values up to 5000 bytes in size. All storage backends are also // guaranteed to support up to 20 tags per request. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExperiment_SdkV2) { @@ -520,11 +537,12 @@ func (newState *CreateExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateExperiment_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExperiment_SdkV2) { } -func (c CreateExperiment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - ExperimentTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateExperiment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_location"] = attrs["artifact_location"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExperiment. @@ -594,7 +612,7 @@ func (o *CreateExperiment_SdkV2) SetTags(ctx context.Context, v []ExperimentTag_ type CreateExperimentResponse_SdkV2 struct { // Unique identifier for the experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` } func (newState *CreateExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExperimentResponse_SdkV2) { @@ -603,9 +621,10 @@ func (newState *CreateExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *CreateExperimentResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateExperimentResponse_SdkV2) { } -func (c CreateExperimentResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateExperimentResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExperimentResponse. @@ -641,11 +660,11 @@ func (o CreateExperimentResponse_SdkV2) Type(ctx context.Context) attr.Type { type CreateModelRequest_SdkV2 struct { // Optional description for registered model. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Register models under this name - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Additional metadata for registered model. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelRequest_SdkV2) { @@ -654,11 +673,12 @@ func (newState *CreateModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateModelRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateModelRequest_SdkV2) { } -func (c CreateModelRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - ModelTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateModelRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelRequest. @@ -727,7 +747,7 @@ func (o *CreateModelRequest_SdkV2) SetTags(ctx context.Context, v []ModelTag_Sdk } type CreateModelResponse_SdkV2 struct { - RegisteredModel types.List `tfsdk:"registered_model" tf:"optional,object"` + RegisteredModel types.List `tfsdk:"registered_model"` } func (newState *CreateModelResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelResponse_SdkV2) { @@ -736,10 +756,11 @@ func (newState *CreateModelResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateModelResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateModelResponse_SdkV2) { } -func (c CreateModelResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "registered_model")...) +func (c CreateModelResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["registered_model"] = attrs["registered_model"].SetOptional() + attrs["registered_model"] = attrs["registered_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelResponse. @@ -805,19 +826,19 @@ func (o *CreateModelResponse_SdkV2) SetRegisteredModel(ctx context.Context, v Mo type CreateModelVersionRequest_SdkV2 struct { // Optional description for model version. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Register model under this name - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // MLflow run ID for correlation, if `source` was generated by an experiment // run in MLflow tracking server - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // MLflow run link - this is the exact link of the run that generated this // model version, potentially hosted at another instance of MLflow. - RunLink types.String `tfsdk:"run_link" tf:"optional"` + RunLink types.String `tfsdk:"run_link"` // URI indicating the location of the model artifacts. - Source types.String `tfsdk:"source" tf:""` + Source types.String `tfsdk:"source"` // Additional metadata for model version. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelVersionRequest_SdkV2) { @@ -826,12 +847,15 @@ func (newState *CreateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *CreateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateModelVersionRequest_SdkV2) { } -func (c CreateModelVersionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "source")...) - ModelVersionTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateModelVersionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_link"] = attrs["run_link"].SetOptional() + attrs["source"] = attrs["source"].SetRequired() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelVersionRequest. @@ -907,7 +931,7 @@ func (o *CreateModelVersionRequest_SdkV2) SetTags(ctx context.Context, v []Model type CreateModelVersionResponse_SdkV2 struct { // Return new version number generated for this model in registry. - ModelVersion types.List `tfsdk:"model_version" tf:"optional,object"` + ModelVersion types.List `tfsdk:"model_version"` } func (newState *CreateModelVersionResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelVersionResponse_SdkV2) { @@ -916,10 +940,11 @@ func (newState *CreateModelVersionResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CreateModelVersionResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateModelVersionResponse_SdkV2) { } -func (c CreateModelVersionResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "model_version")...) +func (c CreateModelVersionResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_version"] = attrs["model_version"].SetOptional() + attrs["model_version"] = attrs["model_version"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelVersionResponse. @@ -985,7 +1010,7 @@ func (o *CreateModelVersionResponse_SdkV2) SetModelVersion(ctx context.Context, type CreateRegistryWebhook_SdkV2 struct { // User-specified description for the webhook. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -1019,13 +1044,13 @@ type CreateRegistryWebhook_SdkV2 struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events types.List `tfsdk:"events" tf:""` + Events types.List `tfsdk:"events"` - HttpUrlSpec types.List `tfsdk:"http_url_spec" tf:"optional,object"` + HttpUrlSpec types.List `tfsdk:"http_url_spec"` - JobSpec types.List `tfsdk:"job_spec" tf:"optional,object"` + JobSpec types.List `tfsdk:"job_spec"` // Name of the model whose events would trigger this webhook. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -1034,7 +1059,7 @@ type CreateRegistryWebhook_SdkV2 struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *CreateRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRegistryWebhook_SdkV2) { @@ -1043,12 +1068,17 @@ func (newState *CreateRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRegistryWebhook_SdkV2) { } -func (c CreateRegistryWebhook_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "events")...) - HttpUrlSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "http_url_spec")...) - JobSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_spec")...) +func (c CreateRegistryWebhook_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["events"] = attrs["events"].SetRequired() + attrs["http_url_spec"] = attrs["http_url_spec"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["job_spec"] = attrs["job_spec"].SetOptional() + attrs["job_spec"] = attrs["job_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRegistryWebhook. @@ -1182,15 +1212,15 @@ func (o *CreateRegistryWebhook_SdkV2) SetJobSpec(ctx context.Context, v JobSpec_ type CreateRun_SdkV2 struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` // Unix timestamp in milliseconds of when the run started. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Additional metadata for run. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // ID of the user executing the run. This field is deprecated as of MLflow // 1.0, and will be removed in a future MLflow release. Use 'mlflow.user' // tag instead. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *CreateRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRun_SdkV2) { @@ -1199,10 +1229,13 @@ func (newState *CreateRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cr func (newState *CreateRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRun_SdkV2) { } -func (c CreateRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRun. @@ -1274,7 +1307,7 @@ func (o *CreateRun_SdkV2) SetTags(ctx context.Context, v []RunTag_SdkV2) { type CreateRunResponse_SdkV2 struct { // The newly created run. - Run types.List `tfsdk:"run" tf:"optional,object"` + Run types.List `tfsdk:"run"` } func (newState *CreateRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRunResponse_SdkV2) { @@ -1283,10 +1316,11 @@ func (newState *CreateRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRunResponse_SdkV2) { } -func (c CreateRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Run_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run")...) +func (c CreateRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run"] = attrs["run"].SetOptional() + attrs["run"] = attrs["run"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRunResponse. @@ -1352,9 +1386,9 @@ func (o *CreateRunResponse_SdkV2) SetRun(ctx context.Context, v Run_SdkV2) { type CreateTransitionRequest_SdkV2 struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -1364,9 +1398,9 @@ type CreateTransitionRequest_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *CreateTransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTransitionRequest_SdkV2) { @@ -1375,12 +1409,13 @@ func (newState *CreateTransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateTransitionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateTransitionRequest_SdkV2) { } -func (c CreateTransitionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c CreateTransitionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTransitionRequest. @@ -1422,7 +1457,7 @@ func (o CreateTransitionRequest_SdkV2) Type(ctx context.Context) attr.Type { type CreateTransitionRequestResponse_SdkV2 struct { // Transition request details. - Request types.List `tfsdk:"request" tf:"optional,object"` + Request types.List `tfsdk:"request"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTransitionRequestResponse. @@ -1487,7 +1522,7 @@ func (o *CreateTransitionRequestResponse_SdkV2) SetRequest(ctx context.Context, } type CreateWebhookResponse_SdkV2 struct { - Webhook types.List `tfsdk:"webhook" tf:"optional,object"` + Webhook types.List `tfsdk:"webhook"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWebhookResponse. @@ -1554,24 +1589,24 @@ func (o *CreateWebhookResponse_SdkV2) SetWebhook(ctx context.Context, v Registry type Dataset_SdkV2 struct { // Dataset digest, e.g. an md5 hash of the dataset that uniquely identifies // it within datasets of the same name. - Digest types.String `tfsdk:"digest" tf:"optional"` + Digest types.String `tfsdk:"digest"` // The name of the dataset. E.g. “my.uc.table@2” “nyc-taxi-dataset”, // “fantastic-elk-3” - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The profile of the dataset. Summary statistics for the dataset, such as // the number of rows in a table, the mean / std / mode of each column in a // table, or the number of elements in an array. - Profile types.String `tfsdk:"profile" tf:"optional"` + Profile types.String `tfsdk:"profile"` // The schema of the dataset. E.g., MLflow ColSpec JSON for a dataframe, // MLflow TensorSpec JSON for an ndarray, or another schema format. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // The type of the dataset source, e.g. ‘databricks-uc-table’, // ‘DBFS’, ‘S3’, ... - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Source information for the dataset. Note that the source may not exactly // reproduce the dataset if it was transformed / modified before use with // MLflow. - SourceType types.String `tfsdk:"source_type" tf:"optional"` + SourceType types.String `tfsdk:"source_type"` } func (newState *Dataset_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dataset_SdkV2) { @@ -1580,9 +1615,15 @@ func (newState *Dataset_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Data func (newState *Dataset_SdkV2) SyncEffectiveFieldsDuringRead(existingState Dataset_SdkV2) { } -func (c Dataset_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Dataset_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["digest"] = attrs["digest"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["profile"] = attrs["profile"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["source_type"] = attrs["source_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dataset. @@ -1628,10 +1669,10 @@ func (o Dataset_SdkV2) Type(ctx context.Context) attr.Type { type DatasetInput_SdkV2 struct { // The dataset being used as a Run input. - Dataset types.List `tfsdk:"dataset" tf:"optional,object"` + Dataset types.List `tfsdk:"dataset"` // A list of tags for the dataset input, e.g. a “context” tag with value // “training” - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *DatasetInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatasetInput_SdkV2) { @@ -1640,11 +1681,12 @@ func (newState *DatasetInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DatasetInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState DatasetInput_SdkV2) { } -func (c DatasetInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Dataset_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dataset")...) - InputTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c DatasetInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataset"] = attrs["dataset"].SetOptional() + attrs["dataset"] = attrs["dataset"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatasetInput. @@ -1807,7 +1849,7 @@ func (o DeleteCommentResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeleteExperiment_SdkV2 struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` } func (newState *DeleteExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteExperiment_SdkV2) { @@ -1816,10 +1858,10 @@ func (newState *DeleteExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *DeleteExperiment_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteExperiment_SdkV2) { } -func (c DeleteExperiment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) +func (c DeleteExperiment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExperiment. @@ -1862,9 +1904,9 @@ func (newState *DeleteExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *DeleteExperimentResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteExperimentResponse_SdkV2) { } -func (c DeleteExperimentResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteExperimentResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExperimentResponse. @@ -2182,7 +2224,7 @@ func (o DeleteModelVersionTagResponse_SdkV2) Type(ctx context.Context) attr.Type type DeleteRun_SdkV2 struct { // ID of the run to delete. - RunId types.String `tfsdk:"run_id" tf:""` + RunId types.String `tfsdk:"run_id"` } func (newState *DeleteRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRun_SdkV2) { @@ -2191,10 +2233,10 @@ func (newState *DeleteRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan De func (newState *DeleteRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRun_SdkV2) { } -func (c DeleteRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c DeleteRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRun. @@ -2237,9 +2279,9 @@ func (newState *DeleteRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *DeleteRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRunResponse_SdkV2) { } -func (c DeleteRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRunResponse. @@ -2271,14 +2313,14 @@ func (o DeleteRunResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeleteRuns_SdkV2 struct { // The ID of the experiment containing the runs to delete. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // An optional positive integer indicating the maximum number of runs to // delete. The maximum allowed value for max_runs is 10000. - MaxRuns types.Int64 `tfsdk:"max_runs" tf:"optional"` + MaxRuns types.Int64 `tfsdk:"max_runs"` // The maximum creation timestamp in milliseconds since the UNIX epoch for // deleting runs. Only runs created prior to or at this timestamp are // deleted. - MaxTimestampMillis types.Int64 `tfsdk:"max_timestamp_millis" tf:""` + MaxTimestampMillis types.Int64 `tfsdk:"max_timestamp_millis"` } func (newState *DeleteRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRuns_SdkV2) { @@ -2287,11 +2329,12 @@ func (newState *DeleteRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan D func (newState *DeleteRuns_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRuns_SdkV2) { } -func (c DeleteRuns_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) - cs.SetRequired(append(path, "max_timestamp_millis")...) +func (c DeleteRuns_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["max_runs"] = attrs["max_runs"].SetOptional() + attrs["max_timestamp_millis"] = attrs["max_timestamp_millis"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRuns. @@ -2331,7 +2374,7 @@ func (o DeleteRuns_SdkV2) Type(ctx context.Context) attr.Type { type DeleteRunsResponse_SdkV2 struct { // The number of runs deleted. - RunsDeleted types.Int64 `tfsdk:"runs_deleted" tf:"optional"` + RunsDeleted types.Int64 `tfsdk:"runs_deleted"` } func (newState *DeleteRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRunsResponse_SdkV2) { @@ -2340,9 +2383,10 @@ func (newState *DeleteRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *DeleteRunsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRunsResponse_SdkV2) { } -func (c DeleteRunsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteRunsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["runs_deleted"] = attrs["runs_deleted"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRunsResponse. @@ -2378,9 +2422,9 @@ func (o DeleteRunsResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeleteTag_SdkV2 struct { // Name of the tag. Maximum size is 255 bytes. Must be provided. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run that the tag was logged under. Must be provided. - RunId types.String `tfsdk:"run_id" tf:""` + RunId types.String `tfsdk:"run_id"` } func (newState *DeleteTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteTag_SdkV2) { @@ -2389,11 +2433,11 @@ func (newState *DeleteTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan De func (newState *DeleteTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteTag_SdkV2) { } -func (c DeleteTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "run_id")...) +func (c DeleteTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteTag. @@ -2438,9 +2482,9 @@ func (newState *DeleteTagResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *DeleteTagResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteTagResponse_SdkV2) { } -func (c DeleteTagResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteTagResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteTagResponse. @@ -2632,20 +2676,20 @@ func (o DeleteWebhookResponse_SdkV2) Type(ctx context.Context) attr.Type { type Experiment_SdkV2 struct { // Location where artifacts for the experiment are stored. - ArtifactLocation types.String `tfsdk:"artifact_location" tf:"optional"` + ArtifactLocation types.String `tfsdk:"artifact_location"` // Creation time - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Unique identifier for the experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` // Last update time - LastUpdateTime types.Int64 `tfsdk:"last_update_time" tf:"optional"` + LastUpdateTime types.Int64 `tfsdk:"last_update_time"` // Current life cycle stage of the experiment: "active" or "deleted". // Deleted experiments are not returned by APIs. - LifecycleStage types.String `tfsdk:"lifecycle_stage" tf:"optional"` + LifecycleStage types.String `tfsdk:"lifecycle_stage"` // Human readable name that identifies the experiment. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Tags: Additional metadata key-value pairs. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *Experiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Experiment_SdkV2) { @@ -2654,10 +2698,16 @@ func (newState *Experiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan E func (newState *Experiment_SdkV2) SyncEffectiveFieldsDuringRead(existingState Experiment_SdkV2) { } -func (c Experiment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c Experiment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_location"] = attrs["artifact_location"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() + attrs["last_update_time"] = attrs["last_update_time"].SetOptional() + attrs["lifecycle_stage"] = attrs["lifecycle_stage"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Experiment. @@ -2735,13 +2785,13 @@ func (o *Experiment_SdkV2) SetTags(ctx context.Context, v []ExperimentTag_SdkV2) type ExperimentAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ExperimentAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentAccessControlRequest_SdkV2) { @@ -2750,9 +2800,13 @@ func (newState *ExperimentAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringC func (newState *ExperimentAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentAccessControlRequest_SdkV2) { } -func (c ExperimentAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentAccessControlRequest. @@ -2794,15 +2848,15 @@ func (o ExperimentAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Typ type ExperimentAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ExperimentAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentAccessControlResponse_SdkV2) { @@ -2811,10 +2865,14 @@ func (newState *ExperimentAccessControlResponse_SdkV2) SyncEffectiveFieldsDuring func (newState *ExperimentAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentAccessControlResponse_SdkV2) { } -func (c ExperimentAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ExperimentAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentAccessControlResponse. @@ -2887,11 +2945,11 @@ func (o *ExperimentAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Co } type ExperimentPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ExperimentPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentPermission_SdkV2) { @@ -2900,9 +2958,12 @@ func (newState *ExperimentPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ExperimentPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentPermission_SdkV2) { } -func (c ExperimentPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermission. @@ -2971,11 +3032,11 @@ func (o *ExperimentPermission_SdkV2) SetInheritedFromObject(ctx context.Context, } type ExperimentPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ExperimentPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentPermissions_SdkV2) { @@ -2984,10 +3045,12 @@ func (newState *ExperimentPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ExperimentPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentPermissions_SdkV2) { } -func (c ExperimentPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ExperimentPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermissions. @@ -3056,9 +3119,9 @@ func (o *ExperimentPermissions_SdkV2) SetAccessControlList(ctx context.Context, } type ExperimentPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ExperimentPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentPermissionsDescription_SdkV2) { @@ -3067,9 +3130,11 @@ func (newState *ExperimentPermissionsDescription_SdkV2) SyncEffectiveFieldsDurin func (newState *ExperimentPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentPermissionsDescription_SdkV2) { } -func (c ExperimentPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermissionsDescription. @@ -3106,7 +3171,7 @@ func (o ExperimentPermissionsDescription_SdkV2) Type(ctx context.Context) attr.T } type ExperimentPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The experiment for which to get or manage permissions. ExperimentId types.String `tfsdk:"-"` } @@ -3117,11 +3182,11 @@ func (newState *ExperimentPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *ExperimentPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentPermissionsRequest_SdkV2) { } -func (c ExperimentPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "experiment_id")...) +func (c ExperimentPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermissionsRequest. @@ -3189,9 +3254,9 @@ func (o *ExperimentPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Co type ExperimentTag_SdkV2 struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ExperimentTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentTag_SdkV2) { @@ -3200,9 +3265,11 @@ func (newState *ExperimentTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ExperimentTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExperimentTag_SdkV2) { } -func (c ExperimentTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentTag. @@ -3240,11 +3307,11 @@ func (o ExperimentTag_SdkV2) Type(ctx context.Context) attr.Type { type FileInfo_SdkV2 struct { // Size in bytes. Unset for directories. - FileSize types.Int64 `tfsdk:"file_size" tf:"optional"` + FileSize types.Int64 `tfsdk:"file_size"` // Whether the path is a directory. - IsDir types.Bool `tfsdk:"is_dir" tf:"optional"` + IsDir types.Bool `tfsdk:"is_dir"` // Path relative to the root artifact directory run. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo_SdkV2) { @@ -3253,9 +3320,12 @@ func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Fil func (newState *FileInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState FileInfo_SdkV2) { } -func (c FileInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_size"] = attrs["file_size"].SetOptional() + attrs["is_dir"] = attrs["is_dir"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileInfo. @@ -3369,7 +3439,7 @@ func (o GetExperimentPermissionLevelsRequest_SdkV2) Type(ctx context.Context) at type GetExperimentPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetExperimentPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetExperimentPermissionLevelsResponse_SdkV2) { @@ -3378,10 +3448,10 @@ func (newState *GetExperimentPermissionLevelsResponse_SdkV2) SyncEffectiveFields func (newState *GetExperimentPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetExperimentPermissionLevelsResponse_SdkV2) { } -func (c GetExperimentPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetExperimentPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetExperimentPermissionLevelsResponse. @@ -3521,7 +3591,7 @@ func (o GetExperimentRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetExperimentResponse_SdkV2 struct { // Experiment details. - Experiment types.List `tfsdk:"experiment" tf:"optional,object"` + Experiment types.List `tfsdk:"experiment"` } func (newState *GetExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetExperimentResponse_SdkV2) { @@ -3530,10 +3600,11 @@ func (newState *GetExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *GetExperimentResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetExperimentResponse_SdkV2) { } -func (c GetExperimentResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Experiment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "experiment")...) +func (c GetExperimentResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment"] = attrs["experiment"].SetOptional() + attrs["experiment"] = attrs["experiment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetExperimentResponse. @@ -3655,9 +3726,9 @@ func (o GetHistoryRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetLatestVersionsRequest_SdkV2 struct { // Registered model unique name identifier. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // List of stages. - Stages types.List `tfsdk:"stages" tf:"optional"` + Stages types.List `tfsdk:"stages"` } func (newState *GetLatestVersionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetLatestVersionsRequest_SdkV2) { @@ -3666,10 +3737,11 @@ func (newState *GetLatestVersionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *GetLatestVersionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetLatestVersionsRequest_SdkV2) { } -func (c GetLatestVersionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c GetLatestVersionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["stages"] = attrs["stages"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetLatestVersionsRequest. @@ -3739,7 +3811,7 @@ type GetLatestVersionsResponse_SdkV2 struct { // Latest version models for each requests stage. Only return models with // current `READY` status. If no `stages` provided, returns the latest // version for each stage, including `"None"`. - ModelVersions types.List `tfsdk:"model_versions" tf:"optional"` + ModelVersions types.List `tfsdk:"model_versions"` } func (newState *GetLatestVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetLatestVersionsResponse_SdkV2) { @@ -3748,10 +3820,10 @@ func (newState *GetLatestVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *GetLatestVersionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetLatestVersionsResponse_SdkV2) { } -func (c GetLatestVersionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "model_versions")...) +func (c GetLatestVersionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_versions"] = attrs["model_versions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetLatestVersionsResponse. @@ -3817,10 +3889,10 @@ func (o *GetLatestVersionsResponse_SdkV2) SetModelVersions(ctx context.Context, type GetMetricHistoryResponse_SdkV2 struct { // All logged values for this metric. - Metrics types.List `tfsdk:"metrics" tf:"optional"` + Metrics types.List `tfsdk:"metrics"` // Token that can be used to retrieve the next page of metric history // results - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetMetricHistoryResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetMetricHistoryResponse_SdkV2) { @@ -3829,10 +3901,11 @@ func (newState *GetMetricHistoryResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *GetMetricHistoryResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetMetricHistoryResponse_SdkV2) { } -func (c GetMetricHistoryResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Metric_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) +func (c GetMetricHistoryResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetMetricHistoryResponse. @@ -3936,7 +4009,7 @@ func (o GetModelRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetModelResponse_SdkV2 struct { - RegisteredModelDatabricks types.List `tfsdk:"registered_model_databricks" tf:"optional,object"` + RegisteredModelDatabricks types.List `tfsdk:"registered_model_databricks"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetModelResponse. @@ -4043,7 +4116,7 @@ func (o GetModelVersionDownloadUriRequest_SdkV2) Type(ctx context.Context) attr. type GetModelVersionDownloadUriResponse_SdkV2 struct { // URI corresponding to where artifacts for this model version are stored. - ArtifactUri types.String `tfsdk:"artifact_uri" tf:"optional"` + ArtifactUri types.String `tfsdk:"artifact_uri"` } func (newState *GetModelVersionDownloadUriResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetModelVersionDownloadUriResponse_SdkV2) { @@ -4052,9 +4125,10 @@ func (newState *GetModelVersionDownloadUriResponse_SdkV2) SyncEffectiveFieldsDur func (newState *GetModelVersionDownloadUriResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetModelVersionDownloadUriResponse_SdkV2) { } -func (c GetModelVersionDownloadUriResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetModelVersionDownloadUriResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_uri"] = attrs["artifact_uri"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetModelVersionDownloadUriResponse. @@ -4130,7 +4204,7 @@ func (o GetModelVersionRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetModelVersionResponse_SdkV2 struct { - ModelVersion types.List `tfsdk:"model_version" tf:"optional,object"` + ModelVersion types.List `tfsdk:"model_version"` } func (newState *GetModelVersionResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetModelVersionResponse_SdkV2) { @@ -4139,10 +4213,11 @@ func (newState *GetModelVersionResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *GetModelVersionResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetModelVersionResponse_SdkV2) { } -func (c GetModelVersionResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "model_version")...) +func (c GetModelVersionResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_version"] = attrs["model_version"].SetOptional() + attrs["model_version"] = attrs["model_version"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetModelVersionResponse. @@ -4245,7 +4320,7 @@ func (o GetRegisteredModelPermissionLevelsRequest_SdkV2) Type(ctx context.Contex type GetRegisteredModelPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetRegisteredModelPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRegisteredModelPermissionLevelsResponse_SdkV2) { @@ -4254,10 +4329,10 @@ func (newState *GetRegisteredModelPermissionLevelsResponse_SdkV2) SyncEffectiveF func (newState *GetRegisteredModelPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetRegisteredModelPermissionLevelsResponse_SdkV2) { } -func (c GetRegisteredModelPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetRegisteredModelPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRegisteredModelPermissionLevelsResponse. @@ -4403,7 +4478,7 @@ func (o GetRunRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetRunResponse_SdkV2 struct { // Run metadata (name, start time, etc) and data (metrics, params, and // tags). - Run types.List `tfsdk:"run" tf:"optional,object"` + Run types.List `tfsdk:"run"` } func (newState *GetRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRunResponse_SdkV2) { @@ -4412,10 +4487,11 @@ func (newState *GetRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *GetRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetRunResponse_SdkV2) { } -func (c GetRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Run_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run")...) +func (c GetRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run"] = attrs["run"].SetOptional() + attrs["run"] = attrs["run"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRunResponse. @@ -4484,7 +4560,7 @@ type HttpUrlSpec_SdkV2 struct { // by the wehbook. It should be of the form `" "`. // If set to an empty string, no authorization header will be included in // the request. - Authorization types.String `tfsdk:"authorization" tf:"optional"` + Authorization types.String `tfsdk:"authorization"` // Enable/disable SSL certificate validation. Default is true. For // self-signed certificates, this field must be false AND the destination // server must disable certificate validation as well. For security @@ -4492,13 +4568,13 @@ type HttpUrlSpec_SdkV2 struct { // HMAC-encoded portion of the payload and acknowledge the risk associated // with disabling hostname validation whereby it becomes more likely that // requests can be maliciously routed to an unintended host. - EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification" tf:"optional"` + EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification"` // Shared secret required for HMAC encoding payload. The HMAC-encoded // payload will be sent in the header as: { "X-Databricks-Signature": // $encoded_payload }. - Secret types.String `tfsdk:"secret" tf:"optional"` + Secret types.String `tfsdk:"secret"` // External HTTPS URL called on event trigger (by using a POST request). - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` } func (newState *HttpUrlSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan HttpUrlSpec_SdkV2) { @@ -4507,10 +4583,13 @@ func (newState *HttpUrlSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *HttpUrlSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState HttpUrlSpec_SdkV2) { } -func (c HttpUrlSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "url")...) +func (c HttpUrlSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authorization"] = attrs["authorization"].SetOptional() + attrs["enable_ssl_verification"] = attrs["enable_ssl_verification"].SetOptional() + attrs["secret"] = attrs["secret"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in HttpUrlSpec. @@ -4558,9 +4637,9 @@ type HttpUrlSpecWithoutSecret_SdkV2 struct { // HMAC-encoded portion of the payload and acknowledge the risk associated // with disabling hostname validation whereby it becomes more likely that // requests can be maliciously routed to an unintended host. - EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification" tf:"optional"` + EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification"` // External HTTPS URL called on event trigger (by using a POST request). - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *HttpUrlSpecWithoutSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan HttpUrlSpecWithoutSecret_SdkV2) { @@ -4569,9 +4648,11 @@ func (newState *HttpUrlSpecWithoutSecret_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *HttpUrlSpecWithoutSecret_SdkV2) SyncEffectiveFieldsDuringRead(existingState HttpUrlSpecWithoutSecret_SdkV2) { } -func (c HttpUrlSpecWithoutSecret_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c HttpUrlSpecWithoutSecret_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enable_ssl_verification"] = attrs["enable_ssl_verification"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in HttpUrlSpecWithoutSecret. @@ -4609,9 +4690,9 @@ func (o HttpUrlSpecWithoutSecret_SdkV2) Type(ctx context.Context) attr.Type { type InputTag_SdkV2 struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *InputTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan InputTag_SdkV2) { @@ -4620,9 +4701,11 @@ func (newState *InputTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Inp func (newState *InputTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState InputTag_SdkV2) { } -func (c InputTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InputTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InputTag. @@ -4660,13 +4743,13 @@ func (o InputTag_SdkV2) Type(ctx context.Context) attr.Type { type JobSpec_SdkV2 struct { // The personal access token used to authorize webhook's job runs. - AccessToken types.String `tfsdk:"access_token" tf:""` + AccessToken types.String `tfsdk:"access_token"` // ID of the job that the webhook runs. - JobId types.String `tfsdk:"job_id" tf:""` + JobId types.String `tfsdk:"job_id"` // URL of the workspace containing the job that this webhook runs. If not // specified, the job’s workspace URL is assumed to be the same as the // workspace where the webhook is created. - WorkspaceUrl types.String `tfsdk:"workspace_url" tf:"optional"` + WorkspaceUrl types.String `tfsdk:"workspace_url"` } func (newState *JobSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSpec_SdkV2) { @@ -4675,11 +4758,12 @@ func (newState *JobSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobS func (newState *JobSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobSpec_SdkV2) { } -func (c JobSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_token")...) - cs.SetRequired(append(path, "job_id")...) +func (c JobSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_token"] = attrs["access_token"].SetRequired() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["workspace_url"] = attrs["workspace_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSpec. @@ -4719,11 +4803,11 @@ func (o JobSpec_SdkV2) Type(ctx context.Context) attr.Type { type JobSpecWithoutSecret_SdkV2 struct { // ID of the job that the webhook runs. - JobId types.String `tfsdk:"job_id" tf:"optional"` + JobId types.String `tfsdk:"job_id"` // URL of the workspace containing the job that this webhook runs. Defaults // to the workspace URL in which the webhook is created. If not specified, // the job’s workspace is assumed to be the same as the webhook’s. - WorkspaceUrl types.String `tfsdk:"workspace_url" tf:"optional"` + WorkspaceUrl types.String `tfsdk:"workspace_url"` } func (newState *JobSpecWithoutSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSpecWithoutSecret_SdkV2) { @@ -4732,9 +4816,11 @@ func (newState *JobSpecWithoutSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *JobSpecWithoutSecret_SdkV2) SyncEffectiveFieldsDuringRead(existingState JobSpecWithoutSecret_SdkV2) { } -func (c JobSpecWithoutSecret_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobSpecWithoutSecret_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["workspace_url"] = attrs["workspace_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSpecWithoutSecret. @@ -4828,11 +4914,11 @@ func (o ListArtifactsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListArtifactsResponse_SdkV2 struct { // File location and metadata for artifacts. - Files types.List `tfsdk:"files" tf:"optional"` + Files types.List `tfsdk:"files"` // Token that can be used to retrieve the next page of artifact results - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Root artifact directory for the run. - RootUri types.String `tfsdk:"root_uri" tf:"optional"` + RootUri types.String `tfsdk:"root_uri"` } func (newState *ListArtifactsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListArtifactsResponse_SdkV2) { @@ -4841,10 +4927,12 @@ func (newState *ListArtifactsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListArtifactsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListArtifactsResponse_SdkV2) { } -func (c ListArtifactsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "files")...) +func (c ListArtifactsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["files"] = attrs["files"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["root_uri"] = attrs["root_uri"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListArtifactsResponse. @@ -4965,10 +5053,10 @@ func (o ListExperimentsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListExperimentsResponse_SdkV2 struct { // Paginated Experiments beginning with the first item on the requested // page. - Experiments types.List `tfsdk:"experiments" tf:"optional"` + Experiments types.List `tfsdk:"experiments"` // Token that can be used to retrieve the next page of experiments. Empty // token means no more experiment is available for retrieval. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExperimentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExperimentsResponse_SdkV2) { @@ -4977,10 +5065,11 @@ func (newState *ListExperimentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ListExperimentsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListExperimentsResponse_SdkV2) { } -func (c ListExperimentsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Experiment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "experiments")...) +func (c ListExperimentsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiments"] = attrs["experiments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExperimentsResponse. @@ -5089,9 +5178,9 @@ func (o ListModelsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListModelsResponse_SdkV2 struct { // Pagination token to request next page of models for the same query. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - RegisteredModels types.List `tfsdk:"registered_models" tf:"optional"` + RegisteredModels types.List `tfsdk:"registered_models"` } func (newState *ListModelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListModelsResponse_SdkV2) { @@ -5100,10 +5189,11 @@ func (newState *ListModelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListModelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListModelsResponse_SdkV2) { } -func (c ListModelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "registered_models")...) +func (c ListModelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["registered_models"] = attrs["registered_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListModelsResponse. @@ -5171,9 +5261,9 @@ func (o *ListModelsResponse_SdkV2) SetRegisteredModels(ctx context.Context, v [] type ListRegistryWebhooks_SdkV2 struct { // Token that can be used to retrieve the next page of artifact results - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Array of registry webhooks. - Webhooks types.List `tfsdk:"webhooks" tf:"optional"` + Webhooks types.List `tfsdk:"webhooks"` } func (newState *ListRegistryWebhooks_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRegistryWebhooks_SdkV2) { @@ -5182,10 +5272,11 @@ func (newState *ListRegistryWebhooks_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListRegistryWebhooks_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListRegistryWebhooks_SdkV2) { } -func (c ListRegistryWebhooks_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegistryWebhook_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "webhooks")...) +func (c ListRegistryWebhooks_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["webhooks"] = attrs["webhooks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRegistryWebhooks. @@ -5294,7 +5385,7 @@ func (o ListTransitionRequestsRequest_SdkV2) Type(ctx context.Context) attr.Type type ListTransitionRequestsResponse_SdkV2 struct { // Array of open transition requests. - Requests types.List `tfsdk:"requests" tf:"optional"` + Requests types.List `tfsdk:"requests"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTransitionRequestsResponse. @@ -5439,15 +5530,15 @@ func (o *ListWebhooksRequest_SdkV2) SetEvents(ctx context.Context, v []types.Str type LogBatch_SdkV2 struct { // Metrics to log. A single request can contain up to 1000 metrics, and up // to 1000 metrics, params, and tags in total. - Metrics types.List `tfsdk:"metrics" tf:"optional"` + Metrics types.List `tfsdk:"metrics"` // Params to log. A single request can contain up to 100 params, and up to // 1000 metrics, params, and tags in total. - Params types.List `tfsdk:"params" tf:"optional"` + Params types.List `tfsdk:"params"` // ID of the run to log under - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // Tags to log. A single request can contain up to 100 tags, and up to 1000 // metrics, params, and tags in total. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *LogBatch_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogBatch_SdkV2) { @@ -5456,12 +5547,13 @@ func (newState *LogBatch_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Log func (newState *LogBatch_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogBatch_SdkV2) { } -func (c LogBatch_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Metric_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) - Param_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "params")...) - RunTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c LogBatch_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["params"] = attrs["params"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogBatch. @@ -5598,9 +5690,9 @@ func (newState *LogBatchResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *LogBatchResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogBatchResponse_SdkV2) { } -func (c LogBatchResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogBatchResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogBatchResponse. @@ -5632,9 +5724,9 @@ func (o LogBatchResponse_SdkV2) Type(ctx context.Context) attr.Type { type LogInputs_SdkV2 struct { // Dataset inputs - Datasets types.List `tfsdk:"datasets" tf:"optional"` + Datasets types.List `tfsdk:"datasets"` // ID of the run to log under - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` } func (newState *LogInputs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogInputs_SdkV2) { @@ -5643,10 +5735,11 @@ func (newState *LogInputs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Lo func (newState *LogInputs_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogInputs_SdkV2) { } -func (c LogInputs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DatasetInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "datasets")...) +func (c LogInputs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["datasets"] = attrs["datasets"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogInputs. @@ -5721,9 +5814,9 @@ func (newState *LogInputsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *LogInputsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogInputsResponse_SdkV2) { } -func (c LogInputsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogInputsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogInputsResponse. @@ -5755,18 +5848,18 @@ func (o LogInputsResponse_SdkV2) Type(ctx context.Context) attr.Type { type LogMetric_SdkV2 struct { // Name of the metric. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run under which to log the metric. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run under which to log the // metric. This field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // Step at which to log the metric - Step types.Int64 `tfsdk:"step" tf:"optional"` + Step types.Int64 `tfsdk:"step"` // Unix timestamp in milliseconds at the time metric was logged. - Timestamp types.Int64 `tfsdk:"timestamp" tf:""` + Timestamp types.Int64 `tfsdk:"timestamp"` // Double value of the metric being logged. - Value types.Float64 `tfsdk:"value" tf:""` + Value types.Float64 `tfsdk:"value"` } func (newState *LogMetric_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogMetric_SdkV2) { @@ -5775,12 +5868,15 @@ func (newState *LogMetric_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Lo func (newState *LogMetric_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogMetric_SdkV2) { } -func (c LogMetric_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "timestamp")...) - cs.SetRequired(append(path, "value")...) +func (c LogMetric_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["step"] = attrs["step"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogMetric. @@ -5833,9 +5929,9 @@ func (newState *LogMetricResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *LogMetricResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogMetricResponse_SdkV2) { } -func (c LogMetricResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogMetricResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogMetricResponse. @@ -5867,9 +5963,9 @@ func (o LogMetricResponse_SdkV2) Type(ctx context.Context) attr.Type { type LogModel_SdkV2 struct { // MLmodel file in json format. - ModelJson types.String `tfsdk:"model_json" tf:"optional"` + ModelJson types.String `tfsdk:"model_json"` // ID of the run to log under - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` } func (newState *LogModel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogModel_SdkV2) { @@ -5878,9 +5974,11 @@ func (newState *LogModel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Log func (newState *LogModel_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogModel_SdkV2) { } -func (c LogModel_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogModel_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_json"] = attrs["model_json"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogModel. @@ -5925,9 +6023,9 @@ func (newState *LogModelResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *LogModelResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogModelResponse_SdkV2) { } -func (c LogModelResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogModelResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogModelResponse. @@ -5959,14 +6057,14 @@ func (o LogModelResponse_SdkV2) Type(ctx context.Context) attr.Type { type LogParam_SdkV2 struct { // Name of the param. Maximum size is 255 bytes. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run under which to log the param. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run under which to log the // param. This field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // String value of the param being logged. Maximum size is 500 bytes. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *LogParam_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogParam_SdkV2) { @@ -5975,11 +6073,13 @@ func (newState *LogParam_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Log func (newState *LogParam_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogParam_SdkV2) { } -func (c LogParam_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "value")...) +func (c LogParam_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogParam. @@ -6028,9 +6128,9 @@ func (newState *LogParamResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *LogParamResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState LogParamResponse_SdkV2) { } -func (c LogParamResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogParamResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogParamResponse. @@ -6062,13 +6162,13 @@ func (o LogParamResponse_SdkV2) Type(ctx context.Context) attr.Type { type Metric_SdkV2 struct { // Key identifying this metric. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Step at which to log the metric. - Step types.Int64 `tfsdk:"step" tf:"optional"` + Step types.Int64 `tfsdk:"step"` // The timestamp at which this metric was recorded. - Timestamp types.Int64 `tfsdk:"timestamp" tf:"optional"` + Timestamp types.Int64 `tfsdk:"timestamp"` // Value associated with this metric. - Value types.Float64 `tfsdk:"value" tf:"optional"` + Value types.Float64 `tfsdk:"value"` } func (newState *Metric_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Metric_SdkV2) { @@ -6077,9 +6177,13 @@ func (newState *Metric_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Metri func (newState *Metric_SdkV2) SyncEffectiveFieldsDuringRead(existingState Metric_SdkV2) { } -func (c Metric_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Metric_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["step"] = attrs["step"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Metric. @@ -6121,21 +6225,21 @@ func (o Metric_SdkV2) Type(ctx context.Context) attr.Type { type Model_SdkV2 struct { // Timestamp recorded when this `registered_model` was created. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Description of this `registered_model`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Timestamp recorded when metadata for this `registered_model` was last // updated. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Collection of latest model versions for each stage. Only contains models // with current `READY` status. - LatestVersions types.List `tfsdk:"latest_versions" tf:"optional"` + LatestVersions types.List `tfsdk:"latest_versions"` // Unique name for the model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Tags: Additional metadata key-value pairs for this `registered_model`. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // User that created this `registered_model` - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *Model_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Model_SdkV2) { @@ -6144,11 +6248,16 @@ func (newState *Model_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Model_ func (newState *Model_SdkV2) SyncEffectiveFieldsDuringRead(existingState Model_SdkV2) { } -func (c Model_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "latest_versions")...) - ModelTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c Model_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["latest_versions"] = attrs["latest_versions"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Model. @@ -6255,24 +6364,24 @@ func (o *Model_SdkV2) SetTags(ctx context.Context, v []ModelTag_SdkV2) { type ModelDatabricks_SdkV2 struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // User-specified description for the object. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Unique identifier for the object. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Array of model versions, each the latest version for its stage. - LatestVersions types.List `tfsdk:"latest_versions" tf:"optional"` + LatestVersions types.List `tfsdk:"latest_versions"` // Name of the model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Permission level of the requesting user on the object. For what is // allowed at each level, see [MLflow Model permissions](..). - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // Array of tags associated with the model. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *ModelDatabricks_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelDatabricks_SdkV2) { @@ -6281,11 +6390,18 @@ func (newState *ModelDatabricks_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ModelDatabricks_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelDatabricks_SdkV2) { } -func (c ModelDatabricks_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "latest_versions")...) - ModelTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ModelDatabricks_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["latest_versions"] = attrs["latest_versions"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelDatabricks. @@ -6396,9 +6512,9 @@ func (o *ModelDatabricks_SdkV2) SetTags(ctx context.Context, v []ModelTag_SdkV2) type ModelTag_SdkV2 struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ModelTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelTag_SdkV2) { @@ -6407,9 +6523,11 @@ func (newState *ModelTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mod func (newState *ModelTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelTag_SdkV2) { } -func (c ModelTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ModelTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelTag. @@ -6447,34 +6565,34 @@ func (o ModelTag_SdkV2) Type(ctx context.Context) attr.Type { type ModelVersion_SdkV2 struct { // Timestamp recorded when this `model_version` was created. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Current stage for this `model_version`. - CurrentStage types.String `tfsdk:"current_stage" tf:"optional"` + CurrentStage types.String `tfsdk:"current_stage"` // Description of this `model_version`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Timestamp recorded when metadata for this `model_version` was last // updated. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Unique name of the model - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // MLflow run ID used when creating `model_version`, if `source` was // generated by an experiment run stored in MLflow tracking server. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // Run Link: Direct link to the run that generated this version - RunLink types.String `tfsdk:"run_link" tf:"optional"` + RunLink types.String `tfsdk:"run_link"` // URI indicating the location of the source model artifacts, used when // creating `model_version` - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Current status of `model_version` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // Details on current `status`, if it is pending or failed. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` // Tags: Additional metadata key-value pairs for this `model_version`. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // User that created this `model_version`. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` // Model's version number. - Version types.String `tfsdk:"version" tf:"optional"` + Version types.String `tfsdk:"version"` } func (newState *ModelVersion_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersion_SdkV2) { @@ -6483,10 +6601,22 @@ func (newState *ModelVersion_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ModelVersion_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelVersion_SdkV2) { } -func (c ModelVersion_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersionTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ModelVersion_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["current_stage"] = attrs["current_stage"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_link"] = attrs["run_link"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersion. @@ -6576,7 +6706,7 @@ func (o *ModelVersion_SdkV2) SetTags(ctx context.Context, v []ModelVersionTag_Sd type ModelVersionDatabricks_SdkV2 struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Stage of the model version. Valid values are: // // * `None`: The initial stage of a model version. @@ -6586,26 +6716,26 @@ type ModelVersionDatabricks_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - CurrentStage types.String `tfsdk:"current_stage" tf:"optional"` + CurrentStage types.String `tfsdk:"current_stage"` // User-specified description for the object. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Name of the model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Permission level of the requesting user on the object. For what is // allowed at each level, see [MLflow Model permissions](..). - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // Unique identifier for the MLflow tracking run associated with the source // model artifacts. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // URL of the run associated with the model artifacts. This field is set at // model version creation time only for model versions whose source run is // from a tracking server that is different from the registry server. - RunLink types.String `tfsdk:"run_link" tf:"optional"` + RunLink types.String `tfsdk:"run_link"` // URI that indicates the location of the source model artifacts. This is // used when creating the model version. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // The status of the model version. Valid values are: * // `PENDING_REGISTRATION`: Request to register a new model version is // pending as server performs background tasks. @@ -6614,15 +6744,15 @@ type ModelVersionDatabricks_SdkV2 struct { // failed. // // * `READY`: Model version is ready for use. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // Details on the current status, for example why registration failed. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` // Array of tags that are associated with the model version. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` // Version of the model. - Version types.String `tfsdk:"version" tf:"optional"` + Version types.String `tfsdk:"version"` } func (newState *ModelVersionDatabricks_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersionDatabricks_SdkV2) { @@ -6631,10 +6761,23 @@ func (newState *ModelVersionDatabricks_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ModelVersionDatabricks_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelVersionDatabricks_SdkV2) { } -func (c ModelVersionDatabricks_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersionTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ModelVersionDatabricks_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["current_stage"] = attrs["current_stage"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_link"] = attrs["run_link"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersionDatabricks. @@ -6726,9 +6869,9 @@ func (o *ModelVersionDatabricks_SdkV2) SetTags(ctx context.Context, v []ModelVer type ModelVersionTag_SdkV2 struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ModelVersionTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersionTag_SdkV2) { @@ -6737,9 +6880,11 @@ func (newState *ModelVersionTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ModelVersionTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelVersionTag_SdkV2) { } -func (c ModelVersionTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ModelVersionTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersionTag. @@ -6777,9 +6922,9 @@ func (o ModelVersionTag_SdkV2) Type(ctx context.Context) attr.Type { type Param_SdkV2 struct { // Key identifying this param. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Value associated with this param. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *Param_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Param_SdkV2) { @@ -6788,9 +6933,11 @@ func (newState *Param_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Param_ func (newState *Param_SdkV2) SyncEffectiveFieldsDuringRead(existingState Param_SdkV2) { } -func (c Param_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Param_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Param. @@ -6828,13 +6975,13 @@ func (o Param_SdkV2) Type(ctx context.Context) attr.Type { type RegisteredModelAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RegisteredModelAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelAccessControlRequest_SdkV2) { @@ -6843,9 +6990,13 @@ func (newState *RegisteredModelAccessControlRequest_SdkV2) SyncEffectiveFieldsDu func (newState *RegisteredModelAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelAccessControlRequest_SdkV2) { } -func (c RegisteredModelAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelAccessControlRequest. @@ -6887,15 +7038,15 @@ func (o RegisteredModelAccessControlRequest_SdkV2) Type(ctx context.Context) att type RegisteredModelAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RegisteredModelAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelAccessControlResponse_SdkV2) { @@ -6904,10 +7055,14 @@ func (newState *RegisteredModelAccessControlResponse_SdkV2) SyncEffectiveFieldsD func (newState *RegisteredModelAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelAccessControlResponse_SdkV2) { } -func (c RegisteredModelAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c RegisteredModelAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelAccessControlResponse. @@ -6980,11 +7135,11 @@ func (o *RegisteredModelAccessControlResponse_SdkV2) SetAllPermissions(ctx conte } type RegisteredModelPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RegisteredModelPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelPermission_SdkV2) { @@ -6993,9 +7148,12 @@ func (newState *RegisteredModelPermission_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *RegisteredModelPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermission_SdkV2) { } -func (c RegisteredModelPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermission. @@ -7064,11 +7222,11 @@ func (o *RegisteredModelPermission_SdkV2) SetInheritedFromObject(ctx context.Con } type RegisteredModelPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *RegisteredModelPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelPermissions_SdkV2) { @@ -7077,10 +7235,12 @@ func (newState *RegisteredModelPermissions_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *RegisteredModelPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermissions_SdkV2) { } -func (c RegisteredModelPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c RegisteredModelPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermissions. @@ -7149,9 +7309,9 @@ func (o *RegisteredModelPermissions_SdkV2) SetAccessControlList(ctx context.Cont } type RegisteredModelPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RegisteredModelPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelPermissionsDescription_SdkV2) { @@ -7160,9 +7320,11 @@ func (newState *RegisteredModelPermissionsDescription_SdkV2) SyncEffectiveFields func (newState *RegisteredModelPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermissionsDescription_SdkV2) { } -func (c RegisteredModelPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermissionsDescription. @@ -7199,7 +7361,7 @@ func (o RegisteredModelPermissionsDescription_SdkV2) Type(ctx context.Context) a } type RegisteredModelPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The registered model for which to get or manage permissions. RegisteredModelId types.String `tfsdk:"-"` } @@ -7210,11 +7372,11 @@ func (newState *RegisteredModelPermissionsRequest_SdkV2) SyncEffectiveFieldsDuri func (newState *RegisteredModelPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermissionsRequest_SdkV2) { } -func (c RegisteredModelPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "registered_model_id")...) +func (c RegisteredModelPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["registered_model_id"] = attrs["registered_model_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermissionsRequest. @@ -7282,9 +7444,9 @@ func (o *RegisteredModelPermissionsRequest_SdkV2) SetAccessControlList(ctx conte type RegistryWebhook_SdkV2 struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // User-specified description for the webhook. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -7318,17 +7480,17 @@ type RegistryWebhook_SdkV2 struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` - HttpUrlSpec types.List `tfsdk:"http_url_spec" tf:"optional,object"` + HttpUrlSpec types.List `tfsdk:"http_url_spec"` // Webhook ID - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - JobSpec types.List `tfsdk:"job_spec" tf:"optional,object"` + JobSpec types.List `tfsdk:"job_spec"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Name of the model whose events would trigger this webhook. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -7337,7 +7499,7 @@ type RegistryWebhook_SdkV2 struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *RegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegistryWebhook_SdkV2) { @@ -7346,11 +7508,20 @@ func (newState *RegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *RegistryWebhook_SdkV2) SyncEffectiveFieldsDuringRead(existingState RegistryWebhook_SdkV2) { } -func (c RegistryWebhook_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - HttpUrlSpecWithoutSecret_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "http_url_spec")...) - JobSpecWithoutSecret_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_spec")...) +func (c RegistryWebhook_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["events"] = attrs["events"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["job_spec"] = attrs["job_spec"].SetOptional() + attrs["job_spec"] = attrs["job_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegistryWebhook. @@ -7490,9 +7661,9 @@ func (o *RegistryWebhook_SdkV2) SetJobSpec(ctx context.Context, v JobSpecWithout type RejectTransitionRequest_SdkV2 struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -7502,9 +7673,9 @@ type RejectTransitionRequest_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *RejectTransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RejectTransitionRequest_SdkV2) { @@ -7513,12 +7684,13 @@ func (newState *RejectTransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *RejectTransitionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RejectTransitionRequest_SdkV2) { } -func (c RejectTransitionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c RejectTransitionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RejectTransitionRequest. @@ -7560,7 +7732,7 @@ func (o RejectTransitionRequest_SdkV2) Type(ctx context.Context) attr.Type { type RejectTransitionRequestResponse_SdkV2 struct { // Activity recorded for the action. - Activity types.List `tfsdk:"activity" tf:"optional,object"` + Activity types.List `tfsdk:"activity"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RejectTransitionRequestResponse. @@ -7626,9 +7798,9 @@ func (o *RejectTransitionRequestResponse_SdkV2) SetActivity(ctx context.Context, type RenameModelRequest_SdkV2 struct { // Registered model unique name identifier. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // If provided, updates the name for this `registered_model`. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` } func (newState *RenameModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RenameModelRequest_SdkV2) { @@ -7637,10 +7809,11 @@ func (newState *RenameModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *RenameModelRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RenameModelRequest_SdkV2) { } -func (c RenameModelRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c RenameModelRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RenameModelRequest. @@ -7677,7 +7850,7 @@ func (o RenameModelRequest_SdkV2) Type(ctx context.Context) attr.Type { } type RenameModelResponse_SdkV2 struct { - RegisteredModel types.List `tfsdk:"registered_model" tf:"optional,object"` + RegisteredModel types.List `tfsdk:"registered_model"` } func (newState *RenameModelResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RenameModelResponse_SdkV2) { @@ -7686,10 +7859,11 @@ func (newState *RenameModelResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RenameModelResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RenameModelResponse_SdkV2) { } -func (c RenameModelResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "registered_model")...) +func (c RenameModelResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["registered_model"] = attrs["registered_model"].SetOptional() + attrs["registered_model"] = attrs["registered_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RenameModelResponse. @@ -7755,7 +7929,7 @@ func (o *RenameModelResponse_SdkV2) SetRegisteredModel(ctx context.Context, v Mo type RestoreExperiment_SdkV2 struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` } func (newState *RestoreExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreExperiment_SdkV2) { @@ -7764,10 +7938,10 @@ func (newState *RestoreExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *RestoreExperiment_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestoreExperiment_SdkV2) { } -func (c RestoreExperiment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) +func (c RestoreExperiment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreExperiment. @@ -7810,9 +7984,9 @@ func (newState *RestoreExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *RestoreExperimentResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestoreExperimentResponse_SdkV2) { } -func (c RestoreExperimentResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestoreExperimentResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreExperimentResponse. @@ -7844,7 +8018,7 @@ func (o RestoreExperimentResponse_SdkV2) Type(ctx context.Context) attr.Type { type RestoreRun_SdkV2 struct { // ID of the run to restore. - RunId types.String `tfsdk:"run_id" tf:""` + RunId types.String `tfsdk:"run_id"` } func (newState *RestoreRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreRun_SdkV2) { @@ -7853,10 +8027,10 @@ func (newState *RestoreRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *RestoreRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestoreRun_SdkV2) { } -func (c RestoreRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c RestoreRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRun. @@ -7899,9 +8073,9 @@ func (newState *RestoreRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *RestoreRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestoreRunResponse_SdkV2) { } -func (c RestoreRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestoreRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRunResponse. @@ -7933,14 +8107,14 @@ func (o RestoreRunResponse_SdkV2) Type(ctx context.Context) attr.Type { type RestoreRuns_SdkV2 struct { // The ID of the experiment containing the runs to restore. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // An optional positive integer indicating the maximum number of runs to // restore. The maximum allowed value for max_runs is 10000. - MaxRuns types.Int64 `tfsdk:"max_runs" tf:"optional"` + MaxRuns types.Int64 `tfsdk:"max_runs"` // The minimum deletion timestamp in milliseconds since the UNIX epoch for // restoring runs. Only runs deleted no earlier than this timestamp are // restored. - MinTimestampMillis types.Int64 `tfsdk:"min_timestamp_millis" tf:""` + MinTimestampMillis types.Int64 `tfsdk:"min_timestamp_millis"` } func (newState *RestoreRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreRuns_SdkV2) { @@ -7949,11 +8123,12 @@ func (newState *RestoreRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RestoreRuns_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestoreRuns_SdkV2) { } -func (c RestoreRuns_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) - cs.SetRequired(append(path, "min_timestamp_millis")...) +func (c RestoreRuns_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["max_runs"] = attrs["max_runs"].SetOptional() + attrs["min_timestamp_millis"] = attrs["min_timestamp_millis"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRuns. @@ -7993,7 +8168,7 @@ func (o RestoreRuns_SdkV2) Type(ctx context.Context) attr.Type { type RestoreRunsResponse_SdkV2 struct { // The number of runs restored. - RunsRestored types.Int64 `tfsdk:"runs_restored" tf:"optional"` + RunsRestored types.Int64 `tfsdk:"runs_restored"` } func (newState *RestoreRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreRunsResponse_SdkV2) { @@ -8002,9 +8177,10 @@ func (newState *RestoreRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RestoreRunsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestoreRunsResponse_SdkV2) { } -func (c RestoreRunsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestoreRunsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["runs_restored"] = attrs["runs_restored"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRunsResponse. @@ -8040,11 +8216,11 @@ func (o RestoreRunsResponse_SdkV2) Type(ctx context.Context) attr.Type { type Run_SdkV2 struct { // Run data. - Data types.List `tfsdk:"data" tf:"optional,object"` + Data types.List `tfsdk:"data"` // Run metadata. - Info types.List `tfsdk:"info" tf:"optional,object"` + Info types.List `tfsdk:"info"` // Run inputs. - Inputs types.List `tfsdk:"inputs" tf:"optional,object"` + Inputs types.List `tfsdk:"inputs"` } func (newState *Run_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run_SdkV2) { @@ -8053,12 +8229,15 @@ func (newState *Run_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run_SdkV func (newState *Run_SdkV2) SyncEffectiveFieldsDuringRead(existingState Run_SdkV2) { } -func (c Run_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunData_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data")...) - RunInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "info")...) - RunInputs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "inputs")...) +func (c Run_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data"] = attrs["data"].SetOptional() + attrs["data"] = attrs["data"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["info"] = attrs["info"].SetOptional() + attrs["info"] = attrs["info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["inputs"] = attrs["inputs"].SetOptional() + attrs["inputs"] = attrs["inputs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Run. @@ -8186,11 +8365,11 @@ func (o *Run_SdkV2) SetInputs(ctx context.Context, v RunInputs_SdkV2) { type RunData_SdkV2 struct { // Run metrics. - Metrics types.List `tfsdk:"metrics" tf:"optional"` + Metrics types.List `tfsdk:"metrics"` // Run parameters. - Params types.List `tfsdk:"params" tf:"optional"` + Params types.List `tfsdk:"params"` // Additional metadata key-value pairs. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *RunData_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunData_SdkV2) { @@ -8199,12 +8378,12 @@ func (newState *RunData_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunD func (newState *RunData_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunData_SdkV2) { } -func (c RunData_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Metric_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) - Param_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "params")...) - RunTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c RunData_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["params"] = attrs["params"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunData. @@ -8335,26 +8514,26 @@ type RunInfo_SdkV2 struct { // local path (starting with "/"), or a distributed file system (DFS) path, // like `s3://bucket/directory` or `dbfs:/my/directory`. If not set, the // local `./mlruns` directory is chosen. - ArtifactUri types.String `tfsdk:"artifact_uri" tf:"optional"` + ArtifactUri types.String `tfsdk:"artifact_uri"` // Unix timestamp of when the run ended in milliseconds. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The experiment ID. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` // Current life cycle stage of the experiment : OneOf("active", "deleted") - LifecycleStage types.String `tfsdk:"lifecycle_stage" tf:"optional"` + LifecycleStage types.String `tfsdk:"lifecycle_stage"` // Unique identifier for the run. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] Unique identifier for the run. This // field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // Unix timestamp of when the run started in milliseconds. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Current status of the run. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // User who initiated the run. This field is deprecated as of MLflow 1.0, // and will be removed in a future MLflow release. Use 'mlflow.user' tag // instead. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *RunInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunInfo_SdkV2) { @@ -8363,9 +8542,18 @@ func (newState *RunInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunI func (newState *RunInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunInfo_SdkV2) { } -func (c RunInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_uri"] = attrs["artifact_uri"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() + attrs["lifecycle_stage"] = attrs["lifecycle_stage"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunInfo. @@ -8417,7 +8605,7 @@ func (o RunInfo_SdkV2) Type(ctx context.Context) attr.Type { type RunInputs_SdkV2 struct { // Run metrics. - DatasetInputs types.List `tfsdk:"dataset_inputs" tf:"optional"` + DatasetInputs types.List `tfsdk:"dataset_inputs"` } func (newState *RunInputs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunInputs_SdkV2) { @@ -8426,10 +8614,10 @@ func (newState *RunInputs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ru func (newState *RunInputs_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunInputs_SdkV2) { } -func (c RunInputs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DatasetInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dataset_inputs")...) +func (c RunInputs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataset_inputs"] = attrs["dataset_inputs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunInputs. @@ -8495,9 +8683,9 @@ func (o *RunInputs_SdkV2) SetDatasetInputs(ctx context.Context, v []DatasetInput type RunTag_SdkV2 struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *RunTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTag_SdkV2) { @@ -8506,9 +8694,11 @@ func (newState *RunTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTa func (newState *RunTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunTag_SdkV2) { } -func (c RunTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunTag. @@ -8547,19 +8737,19 @@ func (o RunTag_SdkV2) Type(ctx context.Context) attr.Type { type SearchExperiments_SdkV2 struct { // String representing a SQL filter condition (e.g. "name ILIKE // 'my-experiment%'") - Filter types.String `tfsdk:"filter" tf:"optional"` + Filter types.String `tfsdk:"filter"` // Maximum number of experiments desired. Max threshold is 3000. - MaxResults types.Int64 `tfsdk:"max_results" tf:"optional"` + MaxResults types.Int64 `tfsdk:"max_results"` // List of columns for ordering search results, which can include experiment // name and last updated timestamp with an optional "DESC" or "ASC" // annotation, where "ASC" is the default. Tiebreaks are done by experiment // id DESC. - OrderBy types.List `tfsdk:"order_by" tf:"optional"` + OrderBy types.List `tfsdk:"order_by"` // Token indicating the page of experiments to fetch - PageToken types.String `tfsdk:"page_token" tf:"optional"` + PageToken types.String `tfsdk:"page_token"` // Qualifier for type of experiments to be returned. If unspecified, return // only active experiments. - ViewType types.String `tfsdk:"view_type" tf:"optional"` + ViewType types.String `tfsdk:"view_type"` } func (newState *SearchExperiments_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchExperiments_SdkV2) { @@ -8568,9 +8758,14 @@ func (newState *SearchExperiments_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *SearchExperiments_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchExperiments_SdkV2) { } -func (c SearchExperiments_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SearchExperiments_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetOptional() + attrs["max_results"] = attrs["max_results"].SetOptional() + attrs["order_by"] = attrs["order_by"].SetOptional() + attrs["page_token"] = attrs["page_token"].SetOptional() + attrs["view_type"] = attrs["view_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchExperiments. @@ -8644,10 +8839,10 @@ func (o *SearchExperiments_SdkV2) SetOrderBy(ctx context.Context, v []types.Stri type SearchExperimentsResponse_SdkV2 struct { // Experiments that match the search criteria - Experiments types.List `tfsdk:"experiments" tf:"optional"` + Experiments types.List `tfsdk:"experiments"` // Token that can be used to retrieve the next page of experiments. An empty // token means that no more experiments are available for retrieval. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *SearchExperimentsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchExperimentsResponse_SdkV2) { @@ -8656,10 +8851,11 @@ func (newState *SearchExperimentsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *SearchExperimentsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchExperimentsResponse_SdkV2) { } -func (c SearchExperimentsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Experiment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "experiments")...) +func (c SearchExperimentsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiments"] = attrs["experiments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchExperimentsResponse. @@ -8810,10 +9006,10 @@ func (o *SearchModelVersionsRequest_SdkV2) SetOrderBy(ctx context.Context, v []t type SearchModelVersionsResponse_SdkV2 struct { // Models that match the search criteria - ModelVersions types.List `tfsdk:"model_versions" tf:"optional"` + ModelVersions types.List `tfsdk:"model_versions"` // Pagination token to request next page of models for the same search // query. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *SearchModelVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchModelVersionsResponse_SdkV2) { @@ -8822,10 +9018,11 @@ func (newState *SearchModelVersionsResponse_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *SearchModelVersionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchModelVersionsResponse_SdkV2) { } -func (c SearchModelVersionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "model_versions")...) +func (c SearchModelVersionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_versions"] = attrs["model_versions"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchModelVersionsResponse. @@ -8976,9 +9173,9 @@ func (o *SearchModelsRequest_SdkV2) SetOrderBy(ctx context.Context, v []types.St type SearchModelsResponse_SdkV2 struct { // Pagination token to request the next page of models. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Registered Models that match the search criteria. - RegisteredModels types.List `tfsdk:"registered_models" tf:"optional"` + RegisteredModels types.List `tfsdk:"registered_models"` } func (newState *SearchModelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchModelsResponse_SdkV2) { @@ -8987,10 +9184,11 @@ func (newState *SearchModelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SearchModelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchModelsResponse_SdkV2) { } -func (c SearchModelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "registered_models")...) +func (c SearchModelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["registered_models"] = attrs["registered_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchModelsResponse. @@ -9058,7 +9256,7 @@ func (o *SearchModelsResponse_SdkV2) SetRegisteredModels(ctx context.Context, v type SearchRuns_SdkV2 struct { // List of experiment IDs to search over. - ExperimentIds types.List `tfsdk:"experiment_ids" tf:"optional"` + ExperimentIds types.List `tfsdk:"experiment_ids"` // A filter expression over params, metrics, and tags, that allows returning // a subset of runs. The syntax is a subset of SQL that supports ANDing // together binary operations between a param, metric, or tag and a @@ -9071,21 +9269,21 @@ type SearchRuns_SdkV2 struct { // and tags."user-name" = 'Tomas'` // // Supported operators are `=`, `!=`, `>`, `>=`, `<`, and `<=`. - Filter types.String `tfsdk:"filter" tf:"optional"` + Filter types.String `tfsdk:"filter"` // Maximum number of runs desired. Max threshold is 50000 - MaxResults types.Int64 `tfsdk:"max_results" tf:"optional"` + MaxResults types.Int64 `tfsdk:"max_results"` // List of columns to be ordered by, including attributes, params, metrics, // and tags with an optional "DESC" or "ASC" annotation, where "ASC" is the // default. Example: ["params.input DESC", "metrics.alpha ASC", // "metrics.rmse"] Tiebreaks are done by start_time DESC followed by run_id // for runs with the same start time (and this is the default ordering // criterion if order_by is not provided). - OrderBy types.List `tfsdk:"order_by" tf:"optional"` + OrderBy types.List `tfsdk:"order_by"` // Token for the current page of runs. - PageToken types.String `tfsdk:"page_token" tf:"optional"` + PageToken types.String `tfsdk:"page_token"` // Whether to display only active, only deleted, or all runs. Defaults to // only active runs. - RunViewType types.String `tfsdk:"run_view_type" tf:"optional"` + RunViewType types.String `tfsdk:"run_view_type"` } func (newState *SearchRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchRuns_SdkV2) { @@ -9094,9 +9292,15 @@ func (newState *SearchRuns_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SearchRuns_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchRuns_SdkV2) { } -func (c SearchRuns_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SearchRuns_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_ids"] = attrs["experiment_ids"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() + attrs["max_results"] = attrs["max_results"].SetOptional() + attrs["order_by"] = attrs["order_by"].SetOptional() + attrs["page_token"] = attrs["page_token"].SetOptional() + attrs["run_view_type"] = attrs["run_view_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchRuns. @@ -9201,9 +9405,9 @@ func (o *SearchRuns_SdkV2) SetOrderBy(ctx context.Context, v []types.String) { type SearchRunsResponse_SdkV2 struct { // Token for the next page of runs. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Runs that match the search criteria. - Runs types.List `tfsdk:"runs" tf:"optional"` + Runs types.List `tfsdk:"runs"` } func (newState *SearchRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchRunsResponse_SdkV2) { @@ -9212,10 +9416,11 @@ func (newState *SearchRunsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *SearchRunsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SearchRunsResponse_SdkV2) { } -func (c SearchRunsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Run_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "runs")...) +func (c SearchRunsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["runs"] = attrs["runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchRunsResponse. @@ -9283,14 +9488,14 @@ func (o *SearchRunsResponse_SdkV2) SetRuns(ctx context.Context, v []Run_SdkV2) { type SetExperimentTag_SdkV2 struct { // ID of the experiment under which to log the tag. Must be provided. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // Name of the tag. Maximum size depends on storage backend. All storage // backends are guaranteed to support key values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *SetExperimentTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetExperimentTag_SdkV2) { @@ -9299,12 +9504,12 @@ func (newState *SetExperimentTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SetExperimentTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetExperimentTag_SdkV2) { } -func (c SetExperimentTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "value")...) +func (c SetExperimentTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["key"] = attrs["key"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetExperimentTag. @@ -9351,9 +9556,9 @@ func (newState *SetExperimentTagResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *SetExperimentTagResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetExperimentTagResponse_SdkV2) { } -func (c SetExperimentTagResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetExperimentTagResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetExperimentTagResponse. @@ -9388,13 +9593,13 @@ type SetModelTagRequest_SdkV2 struct { // this name already exists, its preexisting value will be replaced by the // specified `value`. All storage backends are guaranteed to support key // values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Unique name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *SetModelTagRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetModelTagRequest_SdkV2) { @@ -9403,12 +9608,12 @@ func (newState *SetModelTagRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *SetModelTagRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetModelTagRequest_SdkV2) { } -func (c SetModelTagRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "value")...) +func (c SetModelTagRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelTagRequest. @@ -9455,9 +9660,9 @@ func (newState *SetModelTagResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *SetModelTagResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetModelTagResponse_SdkV2) { } -func (c SetModelTagResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetModelTagResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelTagResponse. @@ -9492,15 +9697,15 @@ type SetModelVersionTagRequest_SdkV2 struct { // this name already exists, its preexisting value will be replaced by the // specified `value`. All storage backends are guaranteed to support key // values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Unique name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` // Model version number. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *SetModelVersionTagRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetModelVersionTagRequest_SdkV2) { @@ -9509,13 +9714,13 @@ func (newState *SetModelVersionTagRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *SetModelVersionTagRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetModelVersionTagRequest_SdkV2) { } -func (c SetModelVersionTagRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "value")...) - cs.SetRequired(append(path, "version")...) +func (c SetModelVersionTagRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelVersionTagRequest. @@ -9564,9 +9769,9 @@ func (newState *SetModelVersionTagResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *SetModelVersionTagResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetModelVersionTagResponse_SdkV2) { } -func (c SetModelVersionTagResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetModelVersionTagResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelVersionTagResponse. @@ -9599,16 +9804,16 @@ func (o SetModelVersionTagResponse_SdkV2) Type(ctx context.Context) attr.Type { type SetTag_SdkV2 struct { // Name of the tag. Maximum size depends on storage backend. All storage // backends are guaranteed to support key values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run under which to log the tag. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run under which to log the // tag. This field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *SetTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetTag_SdkV2) { @@ -9617,11 +9822,13 @@ func (newState *SetTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetTa func (newState *SetTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetTag_SdkV2) { } -func (c SetTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "value")...) +func (c SetTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetTag. @@ -9670,9 +9877,9 @@ func (newState *SetTagResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SetTagResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetTagResponse_SdkV2) { } -func (c SetTagResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetTagResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetTagResponse. @@ -9705,9 +9912,9 @@ func (o SetTagResponse_SdkV2) Type(ctx context.Context) attr.Type { // Test webhook response object. type TestRegistryWebhook_SdkV2 struct { // Body of the response from the webhook URL - Body types.String `tfsdk:"body" tf:"optional"` + Body types.String `tfsdk:"body"` // Status code returned by the webhook URL - StatusCode types.Int64 `tfsdk:"status_code" tf:"optional"` + StatusCode types.Int64 `tfsdk:"status_code"` } func (newState *TestRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TestRegistryWebhook_SdkV2) { @@ -9716,9 +9923,11 @@ func (newState *TestRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *TestRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringRead(existingState TestRegistryWebhook_SdkV2) { } -func (c TestRegistryWebhook_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TestRegistryWebhook_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["body"] = attrs["body"].SetOptional() + attrs["status_code"] = attrs["status_code"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TestRegistryWebhook. @@ -9758,9 +9967,9 @@ type TestRegistryWebhookRequest_SdkV2 struct { // If `event` is specified, the test trigger uses the specified event. If // `event` is not specified, the test trigger uses a randomly chosen event // associated with the webhook. - Event types.String `tfsdk:"event" tf:"optional"` + Event types.String `tfsdk:"event"` // Webhook ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *TestRegistryWebhookRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TestRegistryWebhookRequest_SdkV2) { @@ -9769,10 +9978,11 @@ func (newState *TestRegistryWebhookRequest_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *TestRegistryWebhookRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState TestRegistryWebhookRequest_SdkV2) { } -func (c TestRegistryWebhookRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c TestRegistryWebhookRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["event"] = attrs["event"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TestRegistryWebhookRequest. @@ -9810,7 +10020,7 @@ func (o TestRegistryWebhookRequest_SdkV2) Type(ctx context.Context) attr.Type { type TestRegistryWebhookResponse_SdkV2 struct { // Test webhook response object. - Webhook types.List `tfsdk:"webhook" tf:"optional,object"` + Webhook types.List `tfsdk:"webhook"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TestRegistryWebhookResponse. @@ -9877,11 +10087,11 @@ func (o *TestRegistryWebhookResponse_SdkV2) SetWebhook(ctx context.Context, v Te type TransitionModelVersionStageDatabricks_SdkV2 struct { // Specifies whether to archive all current model versions in the target // stage. - ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions" tf:""` + ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions"` // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -9891,9 +10101,9 @@ type TransitionModelVersionStageDatabricks_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *TransitionModelVersionStageDatabricks_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TransitionModelVersionStageDatabricks_SdkV2) { @@ -9902,13 +10112,14 @@ func (newState *TransitionModelVersionStageDatabricks_SdkV2) SyncEffectiveFields func (newState *TransitionModelVersionStageDatabricks_SdkV2) SyncEffectiveFieldsDuringRead(existingState TransitionModelVersionStageDatabricks_SdkV2) { } -func (c TransitionModelVersionStageDatabricks_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "archive_existing_versions")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c TransitionModelVersionStageDatabricks_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["archive_existing_versions"] = attrs["archive_existing_versions"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransitionModelVersionStageDatabricks. @@ -9953,11 +10164,11 @@ func (o TransitionModelVersionStageDatabricks_SdkV2) Type(ctx context.Context) a // Transition request details. type TransitionRequest_SdkV2 struct { // Array of actions on the activity allowed for the current viewer. - AvailableActions types.List `tfsdk:"available_actions" tf:"optional"` + AvailableActions types.List `tfsdk:"available_actions"` // User-provided comment associated with the transition request. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Target stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -9968,9 +10179,9 @@ type TransitionRequest_SdkV2 struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - ToStage types.String `tfsdk:"to_stage" tf:"optional"` + ToStage types.String `tfsdk:"to_stage"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *TransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TransitionRequest_SdkV2) { @@ -9979,9 +10190,14 @@ func (newState *TransitionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *TransitionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState TransitionRequest_SdkV2) { } -func (c TransitionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TransitionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["available_actions"] = attrs["available_actions"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["to_stage"] = attrs["to_stage"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransitionRequest. @@ -10054,7 +10270,7 @@ func (o *TransitionRequest_SdkV2) SetAvailableActions(ctx context.Context, v []t } type TransitionStageResponse_SdkV2 struct { - ModelVersion types.List `tfsdk:"model_version" tf:"optional,object"` + ModelVersion types.List `tfsdk:"model_version"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransitionStageResponse. @@ -10120,9 +10336,9 @@ func (o *TransitionStageResponse_SdkV2) SetModelVersion(ctx context.Context, v M type UpdateComment_SdkV2 struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:""` + Comment types.String `tfsdk:"comment"` // Unique identifier of an activity - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *UpdateComment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateComment_SdkV2) { @@ -10131,11 +10347,11 @@ func (newState *UpdateComment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *UpdateComment_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateComment_SdkV2) { } -func (c UpdateComment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "comment")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateComment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateComment. @@ -10173,7 +10389,7 @@ func (o UpdateComment_SdkV2) Type(ctx context.Context) attr.Type { type UpdateCommentResponse_SdkV2 struct { // Comment details. - Comment types.List `tfsdk:"comment" tf:"optional,object"` + Comment types.List `tfsdk:"comment"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCommentResponse. @@ -10239,10 +10455,10 @@ func (o *UpdateCommentResponse_SdkV2) SetComment(ctx context.Context, v CommentO type UpdateExperiment_SdkV2 struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // If provided, the experiment's name is changed to the new name. The new // name must be unique. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` } func (newState *UpdateExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExperiment_SdkV2) { @@ -10251,10 +10467,11 @@ func (newState *UpdateExperiment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateExperiment_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExperiment_SdkV2) { } -func (c UpdateExperiment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) +func (c UpdateExperiment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExperiment. @@ -10299,9 +10516,9 @@ func (newState *UpdateExperimentResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *UpdateExperimentResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateExperimentResponse_SdkV2) { } -func (c UpdateExperimentResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateExperimentResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExperimentResponse. @@ -10333,9 +10550,9 @@ func (o UpdateExperimentResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateModelRequest_SdkV2 struct { // If provided, updates the description for this `registered_model`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Registered model unique name identifier. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *UpdateModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateModelRequest_SdkV2) { @@ -10344,10 +10561,11 @@ func (newState *UpdateModelRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateModelRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateModelRequest_SdkV2) { } -func (c UpdateModelRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateModelRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateModelRequest. @@ -10415,11 +10633,11 @@ func (o UpdateModelResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateModelVersionRequest_SdkV2 struct { // If provided, updates the description for this `registered_model`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Name of the registered model - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Model version number - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *UpdateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateModelVersionRequest_SdkV2) { @@ -10428,11 +10646,12 @@ func (newState *UpdateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *UpdateModelVersionRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateModelVersionRequest_SdkV2) { } -func (c UpdateModelVersionRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "version")...) +func (c UpdateModelVersionRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateModelVersionRequest. @@ -10502,7 +10721,7 @@ func (o UpdateModelVersionResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateRegistryWebhook_SdkV2 struct { // User-specified description for the webhook. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -10536,13 +10755,13 @@ type UpdateRegistryWebhook_SdkV2 struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` - HttpUrlSpec types.List `tfsdk:"http_url_spec" tf:"optional,object"` + HttpUrlSpec types.List `tfsdk:"http_url_spec"` // Webhook ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` - JobSpec types.List `tfsdk:"job_spec" tf:"optional,object"` + JobSpec types.List `tfsdk:"job_spec"` // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -10551,7 +10770,7 @@ type UpdateRegistryWebhook_SdkV2 struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *UpdateRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRegistryWebhook_SdkV2) { @@ -10560,12 +10779,17 @@ func (newState *UpdateRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *UpdateRegistryWebhook_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRegistryWebhook_SdkV2) { } -func (c UpdateRegistryWebhook_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - HttpUrlSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "http_url_spec")...) - cs.SetRequired(append(path, "id")...) - JobSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "job_spec")...) +func (c UpdateRegistryWebhook_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["events"] = attrs["events"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetRequired() + attrs["job_spec"] = attrs["job_spec"].SetOptional() + attrs["job_spec"] = attrs["job_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRegistryWebhook. @@ -10699,14 +10923,14 @@ func (o *UpdateRegistryWebhook_SdkV2) SetJobSpec(ctx context.Context, v JobSpec_ type UpdateRun_SdkV2 struct { // Unix timestamp in milliseconds of when the run ended. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // ID of the run to update. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run to update.. This field // will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // Updated status of the run. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *UpdateRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRun_SdkV2) { @@ -10715,9 +10939,13 @@ func (newState *UpdateRun_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Up func (newState *UpdateRun_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRun_SdkV2) { } -func (c UpdateRun_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRun. @@ -10759,7 +10987,7 @@ func (o UpdateRun_SdkV2) Type(ctx context.Context) attr.Type { type UpdateRunResponse_SdkV2 struct { // Updated metadata of the run. - RunInfo types.List `tfsdk:"run_info" tf:"optional,object"` + RunInfo types.List `tfsdk:"run_info"` } func (newState *UpdateRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRunResponse_SdkV2) { @@ -10768,10 +10996,11 @@ func (newState *UpdateRunResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateRunResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRunResponse_SdkV2) { } -func (c UpdateRunResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "run_info")...) +func (c UpdateRunResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_info"] = attrs["run_info"].SetOptional() + attrs["run_info"] = attrs["run_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRunResponse. diff --git a/internal/service/ml_tf/model.go b/internal/service/ml_tf/model.go index 80b631a61..703350c3b 100755 --- a/internal/service/ml_tf/model.go +++ b/internal/service/ml_tf/model.go @@ -38,11 +38,11 @@ type Activity struct { // // * `SYSTEM_TRANSITION`: For events performed as a side effect, such as // archiving existing model versions in a stage. - ActivityType types.String `tfsdk:"activity_type" tf:"optional"` + ActivityType types.String `tfsdk:"activity_type"` // User-provided comment associated with the activity. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Source stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -53,16 +53,16 @@ type Activity struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - FromStage types.String `tfsdk:"from_stage" tf:"optional"` + FromStage types.String `tfsdk:"from_stage"` // Unique identifier for the object. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Comment made by system, for example explaining an activity of type // `SYSTEM_TRANSITION`. It usually describes a side effect, such as a // version being archived as part of another version's stage transition, and // may not be returned for some activity types. - SystemComment types.String `tfsdk:"system_comment" tf:"optional"` + SystemComment types.String `tfsdk:"system_comment"` // Target stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -73,9 +73,9 @@ type Activity struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - ToStage types.String `tfsdk:"to_stage" tf:"optional"` + ToStage types.String `tfsdk:"to_stage"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *Activity) SyncEffectiveFieldsDuringCreateOrUpdate(plan Activity) { @@ -84,9 +84,18 @@ func (newState *Activity) SyncEffectiveFieldsDuringCreateOrUpdate(plan Activity) func (newState *Activity) SyncEffectiveFieldsDuringRead(existingState Activity) { } -func (c Activity) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Activity) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activity_type"] = attrs["activity_type"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["from_stage"] = attrs["from_stage"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["system_comment"] = attrs["system_comment"].SetOptional() + attrs["to_stage"] = attrs["to_stage"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Activity. @@ -139,11 +148,11 @@ func (o Activity) Type(ctx context.Context) attr.Type { type ApproveTransitionRequest struct { // Specifies whether to archive all current model versions in the target // stage. - ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions" tf:""` + ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions"` // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -153,9 +162,9 @@ type ApproveTransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *ApproveTransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ApproveTransitionRequest) { @@ -164,13 +173,14 @@ func (newState *ApproveTransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ApproveTransitionRequest) SyncEffectiveFieldsDuringRead(existingState ApproveTransitionRequest) { } -func (c ApproveTransitionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "archive_existing_versions")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c ApproveTransitionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["archive_existing_versions"] = attrs["archive_existing_versions"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ApproveTransitionRequest. @@ -214,7 +224,7 @@ func (o ApproveTransitionRequest) Type(ctx context.Context) attr.Type { type ApproveTransitionRequestResponse struct { // Activity recorded for the action. - Activity types.Object `tfsdk:"activity" tf:"optional,object"` + Activity types.Object `tfsdk:"activity"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ApproveTransitionRequestResponse. @@ -281,17 +291,17 @@ func (o *ApproveTransitionRequestResponse) SetActivity(ctx context.Context, v Ac // Comment details. type CommentObject struct { // Array of actions on the activity allowed for the current viewer. - AvailableActions types.List `tfsdk:"available_actions" tf:"optional"` + AvailableActions types.List `tfsdk:"available_actions"` // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Comment ID - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *CommentObject) SyncEffectiveFieldsDuringCreateOrUpdate(plan CommentObject) { @@ -300,9 +310,15 @@ func (newState *CommentObject) SyncEffectiveFieldsDuringCreateOrUpdate(plan Comm func (newState *CommentObject) SyncEffectiveFieldsDuringRead(existingState CommentObject) { } -func (c CommentObject) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CommentObject) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["available_actions"] = attrs["available_actions"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CommentObject. @@ -378,11 +394,11 @@ func (o *CommentObject) SetAvailableActions(ctx context.Context, v []types.Strin type CreateComment struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:""` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *CreateComment) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateComment) { @@ -391,12 +407,12 @@ func (newState *CreateComment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Crea func (newState *CreateComment) SyncEffectiveFieldsDuringRead(existingState CreateComment) { } -func (c CreateComment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "comment")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "version")...) +func (c CreateComment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateComment. @@ -436,7 +452,7 @@ func (o CreateComment) Type(ctx context.Context) attr.Type { type CreateCommentResponse struct { // Comment details. - Comment types.Object `tfsdk:"comment" tf:"optional,object"` + Comment types.Object `tfsdk:"comment"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCommentResponse. @@ -503,15 +519,15 @@ func (o *CreateCommentResponse) SetComment(ctx context.Context, v CommentObject) type CreateExperiment struct { // Location where all artifacts for the experiment are stored. If not // provided, the remote server will select an appropriate default. - ArtifactLocation types.String `tfsdk:"artifact_location" tf:"optional"` + ArtifactLocation types.String `tfsdk:"artifact_location"` // Experiment name. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // A collection of tags to set on the experiment. Maximum tag size and // number of tags per request depends on the storage backend. All storage // backends are guaranteed to support tag keys up to 250 bytes in size and // tag values up to 5000 bytes in size. All storage backends are also // guaranteed to support up to 20 tags per request. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExperiment) { @@ -520,11 +536,12 @@ func (newState *CreateExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *CreateExperiment) SyncEffectiveFieldsDuringRead(existingState CreateExperiment) { } -func (c CreateExperiment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - ExperimentTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateExperiment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_location"] = attrs["artifact_location"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExperiment. @@ -594,7 +611,7 @@ func (o *CreateExperiment) SetTags(ctx context.Context, v []ExperimentTag) { type CreateExperimentResponse struct { // Unique identifier for the experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` } func (newState *CreateExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateExperimentResponse) { @@ -603,9 +620,10 @@ func (newState *CreateExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateExperimentResponse) SyncEffectiveFieldsDuringRead(existingState CreateExperimentResponse) { } -func (c CreateExperimentResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateExperimentResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateExperimentResponse. @@ -641,11 +659,11 @@ func (o CreateExperimentResponse) Type(ctx context.Context) attr.Type { type CreateModelRequest struct { // Optional description for registered model. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Register models under this name - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Additional metadata for registered model. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelRequest) { @@ -654,11 +672,12 @@ func (newState *CreateModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateModelRequest) SyncEffectiveFieldsDuringRead(existingState CreateModelRequest) { } -func (c CreateModelRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - ModelTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateModelRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelRequest. @@ -727,7 +746,7 @@ func (o *CreateModelRequest) SetTags(ctx context.Context, v []ModelTag) { } type CreateModelResponse struct { - RegisteredModel types.Object `tfsdk:"registered_model" tf:"optional,object"` + RegisteredModel types.Object `tfsdk:"registered_model"` } func (newState *CreateModelResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelResponse) { @@ -736,10 +755,10 @@ func (newState *CreateModelResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateModelResponse) SyncEffectiveFieldsDuringRead(existingState CreateModelResponse) { } -func (c CreateModelResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model{}.ApplySchemaCustomizations(cs, append(path, "registered_model")...) +func (c CreateModelResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["registered_model"] = attrs["registered_model"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelResponse. @@ -805,19 +824,19 @@ func (o *CreateModelResponse) SetRegisteredModel(ctx context.Context, v Model) { type CreateModelVersionRequest struct { // Optional description for model version. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Register model under this name - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // MLflow run ID for correlation, if `source` was generated by an experiment // run in MLflow tracking server - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // MLflow run link - this is the exact link of the run that generated this // model version, potentially hosted at another instance of MLflow. - RunLink types.String `tfsdk:"run_link" tf:"optional"` + RunLink types.String `tfsdk:"run_link"` // URI indicating the location of the model artifacts. - Source types.String `tfsdk:"source" tf:""` + Source types.String `tfsdk:"source"` // Additional metadata for model version. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateModelVersionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelVersionRequest) { @@ -826,12 +845,15 @@ func (newState *CreateModelVersionRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateModelVersionRequest) SyncEffectiveFieldsDuringRead(existingState CreateModelVersionRequest) { } -func (c CreateModelVersionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "source")...) - ModelVersionTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateModelVersionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_link"] = attrs["run_link"].SetOptional() + attrs["source"] = attrs["source"].SetRequired() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelVersionRequest. @@ -907,7 +929,7 @@ func (o *CreateModelVersionRequest) SetTags(ctx context.Context, v []ModelVersio type CreateModelVersionResponse struct { // Return new version number generated for this model in registry. - ModelVersion types.Object `tfsdk:"model_version" tf:"optional,object"` + ModelVersion types.Object `tfsdk:"model_version"` } func (newState *CreateModelVersionResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateModelVersionResponse) { @@ -916,10 +938,10 @@ func (newState *CreateModelVersionResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateModelVersionResponse) SyncEffectiveFieldsDuringRead(existingState CreateModelVersionResponse) { } -func (c CreateModelVersionResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion{}.ApplySchemaCustomizations(cs, append(path, "model_version")...) +func (c CreateModelVersionResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_version"] = attrs["model_version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateModelVersionResponse. @@ -985,7 +1007,7 @@ func (o *CreateModelVersionResponse) SetModelVersion(ctx context.Context, v Mode type CreateRegistryWebhook struct { // User-specified description for the webhook. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -1019,13 +1041,13 @@ type CreateRegistryWebhook struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events types.List `tfsdk:"events" tf:""` + Events types.List `tfsdk:"events"` - HttpUrlSpec types.Object `tfsdk:"http_url_spec" tf:"optional,object"` + HttpUrlSpec types.Object `tfsdk:"http_url_spec"` - JobSpec types.Object `tfsdk:"job_spec" tf:"optional,object"` + JobSpec types.Object `tfsdk:"job_spec"` // Name of the model whose events would trigger this webhook. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -1034,7 +1056,7 @@ type CreateRegistryWebhook struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *CreateRegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRegistryWebhook) { @@ -1043,12 +1065,15 @@ func (newState *CreateRegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateRegistryWebhook) SyncEffectiveFieldsDuringRead(existingState CreateRegistryWebhook) { } -func (c CreateRegistryWebhook) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "events")...) - HttpUrlSpec{}.ApplySchemaCustomizations(cs, append(path, "http_url_spec")...) - JobSpec{}.ApplySchemaCustomizations(cs, append(path, "job_spec")...) +func (c CreateRegistryWebhook) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["events"] = attrs["events"].SetRequired() + attrs["http_url_spec"] = attrs["http_url_spec"].SetOptional() + attrs["job_spec"] = attrs["job_spec"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRegistryWebhook. @@ -1182,15 +1207,15 @@ func (o *CreateRegistryWebhook) SetJobSpec(ctx context.Context, v JobSpec) { type CreateRun struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` // Unix timestamp in milliseconds of when the run started. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Additional metadata for run. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // ID of the user executing the run. This field is deprecated as of MLflow // 1.0, and will be removed in a future MLflow release. Use 'mlflow.user' // tag instead. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *CreateRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRun) { @@ -1199,10 +1224,13 @@ func (newState *CreateRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRu func (newState *CreateRun) SyncEffectiveFieldsDuringRead(existingState CreateRun) { } -func (c CreateRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRun. @@ -1274,7 +1302,7 @@ func (o *CreateRun) SetTags(ctx context.Context, v []RunTag) { type CreateRunResponse struct { // The newly created run. - Run types.Object `tfsdk:"run" tf:"optional,object"` + Run types.Object `tfsdk:"run"` } func (newState *CreateRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRunResponse) { @@ -1283,10 +1311,10 @@ func (newState *CreateRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateRunResponse) SyncEffectiveFieldsDuringRead(existingState CreateRunResponse) { } -func (c CreateRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Run{}.ApplySchemaCustomizations(cs, append(path, "run")...) +func (c CreateRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run"] = attrs["run"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRunResponse. @@ -1352,9 +1380,9 @@ func (o *CreateRunResponse) SetRun(ctx context.Context, v Run) { type CreateTransitionRequest struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -1364,9 +1392,9 @@ type CreateTransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *CreateTransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTransitionRequest) { @@ -1375,12 +1403,13 @@ func (newState *CreateTransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateTransitionRequest) SyncEffectiveFieldsDuringRead(existingState CreateTransitionRequest) { } -func (c CreateTransitionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c CreateTransitionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTransitionRequest. @@ -1422,7 +1451,7 @@ func (o CreateTransitionRequest) Type(ctx context.Context) attr.Type { type CreateTransitionRequestResponse struct { // Transition request details. - Request types.Object `tfsdk:"request" tf:"optional,object"` + Request types.Object `tfsdk:"request"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTransitionRequestResponse. @@ -1487,7 +1516,7 @@ func (o *CreateTransitionRequestResponse) SetRequest(ctx context.Context, v Tran } type CreateWebhookResponse struct { - Webhook types.Object `tfsdk:"webhook" tf:"optional,object"` + Webhook types.Object `tfsdk:"webhook"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWebhookResponse. @@ -1554,24 +1583,24 @@ func (o *CreateWebhookResponse) SetWebhook(ctx context.Context, v RegistryWebhoo type Dataset struct { // Dataset digest, e.g. an md5 hash of the dataset that uniquely identifies // it within datasets of the same name. - Digest types.String `tfsdk:"digest" tf:"optional"` + Digest types.String `tfsdk:"digest"` // The name of the dataset. E.g. “my.uc.table@2” “nyc-taxi-dataset”, // “fantastic-elk-3” - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The profile of the dataset. Summary statistics for the dataset, such as // the number of rows in a table, the mean / std / mode of each column in a // table, or the number of elements in an array. - Profile types.String `tfsdk:"profile" tf:"optional"` + Profile types.String `tfsdk:"profile"` // The schema of the dataset. E.g., MLflow ColSpec JSON for a dataframe, // MLflow TensorSpec JSON for an ndarray, or another schema format. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // The type of the dataset source, e.g. ‘databricks-uc-table’, // ‘DBFS’, ‘S3’, ... - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Source information for the dataset. Note that the source may not exactly // reproduce the dataset if it was transformed / modified before use with // MLflow. - SourceType types.String `tfsdk:"source_type" tf:"optional"` + SourceType types.String `tfsdk:"source_type"` } func (newState *Dataset) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dataset) { @@ -1580,9 +1609,15 @@ func (newState *Dataset) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dataset) { func (newState *Dataset) SyncEffectiveFieldsDuringRead(existingState Dataset) { } -func (c Dataset) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Dataset) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["digest"] = attrs["digest"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["profile"] = attrs["profile"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["source_type"] = attrs["source_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dataset. @@ -1628,10 +1663,10 @@ func (o Dataset) Type(ctx context.Context) attr.Type { type DatasetInput struct { // The dataset being used as a Run input. - Dataset types.Object `tfsdk:"dataset" tf:"optional,object"` + Dataset types.Object `tfsdk:"dataset"` // A list of tags for the dataset input, e.g. a “context” tag with value // “training” - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *DatasetInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatasetInput) { @@ -1640,11 +1675,11 @@ func (newState *DatasetInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan Datas func (newState *DatasetInput) SyncEffectiveFieldsDuringRead(existingState DatasetInput) { } -func (c DatasetInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Dataset{}.ApplySchemaCustomizations(cs, append(path, "dataset")...) - InputTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c DatasetInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataset"] = attrs["dataset"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatasetInput. @@ -1807,7 +1842,7 @@ func (o DeleteCommentResponse) Type(ctx context.Context) attr.Type { type DeleteExperiment struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` } func (newState *DeleteExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteExperiment) { @@ -1816,10 +1851,10 @@ func (newState *DeleteExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan D func (newState *DeleteExperiment) SyncEffectiveFieldsDuringRead(existingState DeleteExperiment) { } -func (c DeleteExperiment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) +func (c DeleteExperiment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExperiment. @@ -1862,9 +1897,9 @@ func (newState *DeleteExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *DeleteExperimentResponse) SyncEffectiveFieldsDuringRead(existingState DeleteExperimentResponse) { } -func (c DeleteExperimentResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteExperimentResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteExperimentResponse. @@ -2182,7 +2217,7 @@ func (o DeleteModelVersionTagResponse) Type(ctx context.Context) attr.Type { type DeleteRun struct { // ID of the run to delete. - RunId types.String `tfsdk:"run_id" tf:""` + RunId types.String `tfsdk:"run_id"` } func (newState *DeleteRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRun) { @@ -2191,10 +2226,10 @@ func (newState *DeleteRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRu func (newState *DeleteRun) SyncEffectiveFieldsDuringRead(existingState DeleteRun) { } -func (c DeleteRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c DeleteRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRun. @@ -2237,9 +2272,9 @@ func (newState *DeleteRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteRunResponse) SyncEffectiveFieldsDuringRead(existingState DeleteRunResponse) { } -func (c DeleteRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRunResponse. @@ -2271,14 +2306,14 @@ func (o DeleteRunResponse) Type(ctx context.Context) attr.Type { type DeleteRuns struct { // The ID of the experiment containing the runs to delete. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // An optional positive integer indicating the maximum number of runs to // delete. The maximum allowed value for max_runs is 10000. - MaxRuns types.Int64 `tfsdk:"max_runs" tf:"optional"` + MaxRuns types.Int64 `tfsdk:"max_runs"` // The maximum creation timestamp in milliseconds since the UNIX epoch for // deleting runs. Only runs created prior to or at this timestamp are // deleted. - MaxTimestampMillis types.Int64 `tfsdk:"max_timestamp_millis" tf:""` + MaxTimestampMillis types.Int64 `tfsdk:"max_timestamp_millis"` } func (newState *DeleteRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRuns) { @@ -2287,11 +2322,12 @@ func (newState *DeleteRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteR func (newState *DeleteRuns) SyncEffectiveFieldsDuringRead(existingState DeleteRuns) { } -func (c DeleteRuns) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) - cs.SetRequired(append(path, "max_timestamp_millis")...) +func (c DeleteRuns) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["max_runs"] = attrs["max_runs"].SetOptional() + attrs["max_timestamp_millis"] = attrs["max_timestamp_millis"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRuns. @@ -2331,7 +2367,7 @@ func (o DeleteRuns) Type(ctx context.Context) attr.Type { type DeleteRunsResponse struct { // The number of runs deleted. - RunsDeleted types.Int64 `tfsdk:"runs_deleted" tf:"optional"` + RunsDeleted types.Int64 `tfsdk:"runs_deleted"` } func (newState *DeleteRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRunsResponse) { @@ -2340,9 +2376,10 @@ func (newState *DeleteRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteRunsResponse) SyncEffectiveFieldsDuringRead(existingState DeleteRunsResponse) { } -func (c DeleteRunsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteRunsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["runs_deleted"] = attrs["runs_deleted"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRunsResponse. @@ -2378,9 +2415,9 @@ func (o DeleteRunsResponse) Type(ctx context.Context) attr.Type { type DeleteTag struct { // Name of the tag. Maximum size is 255 bytes. Must be provided. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run that the tag was logged under. Must be provided. - RunId types.String `tfsdk:"run_id" tf:""` + RunId types.String `tfsdk:"run_id"` } func (newState *DeleteTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteTag) { @@ -2389,11 +2426,11 @@ func (newState *DeleteTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteTa func (newState *DeleteTag) SyncEffectiveFieldsDuringRead(existingState DeleteTag) { } -func (c DeleteTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "run_id")...) +func (c DeleteTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteTag. @@ -2438,9 +2475,9 @@ func (newState *DeleteTagResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteTagResponse) SyncEffectiveFieldsDuringRead(existingState DeleteTagResponse) { } -func (c DeleteTagResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteTagResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteTagResponse. @@ -2632,20 +2669,20 @@ func (o DeleteWebhookResponse) Type(ctx context.Context) attr.Type { type Experiment struct { // Location where artifacts for the experiment are stored. - ArtifactLocation types.String `tfsdk:"artifact_location" tf:"optional"` + ArtifactLocation types.String `tfsdk:"artifact_location"` // Creation time - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Unique identifier for the experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` // Last update time - LastUpdateTime types.Int64 `tfsdk:"last_update_time" tf:"optional"` + LastUpdateTime types.Int64 `tfsdk:"last_update_time"` // Current life cycle stage of the experiment: "active" or "deleted". // Deleted experiments are not returned by APIs. - LifecycleStage types.String `tfsdk:"lifecycle_stage" tf:"optional"` + LifecycleStage types.String `tfsdk:"lifecycle_stage"` // Human readable name that identifies the experiment. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Tags: Additional metadata key-value pairs. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *Experiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Experiment) { @@ -2654,10 +2691,16 @@ func (newState *Experiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Experim func (newState *Experiment) SyncEffectiveFieldsDuringRead(existingState Experiment) { } -func (c Experiment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c Experiment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_location"] = attrs["artifact_location"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() + attrs["last_update_time"] = attrs["last_update_time"].SetOptional() + attrs["lifecycle_stage"] = attrs["lifecycle_stage"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Experiment. @@ -2735,13 +2778,13 @@ func (o *Experiment) SetTags(ctx context.Context, v []ExperimentTag) { type ExperimentAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ExperimentAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentAccessControlRequest) { @@ -2750,9 +2793,13 @@ func (newState *ExperimentAccessControlRequest) SyncEffectiveFieldsDuringCreateO func (newState *ExperimentAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState ExperimentAccessControlRequest) { } -func (c ExperimentAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentAccessControlRequest. @@ -2794,15 +2841,15 @@ func (o ExperimentAccessControlRequest) Type(ctx context.Context) attr.Type { type ExperimentAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ExperimentAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentAccessControlResponse) { @@ -2811,10 +2858,14 @@ func (newState *ExperimentAccessControlResponse) SyncEffectiveFieldsDuringCreate func (newState *ExperimentAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState ExperimentAccessControlResponse) { } -func (c ExperimentAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ExperimentAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentAccessControlResponse. @@ -2887,11 +2938,11 @@ func (o *ExperimentAccessControlResponse) SetAllPermissions(ctx context.Context, } type ExperimentPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ExperimentPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentPermission) { @@ -2900,9 +2951,12 @@ func (newState *ExperimentPermission) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ExperimentPermission) SyncEffectiveFieldsDuringRead(existingState ExperimentPermission) { } -func (c ExperimentPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermission. @@ -2971,11 +3025,11 @@ func (o *ExperimentPermission) SetInheritedFromObject(ctx context.Context, v []t } type ExperimentPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ExperimentPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentPermissions) { @@ -2984,10 +3038,12 @@ func (newState *ExperimentPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ExperimentPermissions) SyncEffectiveFieldsDuringRead(existingState ExperimentPermissions) { } -func (c ExperimentPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ExperimentPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermissions. @@ -3056,9 +3112,9 @@ func (o *ExperimentPermissions) SetAccessControlList(ctx context.Context, v []Ex } type ExperimentPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ExperimentPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentPermissionsDescription) { @@ -3067,9 +3123,11 @@ func (newState *ExperimentPermissionsDescription) SyncEffectiveFieldsDuringCreat func (newState *ExperimentPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState ExperimentPermissionsDescription) { } -func (c ExperimentPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermissionsDescription. @@ -3106,7 +3164,7 @@ func (o ExperimentPermissionsDescription) Type(ctx context.Context) attr.Type { } type ExperimentPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The experiment for which to get or manage permissions. ExperimentId types.String `tfsdk:"-"` } @@ -3117,11 +3175,11 @@ func (newState *ExperimentPermissionsRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *ExperimentPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState ExperimentPermissionsRequest) { } -func (c ExperimentPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "experiment_id")...) +func (c ExperimentPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentPermissionsRequest. @@ -3189,9 +3247,9 @@ func (o *ExperimentPermissionsRequest) SetAccessControlList(ctx context.Context, type ExperimentTag struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ExperimentTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExperimentTag) { @@ -3200,9 +3258,11 @@ func (newState *ExperimentTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan Expe func (newState *ExperimentTag) SyncEffectiveFieldsDuringRead(existingState ExperimentTag) { } -func (c ExperimentTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExperimentTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExperimentTag. @@ -3240,11 +3300,11 @@ func (o ExperimentTag) Type(ctx context.Context) attr.Type { type FileInfo struct { // Size in bytes. Unset for directories. - FileSize types.Int64 `tfsdk:"file_size" tf:"optional"` + FileSize types.Int64 `tfsdk:"file_size"` // Whether the path is a directory. - IsDir types.Bool `tfsdk:"is_dir" tf:"optional"` + IsDir types.Bool `tfsdk:"is_dir"` // Path relative to the root artifact directory run. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *FileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo) { @@ -3253,9 +3313,12 @@ func (newState *FileInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileInfo) func (newState *FileInfo) SyncEffectiveFieldsDuringRead(existingState FileInfo) { } -func (c FileInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file_size"] = attrs["file_size"].SetOptional() + attrs["is_dir"] = attrs["is_dir"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileInfo. @@ -3369,7 +3432,7 @@ func (o GetExperimentPermissionLevelsRequest) Type(ctx context.Context) attr.Typ type GetExperimentPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetExperimentPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetExperimentPermissionLevelsResponse) { @@ -3378,10 +3441,10 @@ func (newState *GetExperimentPermissionLevelsResponse) SyncEffectiveFieldsDuring func (newState *GetExperimentPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetExperimentPermissionLevelsResponse) { } -func (c GetExperimentPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExperimentPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetExperimentPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetExperimentPermissionLevelsResponse. @@ -3521,7 +3584,7 @@ func (o GetExperimentRequest) Type(ctx context.Context) attr.Type { type GetExperimentResponse struct { // Experiment details. - Experiment types.Object `tfsdk:"experiment" tf:"optional,object"` + Experiment types.Object `tfsdk:"experiment"` } func (newState *GetExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetExperimentResponse) { @@ -3530,10 +3593,10 @@ func (newState *GetExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *GetExperimentResponse) SyncEffectiveFieldsDuringRead(existingState GetExperimentResponse) { } -func (c GetExperimentResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Experiment{}.ApplySchemaCustomizations(cs, append(path, "experiment")...) +func (c GetExperimentResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment"] = attrs["experiment"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetExperimentResponse. @@ -3655,9 +3718,9 @@ func (o GetHistoryRequest) Type(ctx context.Context) attr.Type { type GetLatestVersionsRequest struct { // Registered model unique name identifier. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // List of stages. - Stages types.List `tfsdk:"stages" tf:"optional"` + Stages types.List `tfsdk:"stages"` } func (newState *GetLatestVersionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetLatestVersionsRequest) { @@ -3666,10 +3729,11 @@ func (newState *GetLatestVersionsRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *GetLatestVersionsRequest) SyncEffectiveFieldsDuringRead(existingState GetLatestVersionsRequest) { } -func (c GetLatestVersionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c GetLatestVersionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["stages"] = attrs["stages"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetLatestVersionsRequest. @@ -3739,7 +3803,7 @@ type GetLatestVersionsResponse struct { // Latest version models for each requests stage. Only return models with // current `READY` status. If no `stages` provided, returns the latest // version for each stage, including `"None"`. - ModelVersions types.List `tfsdk:"model_versions" tf:"optional"` + ModelVersions types.List `tfsdk:"model_versions"` } func (newState *GetLatestVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetLatestVersionsResponse) { @@ -3748,10 +3812,10 @@ func (newState *GetLatestVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *GetLatestVersionsResponse) SyncEffectiveFieldsDuringRead(existingState GetLatestVersionsResponse) { } -func (c GetLatestVersionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion{}.ApplySchemaCustomizations(cs, append(path, "model_versions")...) +func (c GetLatestVersionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_versions"] = attrs["model_versions"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetLatestVersionsResponse. @@ -3817,10 +3881,10 @@ func (o *GetLatestVersionsResponse) SetModelVersions(ctx context.Context, v []Mo type GetMetricHistoryResponse struct { // All logged values for this metric. - Metrics types.List `tfsdk:"metrics" tf:"optional"` + Metrics types.List `tfsdk:"metrics"` // Token that can be used to retrieve the next page of metric history // results - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetMetricHistoryResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetMetricHistoryResponse) { @@ -3829,10 +3893,11 @@ func (newState *GetMetricHistoryResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *GetMetricHistoryResponse) SyncEffectiveFieldsDuringRead(existingState GetMetricHistoryResponse) { } -func (c GetMetricHistoryResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Metric{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) +func (c GetMetricHistoryResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetMetricHistoryResponse. @@ -3936,7 +4001,7 @@ func (o GetModelRequest) Type(ctx context.Context) attr.Type { } type GetModelResponse struct { - RegisteredModelDatabricks types.Object `tfsdk:"registered_model_databricks" tf:"optional,object"` + RegisteredModelDatabricks types.Object `tfsdk:"registered_model_databricks"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetModelResponse. @@ -4043,7 +4108,7 @@ func (o GetModelVersionDownloadUriRequest) Type(ctx context.Context) attr.Type { type GetModelVersionDownloadUriResponse struct { // URI corresponding to where artifacts for this model version are stored. - ArtifactUri types.String `tfsdk:"artifact_uri" tf:"optional"` + ArtifactUri types.String `tfsdk:"artifact_uri"` } func (newState *GetModelVersionDownloadUriResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetModelVersionDownloadUriResponse) { @@ -4052,9 +4117,10 @@ func (newState *GetModelVersionDownloadUriResponse) SyncEffectiveFieldsDuringCre func (newState *GetModelVersionDownloadUriResponse) SyncEffectiveFieldsDuringRead(existingState GetModelVersionDownloadUriResponse) { } -func (c GetModelVersionDownloadUriResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetModelVersionDownloadUriResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_uri"] = attrs["artifact_uri"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetModelVersionDownloadUriResponse. @@ -4130,7 +4196,7 @@ func (o GetModelVersionRequest) Type(ctx context.Context) attr.Type { } type GetModelVersionResponse struct { - ModelVersion types.Object `tfsdk:"model_version" tf:"optional,object"` + ModelVersion types.Object `tfsdk:"model_version"` } func (newState *GetModelVersionResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetModelVersionResponse) { @@ -4139,10 +4205,10 @@ func (newState *GetModelVersionResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GetModelVersionResponse) SyncEffectiveFieldsDuringRead(existingState GetModelVersionResponse) { } -func (c GetModelVersionResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion{}.ApplySchemaCustomizations(cs, append(path, "model_version")...) +func (c GetModelVersionResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_version"] = attrs["model_version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetModelVersionResponse. @@ -4245,7 +4311,7 @@ func (o GetRegisteredModelPermissionLevelsRequest) Type(ctx context.Context) att type GetRegisteredModelPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetRegisteredModelPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRegisteredModelPermissionLevelsResponse) { @@ -4254,10 +4320,10 @@ func (newState *GetRegisteredModelPermissionLevelsResponse) SyncEffectiveFieldsD func (newState *GetRegisteredModelPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetRegisteredModelPermissionLevelsResponse) { } -func (c GetRegisteredModelPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetRegisteredModelPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRegisteredModelPermissionLevelsResponse. @@ -4403,7 +4469,7 @@ func (o GetRunRequest) Type(ctx context.Context) attr.Type { type GetRunResponse struct { // Run metadata (name, start time, etc) and data (metrics, params, and // tags). - Run types.Object `tfsdk:"run" tf:"optional,object"` + Run types.Object `tfsdk:"run"` } func (newState *GetRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRunResponse) { @@ -4412,10 +4478,10 @@ func (newState *GetRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Get func (newState *GetRunResponse) SyncEffectiveFieldsDuringRead(existingState GetRunResponse) { } -func (c GetRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Run{}.ApplySchemaCustomizations(cs, append(path, "run")...) +func (c GetRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run"] = attrs["run"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRunResponse. @@ -4484,7 +4550,7 @@ type HttpUrlSpec struct { // by the wehbook. It should be of the form `" "`. // If set to an empty string, no authorization header will be included in // the request. - Authorization types.String `tfsdk:"authorization" tf:"optional"` + Authorization types.String `tfsdk:"authorization"` // Enable/disable SSL certificate validation. Default is true. For // self-signed certificates, this field must be false AND the destination // server must disable certificate validation as well. For security @@ -4492,13 +4558,13 @@ type HttpUrlSpec struct { // HMAC-encoded portion of the payload and acknowledge the risk associated // with disabling hostname validation whereby it becomes more likely that // requests can be maliciously routed to an unintended host. - EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification" tf:"optional"` + EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification"` // Shared secret required for HMAC encoding payload. The HMAC-encoded // payload will be sent in the header as: { "X-Databricks-Signature": // $encoded_payload }. - Secret types.String `tfsdk:"secret" tf:"optional"` + Secret types.String `tfsdk:"secret"` // External HTTPS URL called on event trigger (by using a POST request). - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` } func (newState *HttpUrlSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan HttpUrlSpec) { @@ -4507,10 +4573,13 @@ func (newState *HttpUrlSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan HttpUr func (newState *HttpUrlSpec) SyncEffectiveFieldsDuringRead(existingState HttpUrlSpec) { } -func (c HttpUrlSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "url")...) +func (c HttpUrlSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authorization"] = attrs["authorization"].SetOptional() + attrs["enable_ssl_verification"] = attrs["enable_ssl_verification"].SetOptional() + attrs["secret"] = attrs["secret"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in HttpUrlSpec. @@ -4558,9 +4627,9 @@ type HttpUrlSpecWithoutSecret struct { // HMAC-encoded portion of the payload and acknowledge the risk associated // with disabling hostname validation whereby it becomes more likely that // requests can be maliciously routed to an unintended host. - EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification" tf:"optional"` + EnableSslVerification types.Bool `tfsdk:"enable_ssl_verification"` // External HTTPS URL called on event trigger (by using a POST request). - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *HttpUrlSpecWithoutSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan HttpUrlSpecWithoutSecret) { @@ -4569,9 +4638,11 @@ func (newState *HttpUrlSpecWithoutSecret) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *HttpUrlSpecWithoutSecret) SyncEffectiveFieldsDuringRead(existingState HttpUrlSpecWithoutSecret) { } -func (c HttpUrlSpecWithoutSecret) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c HttpUrlSpecWithoutSecret) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enable_ssl_verification"] = attrs["enable_ssl_verification"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in HttpUrlSpecWithoutSecret. @@ -4609,9 +4680,9 @@ func (o HttpUrlSpecWithoutSecret) Type(ctx context.Context) attr.Type { type InputTag struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *InputTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan InputTag) { @@ -4620,9 +4691,11 @@ func (newState *InputTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan InputTag) func (newState *InputTag) SyncEffectiveFieldsDuringRead(existingState InputTag) { } -func (c InputTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c InputTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in InputTag. @@ -4660,13 +4733,13 @@ func (o InputTag) Type(ctx context.Context) attr.Type { type JobSpec struct { // The personal access token used to authorize webhook's job runs. - AccessToken types.String `tfsdk:"access_token" tf:""` + AccessToken types.String `tfsdk:"access_token"` // ID of the job that the webhook runs. - JobId types.String `tfsdk:"job_id" tf:""` + JobId types.String `tfsdk:"job_id"` // URL of the workspace containing the job that this webhook runs. If not // specified, the job’s workspace URL is assumed to be the same as the // workspace where the webhook is created. - WorkspaceUrl types.String `tfsdk:"workspace_url" tf:"optional"` + WorkspaceUrl types.String `tfsdk:"workspace_url"` } func (newState *JobSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSpec) { @@ -4675,11 +4748,12 @@ func (newState *JobSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSpec) { func (newState *JobSpec) SyncEffectiveFieldsDuringRead(existingState JobSpec) { } -func (c JobSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_token")...) - cs.SetRequired(append(path, "job_id")...) +func (c JobSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_token"] = attrs["access_token"].SetRequired() + attrs["job_id"] = attrs["job_id"].SetRequired() + attrs["workspace_url"] = attrs["workspace_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSpec. @@ -4719,11 +4793,11 @@ func (o JobSpec) Type(ctx context.Context) attr.Type { type JobSpecWithoutSecret struct { // ID of the job that the webhook runs. - JobId types.String `tfsdk:"job_id" tf:"optional"` + JobId types.String `tfsdk:"job_id"` // URL of the workspace containing the job that this webhook runs. Defaults // to the workspace URL in which the webhook is created. If not specified, // the job’s workspace is assumed to be the same as the webhook’s. - WorkspaceUrl types.String `tfsdk:"workspace_url" tf:"optional"` + WorkspaceUrl types.String `tfsdk:"workspace_url"` } func (newState *JobSpecWithoutSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan JobSpecWithoutSecret) { @@ -4732,9 +4806,11 @@ func (newState *JobSpecWithoutSecret) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *JobSpecWithoutSecret) SyncEffectiveFieldsDuringRead(existingState JobSpecWithoutSecret) { } -func (c JobSpecWithoutSecret) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c JobSpecWithoutSecret) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["workspace_url"] = attrs["workspace_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in JobSpecWithoutSecret. @@ -4828,11 +4904,11 @@ func (o ListArtifactsRequest) Type(ctx context.Context) attr.Type { type ListArtifactsResponse struct { // File location and metadata for artifacts. - Files types.List `tfsdk:"files" tf:"optional"` + Files types.List `tfsdk:"files"` // Token that can be used to retrieve the next page of artifact results - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Root artifact directory for the run. - RootUri types.String `tfsdk:"root_uri" tf:"optional"` + RootUri types.String `tfsdk:"root_uri"` } func (newState *ListArtifactsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListArtifactsResponse) { @@ -4841,10 +4917,12 @@ func (newState *ListArtifactsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListArtifactsResponse) SyncEffectiveFieldsDuringRead(existingState ListArtifactsResponse) { } -func (c ListArtifactsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileInfo{}.ApplySchemaCustomizations(cs, append(path, "files")...) +func (c ListArtifactsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["files"] = attrs["files"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["root_uri"] = attrs["root_uri"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListArtifactsResponse. @@ -4965,10 +5043,10 @@ func (o ListExperimentsRequest) Type(ctx context.Context) attr.Type { type ListExperimentsResponse struct { // Paginated Experiments beginning with the first item on the requested // page. - Experiments types.List `tfsdk:"experiments" tf:"optional"` + Experiments types.List `tfsdk:"experiments"` // Token that can be used to retrieve the next page of experiments. Empty // token means no more experiment is available for retrieval. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListExperimentsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListExperimentsResponse) { @@ -4977,10 +5055,11 @@ func (newState *ListExperimentsResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListExperimentsResponse) SyncEffectiveFieldsDuringRead(existingState ListExperimentsResponse) { } -func (c ListExperimentsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Experiment{}.ApplySchemaCustomizations(cs, append(path, "experiments")...) +func (c ListExperimentsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiments"] = attrs["experiments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListExperimentsResponse. @@ -5089,9 +5168,9 @@ func (o ListModelsRequest) Type(ctx context.Context) attr.Type { type ListModelsResponse struct { // Pagination token to request next page of models for the same query. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - RegisteredModels types.List `tfsdk:"registered_models" tf:"optional"` + RegisteredModels types.List `tfsdk:"registered_models"` } func (newState *ListModelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListModelsResponse) { @@ -5100,10 +5179,11 @@ func (newState *ListModelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListModelsResponse) SyncEffectiveFieldsDuringRead(existingState ListModelsResponse) { } -func (c ListModelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model{}.ApplySchemaCustomizations(cs, append(path, "registered_models")...) +func (c ListModelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["registered_models"] = attrs["registered_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListModelsResponse. @@ -5171,9 +5251,9 @@ func (o *ListModelsResponse) SetRegisteredModels(ctx context.Context, v []Model) type ListRegistryWebhooks struct { // Token that can be used to retrieve the next page of artifact results - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Array of registry webhooks. - Webhooks types.List `tfsdk:"webhooks" tf:"optional"` + Webhooks types.List `tfsdk:"webhooks"` } func (newState *ListRegistryWebhooks) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRegistryWebhooks) { @@ -5182,10 +5262,11 @@ func (newState *ListRegistryWebhooks) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListRegistryWebhooks) SyncEffectiveFieldsDuringRead(existingState ListRegistryWebhooks) { } -func (c ListRegistryWebhooks) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegistryWebhook{}.ApplySchemaCustomizations(cs, append(path, "webhooks")...) +func (c ListRegistryWebhooks) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["webhooks"] = attrs["webhooks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRegistryWebhooks. @@ -5294,7 +5375,7 @@ func (o ListTransitionRequestsRequest) Type(ctx context.Context) attr.Type { type ListTransitionRequestsResponse struct { // Array of open transition requests. - Requests types.List `tfsdk:"requests" tf:"optional"` + Requests types.List `tfsdk:"requests"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTransitionRequestsResponse. @@ -5439,15 +5520,15 @@ func (o *ListWebhooksRequest) SetEvents(ctx context.Context, v []types.String) { type LogBatch struct { // Metrics to log. A single request can contain up to 1000 metrics, and up // to 1000 metrics, params, and tags in total. - Metrics types.List `tfsdk:"metrics" tf:"optional"` + Metrics types.List `tfsdk:"metrics"` // Params to log. A single request can contain up to 100 params, and up to // 1000 metrics, params, and tags in total. - Params types.List `tfsdk:"params" tf:"optional"` + Params types.List `tfsdk:"params"` // ID of the run to log under - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // Tags to log. A single request can contain up to 100 tags, and up to 1000 // metrics, params, and tags in total. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *LogBatch) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogBatch) { @@ -5456,12 +5537,13 @@ func (newState *LogBatch) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogBatch) func (newState *LogBatch) SyncEffectiveFieldsDuringRead(existingState LogBatch) { } -func (c LogBatch) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Metric{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) - Param{}.ApplySchemaCustomizations(cs, append(path, "params")...) - RunTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c LogBatch) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["params"] = attrs["params"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogBatch. @@ -5598,9 +5680,9 @@ func (newState *LogBatchResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *LogBatchResponse) SyncEffectiveFieldsDuringRead(existingState LogBatchResponse) { } -func (c LogBatchResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogBatchResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogBatchResponse. @@ -5632,9 +5714,9 @@ func (o LogBatchResponse) Type(ctx context.Context) attr.Type { type LogInputs struct { // Dataset inputs - Datasets types.List `tfsdk:"datasets" tf:"optional"` + Datasets types.List `tfsdk:"datasets"` // ID of the run to log under - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` } func (newState *LogInputs) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogInputs) { @@ -5643,10 +5725,11 @@ func (newState *LogInputs) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogInput func (newState *LogInputs) SyncEffectiveFieldsDuringRead(existingState LogInputs) { } -func (c LogInputs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DatasetInput{}.ApplySchemaCustomizations(cs, append(path, "datasets")...) +func (c LogInputs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["datasets"] = attrs["datasets"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogInputs. @@ -5721,9 +5804,9 @@ func (newState *LogInputsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *LogInputsResponse) SyncEffectiveFieldsDuringRead(existingState LogInputsResponse) { } -func (c LogInputsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogInputsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogInputsResponse. @@ -5755,18 +5838,18 @@ func (o LogInputsResponse) Type(ctx context.Context) attr.Type { type LogMetric struct { // Name of the metric. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run under which to log the metric. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run under which to log the // metric. This field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // Step at which to log the metric - Step types.Int64 `tfsdk:"step" tf:"optional"` + Step types.Int64 `tfsdk:"step"` // Unix timestamp in milliseconds at the time metric was logged. - Timestamp types.Int64 `tfsdk:"timestamp" tf:""` + Timestamp types.Int64 `tfsdk:"timestamp"` // Double value of the metric being logged. - Value types.Float64 `tfsdk:"value" tf:""` + Value types.Float64 `tfsdk:"value"` } func (newState *LogMetric) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogMetric) { @@ -5775,12 +5858,15 @@ func (newState *LogMetric) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogMetri func (newState *LogMetric) SyncEffectiveFieldsDuringRead(existingState LogMetric) { } -func (c LogMetric) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "timestamp")...) - cs.SetRequired(append(path, "value")...) +func (c LogMetric) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["step"] = attrs["step"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogMetric. @@ -5833,9 +5919,9 @@ func (newState *LogMetricResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *LogMetricResponse) SyncEffectiveFieldsDuringRead(existingState LogMetricResponse) { } -func (c LogMetricResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogMetricResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogMetricResponse. @@ -5867,9 +5953,9 @@ func (o LogMetricResponse) Type(ctx context.Context) attr.Type { type LogModel struct { // MLmodel file in json format. - ModelJson types.String `tfsdk:"model_json" tf:"optional"` + ModelJson types.String `tfsdk:"model_json"` // ID of the run to log under - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` } func (newState *LogModel) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogModel) { @@ -5878,9 +5964,11 @@ func (newState *LogModel) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogModel) func (newState *LogModel) SyncEffectiveFieldsDuringRead(existingState LogModel) { } -func (c LogModel) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogModel) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_json"] = attrs["model_json"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogModel. @@ -5925,9 +6013,9 @@ func (newState *LogModelResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *LogModelResponse) SyncEffectiveFieldsDuringRead(existingState LogModelResponse) { } -func (c LogModelResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogModelResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogModelResponse. @@ -5959,14 +6047,14 @@ func (o LogModelResponse) Type(ctx context.Context) attr.Type { type LogParam struct { // Name of the param. Maximum size is 255 bytes. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run under which to log the param. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run under which to log the // param. This field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // String value of the param being logged. Maximum size is 500 bytes. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *LogParam) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogParam) { @@ -5975,11 +6063,13 @@ func (newState *LogParam) SyncEffectiveFieldsDuringCreateOrUpdate(plan LogParam) func (newState *LogParam) SyncEffectiveFieldsDuringRead(existingState LogParam) { } -func (c LogParam) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "value")...) +func (c LogParam) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogParam. @@ -6028,9 +6118,9 @@ func (newState *LogParamResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *LogParamResponse) SyncEffectiveFieldsDuringRead(existingState LogParamResponse) { } -func (c LogParamResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c LogParamResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LogParamResponse. @@ -6062,13 +6152,13 @@ func (o LogParamResponse) Type(ctx context.Context) attr.Type { type Metric struct { // Key identifying this metric. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Step at which to log the metric. - Step types.Int64 `tfsdk:"step" tf:"optional"` + Step types.Int64 `tfsdk:"step"` // The timestamp at which this metric was recorded. - Timestamp types.Int64 `tfsdk:"timestamp" tf:"optional"` + Timestamp types.Int64 `tfsdk:"timestamp"` // Value associated with this metric. - Value types.Float64 `tfsdk:"value" tf:"optional"` + Value types.Float64 `tfsdk:"value"` } func (newState *Metric) SyncEffectiveFieldsDuringCreateOrUpdate(plan Metric) { @@ -6077,9 +6167,13 @@ func (newState *Metric) SyncEffectiveFieldsDuringCreateOrUpdate(plan Metric) { func (newState *Metric) SyncEffectiveFieldsDuringRead(existingState Metric) { } -func (c Metric) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Metric) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["step"] = attrs["step"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Metric. @@ -6121,21 +6215,21 @@ func (o Metric) Type(ctx context.Context) attr.Type { type Model struct { // Timestamp recorded when this `registered_model` was created. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Description of this `registered_model`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Timestamp recorded when metadata for this `registered_model` was last // updated. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Collection of latest model versions for each stage. Only contains models // with current `READY` status. - LatestVersions types.List `tfsdk:"latest_versions" tf:"optional"` + LatestVersions types.List `tfsdk:"latest_versions"` // Unique name for the model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Tags: Additional metadata key-value pairs for this `registered_model`. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // User that created this `registered_model` - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *Model) SyncEffectiveFieldsDuringCreateOrUpdate(plan Model) { @@ -6144,11 +6238,16 @@ func (newState *Model) SyncEffectiveFieldsDuringCreateOrUpdate(plan Model) { func (newState *Model) SyncEffectiveFieldsDuringRead(existingState Model) { } -func (c Model) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion{}.ApplySchemaCustomizations(cs, append(path, "latest_versions")...) - ModelTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c Model) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["latest_versions"] = attrs["latest_versions"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Model. @@ -6255,24 +6354,24 @@ func (o *Model) SetTags(ctx context.Context, v []ModelTag) { type ModelDatabricks struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // User-specified description for the object. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Unique identifier for the object. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Array of model versions, each the latest version for its stage. - LatestVersions types.List `tfsdk:"latest_versions" tf:"optional"` + LatestVersions types.List `tfsdk:"latest_versions"` // Name of the model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Permission level of the requesting user on the object. For what is // allowed at each level, see [MLflow Model permissions](..). - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // Array of tags associated with the model. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *ModelDatabricks) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelDatabricks) { @@ -6281,11 +6380,18 @@ func (newState *ModelDatabricks) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mo func (newState *ModelDatabricks) SyncEffectiveFieldsDuringRead(existingState ModelDatabricks) { } -func (c ModelDatabricks) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion{}.ApplySchemaCustomizations(cs, append(path, "latest_versions")...) - ModelTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ModelDatabricks) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["latest_versions"] = attrs["latest_versions"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelDatabricks. @@ -6396,9 +6502,9 @@ func (o *ModelDatabricks) SetTags(ctx context.Context, v []ModelTag) { type ModelTag struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ModelTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelTag) { @@ -6407,9 +6513,11 @@ func (newState *ModelTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelTag) func (newState *ModelTag) SyncEffectiveFieldsDuringRead(existingState ModelTag) { } -func (c ModelTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ModelTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelTag. @@ -6447,34 +6555,34 @@ func (o ModelTag) Type(ctx context.Context) attr.Type { type ModelVersion struct { // Timestamp recorded when this `model_version` was created. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Current stage for this `model_version`. - CurrentStage types.String `tfsdk:"current_stage" tf:"optional"` + CurrentStage types.String `tfsdk:"current_stage"` // Description of this `model_version`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Timestamp recorded when metadata for this `model_version` was last // updated. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Unique name of the model - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // MLflow run ID used when creating `model_version`, if `source` was // generated by an experiment run stored in MLflow tracking server. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // Run Link: Direct link to the run that generated this version - RunLink types.String `tfsdk:"run_link" tf:"optional"` + RunLink types.String `tfsdk:"run_link"` // URI indicating the location of the source model artifacts, used when // creating `model_version` - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // Current status of `model_version` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // Details on current `status`, if it is pending or failed. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` // Tags: Additional metadata key-value pairs for this `model_version`. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // User that created this `model_version`. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` // Model's version number. - Version types.String `tfsdk:"version" tf:"optional"` + Version types.String `tfsdk:"version"` } func (newState *ModelVersion) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersion) { @@ -6483,10 +6591,22 @@ func (newState *ModelVersion) SyncEffectiveFieldsDuringCreateOrUpdate(plan Model func (newState *ModelVersion) SyncEffectiveFieldsDuringRead(existingState ModelVersion) { } -func (c ModelVersion) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersionTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ModelVersion) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["current_stage"] = attrs["current_stage"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_link"] = attrs["run_link"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersion. @@ -6576,7 +6696,7 @@ func (o *ModelVersion) SetTags(ctx context.Context, v []ModelVersionTag) { type ModelVersionDatabricks struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Stage of the model version. Valid values are: // // * `None`: The initial stage of a model version. @@ -6586,26 +6706,26 @@ type ModelVersionDatabricks struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - CurrentStage types.String `tfsdk:"current_stage" tf:"optional"` + CurrentStage types.String `tfsdk:"current_stage"` // User-specified description for the object. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Name of the model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Permission level of the requesting user on the object. For what is // allowed at each level, see [MLflow Model permissions](..). - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // Unique identifier for the MLflow tracking run associated with the source // model artifacts. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // URL of the run associated with the model artifacts. This field is set at // model version creation time only for model versions whose source run is // from a tracking server that is different from the registry server. - RunLink types.String `tfsdk:"run_link" tf:"optional"` + RunLink types.String `tfsdk:"run_link"` // URI that indicates the location of the source model artifacts. This is // used when creating the model version. - Source types.String `tfsdk:"source" tf:"optional"` + Source types.String `tfsdk:"source"` // The status of the model version. Valid values are: * // `PENDING_REGISTRATION`: Request to register a new model version is // pending as server performs background tasks. @@ -6614,15 +6734,15 @@ type ModelVersionDatabricks struct { // failed. // // * `READY`: Model version is ready for use. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // Details on the current status, for example why registration failed. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` // Array of tags that are associated with the model version. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` // Version of the model. - Version types.String `tfsdk:"version" tf:"optional"` + Version types.String `tfsdk:"version"` } func (newState *ModelVersionDatabricks) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersionDatabricks) { @@ -6631,10 +6751,23 @@ func (newState *ModelVersionDatabricks) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ModelVersionDatabricks) SyncEffectiveFieldsDuringRead(existingState ModelVersionDatabricks) { } -func (c ModelVersionDatabricks) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersionTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ModelVersionDatabricks) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["current_stage"] = attrs["current_stage"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_link"] = attrs["run_link"].SetOptional() + attrs["source"] = attrs["source"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["version"] = attrs["version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersionDatabricks. @@ -6726,9 +6859,9 @@ func (o *ModelVersionDatabricks) SetTags(ctx context.Context, v []ModelVersionTa type ModelVersionTag struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *ModelVersionTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelVersionTag) { @@ -6737,9 +6870,11 @@ func (newState *ModelVersionTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mo func (newState *ModelVersionTag) SyncEffectiveFieldsDuringRead(existingState ModelVersionTag) { } -func (c ModelVersionTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ModelVersionTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelVersionTag. @@ -6777,9 +6912,9 @@ func (o ModelVersionTag) Type(ctx context.Context) attr.Type { type Param struct { // Key identifying this param. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Value associated with this param. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *Param) SyncEffectiveFieldsDuringCreateOrUpdate(plan Param) { @@ -6788,9 +6923,11 @@ func (newState *Param) SyncEffectiveFieldsDuringCreateOrUpdate(plan Param) { func (newState *Param) SyncEffectiveFieldsDuringRead(existingState Param) { } -func (c Param) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Param) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Param. @@ -6828,13 +6965,13 @@ func (o Param) Type(ctx context.Context) attr.Type { type RegisteredModelAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RegisteredModelAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelAccessControlRequest) { @@ -6843,9 +6980,13 @@ func (newState *RegisteredModelAccessControlRequest) SyncEffectiveFieldsDuringCr func (newState *RegisteredModelAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState RegisteredModelAccessControlRequest) { } -func (c RegisteredModelAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelAccessControlRequest. @@ -6887,15 +7028,15 @@ func (o RegisteredModelAccessControlRequest) Type(ctx context.Context) attr.Type type RegisteredModelAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RegisteredModelAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelAccessControlResponse) { @@ -6904,10 +7045,14 @@ func (newState *RegisteredModelAccessControlResponse) SyncEffectiveFieldsDuringC func (newState *RegisteredModelAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState RegisteredModelAccessControlResponse) { } -func (c RegisteredModelAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c RegisteredModelAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelAccessControlResponse. @@ -6980,11 +7125,11 @@ func (o *RegisteredModelAccessControlResponse) SetAllPermissions(ctx context.Con } type RegisteredModelPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RegisteredModelPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelPermission) { @@ -6993,9 +7138,12 @@ func (newState *RegisteredModelPermission) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RegisteredModelPermission) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermission) { } -func (c RegisteredModelPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermission. @@ -7064,11 +7212,11 @@ func (o *RegisteredModelPermission) SetInheritedFromObject(ctx context.Context, } type RegisteredModelPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *RegisteredModelPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelPermissions) { @@ -7077,10 +7225,12 @@ func (newState *RegisteredModelPermissions) SyncEffectiveFieldsDuringCreateOrUpd func (newState *RegisteredModelPermissions) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermissions) { } -func (c RegisteredModelPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c RegisteredModelPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermissions. @@ -7149,9 +7299,9 @@ func (o *RegisteredModelPermissions) SetAccessControlList(ctx context.Context, v } type RegisteredModelPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RegisteredModelPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegisteredModelPermissionsDescription) { @@ -7160,9 +7310,11 @@ func (newState *RegisteredModelPermissionsDescription) SyncEffectiveFieldsDuring func (newState *RegisteredModelPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermissionsDescription) { } -func (c RegisteredModelPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RegisteredModelPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermissionsDescription. @@ -7199,7 +7351,7 @@ func (o RegisteredModelPermissionsDescription) Type(ctx context.Context) attr.Ty } type RegisteredModelPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The registered model for which to get or manage permissions. RegisteredModelId types.String `tfsdk:"-"` } @@ -7210,11 +7362,11 @@ func (newState *RegisteredModelPermissionsRequest) SyncEffectiveFieldsDuringCrea func (newState *RegisteredModelPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState RegisteredModelPermissionsRequest) { } -func (c RegisteredModelPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RegisteredModelAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "registered_model_id")...) +func (c RegisteredModelPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["registered_model_id"] = attrs["registered_model_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegisteredModelPermissionsRequest. @@ -7282,9 +7434,9 @@ func (o *RegisteredModelPermissionsRequest) SetAccessControlList(ctx context.Con type RegistryWebhook struct { // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // User-specified description for the webhook. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -7318,17 +7470,17 @@ type RegistryWebhook struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` - HttpUrlSpec types.Object `tfsdk:"http_url_spec" tf:"optional,object"` + HttpUrlSpec types.Object `tfsdk:"http_url_spec"` // Webhook ID - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - JobSpec types.Object `tfsdk:"job_spec" tf:"optional,object"` + JobSpec types.Object `tfsdk:"job_spec"` // Time of the object at last update, as a Unix timestamp in milliseconds. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // Name of the model whose events would trigger this webhook. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -7337,7 +7489,7 @@ type RegistryWebhook struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *RegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan RegistryWebhook) { @@ -7346,11 +7498,18 @@ func (newState *RegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan Re func (newState *RegistryWebhook) SyncEffectiveFieldsDuringRead(existingState RegistryWebhook) { } -func (c RegistryWebhook) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - HttpUrlSpecWithoutSecret{}.ApplySchemaCustomizations(cs, append(path, "http_url_spec")...) - JobSpecWithoutSecret{}.ApplySchemaCustomizations(cs, append(path, "job_spec")...) +func (c RegistryWebhook) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["events"] = attrs["events"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["job_spec"] = attrs["job_spec"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RegistryWebhook. @@ -7490,9 +7649,9 @@ func (o *RegistryWebhook) SetJobSpec(ctx context.Context, v JobSpecWithoutSecret type RejectTransitionRequest struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -7502,9 +7661,9 @@ type RejectTransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *RejectTransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RejectTransitionRequest) { @@ -7513,12 +7672,13 @@ func (newState *RejectTransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *RejectTransitionRequest) SyncEffectiveFieldsDuringRead(existingState RejectTransitionRequest) { } -func (c RejectTransitionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c RejectTransitionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RejectTransitionRequest. @@ -7560,7 +7720,7 @@ func (o RejectTransitionRequest) Type(ctx context.Context) attr.Type { type RejectTransitionRequestResponse struct { // Activity recorded for the action. - Activity types.Object `tfsdk:"activity" tf:"optional,object"` + Activity types.Object `tfsdk:"activity"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RejectTransitionRequestResponse. @@ -7626,9 +7786,9 @@ func (o *RejectTransitionRequestResponse) SetActivity(ctx context.Context, v Act type RenameModelRequest struct { // Registered model unique name identifier. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // If provided, updates the name for this `registered_model`. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` } func (newState *RenameModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RenameModelRequest) { @@ -7637,10 +7797,11 @@ func (newState *RenameModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RenameModelRequest) SyncEffectiveFieldsDuringRead(existingState RenameModelRequest) { } -func (c RenameModelRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c RenameModelRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RenameModelRequest. @@ -7677,7 +7838,7 @@ func (o RenameModelRequest) Type(ctx context.Context) attr.Type { } type RenameModelResponse struct { - RegisteredModel types.Object `tfsdk:"registered_model" tf:"optional,object"` + RegisteredModel types.Object `tfsdk:"registered_model"` } func (newState *RenameModelResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RenameModelResponse) { @@ -7686,10 +7847,10 @@ func (newState *RenameModelResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RenameModelResponse) SyncEffectiveFieldsDuringRead(existingState RenameModelResponse) { } -func (c RenameModelResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model{}.ApplySchemaCustomizations(cs, append(path, "registered_model")...) +func (c RenameModelResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["registered_model"] = attrs["registered_model"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RenameModelResponse. @@ -7755,7 +7916,7 @@ func (o *RenameModelResponse) SetRegisteredModel(ctx context.Context, v Model) { type RestoreExperiment struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` } func (newState *RestoreExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreExperiment) { @@ -7764,10 +7925,10 @@ func (newState *RestoreExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RestoreExperiment) SyncEffectiveFieldsDuringRead(existingState RestoreExperiment) { } -func (c RestoreExperiment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) +func (c RestoreExperiment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreExperiment. @@ -7810,9 +7971,9 @@ func (newState *RestoreExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RestoreExperimentResponse) SyncEffectiveFieldsDuringRead(existingState RestoreExperimentResponse) { } -func (c RestoreExperimentResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestoreExperimentResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreExperimentResponse. @@ -7844,7 +8005,7 @@ func (o RestoreExperimentResponse) Type(ctx context.Context) attr.Type { type RestoreRun struct { // ID of the run to restore. - RunId types.String `tfsdk:"run_id" tf:""` + RunId types.String `tfsdk:"run_id"` } func (newState *RestoreRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreRun) { @@ -7853,10 +8014,10 @@ func (newState *RestoreRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan Restore func (newState *RestoreRun) SyncEffectiveFieldsDuringRead(existingState RestoreRun) { } -func (c RestoreRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "run_id")...) +func (c RestoreRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_id"] = attrs["run_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRun. @@ -7899,9 +8060,9 @@ func (newState *RestoreRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RestoreRunResponse) SyncEffectiveFieldsDuringRead(existingState RestoreRunResponse) { } -func (c RestoreRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestoreRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRunResponse. @@ -7933,14 +8094,14 @@ func (o RestoreRunResponse) Type(ctx context.Context) attr.Type { type RestoreRuns struct { // The ID of the experiment containing the runs to restore. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // An optional positive integer indicating the maximum number of runs to // restore. The maximum allowed value for max_runs is 10000. - MaxRuns types.Int64 `tfsdk:"max_runs" tf:"optional"` + MaxRuns types.Int64 `tfsdk:"max_runs"` // The minimum deletion timestamp in milliseconds since the UNIX epoch for // restoring runs. Only runs deleted no earlier than this timestamp are // restored. - MinTimestampMillis types.Int64 `tfsdk:"min_timestamp_millis" tf:""` + MinTimestampMillis types.Int64 `tfsdk:"min_timestamp_millis"` } func (newState *RestoreRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreRuns) { @@ -7949,11 +8110,12 @@ func (newState *RestoreRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan Restor func (newState *RestoreRuns) SyncEffectiveFieldsDuringRead(existingState RestoreRuns) { } -func (c RestoreRuns) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) - cs.SetRequired(append(path, "min_timestamp_millis")...) +func (c RestoreRuns) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["max_runs"] = attrs["max_runs"].SetOptional() + attrs["min_timestamp_millis"] = attrs["min_timestamp_millis"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRuns. @@ -7993,7 +8155,7 @@ func (o RestoreRuns) Type(ctx context.Context) attr.Type { type RestoreRunsResponse struct { // The number of runs restored. - RunsRestored types.Int64 `tfsdk:"runs_restored" tf:"optional"` + RunsRestored types.Int64 `tfsdk:"runs_restored"` } func (newState *RestoreRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestoreRunsResponse) { @@ -8002,9 +8164,10 @@ func (newState *RestoreRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RestoreRunsResponse) SyncEffectiveFieldsDuringRead(existingState RestoreRunsResponse) { } -func (c RestoreRunsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RestoreRunsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["runs_restored"] = attrs["runs_restored"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestoreRunsResponse. @@ -8040,11 +8203,11 @@ func (o RestoreRunsResponse) Type(ctx context.Context) attr.Type { type Run struct { // Run data. - Data types.Object `tfsdk:"data" tf:"optional,object"` + Data types.Object `tfsdk:"data"` // Run metadata. - Info types.Object `tfsdk:"info" tf:"optional,object"` + Info types.Object `tfsdk:"info"` // Run inputs. - Inputs types.Object `tfsdk:"inputs" tf:"optional,object"` + Inputs types.Object `tfsdk:"inputs"` } func (newState *Run) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run) { @@ -8053,12 +8216,12 @@ func (newState *Run) SyncEffectiveFieldsDuringCreateOrUpdate(plan Run) { func (newState *Run) SyncEffectiveFieldsDuringRead(existingState Run) { } -func (c Run) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunData{}.ApplySchemaCustomizations(cs, append(path, "data")...) - RunInfo{}.ApplySchemaCustomizations(cs, append(path, "info")...) - RunInputs{}.ApplySchemaCustomizations(cs, append(path, "inputs")...) +func (c Run) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data"] = attrs["data"].SetOptional() + attrs["info"] = attrs["info"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Run. @@ -8186,11 +8349,11 @@ func (o *Run) SetInputs(ctx context.Context, v RunInputs) { type RunData struct { // Run metrics. - Metrics types.List `tfsdk:"metrics" tf:"optional"` + Metrics types.List `tfsdk:"metrics"` // Run parameters. - Params types.List `tfsdk:"params" tf:"optional"` + Params types.List `tfsdk:"params"` // Additional metadata key-value pairs. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *RunData) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunData) { @@ -8199,12 +8362,12 @@ func (newState *RunData) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunData) { func (newState *RunData) SyncEffectiveFieldsDuringRead(existingState RunData) { } -func (c RunData) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Metric{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) - Param{}.ApplySchemaCustomizations(cs, append(path, "params")...) - RunTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c RunData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["params"] = attrs["params"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunData. @@ -8335,26 +8498,26 @@ type RunInfo struct { // local path (starting with "/"), or a distributed file system (DFS) path, // like `s3://bucket/directory` or `dbfs:/my/directory`. If not set, the // local `./mlruns` directory is chosen. - ArtifactUri types.String `tfsdk:"artifact_uri" tf:"optional"` + ArtifactUri types.String `tfsdk:"artifact_uri"` // Unix timestamp of when the run ended in milliseconds. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // The experiment ID. - ExperimentId types.String `tfsdk:"experiment_id" tf:"optional"` + ExperimentId types.String `tfsdk:"experiment_id"` // Current life cycle stage of the experiment : OneOf("active", "deleted") - LifecycleStage types.String `tfsdk:"lifecycle_stage" tf:"optional"` + LifecycleStage types.String `tfsdk:"lifecycle_stage"` // Unique identifier for the run. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] Unique identifier for the run. This // field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // Unix timestamp of when the run started in milliseconds. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // Current status of the run. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // User who initiated the run. This field is deprecated as of MLflow 1.0, // and will be removed in a future MLflow release. Use 'mlflow.user' tag // instead. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *RunInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunInfo) { @@ -8363,9 +8526,18 @@ func (newState *RunInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunInfo) { func (newState *RunInfo) SyncEffectiveFieldsDuringRead(existingState RunInfo) { } -func (c RunInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["artifact_uri"] = attrs["artifact_uri"].SetOptional() + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["experiment_id"] = attrs["experiment_id"].SetOptional() + attrs["lifecycle_stage"] = attrs["lifecycle_stage"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunInfo. @@ -8417,7 +8589,7 @@ func (o RunInfo) Type(ctx context.Context) attr.Type { type RunInputs struct { // Run metrics. - DatasetInputs types.List `tfsdk:"dataset_inputs" tf:"optional"` + DatasetInputs types.List `tfsdk:"dataset_inputs"` } func (newState *RunInputs) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunInputs) { @@ -8426,10 +8598,10 @@ func (newState *RunInputs) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunInput func (newState *RunInputs) SyncEffectiveFieldsDuringRead(existingState RunInputs) { } -func (c RunInputs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DatasetInput{}.ApplySchemaCustomizations(cs, append(path, "dataset_inputs")...) +func (c RunInputs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataset_inputs"] = attrs["dataset_inputs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunInputs. @@ -8495,9 +8667,9 @@ func (o *RunInputs) SetDatasetInputs(ctx context.Context, v []DatasetInput) { type RunTag struct { // The tag key. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The tag value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *RunTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTag) { @@ -8506,9 +8678,11 @@ func (newState *RunTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunTag) { func (newState *RunTag) SyncEffectiveFieldsDuringRead(existingState RunTag) { } -func (c RunTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RunTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RunTag. @@ -8547,19 +8721,19 @@ func (o RunTag) Type(ctx context.Context) attr.Type { type SearchExperiments struct { // String representing a SQL filter condition (e.g. "name ILIKE // 'my-experiment%'") - Filter types.String `tfsdk:"filter" tf:"optional"` + Filter types.String `tfsdk:"filter"` // Maximum number of experiments desired. Max threshold is 3000. - MaxResults types.Int64 `tfsdk:"max_results" tf:"optional"` + MaxResults types.Int64 `tfsdk:"max_results"` // List of columns for ordering search results, which can include experiment // name and last updated timestamp with an optional "DESC" or "ASC" // annotation, where "ASC" is the default. Tiebreaks are done by experiment // id DESC. - OrderBy types.List `tfsdk:"order_by" tf:"optional"` + OrderBy types.List `tfsdk:"order_by"` // Token indicating the page of experiments to fetch - PageToken types.String `tfsdk:"page_token" tf:"optional"` + PageToken types.String `tfsdk:"page_token"` // Qualifier for type of experiments to be returned. If unspecified, return // only active experiments. - ViewType types.String `tfsdk:"view_type" tf:"optional"` + ViewType types.String `tfsdk:"view_type"` } func (newState *SearchExperiments) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchExperiments) { @@ -8568,9 +8742,14 @@ func (newState *SearchExperiments) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SearchExperiments) SyncEffectiveFieldsDuringRead(existingState SearchExperiments) { } -func (c SearchExperiments) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SearchExperiments) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["filter"] = attrs["filter"].SetOptional() + attrs["max_results"] = attrs["max_results"].SetOptional() + attrs["order_by"] = attrs["order_by"].SetOptional() + attrs["page_token"] = attrs["page_token"].SetOptional() + attrs["view_type"] = attrs["view_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchExperiments. @@ -8644,10 +8823,10 @@ func (o *SearchExperiments) SetOrderBy(ctx context.Context, v []types.String) { type SearchExperimentsResponse struct { // Experiments that match the search criteria - Experiments types.List `tfsdk:"experiments" tf:"optional"` + Experiments types.List `tfsdk:"experiments"` // Token that can be used to retrieve the next page of experiments. An empty // token means that no more experiments are available for retrieval. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *SearchExperimentsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchExperimentsResponse) { @@ -8656,10 +8835,11 @@ func (newState *SearchExperimentsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *SearchExperimentsResponse) SyncEffectiveFieldsDuringRead(existingState SearchExperimentsResponse) { } -func (c SearchExperimentsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Experiment{}.ApplySchemaCustomizations(cs, append(path, "experiments")...) +func (c SearchExperimentsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiments"] = attrs["experiments"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchExperimentsResponse. @@ -8810,10 +8990,10 @@ func (o *SearchModelVersionsRequest) SetOrderBy(ctx context.Context, v []types.S type SearchModelVersionsResponse struct { // Models that match the search criteria - ModelVersions types.List `tfsdk:"model_versions" tf:"optional"` + ModelVersions types.List `tfsdk:"model_versions"` // Pagination token to request next page of models for the same search // query. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *SearchModelVersionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchModelVersionsResponse) { @@ -8822,10 +9002,11 @@ func (newState *SearchModelVersionsResponse) SyncEffectiveFieldsDuringCreateOrUp func (newState *SearchModelVersionsResponse) SyncEffectiveFieldsDuringRead(existingState SearchModelVersionsResponse) { } -func (c SearchModelVersionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ModelVersion{}.ApplySchemaCustomizations(cs, append(path, "model_versions")...) +func (c SearchModelVersionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_versions"] = attrs["model_versions"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchModelVersionsResponse. @@ -8976,9 +9157,9 @@ func (o *SearchModelsRequest) SetOrderBy(ctx context.Context, v []types.String) type SearchModelsResponse struct { // Pagination token to request the next page of models. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Registered Models that match the search criteria. - RegisteredModels types.List `tfsdk:"registered_models" tf:"optional"` + RegisteredModels types.List `tfsdk:"registered_models"` } func (newState *SearchModelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchModelsResponse) { @@ -8987,10 +9168,11 @@ func (newState *SearchModelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SearchModelsResponse) SyncEffectiveFieldsDuringRead(existingState SearchModelsResponse) { } -func (c SearchModelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Model{}.ApplySchemaCustomizations(cs, append(path, "registered_models")...) +func (c SearchModelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["registered_models"] = attrs["registered_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchModelsResponse. @@ -9058,7 +9240,7 @@ func (o *SearchModelsResponse) SetRegisteredModels(ctx context.Context, v []Mode type SearchRuns struct { // List of experiment IDs to search over. - ExperimentIds types.List `tfsdk:"experiment_ids" tf:"optional"` + ExperimentIds types.List `tfsdk:"experiment_ids"` // A filter expression over params, metrics, and tags, that allows returning // a subset of runs. The syntax is a subset of SQL that supports ANDing // together binary operations between a param, metric, or tag and a @@ -9071,21 +9253,21 @@ type SearchRuns struct { // and tags."user-name" = 'Tomas'` // // Supported operators are `=`, `!=`, `>`, `>=`, `<`, and `<=`. - Filter types.String `tfsdk:"filter" tf:"optional"` + Filter types.String `tfsdk:"filter"` // Maximum number of runs desired. Max threshold is 50000 - MaxResults types.Int64 `tfsdk:"max_results" tf:"optional"` + MaxResults types.Int64 `tfsdk:"max_results"` // List of columns to be ordered by, including attributes, params, metrics, // and tags with an optional "DESC" or "ASC" annotation, where "ASC" is the // default. Example: ["params.input DESC", "metrics.alpha ASC", // "metrics.rmse"] Tiebreaks are done by start_time DESC followed by run_id // for runs with the same start time (and this is the default ordering // criterion if order_by is not provided). - OrderBy types.List `tfsdk:"order_by" tf:"optional"` + OrderBy types.List `tfsdk:"order_by"` // Token for the current page of runs. - PageToken types.String `tfsdk:"page_token" tf:"optional"` + PageToken types.String `tfsdk:"page_token"` // Whether to display only active, only deleted, or all runs. Defaults to // only active runs. - RunViewType types.String `tfsdk:"run_view_type" tf:"optional"` + RunViewType types.String `tfsdk:"run_view_type"` } func (newState *SearchRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchRuns) { @@ -9094,9 +9276,15 @@ func (newState *SearchRuns) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchR func (newState *SearchRuns) SyncEffectiveFieldsDuringRead(existingState SearchRuns) { } -func (c SearchRuns) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SearchRuns) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_ids"] = attrs["experiment_ids"].SetOptional() + attrs["filter"] = attrs["filter"].SetOptional() + attrs["max_results"] = attrs["max_results"].SetOptional() + attrs["order_by"] = attrs["order_by"].SetOptional() + attrs["page_token"] = attrs["page_token"].SetOptional() + attrs["run_view_type"] = attrs["run_view_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchRuns. @@ -9201,9 +9389,9 @@ func (o *SearchRuns) SetOrderBy(ctx context.Context, v []types.String) { type SearchRunsResponse struct { // Token for the next page of runs. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Runs that match the search criteria. - Runs types.List `tfsdk:"runs" tf:"optional"` + Runs types.List `tfsdk:"runs"` } func (newState *SearchRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan SearchRunsResponse) { @@ -9212,10 +9400,11 @@ func (newState *SearchRunsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SearchRunsResponse) SyncEffectiveFieldsDuringRead(existingState SearchRunsResponse) { } -func (c SearchRunsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Run{}.ApplySchemaCustomizations(cs, append(path, "runs")...) +func (c SearchRunsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["runs"] = attrs["runs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SearchRunsResponse. @@ -9283,14 +9472,14 @@ func (o *SearchRunsResponse) SetRuns(ctx context.Context, v []Run) { type SetExperimentTag struct { // ID of the experiment under which to log the tag. Must be provided. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // Name of the tag. Maximum size depends on storage backend. All storage // backends are guaranteed to support key values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *SetExperimentTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetExperimentTag) { @@ -9299,12 +9488,12 @@ func (newState *SetExperimentTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SetExperimentTag) SyncEffectiveFieldsDuringRead(existingState SetExperimentTag) { } -func (c SetExperimentTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "value")...) +func (c SetExperimentTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["key"] = attrs["key"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetExperimentTag. @@ -9351,9 +9540,9 @@ func (newState *SetExperimentTagResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *SetExperimentTagResponse) SyncEffectiveFieldsDuringRead(existingState SetExperimentTagResponse) { } -func (c SetExperimentTagResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetExperimentTagResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetExperimentTagResponse. @@ -9388,13 +9577,13 @@ type SetModelTagRequest struct { // this name already exists, its preexisting value will be replaced by the // specified `value`. All storage backends are guaranteed to support key // values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Unique name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *SetModelTagRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetModelTagRequest) { @@ -9403,12 +9592,12 @@ func (newState *SetModelTagRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SetModelTagRequest) SyncEffectiveFieldsDuringRead(existingState SetModelTagRequest) { } -func (c SetModelTagRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "value")...) +func (c SetModelTagRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelTagRequest. @@ -9455,9 +9644,9 @@ func (newState *SetModelTagResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *SetModelTagResponse) SyncEffectiveFieldsDuringRead(existingState SetModelTagResponse) { } -func (c SetModelTagResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetModelTagResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelTagResponse. @@ -9492,15 +9681,15 @@ type SetModelVersionTagRequest struct { // this name already exists, its preexisting value will be replaced by the // specified `value`. All storage backends are guaranteed to support key // values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Unique name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` // Model version number. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *SetModelVersionTagRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetModelVersionTagRequest) { @@ -9509,13 +9698,13 @@ func (newState *SetModelVersionTagRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *SetModelVersionTagRequest) SyncEffectiveFieldsDuringRead(existingState SetModelVersionTagRequest) { } -func (c SetModelVersionTagRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "value")...) - cs.SetRequired(append(path, "version")...) +func (c SetModelVersionTagRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelVersionTagRequest. @@ -9564,9 +9753,9 @@ func (newState *SetModelVersionTagResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SetModelVersionTagResponse) SyncEffectiveFieldsDuringRead(existingState SetModelVersionTagResponse) { } -func (c SetModelVersionTagResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetModelVersionTagResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetModelVersionTagResponse. @@ -9599,16 +9788,16 @@ func (o SetModelVersionTagResponse) Type(ctx context.Context) attr.Type { type SetTag struct { // Name of the tag. Maximum size depends on storage backend. All storage // backends are guaranteed to support key values up to 250 bytes in size. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // ID of the run under which to log the tag. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run under which to log the // tag. This field will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // String value of the tag being logged. Maximum size depends on storage // backend. All storage backends are guaranteed to support key values up to // 5000 bytes in size. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *SetTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetTag) { @@ -9617,11 +9806,13 @@ func (newState *SetTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetTag) { func (newState *SetTag) SyncEffectiveFieldsDuringRead(existingState SetTag) { } -func (c SetTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "value")...) +func (c SetTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetTag. @@ -9670,9 +9861,9 @@ func (newState *SetTagResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Set func (newState *SetTagResponse) SyncEffectiveFieldsDuringRead(existingState SetTagResponse) { } -func (c SetTagResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetTagResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetTagResponse. @@ -9705,9 +9896,9 @@ func (o SetTagResponse) Type(ctx context.Context) attr.Type { // Test webhook response object. type TestRegistryWebhook struct { // Body of the response from the webhook URL - Body types.String `tfsdk:"body" tf:"optional"` + Body types.String `tfsdk:"body"` // Status code returned by the webhook URL - StatusCode types.Int64 `tfsdk:"status_code" tf:"optional"` + StatusCode types.Int64 `tfsdk:"status_code"` } func (newState *TestRegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan TestRegistryWebhook) { @@ -9716,9 +9907,11 @@ func (newState *TestRegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *TestRegistryWebhook) SyncEffectiveFieldsDuringRead(existingState TestRegistryWebhook) { } -func (c TestRegistryWebhook) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TestRegistryWebhook) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["body"] = attrs["body"].SetOptional() + attrs["status_code"] = attrs["status_code"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TestRegistryWebhook. @@ -9758,9 +9951,9 @@ type TestRegistryWebhookRequest struct { // If `event` is specified, the test trigger uses the specified event. If // `event` is not specified, the test trigger uses a randomly chosen event // associated with the webhook. - Event types.String `tfsdk:"event" tf:"optional"` + Event types.String `tfsdk:"event"` // Webhook ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *TestRegistryWebhookRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan TestRegistryWebhookRequest) { @@ -9769,10 +9962,11 @@ func (newState *TestRegistryWebhookRequest) SyncEffectiveFieldsDuringCreateOrUpd func (newState *TestRegistryWebhookRequest) SyncEffectiveFieldsDuringRead(existingState TestRegistryWebhookRequest) { } -func (c TestRegistryWebhookRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) +func (c TestRegistryWebhookRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["event"] = attrs["event"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TestRegistryWebhookRequest. @@ -9810,7 +10004,7 @@ func (o TestRegistryWebhookRequest) Type(ctx context.Context) attr.Type { type TestRegistryWebhookResponse struct { // Test webhook response object. - Webhook types.Object `tfsdk:"webhook" tf:"optional,object"` + Webhook types.Object `tfsdk:"webhook"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TestRegistryWebhookResponse. @@ -9877,11 +10071,11 @@ func (o *TestRegistryWebhookResponse) SetWebhook(ctx context.Context, v TestRegi type TransitionModelVersionStageDatabricks struct { // Specifies whether to archive all current model versions in the target // stage. - ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions" tf:""` + ArchiveExistingVersions types.Bool `tfsdk:"archive_existing_versions"` // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Target stage of the transition. Valid values are: // // * `None`: The initial stage of a model version. @@ -9891,9 +10085,9 @@ type TransitionModelVersionStageDatabricks struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - Stage types.String `tfsdk:"stage" tf:""` + Stage types.String `tfsdk:"stage"` // Version of the model. - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *TransitionModelVersionStageDatabricks) SyncEffectiveFieldsDuringCreateOrUpdate(plan TransitionModelVersionStageDatabricks) { @@ -9902,13 +10096,14 @@ func (newState *TransitionModelVersionStageDatabricks) SyncEffectiveFieldsDuring func (newState *TransitionModelVersionStageDatabricks) SyncEffectiveFieldsDuringRead(existingState TransitionModelVersionStageDatabricks) { } -func (c TransitionModelVersionStageDatabricks) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "archive_existing_versions")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "stage")...) - cs.SetRequired(append(path, "version")...) +func (c TransitionModelVersionStageDatabricks) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["archive_existing_versions"] = attrs["archive_existing_versions"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["stage"] = attrs["stage"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransitionModelVersionStageDatabricks. @@ -9953,11 +10148,11 @@ func (o TransitionModelVersionStageDatabricks) Type(ctx context.Context) attr.Ty // Transition request details. type TransitionRequest struct { // Array of actions on the activity allowed for the current viewer. - AvailableActions types.List `tfsdk:"available_actions" tf:"optional"` + AvailableActions types.List `tfsdk:"available_actions"` // User-provided comment associated with the transition request. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Creation time of the object, as a Unix timestamp in milliseconds. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Target stage of the transition (if the activity is stage transition // related). Valid values are: // @@ -9968,9 +10163,9 @@ type TransitionRequest struct { // * `Production`: Production stage. // // * `Archived`: Archived stage. - ToStage types.String `tfsdk:"to_stage" tf:"optional"` + ToStage types.String `tfsdk:"to_stage"` // The username of the user that created the object. - UserId types.String `tfsdk:"user_id" tf:"optional"` + UserId types.String `tfsdk:"user_id"` } func (newState *TransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan TransitionRequest) { @@ -9979,9 +10174,14 @@ func (newState *TransitionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TransitionRequest) SyncEffectiveFieldsDuringRead(existingState TransitionRequest) { } -func (c TransitionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TransitionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["available_actions"] = attrs["available_actions"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["to_stage"] = attrs["to_stage"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransitionRequest. @@ -10054,7 +10254,7 @@ func (o *TransitionRequest) SetAvailableActions(ctx context.Context, v []types.S } type TransitionStageResponse struct { - ModelVersion types.Object `tfsdk:"model_version" tf:"optional,object"` + ModelVersion types.Object `tfsdk:"model_version"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransitionStageResponse. @@ -10120,9 +10320,9 @@ func (o *TransitionStageResponse) SetModelVersion(ctx context.Context, v ModelVe type UpdateComment struct { // User-provided comment on the action. - Comment types.String `tfsdk:"comment" tf:""` + Comment types.String `tfsdk:"comment"` // Unique identifier of an activity - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` } func (newState *UpdateComment) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateComment) { @@ -10131,11 +10331,11 @@ func (newState *UpdateComment) SyncEffectiveFieldsDuringCreateOrUpdate(plan Upda func (newState *UpdateComment) SyncEffectiveFieldsDuringRead(existingState UpdateComment) { } -func (c UpdateComment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "comment")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateComment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateComment. @@ -10173,7 +10373,7 @@ func (o UpdateComment) Type(ctx context.Context) attr.Type { type UpdateCommentResponse struct { // Comment details. - Comment types.Object `tfsdk:"comment" tf:"optional,object"` + Comment types.Object `tfsdk:"comment"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCommentResponse. @@ -10239,10 +10439,10 @@ func (o *UpdateCommentResponse) SetComment(ctx context.Context, v CommentObject) type UpdateExperiment struct { // ID of the associated experiment. - ExperimentId types.String `tfsdk:"experiment_id" tf:""` + ExperimentId types.String `tfsdk:"experiment_id"` // If provided, the experiment's name is changed to the new name. The new // name must be unique. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` } func (newState *UpdateExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateExperiment) { @@ -10251,10 +10451,11 @@ func (newState *UpdateExperiment) SyncEffectiveFieldsDuringCreateOrUpdate(plan U func (newState *UpdateExperiment) SyncEffectiveFieldsDuringRead(existingState UpdateExperiment) { } -func (c UpdateExperiment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "experiment_id")...) +func (c UpdateExperiment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["experiment_id"] = attrs["experiment_id"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExperiment. @@ -10299,9 +10500,9 @@ func (newState *UpdateExperimentResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateExperimentResponse) SyncEffectiveFieldsDuringRead(existingState UpdateExperimentResponse) { } -func (c UpdateExperimentResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateExperimentResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateExperimentResponse. @@ -10333,9 +10534,9 @@ func (o UpdateExperimentResponse) Type(ctx context.Context) attr.Type { type UpdateModelRequest struct { // If provided, updates the description for this `registered_model`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Registered model unique name identifier. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *UpdateModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateModelRequest) { @@ -10344,10 +10545,11 @@ func (newState *UpdateModelRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateModelRequest) SyncEffectiveFieldsDuringRead(existingState UpdateModelRequest) { } -func (c UpdateModelRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateModelRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateModelRequest. @@ -10415,11 +10617,11 @@ func (o UpdateModelResponse) Type(ctx context.Context) attr.Type { type UpdateModelVersionRequest struct { // If provided, updates the description for this `registered_model`. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Name of the registered model - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Model version number - Version types.String `tfsdk:"version" tf:""` + Version types.String `tfsdk:"version"` } func (newState *UpdateModelVersionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateModelVersionRequest) { @@ -10428,11 +10630,12 @@ func (newState *UpdateModelVersionRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *UpdateModelVersionRequest) SyncEffectiveFieldsDuringRead(existingState UpdateModelVersionRequest) { } -func (c UpdateModelVersionRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "version")...) +func (c UpdateModelVersionRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["version"] = attrs["version"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateModelVersionRequest. @@ -10502,7 +10705,7 @@ func (o UpdateModelVersionResponse) Type(ctx context.Context) attr.Type { type UpdateRegistryWebhook struct { // User-specified description for the webhook. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A // new model version was created for the associated model. // @@ -10536,13 +10739,13 @@ type UpdateRegistryWebhook struct { // // * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model // version be archived. - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` - HttpUrlSpec types.Object `tfsdk:"http_url_spec" tf:"optional,object"` + HttpUrlSpec types.Object `tfsdk:"http_url_spec"` // Webhook ID - Id types.String `tfsdk:"id" tf:""` + Id types.String `tfsdk:"id"` - JobSpec types.Object `tfsdk:"job_spec" tf:"optional,object"` + JobSpec types.Object `tfsdk:"job_spec"` // Enable or disable triggering the webhook, or put the webhook into test // mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an // associated event happens. @@ -10551,7 +10754,7 @@ type UpdateRegistryWebhook struct { // // * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is // not triggered on a real event. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *UpdateRegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRegistryWebhook) { @@ -10560,12 +10763,15 @@ func (newState *UpdateRegistryWebhook) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateRegistryWebhook) SyncEffectiveFieldsDuringRead(existingState UpdateRegistryWebhook) { } -func (c UpdateRegistryWebhook) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - HttpUrlSpec{}.ApplySchemaCustomizations(cs, append(path, "http_url_spec")...) - cs.SetRequired(append(path, "id")...) - JobSpec{}.ApplySchemaCustomizations(cs, append(path, "job_spec")...) +func (c UpdateRegistryWebhook) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["events"] = attrs["events"].SetOptional() + attrs["http_url_spec"] = attrs["http_url_spec"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["job_spec"] = attrs["job_spec"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRegistryWebhook. @@ -10699,14 +10905,14 @@ func (o *UpdateRegistryWebhook) SetJobSpec(ctx context.Context, v JobSpec) { type UpdateRun struct { // Unix timestamp in milliseconds of when the run ended. - EndTime types.Int64 `tfsdk:"end_time" tf:"optional"` + EndTime types.Int64 `tfsdk:"end_time"` // ID of the run to update. Must be provided. - RunId types.String `tfsdk:"run_id" tf:"optional"` + RunId types.String `tfsdk:"run_id"` // [Deprecated, use run_id instead] ID of the run to update.. This field // will be removed in a future MLflow version. - RunUuid types.String `tfsdk:"run_uuid" tf:"optional"` + RunUuid types.String `tfsdk:"run_uuid"` // Updated status of the run. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *UpdateRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRun) { @@ -10715,9 +10921,13 @@ func (newState *UpdateRun) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRu func (newState *UpdateRun) SyncEffectiveFieldsDuringRead(existingState UpdateRun) { } -func (c UpdateRun) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time"] = attrs["end_time"].SetOptional() + attrs["run_id"] = attrs["run_id"].SetOptional() + attrs["run_uuid"] = attrs["run_uuid"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRun. @@ -10759,7 +10969,7 @@ func (o UpdateRun) Type(ctx context.Context) attr.Type { type UpdateRunResponse struct { // Updated metadata of the run. - RunInfo types.Object `tfsdk:"run_info" tf:"optional,object"` + RunInfo types.Object `tfsdk:"run_info"` } func (newState *UpdateRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRunResponse) { @@ -10768,10 +10978,10 @@ func (newState *UpdateRunResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateRunResponse) SyncEffectiveFieldsDuringRead(existingState UpdateRunResponse) { } -func (c UpdateRunResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RunInfo{}.ApplySchemaCustomizations(cs, append(path, "run_info")...) +func (c UpdateRunResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["run_info"] = attrs["run_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRunResponse. diff --git a/internal/service/oauth2_tf/legacy_model.go b/internal/service/oauth2_tf/legacy_model.go index 4b0a8d0bf..55c16e437 100755 --- a/internal/service/oauth2_tf/legacy_model.go +++ b/internal/service/oauth2_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -24,7 +25,7 @@ import ( // Create account federation policy type CreateAccountFederationPolicyRequest_SdkV2 struct { - Policy types.List `tfsdk:"policy" tf:"optional,object"` + Policy types.List `tfsdk:"policy"` // The identifier for the federation policy. If unspecified, the id will be // assigned by Databricks. PolicyId types.String `tfsdk:"-"` @@ -96,16 +97,16 @@ func (o *CreateAccountFederationPolicyRequest_SdkV2) SetPolicy(ctx context.Conte type CreateCustomAppIntegration_SdkV2 struct { // This field indicates whether an OAuth client secret is required to // authenticate this client. - Confidential types.Bool `tfsdk:"confidential" tf:"optional"` + Confidential types.Bool `tfsdk:"confidential"` // Name of the custom OAuth app - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of OAuth redirect urls - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` // OAuth scopes granted to the application. Supported scopes: all-apis, sql, // offline_access, openid, profile, email. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` // Token access policy - TokenAccessPolicy types.List `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.List `tfsdk:"token_access_policy"` } func (newState *CreateCustomAppIntegration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCustomAppIntegration_SdkV2) { @@ -114,10 +115,15 @@ func (newState *CreateCustomAppIntegration_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CreateCustomAppIntegration_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCustomAppIntegration_SdkV2) { } -func (c CreateCustomAppIntegration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c CreateCustomAppIntegration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["confidential"] = attrs["confidential"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCustomAppIntegration. @@ -249,12 +255,12 @@ func (o *CreateCustomAppIntegration_SdkV2) SetTokenAccessPolicy(ctx context.Cont type CreateCustomAppIntegrationOutput_SdkV2 struct { // OAuth client-id generated by the Databricks - ClientId types.String `tfsdk:"client_id" tf:"optional"` + ClientId types.String `tfsdk:"client_id"` // OAuth client-secret generated by the Databricks. If this is a // confidential OAuth app client-secret will be generated. - ClientSecret types.String `tfsdk:"client_secret" tf:"optional"` + ClientSecret types.String `tfsdk:"client_secret"` // Unique integration id for the custom OAuth app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` } func (newState *CreateCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCustomAppIntegrationOutput_SdkV2) { @@ -263,9 +269,12 @@ func (newState *CreateCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDurin func (newState *CreateCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCustomAppIntegrationOutput_SdkV2) { } -func (c CreateCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["client_id"] = attrs["client_id"].SetOptional() + attrs["client_secret"] = attrs["client_secret"].SetOptional() + attrs["integration_id"] = attrs["integration_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCustomAppIntegrationOutput. @@ -306,9 +315,9 @@ func (o CreateCustomAppIntegrationOutput_SdkV2) Type(ctx context.Context) attr.T type CreatePublishedAppIntegration_SdkV2 struct { // App id of the OAuth published app integration. For example power-bi, // tableau-deskop - AppId types.String `tfsdk:"app_id" tf:"optional"` + AppId types.String `tfsdk:"app_id"` // Token access policy - TokenAccessPolicy types.List `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.List `tfsdk:"token_access_policy"` } func (newState *CreatePublishedAppIntegration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePublishedAppIntegration_SdkV2) { @@ -317,10 +326,12 @@ func (newState *CreatePublishedAppIntegration_SdkV2) SyncEffectiveFieldsDuringCr func (newState *CreatePublishedAppIntegration_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePublishedAppIntegration_SdkV2) { } -func (c CreatePublishedAppIntegration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c CreatePublishedAppIntegration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_id"] = attrs["app_id"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePublishedAppIntegration. @@ -388,7 +399,7 @@ func (o *CreatePublishedAppIntegration_SdkV2) SetTokenAccessPolicy(ctx context.C type CreatePublishedAppIntegrationOutput_SdkV2 struct { // Unique integration id for the published OAuth app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` } func (newState *CreatePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePublishedAppIntegrationOutput_SdkV2) { @@ -397,9 +408,10 @@ func (newState *CreatePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDu func (newState *CreatePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePublishedAppIntegrationOutput_SdkV2) { } -func (c CreatePublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreatePublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_id"] = attrs["integration_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePublishedAppIntegrationOutput. @@ -435,7 +447,7 @@ func (o CreatePublishedAppIntegrationOutput_SdkV2) Type(ctx context.Context) att // Create service principal federation policy type CreateServicePrincipalFederationPolicyRequest_SdkV2 struct { - Policy types.List `tfsdk:"policy" tf:"optional,object"` + Policy types.List `tfsdk:"policy"` // The identifier for the federation policy. If unspecified, the id will be // assigned by Databricks. PolicyId types.String `tfsdk:"-"` @@ -547,17 +559,17 @@ func (o CreateServicePrincipalSecretRequest_SdkV2) Type(ctx context.Context) att type CreateServicePrincipalSecretResponse_SdkV2 struct { // UTC time when the secret was created - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // ID of the secret - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Secret Value - Secret types.String `tfsdk:"secret" tf:"optional"` + Secret types.String `tfsdk:"secret"` // Secret Hash - SecretHash types.String `tfsdk:"secret_hash" tf:"optional"` + SecretHash types.String `tfsdk:"secret_hash"` // Status of the secret - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // UTC time when the secret was updated - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *CreateServicePrincipalSecretResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateServicePrincipalSecretResponse_SdkV2) { @@ -566,9 +578,15 @@ func (newState *CreateServicePrincipalSecretResponse_SdkV2) SyncEffectiveFieldsD func (newState *CreateServicePrincipalSecretResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateServicePrincipalSecretResponse_SdkV2) { } -func (c CreateServicePrincipalSecretResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateServicePrincipalSecretResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["secret"] = attrs["secret"].SetOptional() + attrs["secret_hash"] = attrs["secret_hash"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateServicePrincipalSecretResponse. @@ -614,9 +632,9 @@ func (o CreateServicePrincipalSecretResponse_SdkV2) Type(ctx context.Context) at type DataPlaneInfo_SdkV2 struct { // Authorization details as a string. - AuthorizationDetails types.String `tfsdk:"authorization_details" tf:"optional"` + AuthorizationDetails types.String `tfsdk:"authorization_details"` // The URL of the endpoint for this operation in the dataplane. - EndpointUrl types.String `tfsdk:"endpoint_url" tf:"optional"` + EndpointUrl types.String `tfsdk:"endpoint_url"` } func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneInfo_SdkV2) { @@ -625,9 +643,11 @@ func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataPlaneInfo_SdkV2) { } -func (c DataPlaneInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataPlaneInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authorization_details"] = attrs["authorization_details"].SetOptional() + attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneInfo. @@ -708,9 +728,9 @@ func (newState *DeleteCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDurin func (newState *DeleteCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteCustomAppIntegrationOutput_SdkV2) { } -func (c DeleteCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCustomAppIntegrationOutput. @@ -785,9 +805,9 @@ func (newState *DeletePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDu func (newState *DeletePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeletePublishedAppIntegrationOutput_SdkV2) { } -func (c DeletePublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeletePublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePublishedAppIntegrationOutput. @@ -966,20 +986,20 @@ func (o DeleteServicePrincipalSecretRequest_SdkV2) Type(ctx context.Context) att type FederationPolicy_SdkV2 struct { // Creation time of the federation policy. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // Description of the federation policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Name of the federation policy. The name must contain only lowercase // alphanumeric characters, numbers, and hyphens. It must be unique within // the account. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Specifies the policy to use for validating OIDC claims in your federated // tokens. - OidcPolicy types.List `tfsdk:"oidc_policy" tf:"optional,object"` + OidcPolicy types.List `tfsdk:"oidc_policy"` // Unique, immutable id of the federation policy. - Uid types.String `tfsdk:"uid" tf:"computed"` + Uid types.String `tfsdk:"uid"` // Last update time of the federation policy. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *FederationPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FederationPolicy_SdkV2) { @@ -988,13 +1008,16 @@ func (newState *FederationPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *FederationPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState FederationPolicy_SdkV2) { } -func (c FederationPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - OidcFederationPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "oidc_policy")...) - cs.SetComputed(append(path, "uid")...) - cs.SetComputed(append(path, "update_time")...) +func (c FederationPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["oidc_policy"] = attrs["oidc_policy"].SetOptional() + attrs["oidc_policy"] = attrs["oidc_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["uid"] = attrs["uid"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FederationPolicy. @@ -1106,26 +1129,26 @@ func (o GetAccountFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr. type GetCustomAppIntegrationOutput_SdkV2 struct { // The client id of the custom OAuth app - ClientId types.String `tfsdk:"client_id" tf:"optional"` + ClientId types.String `tfsdk:"client_id"` // This field indicates whether an OAuth client secret is required to // authenticate this client. - Confidential types.Bool `tfsdk:"confidential" tf:"optional"` + Confidential types.Bool `tfsdk:"confidential"` - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` - CreatedBy types.Int64 `tfsdk:"created_by" tf:"optional"` + CreatedBy types.Int64 `tfsdk:"created_by"` - CreatorUsername types.String `tfsdk:"creator_username" tf:"optional"` + CreatorUsername types.String `tfsdk:"creator_username"` // ID of this custom app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` // The display name of the custom OAuth app - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of OAuth redirect urls - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` // Token access policy - TokenAccessPolicy types.List `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.List `tfsdk:"token_access_policy"` } func (newState *GetCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetCustomAppIntegrationOutput_SdkV2) { @@ -1134,10 +1157,20 @@ func (newState *GetCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringCr func (newState *GetCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetCustomAppIntegrationOutput_SdkV2) { } -func (c GetCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c GetCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["client_id"] = attrs["client_id"].SetOptional() + attrs["confidential"] = attrs["confidential"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["creator_username"] = attrs["creator_username"].SetOptional() + attrs["integration_id"] = attrs["integration_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetCustomAppIntegrationOutput. @@ -1316,9 +1349,9 @@ func (o GetCustomAppIntegrationRequest_SdkV2) Type(ctx context.Context) attr.Typ type GetCustomAppIntegrationsOutput_SdkV2 struct { // List of Custom OAuth App Integrations defined for the account. - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetCustomAppIntegrationsOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetCustomAppIntegrationsOutput_SdkV2) { @@ -1327,10 +1360,11 @@ func (newState *GetCustomAppIntegrationsOutput_SdkV2) SyncEffectiveFieldsDuringC func (newState *GetCustomAppIntegrationsOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetCustomAppIntegrationsOutput_SdkV2) { } -func (c GetCustomAppIntegrationsOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GetCustomAppIntegrationOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c GetCustomAppIntegrationsOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetCustomAppIntegrationsOutput. @@ -1398,17 +1432,17 @@ func (o *GetCustomAppIntegrationsOutput_SdkV2) SetApps(ctx context.Context, v [] type GetPublishedAppIntegrationOutput_SdkV2 struct { // App-id of the published app integration - AppId types.String `tfsdk:"app_id" tf:"optional"` + AppId types.String `tfsdk:"app_id"` - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` - CreatedBy types.Int64 `tfsdk:"created_by" tf:"optional"` + CreatedBy types.Int64 `tfsdk:"created_by"` // Unique integration id for the published OAuth app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` // Display name of the published OAuth app - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Token access policy - TokenAccessPolicy types.List `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.List `tfsdk:"token_access_policy"` } func (newState *GetPublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPublishedAppIntegrationOutput_SdkV2) { @@ -1417,10 +1451,16 @@ func (newState *GetPublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDurin func (newState *GetPublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPublishedAppIntegrationOutput_SdkV2) { } -func (c GetPublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c GetPublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_id"] = attrs["app_id"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["integration_id"] = attrs["integration_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPublishedAppIntegrationOutput. @@ -1532,9 +1572,9 @@ func (o GetPublishedAppIntegrationRequest_SdkV2) Type(ctx context.Context) attr. type GetPublishedAppIntegrationsOutput_SdkV2 struct { // List of Published OAuth App Integrations defined for the account. - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetPublishedAppIntegrationsOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPublishedAppIntegrationsOutput_SdkV2) { @@ -1543,10 +1583,11 @@ func (newState *GetPublishedAppIntegrationsOutput_SdkV2) SyncEffectiveFieldsDuri func (newState *GetPublishedAppIntegrationsOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPublishedAppIntegrationsOutput_SdkV2) { } -func (c GetPublishedAppIntegrationsOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GetPublishedAppIntegrationOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c GetPublishedAppIntegrationsOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPublishedAppIntegrationsOutput. @@ -1614,10 +1655,10 @@ func (o *GetPublishedAppIntegrationsOutput_SdkV2) SetApps(ctx context.Context, v type GetPublishedAppsOutput_SdkV2 struct { // List of Published OAuth Apps. - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetPublishedAppsOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPublishedAppsOutput_SdkV2) { @@ -1626,10 +1667,11 @@ func (newState *GetPublishedAppsOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *GetPublishedAppsOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPublishedAppsOutput_SdkV2) { } -func (c GetPublishedAppsOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PublishedAppOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c GetPublishedAppsOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPublishedAppsOutput. @@ -1820,9 +1862,9 @@ func (o ListCustomAppIntegrationsRequest_SdkV2) Type(ctx context.Context) attr.T } type ListFederationPoliciesResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Policies types.List `tfsdk:"policies" tf:"optional"` + Policies types.List `tfsdk:"policies"` } func (newState *ListFederationPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFederationPoliciesResponse_SdkV2) { @@ -1831,10 +1873,11 @@ func (newState *ListFederationPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *ListFederationPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListFederationPoliciesResponse_SdkV2) { } -func (c ListFederationPoliciesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FederationPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "policies")...) +func (c ListFederationPoliciesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["policies"] = attrs["policies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFederationPoliciesResponse. @@ -2076,9 +2119,9 @@ func (o ListServicePrincipalSecretsRequest_SdkV2) Type(ctx context.Context) attr type ListServicePrincipalSecretsResponse_SdkV2 struct { // A token, which can be sent as `page_token` to retrieve the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of the secrets - Secrets types.List `tfsdk:"secrets" tf:"optional"` + Secrets types.List `tfsdk:"secrets"` } func (newState *ListServicePrincipalSecretsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListServicePrincipalSecretsResponse_SdkV2) { @@ -2087,10 +2130,11 @@ func (newState *ListServicePrincipalSecretsResponse_SdkV2) SyncEffectiveFieldsDu func (newState *ListServicePrincipalSecretsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListServicePrincipalSecretsResponse_SdkV2) { } -func (c ListServicePrincipalSecretsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SecretInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "secrets")...) +func (c ListServicePrincipalSecretsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["secrets"] = attrs["secrets"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListServicePrincipalSecretsResponse. @@ -2165,23 +2209,23 @@ type OidcFederationPolicy_SdkV2 struct { // the token matches at least one audience in the policy, the token is // considered a match. If audiences is unspecified, defaults to your // Databricks account id. - Audiences types.List `tfsdk:"audiences" tf:"optional"` + Audiences types.List `tfsdk:"audiences"` // The required token issuer, as specified in the 'iss' claim of federated // tokens. - Issuer types.String `tfsdk:"issuer" tf:"optional"` + Issuer types.String `tfsdk:"issuer"` // The public keys used to validate the signature of federated tokens, in // JWKS format. If unspecified (recommended), Databricks automatically // fetches the public keys from your issuer’s well known endpoint. // Databricks strongly recommends relying on your issuer’s well known // endpoint for discovering public keys. - JwksJson types.String `tfsdk:"jwks_json" tf:"optional"` + JwksJson types.String `tfsdk:"jwks_json"` // The required token subject, as specified in the subject claim of // federated tokens. Must be specified for service principal federation // policies. Must not be specified for account federation policies. - Subject types.String `tfsdk:"subject" tf:"optional"` + Subject types.String `tfsdk:"subject"` // The claim that contains the subject of the token. If unspecified, the // default value is 'sub'. - SubjectClaim types.String `tfsdk:"subject_claim" tf:"optional"` + SubjectClaim types.String `tfsdk:"subject_claim"` } func (newState *OidcFederationPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OidcFederationPolicy_SdkV2) { @@ -2190,9 +2234,14 @@ func (newState *OidcFederationPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *OidcFederationPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState OidcFederationPolicy_SdkV2) { } -func (c OidcFederationPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OidcFederationPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["audiences"] = attrs["audiences"].SetOptional() + attrs["issuer"] = attrs["issuer"].SetOptional() + attrs["jwks_json"] = attrs["jwks_json"].SetOptional() + attrs["subject"] = attrs["subject"].SetOptional() + attrs["subject_claim"] = attrs["subject_claim"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OidcFederationPolicy. @@ -2266,21 +2315,21 @@ func (o *OidcFederationPolicy_SdkV2) SetAudiences(ctx context.Context, v []types type PublishedAppOutput_SdkV2 struct { // Unique ID of the published OAuth app. - AppId types.String `tfsdk:"app_id" tf:"optional"` + AppId types.String `tfsdk:"app_id"` // Client ID of the published OAuth app. It is the client_id in the OAuth // flow - ClientId types.String `tfsdk:"client_id" tf:"optional"` + ClientId types.String `tfsdk:"client_id"` // Description of the published OAuth app. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Whether the published OAuth app is a confidential client. It is always // false for published OAuth apps. - IsConfidentialClient types.Bool `tfsdk:"is_confidential_client" tf:"optional"` + IsConfidentialClient types.Bool `tfsdk:"is_confidential_client"` // The display name of the published OAuth app. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Redirect URLs of the published OAuth app. - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` // Required scopes for the published OAuth app. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` } func (newState *PublishedAppOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishedAppOutput_SdkV2) { @@ -2289,9 +2338,16 @@ func (newState *PublishedAppOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PublishedAppOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState PublishedAppOutput_SdkV2) { } -func (c PublishedAppOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PublishedAppOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_id"] = attrs["app_id"].SetOptional() + attrs["client_id"] = attrs["client_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["is_confidential_client"] = attrs["is_confidential_client"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublishedAppOutput. @@ -2398,15 +2454,15 @@ func (o *PublishedAppOutput_SdkV2) SetScopes(ctx context.Context, v []types.Stri type SecretInfo_SdkV2 struct { // UTC time when the secret was created - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // ID of the secret - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Secret Hash - SecretHash types.String `tfsdk:"secret_hash" tf:"optional"` + SecretHash types.String `tfsdk:"secret_hash"` // Status of the secret - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // UTC time when the secret was updated - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *SecretInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretInfo_SdkV2) { @@ -2415,9 +2471,14 @@ func (newState *SecretInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SecretInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState SecretInfo_SdkV2) { } -func (c SecretInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SecretInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["secret_hash"] = attrs["secret_hash"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecretInfo. @@ -2461,9 +2522,9 @@ func (o SecretInfo_SdkV2) Type(ctx context.Context) attr.Type { type TokenAccessPolicy_SdkV2 struct { // access token time to live in minutes - AccessTokenTtlInMinutes types.Int64 `tfsdk:"access_token_ttl_in_minutes" tf:"optional"` + AccessTokenTtlInMinutes types.Int64 `tfsdk:"access_token_ttl_in_minutes"` // refresh token time to live in minutes - RefreshTokenTtlInMinutes types.Int64 `tfsdk:"refresh_token_ttl_in_minutes" tf:"optional"` + RefreshTokenTtlInMinutes types.Int64 `tfsdk:"refresh_token_ttl_in_minutes"` } func (newState *TokenAccessPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenAccessPolicy_SdkV2) { @@ -2472,9 +2533,11 @@ func (newState *TokenAccessPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *TokenAccessPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenAccessPolicy_SdkV2) { } -func (c TokenAccessPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenAccessPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_token_ttl_in_minutes"] = attrs["access_token_ttl_in_minutes"].SetOptional() + attrs["refresh_token_ttl_in_minutes"] = attrs["refresh_token_ttl_in_minutes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenAccessPolicy. @@ -2512,7 +2575,7 @@ func (o TokenAccessPolicy_SdkV2) Type(ctx context.Context) attr.Type { // Update account federation policy type UpdateAccountFederationPolicyRequest_SdkV2 struct { - Policy types.List `tfsdk:"policy" tf:"optional,object"` + Policy types.List `tfsdk:"policy"` PolicyId types.String `tfsdk:"-"` // Field mask is required to be passed into the PATCH request. Field mask @@ -2591,9 +2654,9 @@ type UpdateCustomAppIntegration_SdkV2 struct { IntegrationId types.String `tfsdk:"-"` // List of OAuth redirect urls to be updated in the custom OAuth app // integration - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` // Token access policy to be updated in the custom OAuth app integration - TokenAccessPolicy types.List `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.List `tfsdk:"token_access_policy"` } func (newState *UpdateCustomAppIntegration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCustomAppIntegration_SdkV2) { @@ -2602,11 +2665,13 @@ func (newState *UpdateCustomAppIntegration_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UpdateCustomAppIntegration_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCustomAppIntegration_SdkV2) { } -func (c UpdateCustomAppIntegration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "integration_id")...) - TokenAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c UpdateCustomAppIntegration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_id"] = attrs["integration_id"].SetRequired() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCustomAppIntegration. @@ -2712,9 +2777,9 @@ func (newState *UpdateCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDurin func (newState *UpdateCustomAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCustomAppIntegrationOutput_SdkV2) { } -func (c UpdateCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateCustomAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCustomAppIntegrationOutput. @@ -2747,7 +2812,7 @@ func (o UpdateCustomAppIntegrationOutput_SdkV2) Type(ctx context.Context) attr.T type UpdatePublishedAppIntegration_SdkV2 struct { IntegrationId types.String `tfsdk:"-"` // Token access policy to be updated in the published OAuth app integration - TokenAccessPolicy types.List `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.List `tfsdk:"token_access_policy"` } func (newState *UpdatePublishedAppIntegration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePublishedAppIntegration_SdkV2) { @@ -2756,11 +2821,12 @@ func (newState *UpdatePublishedAppIntegration_SdkV2) SyncEffectiveFieldsDuringCr func (newState *UpdatePublishedAppIntegration_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdatePublishedAppIntegration_SdkV2) { } -func (c UpdatePublishedAppIntegration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "integration_id")...) - TokenAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c UpdatePublishedAppIntegration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_id"] = attrs["integration_id"].SetRequired() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePublishedAppIntegration. @@ -2835,9 +2901,9 @@ func (newState *UpdatePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDu func (newState *UpdatePublishedAppIntegrationOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdatePublishedAppIntegrationOutput_SdkV2) { } -func (c UpdatePublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdatePublishedAppIntegrationOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePublishedAppIntegrationOutput. @@ -2869,7 +2935,7 @@ func (o UpdatePublishedAppIntegrationOutput_SdkV2) Type(ctx context.Context) att // Update service principal federation policy type UpdateServicePrincipalFederationPolicyRequest_SdkV2 struct { - Policy types.List `tfsdk:"policy" tf:"optional,object"` + Policy types.List `tfsdk:"policy"` PolicyId types.String `tfsdk:"-"` // The service principal id for the federation policy. diff --git a/internal/service/oauth2_tf/model.go b/internal/service/oauth2_tf/model.go index 221b6ddbd..3e7fa74de 100755 --- a/internal/service/oauth2_tf/model.go +++ b/internal/service/oauth2_tf/model.go @@ -24,7 +24,7 @@ import ( // Create account federation policy type CreateAccountFederationPolicyRequest struct { - Policy types.Object `tfsdk:"policy" tf:"optional,object"` + Policy types.Object `tfsdk:"policy"` // The identifier for the federation policy. If unspecified, the id will be // assigned by Databricks. PolicyId types.String `tfsdk:"-"` @@ -96,16 +96,16 @@ func (o *CreateAccountFederationPolicyRequest) SetPolicy(ctx context.Context, v type CreateCustomAppIntegration struct { // This field indicates whether an OAuth client secret is required to // authenticate this client. - Confidential types.Bool `tfsdk:"confidential" tf:"optional"` + Confidential types.Bool `tfsdk:"confidential"` // Name of the custom OAuth app - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of OAuth redirect urls - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` // OAuth scopes granted to the application. Supported scopes: all-apis, sql, // offline_access, openid, profile, email. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` // Token access policy - TokenAccessPolicy types.Object `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.Object `tfsdk:"token_access_policy"` } func (newState *CreateCustomAppIntegration) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCustomAppIntegration) { @@ -114,10 +114,14 @@ func (newState *CreateCustomAppIntegration) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateCustomAppIntegration) SyncEffectiveFieldsDuringRead(existingState CreateCustomAppIntegration) { } -func (c CreateCustomAppIntegration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c CreateCustomAppIntegration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["confidential"] = attrs["confidential"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCustomAppIntegration. @@ -249,12 +253,12 @@ func (o *CreateCustomAppIntegration) SetTokenAccessPolicy(ctx context.Context, v type CreateCustomAppIntegrationOutput struct { // OAuth client-id generated by the Databricks - ClientId types.String `tfsdk:"client_id" tf:"optional"` + ClientId types.String `tfsdk:"client_id"` // OAuth client-secret generated by the Databricks. If this is a // confidential OAuth app client-secret will be generated. - ClientSecret types.String `tfsdk:"client_secret" tf:"optional"` + ClientSecret types.String `tfsdk:"client_secret"` // Unique integration id for the custom OAuth app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` } func (newState *CreateCustomAppIntegrationOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCustomAppIntegrationOutput) { @@ -263,9 +267,12 @@ func (newState *CreateCustomAppIntegrationOutput) SyncEffectiveFieldsDuringCreat func (newState *CreateCustomAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState CreateCustomAppIntegrationOutput) { } -func (c CreateCustomAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateCustomAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["client_id"] = attrs["client_id"].SetOptional() + attrs["client_secret"] = attrs["client_secret"].SetOptional() + attrs["integration_id"] = attrs["integration_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCustomAppIntegrationOutput. @@ -306,9 +313,9 @@ func (o CreateCustomAppIntegrationOutput) Type(ctx context.Context) attr.Type { type CreatePublishedAppIntegration struct { // App id of the OAuth published app integration. For example power-bi, // tableau-deskop - AppId types.String `tfsdk:"app_id" tf:"optional"` + AppId types.String `tfsdk:"app_id"` // Token access policy - TokenAccessPolicy types.Object `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.Object `tfsdk:"token_access_policy"` } func (newState *CreatePublishedAppIntegration) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePublishedAppIntegration) { @@ -317,10 +324,11 @@ func (newState *CreatePublishedAppIntegration) SyncEffectiveFieldsDuringCreateOr func (newState *CreatePublishedAppIntegration) SyncEffectiveFieldsDuringRead(existingState CreatePublishedAppIntegration) { } -func (c CreatePublishedAppIntegration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c CreatePublishedAppIntegration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_id"] = attrs["app_id"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePublishedAppIntegration. @@ -388,7 +396,7 @@ func (o *CreatePublishedAppIntegration) SetTokenAccessPolicy(ctx context.Context type CreatePublishedAppIntegrationOutput struct { // Unique integration id for the published OAuth app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` } func (newState *CreatePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePublishedAppIntegrationOutput) { @@ -397,9 +405,10 @@ func (newState *CreatePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringCr func (newState *CreatePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState CreatePublishedAppIntegrationOutput) { } -func (c CreatePublishedAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreatePublishedAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_id"] = attrs["integration_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePublishedAppIntegrationOutput. @@ -435,7 +444,7 @@ func (o CreatePublishedAppIntegrationOutput) Type(ctx context.Context) attr.Type // Create service principal federation policy type CreateServicePrincipalFederationPolicyRequest struct { - Policy types.Object `tfsdk:"policy" tf:"optional,object"` + Policy types.Object `tfsdk:"policy"` // The identifier for the federation policy. If unspecified, the id will be // assigned by Databricks. PolicyId types.String `tfsdk:"-"` @@ -547,17 +556,17 @@ func (o CreateServicePrincipalSecretRequest) Type(ctx context.Context) attr.Type type CreateServicePrincipalSecretResponse struct { // UTC time when the secret was created - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // ID of the secret - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Secret Value - Secret types.String `tfsdk:"secret" tf:"optional"` + Secret types.String `tfsdk:"secret"` // Secret Hash - SecretHash types.String `tfsdk:"secret_hash" tf:"optional"` + SecretHash types.String `tfsdk:"secret_hash"` // Status of the secret - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // UTC time when the secret was updated - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *CreateServicePrincipalSecretResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateServicePrincipalSecretResponse) { @@ -566,9 +575,15 @@ func (newState *CreateServicePrincipalSecretResponse) SyncEffectiveFieldsDuringC func (newState *CreateServicePrincipalSecretResponse) SyncEffectiveFieldsDuringRead(existingState CreateServicePrincipalSecretResponse) { } -func (c CreateServicePrincipalSecretResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateServicePrincipalSecretResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["secret"] = attrs["secret"].SetOptional() + attrs["secret_hash"] = attrs["secret_hash"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateServicePrincipalSecretResponse. @@ -614,9 +629,9 @@ func (o CreateServicePrincipalSecretResponse) Type(ctx context.Context) attr.Typ type DataPlaneInfo struct { // Authorization details as a string. - AuthorizationDetails types.String `tfsdk:"authorization_details" tf:"optional"` + AuthorizationDetails types.String `tfsdk:"authorization_details"` // The URL of the endpoint for this operation in the dataplane. - EndpointUrl types.String `tfsdk:"endpoint_url" tf:"optional"` + EndpointUrl types.String `tfsdk:"endpoint_url"` } func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneInfo) { @@ -625,9 +640,11 @@ func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Data func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringRead(existingState DataPlaneInfo) { } -func (c DataPlaneInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataPlaneInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authorization_details"] = attrs["authorization_details"].SetOptional() + attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneInfo. @@ -708,9 +725,9 @@ func (newState *DeleteCustomAppIntegrationOutput) SyncEffectiveFieldsDuringCreat func (newState *DeleteCustomAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState DeleteCustomAppIntegrationOutput) { } -func (c DeleteCustomAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCustomAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCustomAppIntegrationOutput. @@ -785,9 +802,9 @@ func (newState *DeletePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringCr func (newState *DeletePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState DeletePublishedAppIntegrationOutput) { } -func (c DeletePublishedAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeletePublishedAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePublishedAppIntegrationOutput. @@ -966,20 +983,20 @@ func (o DeleteServicePrincipalSecretRequest) Type(ctx context.Context) attr.Type type FederationPolicy struct { // Creation time of the federation policy. - CreateTime types.String `tfsdk:"create_time" tf:"computed"` + CreateTime types.String `tfsdk:"create_time"` // Description of the federation policy. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Name of the federation policy. The name must contain only lowercase // alphanumeric characters, numbers, and hyphens. It must be unique within // the account. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Specifies the policy to use for validating OIDC claims in your federated // tokens. - OidcPolicy types.Object `tfsdk:"oidc_policy" tf:"optional,object"` + OidcPolicy types.Object `tfsdk:"oidc_policy"` // Unique, immutable id of the federation policy. - Uid types.String `tfsdk:"uid" tf:"computed"` + Uid types.String `tfsdk:"uid"` // Last update time of the federation policy. - UpdateTime types.String `tfsdk:"update_time" tf:"computed"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *FederationPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan FederationPolicy) { @@ -988,13 +1005,15 @@ func (newState *FederationPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan F func (newState *FederationPolicy) SyncEffectiveFieldsDuringRead(existingState FederationPolicy) { } -func (c FederationPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "create_time")...) - OidcFederationPolicy{}.ApplySchemaCustomizations(cs, append(path, "oidc_policy")...) - cs.SetComputed(append(path, "uid")...) - cs.SetComputed(append(path, "update_time")...) +func (c FederationPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetComputed() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["oidc_policy"] = attrs["oidc_policy"].SetOptional() + attrs["uid"] = attrs["uid"].SetComputed() + attrs["update_time"] = attrs["update_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FederationPolicy. @@ -1106,26 +1125,26 @@ func (o GetAccountFederationPolicyRequest) Type(ctx context.Context) attr.Type { type GetCustomAppIntegrationOutput struct { // The client id of the custom OAuth app - ClientId types.String `tfsdk:"client_id" tf:"optional"` + ClientId types.String `tfsdk:"client_id"` // This field indicates whether an OAuth client secret is required to // authenticate this client. - Confidential types.Bool `tfsdk:"confidential" tf:"optional"` + Confidential types.Bool `tfsdk:"confidential"` - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` - CreatedBy types.Int64 `tfsdk:"created_by" tf:"optional"` + CreatedBy types.Int64 `tfsdk:"created_by"` - CreatorUsername types.String `tfsdk:"creator_username" tf:"optional"` + CreatorUsername types.String `tfsdk:"creator_username"` // ID of this custom app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` // The display name of the custom OAuth app - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of OAuth redirect urls - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` // Token access policy - TokenAccessPolicy types.Object `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.Object `tfsdk:"token_access_policy"` } func (newState *GetCustomAppIntegrationOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetCustomAppIntegrationOutput) { @@ -1134,10 +1153,19 @@ func (newState *GetCustomAppIntegrationOutput) SyncEffectiveFieldsDuringCreateOr func (newState *GetCustomAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState GetCustomAppIntegrationOutput) { } -func (c GetCustomAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c GetCustomAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["client_id"] = attrs["client_id"].SetOptional() + attrs["confidential"] = attrs["confidential"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["creator_username"] = attrs["creator_username"].SetOptional() + attrs["integration_id"] = attrs["integration_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetCustomAppIntegrationOutput. @@ -1316,9 +1344,9 @@ func (o GetCustomAppIntegrationRequest) Type(ctx context.Context) attr.Type { type GetCustomAppIntegrationsOutput struct { // List of Custom OAuth App Integrations defined for the account. - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetCustomAppIntegrationsOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetCustomAppIntegrationsOutput) { @@ -1327,10 +1355,11 @@ func (newState *GetCustomAppIntegrationsOutput) SyncEffectiveFieldsDuringCreateO func (newState *GetCustomAppIntegrationsOutput) SyncEffectiveFieldsDuringRead(existingState GetCustomAppIntegrationsOutput) { } -func (c GetCustomAppIntegrationsOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GetCustomAppIntegrationOutput{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c GetCustomAppIntegrationsOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetCustomAppIntegrationsOutput. @@ -1398,17 +1427,17 @@ func (o *GetCustomAppIntegrationsOutput) SetApps(ctx context.Context, v []GetCus type GetPublishedAppIntegrationOutput struct { // App-id of the published app integration - AppId types.String `tfsdk:"app_id" tf:"optional"` + AppId types.String `tfsdk:"app_id"` - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` - CreatedBy types.Int64 `tfsdk:"created_by" tf:"optional"` + CreatedBy types.Int64 `tfsdk:"created_by"` // Unique integration id for the published OAuth app - IntegrationId types.String `tfsdk:"integration_id" tf:"optional"` + IntegrationId types.String `tfsdk:"integration_id"` // Display name of the published OAuth app - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Token access policy - TokenAccessPolicy types.Object `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.Object `tfsdk:"token_access_policy"` } func (newState *GetPublishedAppIntegrationOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPublishedAppIntegrationOutput) { @@ -1417,10 +1446,15 @@ func (newState *GetPublishedAppIntegrationOutput) SyncEffectiveFieldsDuringCreat func (newState *GetPublishedAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState GetPublishedAppIntegrationOutput) { } -func (c GetPublishedAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c GetPublishedAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_id"] = attrs["app_id"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["integration_id"] = attrs["integration_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPublishedAppIntegrationOutput. @@ -1532,9 +1566,9 @@ func (o GetPublishedAppIntegrationRequest) Type(ctx context.Context) attr.Type { type GetPublishedAppIntegrationsOutput struct { // List of Published OAuth App Integrations defined for the account. - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetPublishedAppIntegrationsOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPublishedAppIntegrationsOutput) { @@ -1543,10 +1577,11 @@ func (newState *GetPublishedAppIntegrationsOutput) SyncEffectiveFieldsDuringCrea func (newState *GetPublishedAppIntegrationsOutput) SyncEffectiveFieldsDuringRead(existingState GetPublishedAppIntegrationsOutput) { } -func (c GetPublishedAppIntegrationsOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GetPublishedAppIntegrationOutput{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c GetPublishedAppIntegrationsOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPublishedAppIntegrationsOutput. @@ -1614,10 +1649,10 @@ func (o *GetPublishedAppIntegrationsOutput) SetApps(ctx context.Context, v []Get type GetPublishedAppsOutput struct { // List of Published OAuth Apps. - Apps types.List `tfsdk:"apps" tf:"optional"` + Apps types.List `tfsdk:"apps"` // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *GetPublishedAppsOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPublishedAppsOutput) { @@ -1626,10 +1661,11 @@ func (newState *GetPublishedAppsOutput) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *GetPublishedAppsOutput) SyncEffectiveFieldsDuringRead(existingState GetPublishedAppsOutput) { } -func (c GetPublishedAppsOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PublishedAppOutput{}.ApplySchemaCustomizations(cs, append(path, "apps")...) +func (c GetPublishedAppsOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apps"] = attrs["apps"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPublishedAppsOutput. @@ -1820,9 +1856,9 @@ func (o ListCustomAppIntegrationsRequest) Type(ctx context.Context) attr.Type { } type ListFederationPoliciesResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Policies types.List `tfsdk:"policies" tf:"optional"` + Policies types.List `tfsdk:"policies"` } func (newState *ListFederationPoliciesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFederationPoliciesResponse) { @@ -1831,10 +1867,11 @@ func (newState *ListFederationPoliciesResponse) SyncEffectiveFieldsDuringCreateO func (newState *ListFederationPoliciesResponse) SyncEffectiveFieldsDuringRead(existingState ListFederationPoliciesResponse) { } -func (c ListFederationPoliciesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FederationPolicy{}.ApplySchemaCustomizations(cs, append(path, "policies")...) +func (c ListFederationPoliciesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["policies"] = attrs["policies"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFederationPoliciesResponse. @@ -2076,9 +2113,9 @@ func (o ListServicePrincipalSecretsRequest) Type(ctx context.Context) attr.Type type ListServicePrincipalSecretsResponse struct { // A token, which can be sent as `page_token` to retrieve the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of the secrets - Secrets types.List `tfsdk:"secrets" tf:"optional"` + Secrets types.List `tfsdk:"secrets"` } func (newState *ListServicePrincipalSecretsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListServicePrincipalSecretsResponse) { @@ -2087,10 +2124,11 @@ func (newState *ListServicePrincipalSecretsResponse) SyncEffectiveFieldsDuringCr func (newState *ListServicePrincipalSecretsResponse) SyncEffectiveFieldsDuringRead(existingState ListServicePrincipalSecretsResponse) { } -func (c ListServicePrincipalSecretsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SecretInfo{}.ApplySchemaCustomizations(cs, append(path, "secrets")...) +func (c ListServicePrincipalSecretsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["secrets"] = attrs["secrets"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListServicePrincipalSecretsResponse. @@ -2165,23 +2203,23 @@ type OidcFederationPolicy struct { // the token matches at least one audience in the policy, the token is // considered a match. If audiences is unspecified, defaults to your // Databricks account id. - Audiences types.List `tfsdk:"audiences" tf:"optional"` + Audiences types.List `tfsdk:"audiences"` // The required token issuer, as specified in the 'iss' claim of federated // tokens. - Issuer types.String `tfsdk:"issuer" tf:"optional"` + Issuer types.String `tfsdk:"issuer"` // The public keys used to validate the signature of federated tokens, in // JWKS format. If unspecified (recommended), Databricks automatically // fetches the public keys from your issuer’s well known endpoint. // Databricks strongly recommends relying on your issuer’s well known // endpoint for discovering public keys. - JwksJson types.String `tfsdk:"jwks_json" tf:"optional"` + JwksJson types.String `tfsdk:"jwks_json"` // The required token subject, as specified in the subject claim of // federated tokens. Must be specified for service principal federation // policies. Must not be specified for account federation policies. - Subject types.String `tfsdk:"subject" tf:"optional"` + Subject types.String `tfsdk:"subject"` // The claim that contains the subject of the token. If unspecified, the // default value is 'sub'. - SubjectClaim types.String `tfsdk:"subject_claim" tf:"optional"` + SubjectClaim types.String `tfsdk:"subject_claim"` } func (newState *OidcFederationPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan OidcFederationPolicy) { @@ -2190,9 +2228,14 @@ func (newState *OidcFederationPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *OidcFederationPolicy) SyncEffectiveFieldsDuringRead(existingState OidcFederationPolicy) { } -func (c OidcFederationPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OidcFederationPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["audiences"] = attrs["audiences"].SetOptional() + attrs["issuer"] = attrs["issuer"].SetOptional() + attrs["jwks_json"] = attrs["jwks_json"].SetOptional() + attrs["subject"] = attrs["subject"].SetOptional() + attrs["subject_claim"] = attrs["subject_claim"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OidcFederationPolicy. @@ -2266,21 +2309,21 @@ func (o *OidcFederationPolicy) SetAudiences(ctx context.Context, v []types.Strin type PublishedAppOutput struct { // Unique ID of the published OAuth app. - AppId types.String `tfsdk:"app_id" tf:"optional"` + AppId types.String `tfsdk:"app_id"` // Client ID of the published OAuth app. It is the client_id in the OAuth // flow - ClientId types.String `tfsdk:"client_id" tf:"optional"` + ClientId types.String `tfsdk:"client_id"` // Description of the published OAuth app. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Whether the published OAuth app is a confidential client. It is always // false for published OAuth apps. - IsConfidentialClient types.Bool `tfsdk:"is_confidential_client" tf:"optional"` + IsConfidentialClient types.Bool `tfsdk:"is_confidential_client"` // The display name of the published OAuth app. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Redirect URLs of the published OAuth app. - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` // Required scopes for the published OAuth app. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` } func (newState *PublishedAppOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishedAppOutput) { @@ -2289,9 +2332,16 @@ func (newState *PublishedAppOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PublishedAppOutput) SyncEffectiveFieldsDuringRead(existingState PublishedAppOutput) { } -func (c PublishedAppOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PublishedAppOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app_id"] = attrs["app_id"].SetOptional() + attrs["client_id"] = attrs["client_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["is_confidential_client"] = attrs["is_confidential_client"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublishedAppOutput. @@ -2398,15 +2448,15 @@ func (o *PublishedAppOutput) SetScopes(ctx context.Context, v []types.String) { type SecretInfo struct { // UTC time when the secret was created - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // ID of the secret - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Secret Hash - SecretHash types.String `tfsdk:"secret_hash" tf:"optional"` + SecretHash types.String `tfsdk:"secret_hash"` // Status of the secret - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // UTC time when the secret was updated - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *SecretInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretInfo) { @@ -2415,9 +2465,14 @@ func (newState *SecretInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretI func (newState *SecretInfo) SyncEffectiveFieldsDuringRead(existingState SecretInfo) { } -func (c SecretInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SecretInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["secret_hash"] = attrs["secret_hash"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecretInfo. @@ -2461,9 +2516,9 @@ func (o SecretInfo) Type(ctx context.Context) attr.Type { type TokenAccessPolicy struct { // access token time to live in minutes - AccessTokenTtlInMinutes types.Int64 `tfsdk:"access_token_ttl_in_minutes" tf:"optional"` + AccessTokenTtlInMinutes types.Int64 `tfsdk:"access_token_ttl_in_minutes"` // refresh token time to live in minutes - RefreshTokenTtlInMinutes types.Int64 `tfsdk:"refresh_token_ttl_in_minutes" tf:"optional"` + RefreshTokenTtlInMinutes types.Int64 `tfsdk:"refresh_token_ttl_in_minutes"` } func (newState *TokenAccessPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenAccessPolicy) { @@ -2472,9 +2527,11 @@ func (newState *TokenAccessPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TokenAccessPolicy) SyncEffectiveFieldsDuringRead(existingState TokenAccessPolicy) { } -func (c TokenAccessPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenAccessPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_token_ttl_in_minutes"] = attrs["access_token_ttl_in_minutes"].SetOptional() + attrs["refresh_token_ttl_in_minutes"] = attrs["refresh_token_ttl_in_minutes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenAccessPolicy. @@ -2512,7 +2569,7 @@ func (o TokenAccessPolicy) Type(ctx context.Context) attr.Type { // Update account federation policy type UpdateAccountFederationPolicyRequest struct { - Policy types.Object `tfsdk:"policy" tf:"optional,object"` + Policy types.Object `tfsdk:"policy"` PolicyId types.String `tfsdk:"-"` // Field mask is required to be passed into the PATCH request. Field mask @@ -2591,9 +2648,9 @@ type UpdateCustomAppIntegration struct { IntegrationId types.String `tfsdk:"-"` // List of OAuth redirect urls to be updated in the custom OAuth app // integration - RedirectUrls types.List `tfsdk:"redirect_urls" tf:"optional"` + RedirectUrls types.List `tfsdk:"redirect_urls"` // Token access policy to be updated in the custom OAuth app integration - TokenAccessPolicy types.Object `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.Object `tfsdk:"token_access_policy"` } func (newState *UpdateCustomAppIntegration) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCustomAppIntegration) { @@ -2602,11 +2659,12 @@ func (newState *UpdateCustomAppIntegration) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateCustomAppIntegration) SyncEffectiveFieldsDuringRead(existingState UpdateCustomAppIntegration) { } -func (c UpdateCustomAppIntegration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "integration_id")...) - TokenAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c UpdateCustomAppIntegration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_id"] = attrs["integration_id"].SetRequired() + attrs["redirect_urls"] = attrs["redirect_urls"].SetOptional() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCustomAppIntegration. @@ -2712,9 +2770,9 @@ func (newState *UpdateCustomAppIntegrationOutput) SyncEffectiveFieldsDuringCreat func (newState *UpdateCustomAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState UpdateCustomAppIntegrationOutput) { } -func (c UpdateCustomAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateCustomAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCustomAppIntegrationOutput. @@ -2747,7 +2805,7 @@ func (o UpdateCustomAppIntegrationOutput) Type(ctx context.Context) attr.Type { type UpdatePublishedAppIntegration struct { IntegrationId types.String `tfsdk:"-"` // Token access policy to be updated in the published OAuth app integration - TokenAccessPolicy types.Object `tfsdk:"token_access_policy" tf:"optional,object"` + TokenAccessPolicy types.Object `tfsdk:"token_access_policy"` } func (newState *UpdatePublishedAppIntegration) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePublishedAppIntegration) { @@ -2756,11 +2814,11 @@ func (newState *UpdatePublishedAppIntegration) SyncEffectiveFieldsDuringCreateOr func (newState *UpdatePublishedAppIntegration) SyncEffectiveFieldsDuringRead(existingState UpdatePublishedAppIntegration) { } -func (c UpdatePublishedAppIntegration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "integration_id")...) - TokenAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "token_access_policy")...) +func (c UpdatePublishedAppIntegration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_id"] = attrs["integration_id"].SetRequired() + attrs["token_access_policy"] = attrs["token_access_policy"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePublishedAppIntegration. @@ -2835,9 +2893,9 @@ func (newState *UpdatePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringCr func (newState *UpdatePublishedAppIntegrationOutput) SyncEffectiveFieldsDuringRead(existingState UpdatePublishedAppIntegrationOutput) { } -func (c UpdatePublishedAppIntegrationOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdatePublishedAppIntegrationOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePublishedAppIntegrationOutput. @@ -2869,7 +2927,7 @@ func (o UpdatePublishedAppIntegrationOutput) Type(ctx context.Context) attr.Type // Update service principal federation policy type UpdateServicePrincipalFederationPolicyRequest struct { - Policy types.Object `tfsdk:"policy" tf:"optional,object"` + Policy types.Object `tfsdk:"policy"` PolicyId types.String `tfsdk:"-"` // The service principal id for the federation policy. diff --git a/internal/service/pipelines_tf/legacy_model.go b/internal/service/pipelines_tf/legacy_model.go index f560f71d4..c30a90cdd 100755 --- a/internal/service/pipelines_tf/legacy_model.go +++ b/internal/service/pipelines_tf/legacy_model.go @@ -18,6 +18,7 @@ import ( "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" "github.com/databricks/terraform-provider-databricks/internal/service/compute_tf" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -26,64 +27,64 @@ import ( type CreatePipeline_SdkV2 struct { // If false, deployment will fail if name conflicts with that of another // pipeline. - AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names" tf:"optional"` + AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names"` // Budget policy of this pipeline. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // DLT Release Channel that specifies which version to use. - Channel types.String `tfsdk:"channel" tf:"optional"` + Channel types.String `tfsdk:"channel"` // Cluster settings for this pipeline deployment. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // String-String configuration for this pipeline execution. - Configuration types.Map `tfsdk:"configuration" tf:"optional"` + Configuration types.Map `tfsdk:"configuration"` // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous types.Bool `tfsdk:"continuous" tf:"optional"` + Continuous types.Bool `tfsdk:"continuous"` // Deployment type of this pipeline. - Deployment types.List `tfsdk:"deployment" tf:"optional,object"` + Deployment types.List `tfsdk:"deployment"` // Whether the pipeline is in Development mode. Defaults to false. - Development types.Bool `tfsdk:"development" tf:"optional"` + Development types.Bool `tfsdk:"development"` - DryRun types.Bool `tfsdk:"dry_run" tf:"optional"` + DryRun types.Bool `tfsdk:"dry_run"` // Pipeline product edition. - Edition types.String `tfsdk:"edition" tf:"optional"` + Edition types.String `tfsdk:"edition"` // Filters on which Pipeline packages to include in the deployed graph. - Filters types.List `tfsdk:"filters" tf:"optional,object"` + Filters types.List `tfsdk:"filters"` // The definition of a gateway pipeline to support change data capture. - GatewayDefinition types.List `tfsdk:"gateway_definition" tf:"optional,object"` + GatewayDefinition types.List `tfsdk:"gateway_definition"` // Unique identifier for this pipeline. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'target' or 'catalog' settings. - IngestionDefinition types.List `tfsdk:"ingestion_definition" tf:"optional,object"` + IngestionDefinition types.List `tfsdk:"ingestion_definition"` // Libraries or code needed by this deployment. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Friendly identifier for this pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of notification settings for this pipeline. - Notifications types.List `tfsdk:"notifications" tf:"optional"` + Notifications types.List `tfsdk:"notifications"` // Whether Photon is enabled for this pipeline. - Photon types.Bool `tfsdk:"photon" tf:"optional"` + Photon types.Bool `tfsdk:"photon"` // Restart window of this pipeline. - RestartWindow types.List `tfsdk:"restart_window" tf:"optional,object"` + RestartWindow types.List `tfsdk:"restart_window"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Whether serverless compute is enabled for this pipeline. - Serverless types.Bool `tfsdk:"serverless" tf:"optional"` + Serverless types.Bool `tfsdk:"serverless"` // DBFS root directory for storing checkpoints and tables. - Storage types.String `tfsdk:"storage" tf:"optional"` + Storage types.String `tfsdk:"storage"` // Target schema (database) to add tables in this pipeline to. If not // specified, no data is published to the Hive metastore or Unity Catalog. // To publish to Unity Catalog, also specify `catalog`. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger types.List `tfsdk:"trigger" tf:"optional,object"` + Trigger types.List `tfsdk:"trigger"` } func (newState *CreatePipeline_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePipeline_SdkV2) { @@ -92,18 +93,40 @@ func (newState *CreatePipeline_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreatePipeline_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePipeline_SdkV2) { } -func (c CreatePipeline_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) - PipelineDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - Filters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - IngestionGatewayPipelineDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gateway_definition")...) - IngestionPipelineDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ingestion_definition")...) - PipelineLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - Notifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - RestartWindow_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "restart_window")...) - PipelineTrigger_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - - return cs +func (c CreatePipeline_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_duplicate_names"] = attrs["allow_duplicate_names"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["configuration"] = attrs["configuration"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment"] = attrs["deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["development"] = attrs["development"].SetOptional() + attrs["dry_run"] = attrs["dry_run"].SetOptional() + attrs["edition"] = attrs["edition"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["filters"] = attrs["filters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gateway_definition"] = attrs["gateway_definition"].SetOptional() + attrs["gateway_definition"] = attrs["gateway_definition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["photon"] = attrs["photon"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema"] = attrs["schema"].SetOptional() + attrs["serverless"] = attrs["serverless"].SetOptional() + attrs["storage"] = attrs["storage"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger"] = attrs["trigger"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePipeline. @@ -478,10 +501,10 @@ func (o *CreatePipeline_SdkV2) SetTrigger(ctx context.Context, v PipelineTrigger type CreatePipelineResponse_SdkV2 struct { // Only returned when dry_run is true. - EffectiveSettings types.List `tfsdk:"effective_settings" tf:"optional,object"` + EffectiveSettings types.List `tfsdk:"effective_settings"` // The unique identifier for the newly created pipeline. Only returned when // dry_run is false. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` } func (newState *CreatePipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePipelineResponse_SdkV2) { @@ -490,10 +513,12 @@ func (newState *CreatePipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreatePipelineResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePipelineResponse_SdkV2) { } -func (c CreatePipelineResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "effective_settings")...) +func (c CreatePipelineResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["effective_settings"] = attrs["effective_settings"].SetOptional() + attrs["effective_settings"] = attrs["effective_settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePipelineResponse. @@ -560,9 +585,9 @@ func (o *CreatePipelineResponse_SdkV2) SetEffectiveSettings(ctx context.Context, } type CronTrigger_SdkV2 struct { - QuartzCronSchedule types.String `tfsdk:"quartz_cron_schedule" tf:"optional"` + QuartzCronSchedule types.String `tfsdk:"quartz_cron_schedule"` - TimezoneId types.String `tfsdk:"timezone_id" tf:"optional"` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *CronTrigger_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronTrigger_SdkV2) { @@ -571,9 +596,11 @@ func (newState *CronTrigger_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CronTrigger_SdkV2) SyncEffectiveFieldsDuringRead(existingState CronTrigger_SdkV2) { } -func (c CronTrigger_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CronTrigger_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["quartz_cron_schedule"] = attrs["quartz_cron_schedule"].SetOptional() + attrs["timezone_id"] = attrs["timezone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CronTrigger. @@ -611,9 +638,9 @@ func (o CronTrigger_SdkV2) Type(ctx context.Context) attr.Type { type DataPlaneId_SdkV2 struct { // The instance name of the data plane emitting an event. - Instance types.String `tfsdk:"instance" tf:"optional"` + Instance types.String `tfsdk:"instance"` // A sequence number, unique and increasing within the data plane instance. - SeqNo types.Int64 `tfsdk:"seq_no" tf:"optional"` + SeqNo types.Int64 `tfsdk:"seq_no"` } func (newState *DataPlaneId_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneId_SdkV2) { @@ -622,9 +649,11 @@ func (newState *DataPlaneId_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DataPlaneId_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataPlaneId_SdkV2) { } -func (c DataPlaneId_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataPlaneId_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance"] = attrs["instance"].SetOptional() + attrs["seq_no"] = attrs["seq_no"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneId. @@ -705,9 +734,9 @@ func (newState *DeletePipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *DeletePipelineResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeletePipelineResponse_SdkV2) { } -func (c DeletePipelineResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeletePipelineResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePipelineResponse. @@ -740,68 +769,68 @@ func (o DeletePipelineResponse_SdkV2) Type(ctx context.Context) attr.Type { type EditPipeline_SdkV2 struct { // If false, deployment will fail if name has changed and conflicts the name // of another pipeline. - AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names" tf:"optional"` + AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names"` // Budget policy of this pipeline. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // DLT Release Channel that specifies which version to use. - Channel types.String `tfsdk:"channel" tf:"optional"` + Channel types.String `tfsdk:"channel"` // Cluster settings for this pipeline deployment. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // String-String configuration for this pipeline execution. - Configuration types.Map `tfsdk:"configuration" tf:"optional"` + Configuration types.Map `tfsdk:"configuration"` // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous types.Bool `tfsdk:"continuous" tf:"optional"` + Continuous types.Bool `tfsdk:"continuous"` // Deployment type of this pipeline. - Deployment types.List `tfsdk:"deployment" tf:"optional,object"` + Deployment types.List `tfsdk:"deployment"` // Whether the pipeline is in Development mode. Defaults to false. - Development types.Bool `tfsdk:"development" tf:"optional"` + Development types.Bool `tfsdk:"development"` // Pipeline product edition. - Edition types.String `tfsdk:"edition" tf:"optional"` + Edition types.String `tfsdk:"edition"` // If present, the last-modified time of the pipeline settings before the // edit. If the settings were modified after that time, then the request // will fail with a conflict. - ExpectedLastModified types.Int64 `tfsdk:"expected_last_modified" tf:"optional"` + ExpectedLastModified types.Int64 `tfsdk:"expected_last_modified"` // Filters on which Pipeline packages to include in the deployed graph. - Filters types.List `tfsdk:"filters" tf:"optional,object"` + Filters types.List `tfsdk:"filters"` // The definition of a gateway pipeline to support change data capture. - GatewayDefinition types.List `tfsdk:"gateway_definition" tf:"optional,object"` + GatewayDefinition types.List `tfsdk:"gateway_definition"` // Unique identifier for this pipeline. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'target' or 'catalog' settings. - IngestionDefinition types.List `tfsdk:"ingestion_definition" tf:"optional,object"` + IngestionDefinition types.List `tfsdk:"ingestion_definition"` // Libraries or code needed by this deployment. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Friendly identifier for this pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of notification settings for this pipeline. - Notifications types.List `tfsdk:"notifications" tf:"optional"` + Notifications types.List `tfsdk:"notifications"` // Whether Photon is enabled for this pipeline. - Photon types.Bool `tfsdk:"photon" tf:"optional"` + Photon types.Bool `tfsdk:"photon"` // Unique identifier for this pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // Restart window of this pipeline. - RestartWindow types.List `tfsdk:"restart_window" tf:"optional,object"` + RestartWindow types.List `tfsdk:"restart_window"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Whether serverless compute is enabled for this pipeline. - Serverless types.Bool `tfsdk:"serverless" tf:"optional"` + Serverless types.Bool `tfsdk:"serverless"` // DBFS root directory for storing checkpoints and tables. - Storage types.String `tfsdk:"storage" tf:"optional"` + Storage types.String `tfsdk:"storage"` // Target schema (database) to add tables in this pipeline to. If not // specified, no data is published to the Hive metastore or Unity Catalog. // To publish to Unity Catalog, also specify `catalog`. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger types.List `tfsdk:"trigger" tf:"optional,object"` + Trigger types.List `tfsdk:"trigger"` } func (newState *EditPipeline_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditPipeline_SdkV2) { @@ -810,18 +839,41 @@ func (newState *EditPipeline_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EditPipeline_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditPipeline_SdkV2) { } -func (c EditPipeline_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) - PipelineDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - Filters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - IngestionGatewayPipelineDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gateway_definition")...) - IngestionPipelineDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ingestion_definition")...) - PipelineLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - Notifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - RestartWindow_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "restart_window")...) - PipelineTrigger_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - - return cs +func (c EditPipeline_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_duplicate_names"] = attrs["allow_duplicate_names"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["configuration"] = attrs["configuration"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment"] = attrs["deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["development"] = attrs["development"].SetOptional() + attrs["edition"] = attrs["edition"].SetOptional() + attrs["expected_last_modified"] = attrs["expected_last_modified"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["filters"] = attrs["filters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gateway_definition"] = attrs["gateway_definition"].SetOptional() + attrs["gateway_definition"] = attrs["gateway_definition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["photon"] = attrs["photon"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema"] = attrs["schema"].SetOptional() + attrs["serverless"] = attrs["serverless"].SetOptional() + attrs["storage"] = attrs["storage"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger"] = attrs["trigger"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPipeline. @@ -1205,9 +1257,9 @@ func (newState *EditPipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *EditPipelineResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditPipelineResponse_SdkV2) { } -func (c EditPipelineResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditPipelineResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPipelineResponse. @@ -1239,9 +1291,9 @@ func (o EditPipelineResponse_SdkV2) Type(ctx context.Context) attr.Type { type ErrorDetail_SdkV2 struct { // The exception thrown for this error, with its chain of cause. - Exceptions types.List `tfsdk:"exceptions" tf:"optional"` + Exceptions types.List `tfsdk:"exceptions"` // Whether this error is considered fatal, that is, unrecoverable. - Fatal types.Bool `tfsdk:"fatal" tf:"optional"` + Fatal types.Bool `tfsdk:"fatal"` } func (newState *ErrorDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ErrorDetail_SdkV2) { @@ -1250,10 +1302,11 @@ func (newState *ErrorDetail_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ErrorDetail_SdkV2) SyncEffectiveFieldsDuringRead(existingState ErrorDetail_SdkV2) { } -func (c ErrorDetail_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SerializedException_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "exceptions")...) +func (c ErrorDetail_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exceptions"] = attrs["exceptions"].SetOptional() + attrs["fatal"] = attrs["fatal"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ErrorDetail. @@ -1321,7 +1374,7 @@ func (o *ErrorDetail_SdkV2) SetExceptions(ctx context.Context, v []SerializedExc type FileLibrary_SdkV2 struct { // The absolute path of the file. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *FileLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileLibrary_SdkV2) { @@ -1330,9 +1383,10 @@ func (newState *FileLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *FileLibrary_SdkV2) SyncEffectiveFieldsDuringRead(existingState FileLibrary_SdkV2) { } -func (c FileLibrary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileLibrary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileLibrary. @@ -1368,9 +1422,9 @@ func (o FileLibrary_SdkV2) Type(ctx context.Context) attr.Type { type Filters_SdkV2 struct { // Paths to exclude. - Exclude types.List `tfsdk:"exclude" tf:"optional"` + Exclude types.List `tfsdk:"exclude"` // Paths to include. - Include types.List `tfsdk:"include" tf:"optional"` + Include types.List `tfsdk:"include"` } func (newState *Filters_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Filters_SdkV2) { @@ -1379,9 +1433,11 @@ func (newState *Filters_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Filt func (newState *Filters_SdkV2) SyncEffectiveFieldsDuringRead(existingState Filters_SdkV2) { } -func (c Filters_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Filters_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exclude"] = attrs["exclude"].SetOptional() + attrs["include"] = attrs["include"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Filters. @@ -1515,7 +1571,7 @@ func (o GetPipelinePermissionLevelsRequest_SdkV2) Type(ctx context.Context) attr type GetPipelinePermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetPipelinePermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPipelinePermissionLevelsResponse_SdkV2) { @@ -1524,10 +1580,10 @@ func (newState *GetPipelinePermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDu func (newState *GetPipelinePermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPipelinePermissionLevelsResponse_SdkV2) { } -func (c GetPipelinePermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelinePermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetPipelinePermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPipelinePermissionLevelsResponse. @@ -1666,31 +1722,31 @@ func (o GetPipelineRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetPipelineResponse_SdkV2 struct { // An optional message detailing the cause of the pipeline state. - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // The ID of the cluster that the pipeline is running on. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The username of the pipeline creator. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Serverless budget policy ID of this pipeline. - EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"optional"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` // The health of a pipeline. - Health types.String `tfsdk:"health" tf:"optional"` + Health types.String `tfsdk:"health"` // The last time the pipeline settings were modified or created. - LastModified types.Int64 `tfsdk:"last_modified" tf:"optional"` + LastModified types.Int64 `tfsdk:"last_modified"` // Status of the latest updates for the pipeline. Ordered with the newest // update first. - LatestUpdates types.List `tfsdk:"latest_updates" tf:"optional"` + LatestUpdates types.List `tfsdk:"latest_updates"` // A human friendly identifier for the pipeline, taken from the `spec`. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The ID of the pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // Username of the user that the pipeline will run on behalf of. - RunAsUserName types.String `tfsdk:"run_as_user_name" tf:"optional"` + RunAsUserName types.String `tfsdk:"run_as_user_name"` // The pipeline specification. This field is not returned when called by // `ListPipelines`. - Spec types.List `tfsdk:"spec" tf:"optional,object"` + Spec types.List `tfsdk:"spec"` // The pipeline state. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *GetPipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPipelineResponse_SdkV2) { @@ -1699,11 +1755,22 @@ func (newState *GetPipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *GetPipelineResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetPipelineResponse_SdkV2) { } -func (c GetPipelineResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateStateInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "latest_updates")...) - PipelineSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "spec")...) +func (c GetPipelineResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["last_modified"] = attrs["last_modified"].SetOptional() + attrs["latest_updates"] = attrs["latest_updates"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["spec"] = attrs["spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPipelineResponse. @@ -1861,7 +1928,7 @@ func (o GetUpdateRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetUpdateResponse_SdkV2 struct { // The current update info. - Update types.List `tfsdk:"update" tf:"optional,object"` + Update types.List `tfsdk:"update"` } func (newState *GetUpdateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetUpdateResponse_SdkV2) { @@ -1870,10 +1937,11 @@ func (newState *GetUpdateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GetUpdateResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetUpdateResponse_SdkV2) { } -func (c GetUpdateResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "update")...) +func (c GetUpdateResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["update"] = attrs["update"].SetOptional() + attrs["update"] = attrs["update"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetUpdateResponse. @@ -1939,11 +2007,11 @@ func (o *GetUpdateResponse_SdkV2) SetUpdate(ctx context.Context, v UpdateInfo_Sd type IngestionConfig_SdkV2 struct { // Select a specific source report. - Report types.List `tfsdk:"report" tf:"optional,object"` + Report types.List `tfsdk:"report"` // Select all tables from a specific source schema. - Schema types.List `tfsdk:"schema" tf:"optional,object"` + Schema types.List `tfsdk:"schema"` // Select a specific source table. - Table types.List `tfsdk:"table" tf:"optional,object"` + Table types.List `tfsdk:"table"` } func (newState *IngestionConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan IngestionConfig_SdkV2) { @@ -1952,12 +2020,15 @@ func (newState *IngestionConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *IngestionConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState IngestionConfig_SdkV2) { } -func (c IngestionConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ReportSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "report")...) - SchemaSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schema")...) - TableSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table")...) +func (c IngestionConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["report"] = attrs["report"].SetOptional() + attrs["report"] = attrs["report"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema"] = attrs["schema"].SetOptional() + attrs["schema"] = attrs["schema"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table"] = attrs["table"].SetOptional() + attrs["table"] = attrs["table"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IngestionConfig. @@ -2087,21 +2158,21 @@ type IngestionGatewayPipelineDefinition_SdkV2 struct { // [Deprecated, use connection_name instead] Immutable. The Unity Catalog // connection that this gateway pipeline uses to communicate with the // source. - ConnectionId types.String `tfsdk:"connection_id" tf:"optional"` + ConnectionId types.String `tfsdk:"connection_id"` // Immutable. The Unity Catalog connection that this gateway pipeline uses // to communicate with the source. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Required, Immutable. The name of the catalog for the gateway pipeline's // storage location. - GatewayStorageCatalog types.String `tfsdk:"gateway_storage_catalog" tf:"optional"` + GatewayStorageCatalog types.String `tfsdk:"gateway_storage_catalog"` // Optional. The Unity Catalog-compatible name for the gateway storage // location. This is the destination to use for the data that is extracted // by the gateway. Delta Live Tables system will automatically create the // storage location under the catalog and schema. - GatewayStorageName types.String `tfsdk:"gateway_storage_name" tf:"optional"` + GatewayStorageName types.String `tfsdk:"gateway_storage_name"` // Required, Immutable. The name of the schema for the gateway pipelines's // storage location. - GatewayStorageSchema types.String `tfsdk:"gateway_storage_schema" tf:"optional"` + GatewayStorageSchema types.String `tfsdk:"gateway_storage_schema"` } func (newState *IngestionGatewayPipelineDefinition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan IngestionGatewayPipelineDefinition_SdkV2) { @@ -2110,9 +2181,14 @@ func (newState *IngestionGatewayPipelineDefinition_SdkV2) SyncEffectiveFieldsDur func (newState *IngestionGatewayPipelineDefinition_SdkV2) SyncEffectiveFieldsDuringRead(existingState IngestionGatewayPipelineDefinition_SdkV2) { } -func (c IngestionGatewayPipelineDefinition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c IngestionGatewayPipelineDefinition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connection_id"] = attrs["connection_id"].SetOptional() + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["gateway_storage_catalog"] = attrs["gateway_storage_catalog"].SetOptional() + attrs["gateway_storage_name"] = attrs["gateway_storage_name"].SetOptional() + attrs["gateway_storage_schema"] = attrs["gateway_storage_schema"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IngestionGatewayPipelineDefinition. @@ -2158,17 +2234,17 @@ type IngestionPipelineDefinition_SdkV2 struct { // Immutable. The Unity Catalog connection that this ingestion pipeline uses // to communicate with the source. This is used with connectors for // applications like Salesforce, Workday, and so on. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Immutable. Identifier for the gateway that is used by this ingestion // pipeline to communicate with the source database. This is used with // connectors to databases like SQL Server. - IngestionGatewayId types.String `tfsdk:"ingestion_gateway_id" tf:"optional"` + IngestionGatewayId types.String `tfsdk:"ingestion_gateway_id"` // Required. Settings specifying tables to replicate and the destination for // the replicated tables. - Objects types.List `tfsdk:"objects" tf:"optional"` + Objects types.List `tfsdk:"objects"` // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in the pipeline. - TableConfiguration types.List `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.List `tfsdk:"table_configuration"` } func (newState *IngestionPipelineDefinition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan IngestionPipelineDefinition_SdkV2) { @@ -2177,11 +2253,14 @@ func (newState *IngestionPipelineDefinition_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *IngestionPipelineDefinition_SdkV2) SyncEffectiveFieldsDuringRead(existingState IngestionPipelineDefinition_SdkV2) { } -func (c IngestionPipelineDefinition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IngestionConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "objects")...) - TableSpecificConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c IngestionPipelineDefinition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["ingestion_gateway_id"] = attrs["ingestion_gateway_id"].SetOptional() + attrs["objects"] = attrs["objects"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IngestionPipelineDefinition. @@ -2378,11 +2457,11 @@ func (o *ListPipelineEventsRequest_SdkV2) SetOrderBy(ctx context.Context, v []ty type ListPipelineEventsResponse_SdkV2 struct { // The list of events matching the request criteria. - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` // If present, a token to fetch the next page of events. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // If present, a token to fetch the previous page of events. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListPipelineEventsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPipelineEventsResponse_SdkV2) { @@ -2391,10 +2470,12 @@ func (newState *ListPipelineEventsResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListPipelineEventsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListPipelineEventsResponse_SdkV2) { } -func (c ListPipelineEventsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineEvent_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "events")...) +func (c ListPipelineEventsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["events"] = attrs["events"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPipelineEventsResponse. @@ -2556,9 +2637,9 @@ func (o *ListPipelinesRequest_SdkV2) SetOrderBy(ctx context.Context, v []types.S type ListPipelinesResponse_SdkV2 struct { // If present, a token to fetch the next page of events. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // The list of events matching the request criteria. - Statuses types.List `tfsdk:"statuses" tf:"optional"` + Statuses types.List `tfsdk:"statuses"` } func (newState *ListPipelinesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPipelinesResponse_SdkV2) { @@ -2567,10 +2648,11 @@ func (newState *ListPipelinesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListPipelinesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListPipelinesResponse_SdkV2) { } -func (c ListPipelinesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineStateInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "statuses")...) +func (c ListPipelinesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["statuses"] = attrs["statuses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPipelinesResponse. @@ -2688,12 +2770,12 @@ func (o ListUpdatesRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListUpdatesResponse_SdkV2 struct { // If present, then there are more results, and this a token to be used in a // subsequent request to fetch the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // If present, then this token can be used in a subsequent request to fetch // the previous page. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` - Updates types.List `tfsdk:"updates" tf:"optional"` + Updates types.List `tfsdk:"updates"` } func (newState *ListUpdatesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListUpdatesResponse_SdkV2) { @@ -2702,10 +2784,12 @@ func (newState *ListUpdatesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListUpdatesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListUpdatesResponse_SdkV2) { } -func (c ListUpdatesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "updates")...) +func (c ListUpdatesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() + attrs["updates"] = attrs["updates"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListUpdatesResponse. @@ -2782,9 +2866,9 @@ func (newState *ManualTrigger_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ManualTrigger_SdkV2) SyncEffectiveFieldsDuringRead(existingState ManualTrigger_SdkV2) { } -func (c ManualTrigger_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ManualTrigger_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ManualTrigger. @@ -2816,7 +2900,7 @@ func (o ManualTrigger_SdkV2) Type(ctx context.Context) attr.Type { type NotebookLibrary_SdkV2 struct { // The absolute path of the notebook. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *NotebookLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotebookLibrary_SdkV2) { @@ -2825,9 +2909,10 @@ func (newState *NotebookLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *NotebookLibrary_SdkV2) SyncEffectiveFieldsDuringRead(existingState NotebookLibrary_SdkV2) { } -func (c NotebookLibrary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NotebookLibrary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotebookLibrary. @@ -2869,9 +2954,9 @@ type Notifications_SdkV2 struct { // `on-update-failure`: Each time a pipeline update fails. * // `on-update-fatal-failure`: A pipeline update fails with a non-retryable // (fatal) error. * `on-flow-failure`: A single data flow fails. - Alerts types.List `tfsdk:"alerts" tf:"optional"` + Alerts types.List `tfsdk:"alerts"` // A list of email addresses notified when a configured alert is triggered. - EmailRecipients types.List `tfsdk:"email_recipients" tf:"optional"` + EmailRecipients types.List `tfsdk:"email_recipients"` } func (newState *Notifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Notifications_SdkV2) { @@ -2880,9 +2965,11 @@ func (newState *Notifications_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *Notifications_SdkV2) SyncEffectiveFieldsDuringRead(existingState Notifications_SdkV2) { } -func (c Notifications_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Notifications_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alerts"] = attrs["alerts"].SetOptional() + attrs["email_recipients"] = attrs["email_recipients"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Notifications. @@ -2979,40 +3066,40 @@ func (o *Notifications_SdkV2) SetEmailRecipients(ctx context.Context, v []types. type Origin_SdkV2 struct { // The id of a batch. Unique within a flow. - BatchId types.Int64 `tfsdk:"batch_id" tf:"optional"` + BatchId types.Int64 `tfsdk:"batch_id"` // The cloud provider, e.g., AWS or Azure. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // The id of the cluster where an execution happens. Unique within a region. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The name of a dataset. Unique within a pipeline. - DatasetName types.String `tfsdk:"dataset_name" tf:"optional"` + DatasetName types.String `tfsdk:"dataset_name"` // The id of the flow. Globally unique. Incremental queries will generally // reuse the same id while complete queries will have a new id per update. - FlowId types.String `tfsdk:"flow_id" tf:"optional"` + FlowId types.String `tfsdk:"flow_id"` // The name of the flow. Not unique. - FlowName types.String `tfsdk:"flow_name" tf:"optional"` + FlowName types.String `tfsdk:"flow_name"` // The optional host name where the event was triggered - Host types.String `tfsdk:"host" tf:"optional"` + Host types.String `tfsdk:"host"` // The id of a maintenance run. Globally unique. - MaintenanceId types.String `tfsdk:"maintenance_id" tf:"optional"` + MaintenanceId types.String `tfsdk:"maintenance_id"` // Materialization name. - MaterializationName types.String `tfsdk:"materialization_name" tf:"optional"` + MaterializationName types.String `tfsdk:"materialization_name"` // The org id of the user. Unique within a cloud. - OrgId types.Int64 `tfsdk:"org_id" tf:"optional"` + OrgId types.Int64 `tfsdk:"org_id"` // The id of the pipeline. Globally unique. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // The name of the pipeline. Not unique. - PipelineName types.String `tfsdk:"pipeline_name" tf:"optional"` + PipelineName types.String `tfsdk:"pipeline_name"` // The cloud region. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The id of the request that caused an update. - RequestId types.String `tfsdk:"request_id" tf:"optional"` + RequestId types.String `tfsdk:"request_id"` // The id of a (delta) table. Globally unique. - TableId types.String `tfsdk:"table_id" tf:"optional"` + TableId types.String `tfsdk:"table_id"` // The Unity Catalog id of the MV or ST being updated. - UcResourceId types.String `tfsdk:"uc_resource_id" tf:"optional"` + UcResourceId types.String `tfsdk:"uc_resource_id"` // The id of an execution. Globally unique. - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` } func (newState *Origin_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Origin_SdkV2) { @@ -3021,9 +3108,26 @@ func (newState *Origin_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Origi func (newState *Origin_SdkV2) SyncEffectiveFieldsDuringRead(existingState Origin_SdkV2) { } -func (c Origin_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c Origin_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["batch_id"] = attrs["batch_id"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["dataset_name"] = attrs["dataset_name"].SetOptional() + attrs["flow_id"] = attrs["flow_id"].SetOptional() + attrs["flow_name"] = attrs["flow_name"].SetOptional() + attrs["host"] = attrs["host"].SetOptional() + attrs["maintenance_id"] = attrs["maintenance_id"].SetOptional() + attrs["materialization_name"] = attrs["materialization_name"].SetOptional() + attrs["org_id"] = attrs["org_id"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["pipeline_name"] = attrs["pipeline_name"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["request_id"] = attrs["request_id"].SetOptional() + attrs["table_id"] = attrs["table_id"].SetOptional() + attrs["uc_resource_id"] = attrs["uc_resource_id"].SetOptional() + attrs["update_id"] = attrs["update_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Origin. @@ -3091,13 +3195,13 @@ func (o Origin_SdkV2) Type(ctx context.Context) attr.Type { type PipelineAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PipelineAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineAccessControlRequest_SdkV2) { @@ -3106,9 +3210,13 @@ func (newState *PipelineAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *PipelineAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineAccessControlRequest_SdkV2) { } -func (c PipelineAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineAccessControlRequest. @@ -3150,15 +3258,15 @@ func (o PipelineAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type type PipelineAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PipelineAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineAccessControlResponse_SdkV2) { @@ -3167,10 +3275,14 @@ func (newState *PipelineAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *PipelineAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineAccessControlResponse_SdkV2) { } -func (c PipelineAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelinePermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c PipelineAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineAccessControlResponse. @@ -3245,24 +3357,24 @@ func (o *PipelineAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Cont type PipelineCluster_SdkV2 struct { // Note: This field won't be persisted. Only API users will check this // field. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.List `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.List `tfsdk:"autoscale"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.List `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.List `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.List `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.List `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Only dbfs destinations are supported. Only one destination // can be specified for one cluster. If the conf is given, the logs will be // delivered to the destination every `5 mins`. The destination of driver // logs is `$destination/$clusterId/driver`, while the destination of // executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.List `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.List `tfsdk:"cluster_log_conf"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -3271,37 +3383,37 @@ type PipelineCluster_SdkV2 struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Whether to enable local disk encryption for the cluster. - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.List `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.List `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // A label for the cluster specification, either `default` to configure the // default cluster, or `maintenance` to configure the maintenance cluster. // This field is optional. The default value is `default`. - Label types.String `tfsdk:"label" tf:"optional"` + Label types.String `tfsdk:"label"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -3312,13 +3424,13 @@ type PipelineCluster_SdkV2 struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. See :method:clusters/create for more // details. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -3332,11 +3444,11 @@ type PipelineCluster_SdkV2 struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` } func (newState *PipelineCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineCluster_SdkV2) { @@ -3345,14 +3457,33 @@ func (newState *PipelineCluster_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PipelineCluster_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineCluster_SdkV2) { } -func (c PipelineCluster_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineClusterAutoscale_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - compute_tf.AwsAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - compute_tf.AzureAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - compute_tf.ClusterLogConf_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - compute_tf.GcpAttributes_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - - return cs +func (c PipelineCluster_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["label"] = attrs["label"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineCluster. @@ -3716,17 +3847,17 @@ func (o *PipelineCluster_SdkV2) SetSshPublicKeys(ctx context.Context, v []types. type PipelineClusterAutoscale_SdkV2 struct { // The maximum number of workers to which the cluster can scale up when // overloaded. `max_workers` must be strictly greater than `min_workers`. - MaxWorkers types.Int64 `tfsdk:"max_workers" tf:""` + MaxWorkers types.Int64 `tfsdk:"max_workers"` // The minimum number of workers the cluster can scale down to when // underutilized. It is also the initial number of workers the cluster will // have after creation. - MinWorkers types.Int64 `tfsdk:"min_workers" tf:""` + MinWorkers types.Int64 `tfsdk:"min_workers"` // Databricks Enhanced Autoscaling optimizes cluster utilization by // automatically allocating cluster resources based on workload volume, with // minimal impact to the data processing latency of your pipelines. Enhanced // Autoscaling is available for `updates` clusters only. The legacy // autoscaling feature is used for `maintenance` clusters. - Mode types.String `tfsdk:"mode" tf:"optional"` + Mode types.String `tfsdk:"mode"` } func (newState *PipelineClusterAutoscale_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineClusterAutoscale_SdkV2) { @@ -3735,11 +3866,12 @@ func (newState *PipelineClusterAutoscale_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *PipelineClusterAutoscale_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineClusterAutoscale_SdkV2) { } -func (c PipelineClusterAutoscale_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "max_workers")...) - cs.SetRequired(append(path, "min_workers")...) +func (c PipelineClusterAutoscale_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["max_workers"] = attrs["max_workers"].SetRequired() + attrs["min_workers"] = attrs["min_workers"].SetRequired() + attrs["mode"] = attrs["mode"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineClusterAutoscale. @@ -3779,9 +3911,9 @@ func (o PipelineClusterAutoscale_SdkV2) Type(ctx context.Context) attr.Type { type PipelineDeployment_SdkV2 struct { // The deployment method that manages the pipeline. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // The path to the file containing metadata about the deployment. - MetadataFilePath types.String `tfsdk:"metadata_file_path" tf:"optional"` + MetadataFilePath types.String `tfsdk:"metadata_file_path"` } func (newState *PipelineDeployment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineDeployment_SdkV2) { @@ -3790,9 +3922,11 @@ func (newState *PipelineDeployment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PipelineDeployment_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineDeployment_SdkV2) { } -func (c PipelineDeployment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineDeployment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kind"] = attrs["kind"].SetOptional() + attrs["metadata_file_path"] = attrs["metadata_file_path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineDeployment. @@ -3830,23 +3964,23 @@ func (o PipelineDeployment_SdkV2) Type(ctx context.Context) attr.Type { type PipelineEvent_SdkV2 struct { // Information about an error captured by the event. - Error types.List `tfsdk:"error" tf:"optional,object"` + Error types.List `tfsdk:"error"` // The event type. Should always correspond to the details - EventType types.String `tfsdk:"event_type" tf:"optional"` + EventType types.String `tfsdk:"event_type"` // A time-based, globally unique id. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The severity level of the event. - Level types.String `tfsdk:"level" tf:"optional"` + Level types.String `tfsdk:"level"` // Maturity level for event_type. - MaturityLevel types.String `tfsdk:"maturity_level" tf:"optional"` + MaturityLevel types.String `tfsdk:"maturity_level"` // The display message associated with the event. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Describes where the event originates from. - Origin types.List `tfsdk:"origin" tf:"optional,object"` + Origin types.List `tfsdk:"origin"` // A sequencing object to identify and order events. - Sequence types.List `tfsdk:"sequence" tf:"optional,object"` + Sequence types.List `tfsdk:"sequence"` // The time of the event. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` } func (newState *PipelineEvent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineEvent_SdkV2) { @@ -3855,12 +3989,21 @@ func (newState *PipelineEvent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *PipelineEvent_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineEvent_SdkV2) { } -func (c PipelineEvent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ErrorDetail_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "error")...) - Origin_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "origin")...) - Sequencing_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sequence")...) +func (c PipelineEvent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["error"] = attrs["error"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["event_type"] = attrs["event_type"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["level"] = attrs["level"].SetOptional() + attrs["maturity_level"] = attrs["maturity_level"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["origin"] = attrs["origin"].SetOptional() + attrs["origin"] = attrs["origin"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sequence"] = attrs["sequence"].SetOptional() + attrs["sequence"] = attrs["sequence"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineEvent. @@ -4001,16 +4144,16 @@ func (o *PipelineEvent_SdkV2) SetSequence(ctx context.Context, v Sequencing_SdkV type PipelineLibrary_SdkV2 struct { // The path to a file that defines a pipeline and is stored in the // Databricks Repos. - File types.List `tfsdk:"file" tf:"optional,object"` + File types.List `tfsdk:"file"` // URI of the jar to be installed. Currently only DBFS is supported. - Jar types.String `tfsdk:"jar" tf:"optional"` + Jar types.String `tfsdk:"jar"` // Specification of a maven library to be installed. - Maven types.List `tfsdk:"maven" tf:"optional,object"` + Maven types.List `tfsdk:"maven"` // The path to a notebook that defines a pipeline and is stored in the // Databricks workspace. - Notebook types.List `tfsdk:"notebook" tf:"optional,object"` + Notebook types.List `tfsdk:"notebook"` // URI of the whl to be installed. - Whl types.String `tfsdk:"whl" tf:"optional"` + Whl types.String `tfsdk:"whl"` } func (newState *PipelineLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineLibrary_SdkV2) { @@ -4019,12 +4162,17 @@ func (newState *PipelineLibrary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PipelineLibrary_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineLibrary_SdkV2) { } -func (c PipelineLibrary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "file")...) - compute_tf.MavenLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "maven")...) - NotebookLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notebook")...) +func (c PipelineLibrary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file"] = attrs["file"].SetOptional() + attrs["file"] = attrs["file"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["jar"] = attrs["jar"].SetOptional() + attrs["maven"] = attrs["maven"].SetOptional() + attrs["maven"] = attrs["maven"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["notebook"] = attrs["notebook"].SetOptional() + attrs["notebook"] = attrs["notebook"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["whl"] = attrs["whl"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineLibrary. @@ -4155,11 +4303,11 @@ func (o *PipelineLibrary_SdkV2) SetNotebook(ctx context.Context, v NotebookLibra } type PipelinePermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PipelinePermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelinePermission_SdkV2) { @@ -4168,9 +4316,12 @@ func (newState *PipelinePermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PipelinePermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelinePermission_SdkV2) { } -func (c PipelinePermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelinePermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermission. @@ -4239,11 +4390,11 @@ func (o *PipelinePermission_SdkV2) SetInheritedFromObject(ctx context.Context, v } type PipelinePermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *PipelinePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelinePermissions_SdkV2) { @@ -4252,10 +4403,12 @@ func (newState *PipelinePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *PipelinePermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelinePermissions_SdkV2) { } -func (c PipelinePermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c PipelinePermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermissions. @@ -4324,9 +4477,9 @@ func (o *PipelinePermissions_SdkV2) SetAccessControlList(ctx context.Context, v } type PipelinePermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PipelinePermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelinePermissionsDescription_SdkV2) { @@ -4335,9 +4488,11 @@ func (newState *PipelinePermissionsDescription_SdkV2) SyncEffectiveFieldsDuringC func (newState *PipelinePermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelinePermissionsDescription_SdkV2) { } -func (c PipelinePermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelinePermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermissionsDescription. @@ -4374,7 +4529,7 @@ func (o PipelinePermissionsDescription_SdkV2) Type(ctx context.Context) attr.Typ } type PipelinePermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The pipeline for which to get or manage permissions. PipelineId types.String `tfsdk:"-"` } @@ -4385,11 +4540,11 @@ func (newState *PipelinePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *PipelinePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelinePermissionsRequest_SdkV2) { } -func (c PipelinePermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "pipeline_id")...) +func (c PipelinePermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermissionsRequest. @@ -4457,60 +4612,60 @@ func (o *PipelinePermissionsRequest_SdkV2) SetAccessControlList(ctx context.Cont type PipelineSpec_SdkV2 struct { // Budget policy of this pipeline. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // DLT Release Channel that specifies which version to use. - Channel types.String `tfsdk:"channel" tf:"optional"` + Channel types.String `tfsdk:"channel"` // Cluster settings for this pipeline deployment. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // String-String configuration for this pipeline execution. - Configuration types.Map `tfsdk:"configuration" tf:"optional"` + Configuration types.Map `tfsdk:"configuration"` // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous types.Bool `tfsdk:"continuous" tf:"optional"` + Continuous types.Bool `tfsdk:"continuous"` // Deployment type of this pipeline. - Deployment types.List `tfsdk:"deployment" tf:"optional,object"` + Deployment types.List `tfsdk:"deployment"` // Whether the pipeline is in Development mode. Defaults to false. - Development types.Bool `tfsdk:"development" tf:"optional"` + Development types.Bool `tfsdk:"development"` // Pipeline product edition. - Edition types.String `tfsdk:"edition" tf:"optional"` + Edition types.String `tfsdk:"edition"` // Filters on which Pipeline packages to include in the deployed graph. - Filters types.List `tfsdk:"filters" tf:"optional,object"` + Filters types.List `tfsdk:"filters"` // The definition of a gateway pipeline to support change data capture. - GatewayDefinition types.List `tfsdk:"gateway_definition" tf:"optional,object"` + GatewayDefinition types.List `tfsdk:"gateway_definition"` // Unique identifier for this pipeline. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'target' or 'catalog' settings. - IngestionDefinition types.List `tfsdk:"ingestion_definition" tf:"optional,object"` + IngestionDefinition types.List `tfsdk:"ingestion_definition"` // Libraries or code needed by this deployment. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Friendly identifier for this pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of notification settings for this pipeline. - Notifications types.List `tfsdk:"notifications" tf:"optional"` + Notifications types.List `tfsdk:"notifications"` // Whether Photon is enabled for this pipeline. - Photon types.Bool `tfsdk:"photon" tf:"optional"` + Photon types.Bool `tfsdk:"photon"` // Restart window of this pipeline. - RestartWindow types.List `tfsdk:"restart_window" tf:"optional,object"` + RestartWindow types.List `tfsdk:"restart_window"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Whether serverless compute is enabled for this pipeline. - Serverless types.Bool `tfsdk:"serverless" tf:"optional"` + Serverless types.Bool `tfsdk:"serverless"` // DBFS root directory for storing checkpoints and tables. - Storage types.String `tfsdk:"storage" tf:"optional"` + Storage types.String `tfsdk:"storage"` // Target schema (database) to add tables in this pipeline to. If not // specified, no data is published to the Hive metastore or Unity Catalog. // To publish to Unity Catalog, also specify `catalog`. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger types.List `tfsdk:"trigger" tf:"optional,object"` + Trigger types.List `tfsdk:"trigger"` } func (newState *PipelineSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineSpec_SdkV2) { @@ -4519,18 +4674,38 @@ func (newState *PipelineSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PipelineSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineSpec_SdkV2) { } -func (c PipelineSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineCluster_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) - PipelineDeployment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - Filters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - IngestionGatewayPipelineDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gateway_definition")...) - IngestionPipelineDefinition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ingestion_definition")...) - PipelineLibrary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - Notifications_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - RestartWindow_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "restart_window")...) - PipelineTrigger_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - - return cs +func (c PipelineSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["configuration"] = attrs["configuration"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment"] = attrs["deployment"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["development"] = attrs["development"].SetOptional() + attrs["edition"] = attrs["edition"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["filters"] = attrs["filters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gateway_definition"] = attrs["gateway_definition"].SetOptional() + attrs["gateway_definition"] = attrs["gateway_definition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["photon"] = attrs["photon"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["schema"] = attrs["schema"].SetOptional() + attrs["serverless"] = attrs["serverless"].SetOptional() + attrs["storage"] = attrs["storage"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + attrs["trigger"] = attrs["trigger"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineSpec. @@ -4901,23 +5076,23 @@ func (o *PipelineSpec_SdkV2) SetTrigger(ctx context.Context, v PipelineTrigger_S type PipelineStateInfo_SdkV2 struct { // The unique identifier of the cluster running the pipeline. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The username of the pipeline creator. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // The health of a pipeline. - Health types.String `tfsdk:"health" tf:"optional"` + Health types.String `tfsdk:"health"` // Status of the latest updates for the pipeline. Ordered with the newest // update first. - LatestUpdates types.List `tfsdk:"latest_updates" tf:"optional"` + LatestUpdates types.List `tfsdk:"latest_updates"` // The user-friendly name of the pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The unique identifier of the pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // The username that the pipeline runs as. This is a read only value derived // from the pipeline owner. - RunAsUserName types.String `tfsdk:"run_as_user_name" tf:"optional"` + RunAsUserName types.String `tfsdk:"run_as_user_name"` // The pipeline state. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *PipelineStateInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineStateInfo_SdkV2) { @@ -4926,10 +5101,17 @@ func (newState *PipelineStateInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *PipelineStateInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineStateInfo_SdkV2) { } -func (c PipelineStateInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateStateInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "latest_updates")...) +func (c PipelineStateInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["latest_updates"] = attrs["latest_updates"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineStateInfo. @@ -5008,9 +5190,9 @@ func (o *PipelineStateInfo_SdkV2) SetLatestUpdates(ctx context.Context, v []Upda } type PipelineTrigger_SdkV2 struct { - Cron types.List `tfsdk:"cron" tf:"optional,object"` + Cron types.List `tfsdk:"cron"` - Manual types.List `tfsdk:"manual" tf:"optional,object"` + Manual types.List `tfsdk:"manual"` } func (newState *PipelineTrigger_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineTrigger_SdkV2) { @@ -5019,11 +5201,13 @@ func (newState *PipelineTrigger_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PipelineTrigger_SdkV2) SyncEffectiveFieldsDuringRead(existingState PipelineTrigger_SdkV2) { } -func (c PipelineTrigger_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CronTrigger_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cron")...) - ManualTrigger_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "manual")...) +func (c PipelineTrigger_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cron"] = attrs["cron"].SetOptional() + attrs["cron"] = attrs["cron"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["manual"] = attrs["manual"].SetOptional() + attrs["manual"] = attrs["manual"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineTrigger. @@ -5120,18 +5304,18 @@ func (o *PipelineTrigger_SdkV2) SetManual(ctx context.Context, v ManualTrigger_S type ReportSpec_SdkV2 struct { // Required. Destination catalog to store table. - DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"` + DestinationCatalog types.String `tfsdk:"destination_catalog"` // Required. Destination schema to store table. - DestinationSchema types.String `tfsdk:"destination_schema" tf:"optional"` + DestinationSchema types.String `tfsdk:"destination_schema"` // Required. Destination table name. The pipeline fails if a table with that // name already exists. - DestinationTable types.String `tfsdk:"destination_table" tf:"optional"` + DestinationTable types.String `tfsdk:"destination_table"` // Required. Report URL in the source system. - SourceUrl types.String `tfsdk:"source_url" tf:"optional"` + SourceUrl types.String `tfsdk:"source_url"` // Configuration settings to control the ingestion of tables. These settings // override the table_configuration defined in the // IngestionPipelineDefinition object. - TableConfiguration types.List `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.List `tfsdk:"table_configuration"` } func (newState *ReportSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReportSpec_SdkV2) { @@ -5140,10 +5324,15 @@ func (newState *ReportSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *ReportSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState ReportSpec_SdkV2) { } -func (c ReportSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSpecificConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c ReportSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_catalog"] = attrs["destination_catalog"].SetOptional() + attrs["destination_schema"] = attrs["destination_schema"].SetOptional() + attrs["destination_table"] = attrs["destination_table"].SetOptional() + attrs["source_url"] = attrs["source_url"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ReportSpec. @@ -5219,15 +5408,15 @@ type RestartWindow_SdkV2 struct { // Days of week in which the restart is allowed to happen (within a // five-hour window starting at start_hour). If not specified all days of // the week will be used. - DaysOfWeek types.List `tfsdk:"days_of_week" tf:"optional"` + DaysOfWeek types.List `tfsdk:"days_of_week"` // An integer between 0 and 23 denoting the start hour for the restart // window in the 24-hour day. Continuous pipeline restart is triggered only // within a five-hour window starting at this hour. - StartHour types.Int64 `tfsdk:"start_hour" tf:""` + StartHour types.Int64 `tfsdk:"start_hour"` // Time zone id of restart window. See // https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html // for details. If not specified, UTC will be used. - TimeZoneId types.String `tfsdk:"time_zone_id" tf:"optional"` + TimeZoneId types.String `tfsdk:"time_zone_id"` } func (newState *RestartWindow_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestartWindow_SdkV2) { @@ -5236,10 +5425,12 @@ func (newState *RestartWindow_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RestartWindow_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestartWindow_SdkV2) { } -func (c RestartWindow_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "start_hour")...) +func (c RestartWindow_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["days_of_week"] = attrs["days_of_week"].SetOptional() + attrs["start_hour"] = attrs["start_hour"].SetRequired() + attrs["time_zone_id"] = attrs["time_zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestartWindow. @@ -5309,20 +5500,20 @@ func (o *RestartWindow_SdkV2) SetDaysOfWeek(ctx context.Context, v []types.Strin type SchemaSpec_SdkV2 struct { // Required. Destination catalog to store tables. - DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"` + DestinationCatalog types.String `tfsdk:"destination_catalog"` // Required. Destination schema to store tables in. Tables with the same // name as the source tables are created in this destination schema. The // pipeline fails If a table with the same name already exists. - DestinationSchema types.String `tfsdk:"destination_schema" tf:"optional"` + DestinationSchema types.String `tfsdk:"destination_schema"` // The source catalog name. Might be optional depending on the type of // source. - SourceCatalog types.String `tfsdk:"source_catalog" tf:"optional"` + SourceCatalog types.String `tfsdk:"source_catalog"` // Required. Schema name in the source database. - SourceSchema types.String `tfsdk:"source_schema" tf:"optional"` + SourceSchema types.String `tfsdk:"source_schema"` // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in this schema and override the // table_configuration defined in the IngestionPipelineDefinition object. - TableConfiguration types.List `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.List `tfsdk:"table_configuration"` } func (newState *SchemaSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SchemaSpec_SdkV2) { @@ -5331,10 +5522,15 @@ func (newState *SchemaSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *SchemaSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState SchemaSpec_SdkV2) { } -func (c SchemaSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSpecificConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c SchemaSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_catalog"] = attrs["destination_catalog"].SetOptional() + attrs["destination_schema"] = attrs["destination_schema"].SetOptional() + attrs["source_catalog"] = attrs["source_catalog"].SetOptional() + attrs["source_schema"] = attrs["source_schema"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SchemaSpec. @@ -5408,9 +5604,9 @@ func (o *SchemaSpec_SdkV2) SetTableConfiguration(ctx context.Context, v TableSpe type Sequencing_SdkV2 struct { // A sequence number, unique and increasing within the control plane. - ControlPlaneSeqNo types.Int64 `tfsdk:"control_plane_seq_no" tf:"optional"` + ControlPlaneSeqNo types.Int64 `tfsdk:"control_plane_seq_no"` // the ID assigned by the data plane. - DataPlaneId types.List `tfsdk:"data_plane_id" tf:"optional,object"` + DataPlaneId types.List `tfsdk:"data_plane_id"` } func (newState *Sequencing_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sequencing_SdkV2) { @@ -5419,10 +5615,12 @@ func (newState *Sequencing_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *Sequencing_SdkV2) SyncEffectiveFieldsDuringRead(existingState Sequencing_SdkV2) { } -func (c Sequencing_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DataPlaneId_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_plane_id")...) +func (c Sequencing_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["control_plane_seq_no"] = attrs["control_plane_seq_no"].SetOptional() + attrs["data_plane_id"] = attrs["data_plane_id"].SetOptional() + attrs["data_plane_id"] = attrs["data_plane_id"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Sequencing. @@ -5490,11 +5688,11 @@ func (o *Sequencing_SdkV2) SetDataPlaneId(ctx context.Context, v DataPlaneId_Sdk type SerializedException_SdkV2 struct { // Runtime class of the exception - ClassName types.String `tfsdk:"class_name" tf:"optional"` + ClassName types.String `tfsdk:"class_name"` // Exception message - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Stack trace consisting of a list of stack frames - Stack types.List `tfsdk:"stack" tf:"optional"` + Stack types.List `tfsdk:"stack"` } func (newState *SerializedException_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SerializedException_SdkV2) { @@ -5503,10 +5701,12 @@ func (newState *SerializedException_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *SerializedException_SdkV2) SyncEffectiveFieldsDuringRead(existingState SerializedException_SdkV2) { } -func (c SerializedException_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StackFrame_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "stack")...) +func (c SerializedException_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["class_name"] = attrs["class_name"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["stack"] = attrs["stack"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SerializedException. @@ -5576,13 +5776,13 @@ func (o *SerializedException_SdkV2) SetStack(ctx context.Context, v []StackFrame type StackFrame_SdkV2 struct { // Class from which the method call originated - DeclaringClass types.String `tfsdk:"declaring_class" tf:"optional"` + DeclaringClass types.String `tfsdk:"declaring_class"` // File where the method is defined - FileName types.String `tfsdk:"file_name" tf:"optional"` + FileName types.String `tfsdk:"file_name"` // Line from which the method was called - LineNumber types.Int64 `tfsdk:"line_number" tf:"optional"` + LineNumber types.Int64 `tfsdk:"line_number"` // Name of the method which was called - MethodName types.String `tfsdk:"method_name" tf:"optional"` + MethodName types.String `tfsdk:"method_name"` } func (newState *StackFrame_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StackFrame_SdkV2) { @@ -5591,9 +5791,13 @@ func (newState *StackFrame_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *StackFrame_SdkV2) SyncEffectiveFieldsDuringRead(existingState StackFrame_SdkV2) { } -func (c StackFrame_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StackFrame_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["declaring_class"] = attrs["declaring_class"].SetOptional() + attrs["file_name"] = attrs["file_name"].SetOptional() + attrs["line_number"] = attrs["line_number"].SetOptional() + attrs["method_name"] = attrs["method_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StackFrame. @@ -5634,24 +5838,24 @@ func (o StackFrame_SdkV2) Type(ctx context.Context) attr.Type { } type StartUpdate_SdkV2 struct { - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // If true, this update will reset all tables before running. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` // A list of tables to update with fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - FullRefreshSelection types.List `tfsdk:"full_refresh_selection" tf:"optional"` + FullRefreshSelection types.List `tfsdk:"full_refresh_selection"` PipelineId types.String `tfsdk:"-"` // A list of tables to update without fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - RefreshSelection types.List `tfsdk:"refresh_selection" tf:"optional"` + RefreshSelection types.List `tfsdk:"refresh_selection"` // If true, this update only validates the correctness of pipeline source // code but does not materialize or publish any datasets. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *StartUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartUpdate_SdkV2) { @@ -5660,10 +5864,15 @@ func (newState *StartUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *StartUpdate_SdkV2) SyncEffectiveFieldsDuringRead(existingState StartUpdate_SdkV2) { } -func (c StartUpdate_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "pipeline_id")...) +func (c StartUpdate_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() + attrs["full_refresh_selection"] = attrs["full_refresh_selection"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetRequired() + attrs["refresh_selection"] = attrs["refresh_selection"].SetOptional() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartUpdate. @@ -5767,7 +5976,7 @@ func (o *StartUpdate_SdkV2) SetRefreshSelection(ctx context.Context, v []types.S } type StartUpdateResponse_SdkV2 struct { - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` } func (newState *StartUpdateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartUpdateResponse_SdkV2) { @@ -5776,9 +5985,10 @@ func (newState *StartUpdateResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *StartUpdateResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState StartUpdateResponse_SdkV2) { } -func (c StartUpdateResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StartUpdateResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["update_id"] = attrs["update_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartUpdateResponse. @@ -5821,9 +6031,9 @@ func (newState *StopPipelineResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *StopPipelineResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState StopPipelineResponse_SdkV2) { } -func (c StopPipelineResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StopPipelineResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StopPipelineResponse. @@ -5891,23 +6101,23 @@ func (o StopRequest_SdkV2) Type(ctx context.Context) attr.Type { type TableSpec_SdkV2 struct { // Required. Destination catalog to store table. - DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"` + DestinationCatalog types.String `tfsdk:"destination_catalog"` // Required. Destination schema to store table. - DestinationSchema types.String `tfsdk:"destination_schema" tf:"optional"` + DestinationSchema types.String `tfsdk:"destination_schema"` // Optional. Destination table name. The pipeline fails if a table with that // name already exists. If not set, the source table name is used. - DestinationTable types.String `tfsdk:"destination_table" tf:"optional"` + DestinationTable types.String `tfsdk:"destination_table"` // Source catalog name. Might be optional depending on the type of source. - SourceCatalog types.String `tfsdk:"source_catalog" tf:"optional"` + SourceCatalog types.String `tfsdk:"source_catalog"` // Schema name in the source database. Might be optional depending on the // type of source. - SourceSchema types.String `tfsdk:"source_schema" tf:"optional"` + SourceSchema types.String `tfsdk:"source_schema"` // Required. Table name in the source database. - SourceTable types.String `tfsdk:"source_table" tf:"optional"` + SourceTable types.String `tfsdk:"source_table"` // Configuration settings to control the ingestion of tables. These settings // override the table_configuration defined in the // IngestionPipelineDefinition object and the SchemaSpec. - TableConfiguration types.List `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.List `tfsdk:"table_configuration"` } func (newState *TableSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSpec_SdkV2) { @@ -5916,10 +6126,17 @@ func (newState *TableSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ta func (newState *TableSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableSpec_SdkV2) { } -func (c TableSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSpecificConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c TableSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_catalog"] = attrs["destination_catalog"].SetOptional() + attrs["destination_schema"] = attrs["destination_schema"].SetOptional() + attrs["destination_table"] = attrs["destination_table"].SetOptional() + attrs["source_catalog"] = attrs["source_catalog"].SetOptional() + attrs["source_schema"] = attrs["source_schema"].SetOptional() + attrs["source_table"] = attrs["source_table"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableSpec. @@ -5997,16 +6214,16 @@ func (o *TableSpec_SdkV2) SetTableConfiguration(ctx context.Context, v TableSpec type TableSpecificConfig_SdkV2 struct { // The primary key of the table used to apply changes. - PrimaryKeys types.List `tfsdk:"primary_keys" tf:"optional"` + PrimaryKeys types.List `tfsdk:"primary_keys"` // If true, formula fields defined in the table are included in the // ingestion. This setting is only valid for the Salesforce connector - SalesforceIncludeFormulaFields types.Bool `tfsdk:"salesforce_include_formula_fields" tf:"optional"` + SalesforceIncludeFormulaFields types.Bool `tfsdk:"salesforce_include_formula_fields"` // The SCD type to use to ingest the table. - ScdType types.String `tfsdk:"scd_type" tf:"optional"` + ScdType types.String `tfsdk:"scd_type"` // The column names specifying the logical order of events in the source // data. Delta Live Tables uses this sequencing to handle change events that // arrive out of order. - SequenceBy types.List `tfsdk:"sequence_by" tf:"optional"` + SequenceBy types.List `tfsdk:"sequence_by"` } func (newState *TableSpecificConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSpecificConfig_SdkV2) { @@ -6015,9 +6232,13 @@ func (newState *TableSpecificConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *TableSpecificConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState TableSpecificConfig_SdkV2) { } -func (c TableSpecificConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableSpecificConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["primary_keys"] = attrs["primary_keys"].SetOptional() + attrs["salesforce_include_formula_fields"] = attrs["salesforce_include_formula_fields"].SetOptional() + attrs["scd_type"] = attrs["scd_type"].SetOptional() + attrs["sequence_by"] = attrs["sequence_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableSpecificConfig. @@ -6118,35 +6339,35 @@ func (o *TableSpecificConfig_SdkV2) SetSequenceBy(ctx context.Context, v []types type UpdateInfo_SdkV2 struct { // What triggered this update. - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // The ID of the cluster that the update is running on. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The pipeline configuration with system defaults applied where unspecified // by the user. Not returned by ListUpdates. - Config types.List `tfsdk:"config" tf:"optional,object"` + Config types.List `tfsdk:"config"` // The time when this update was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // If true, this update will reset all tables before running. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` // A list of tables to update with fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - FullRefreshSelection types.List `tfsdk:"full_refresh_selection" tf:"optional"` + FullRefreshSelection types.List `tfsdk:"full_refresh_selection"` // The ID of the pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // A list of tables to update without fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - RefreshSelection types.List `tfsdk:"refresh_selection" tf:"optional"` + RefreshSelection types.List `tfsdk:"refresh_selection"` // The update state. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // The ID of this update. - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` // If true, this update only validates the correctness of pipeline source // code but does not materialize or publish any datasets. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *UpdateInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateInfo_SdkV2) { @@ -6155,10 +6376,21 @@ func (newState *UpdateInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan U func (newState *UpdateInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateInfo_SdkV2) { } -func (c UpdateInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) +func (c UpdateInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["config"] = attrs["config"].SetOptional() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() + attrs["full_refresh_selection"] = attrs["full_refresh_selection"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["refresh_selection"] = attrs["refresh_selection"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["update_id"] = attrs["update_id"].SetOptional() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateInfo. @@ -6301,11 +6533,11 @@ func (o *UpdateInfo_SdkV2) SetRefreshSelection(ctx context.Context, v []types.St } type UpdateStateInfo_SdkV2 struct { - CreationTime types.String `tfsdk:"creation_time" tf:"optional"` + CreationTime types.String `tfsdk:"creation_time"` - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` } func (newState *UpdateStateInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateStateInfo_SdkV2) { @@ -6314,9 +6546,12 @@ func (newState *UpdateStateInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateStateInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateStateInfo_SdkV2) { } -func (c UpdateStateInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateStateInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["update_id"] = attrs["update_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateStateInfo. diff --git a/internal/service/pipelines_tf/model.go b/internal/service/pipelines_tf/model.go index 04c87e9ae..4fc6d7902 100755 --- a/internal/service/pipelines_tf/model.go +++ b/internal/service/pipelines_tf/model.go @@ -26,64 +26,64 @@ import ( type CreatePipeline struct { // If false, deployment will fail if name conflicts with that of another // pipeline. - AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names" tf:"optional"` + AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names"` // Budget policy of this pipeline. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // DLT Release Channel that specifies which version to use. - Channel types.String `tfsdk:"channel" tf:"optional"` + Channel types.String `tfsdk:"channel"` // Cluster settings for this pipeline deployment. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // String-String configuration for this pipeline execution. - Configuration types.Map `tfsdk:"configuration" tf:"optional"` + Configuration types.Map `tfsdk:"configuration"` // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous types.Bool `tfsdk:"continuous" tf:"optional"` + Continuous types.Bool `tfsdk:"continuous"` // Deployment type of this pipeline. - Deployment types.Object `tfsdk:"deployment" tf:"optional,object"` + Deployment types.Object `tfsdk:"deployment"` // Whether the pipeline is in Development mode. Defaults to false. - Development types.Bool `tfsdk:"development" tf:"optional"` + Development types.Bool `tfsdk:"development"` - DryRun types.Bool `tfsdk:"dry_run" tf:"optional"` + DryRun types.Bool `tfsdk:"dry_run"` // Pipeline product edition. - Edition types.String `tfsdk:"edition" tf:"optional"` + Edition types.String `tfsdk:"edition"` // Filters on which Pipeline packages to include in the deployed graph. - Filters types.Object `tfsdk:"filters" tf:"optional,object"` + Filters types.Object `tfsdk:"filters"` // The definition of a gateway pipeline to support change data capture. - GatewayDefinition types.Object `tfsdk:"gateway_definition" tf:"optional,object"` + GatewayDefinition types.Object `tfsdk:"gateway_definition"` // Unique identifier for this pipeline. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'target' or 'catalog' settings. - IngestionDefinition types.Object `tfsdk:"ingestion_definition" tf:"optional,object"` + IngestionDefinition types.Object `tfsdk:"ingestion_definition"` // Libraries or code needed by this deployment. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Friendly identifier for this pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of notification settings for this pipeline. - Notifications types.List `tfsdk:"notifications" tf:"optional"` + Notifications types.List `tfsdk:"notifications"` // Whether Photon is enabled for this pipeline. - Photon types.Bool `tfsdk:"photon" tf:"optional"` + Photon types.Bool `tfsdk:"photon"` // Restart window of this pipeline. - RestartWindow types.Object `tfsdk:"restart_window" tf:"optional,object"` + RestartWindow types.Object `tfsdk:"restart_window"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Whether serverless compute is enabled for this pipeline. - Serverless types.Bool `tfsdk:"serverless" tf:"optional"` + Serverless types.Bool `tfsdk:"serverless"` // DBFS root directory for storing checkpoints and tables. - Storage types.String `tfsdk:"storage" tf:"optional"` + Storage types.String `tfsdk:"storage"` // Target schema (database) to add tables in this pipeline to. If not // specified, no data is published to the Hive metastore or Unity Catalog. // To publish to Unity Catalog, also specify `catalog`. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger types.Object `tfsdk:"trigger" tf:"optional,object"` + Trigger types.Object `tfsdk:"trigger"` } func (newState *CreatePipeline) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePipeline) { @@ -92,18 +92,34 @@ func (newState *CreatePipeline) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CreatePipeline) SyncEffectiveFieldsDuringRead(existingState CreatePipeline) { } -func (c CreatePipeline) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineCluster{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) - PipelineDeployment{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - Filters{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - IngestionGatewayPipelineDefinition{}.ApplySchemaCustomizations(cs, append(path, "gateway_definition")...) - IngestionPipelineDefinition{}.ApplySchemaCustomizations(cs, append(path, "ingestion_definition")...) - PipelineLibrary{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - Notifications{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - RestartWindow{}.ApplySchemaCustomizations(cs, append(path, "restart_window")...) - PipelineTrigger{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - - return cs +func (c CreatePipeline) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_duplicate_names"] = attrs["allow_duplicate_names"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["configuration"] = attrs["configuration"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["development"] = attrs["development"].SetOptional() + attrs["dry_run"] = attrs["dry_run"].SetOptional() + attrs["edition"] = attrs["edition"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["gateway_definition"] = attrs["gateway_definition"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["photon"] = attrs["photon"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["serverless"] = attrs["serverless"].SetOptional() + attrs["storage"] = attrs["storage"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePipeline. @@ -478,10 +494,10 @@ func (o *CreatePipeline) SetTrigger(ctx context.Context, v PipelineTrigger) { type CreatePipelineResponse struct { // Only returned when dry_run is true. - EffectiveSettings types.Object `tfsdk:"effective_settings" tf:"optional,object"` + EffectiveSettings types.Object `tfsdk:"effective_settings"` // The unique identifier for the newly created pipeline. Only returned when // dry_run is false. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` } func (newState *CreatePipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePipelineResponse) { @@ -490,10 +506,11 @@ func (newState *CreatePipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreatePipelineResponse) SyncEffectiveFieldsDuringRead(existingState CreatePipelineResponse) { } -func (c CreatePipelineResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineSpec{}.ApplySchemaCustomizations(cs, append(path, "effective_settings")...) +func (c CreatePipelineResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["effective_settings"] = attrs["effective_settings"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePipelineResponse. @@ -560,9 +577,9 @@ func (o *CreatePipelineResponse) SetEffectiveSettings(ctx context.Context, v Pip } type CronTrigger struct { - QuartzCronSchedule types.String `tfsdk:"quartz_cron_schedule" tf:"optional"` + QuartzCronSchedule types.String `tfsdk:"quartz_cron_schedule"` - TimezoneId types.String `tfsdk:"timezone_id" tf:"optional"` + TimezoneId types.String `tfsdk:"timezone_id"` } func (newState *CronTrigger) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronTrigger) { @@ -571,9 +588,11 @@ func (newState *CronTrigger) SyncEffectiveFieldsDuringCreateOrUpdate(plan CronTr func (newState *CronTrigger) SyncEffectiveFieldsDuringRead(existingState CronTrigger) { } -func (c CronTrigger) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CronTrigger) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["quartz_cron_schedule"] = attrs["quartz_cron_schedule"].SetOptional() + attrs["timezone_id"] = attrs["timezone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CronTrigger. @@ -611,9 +630,9 @@ func (o CronTrigger) Type(ctx context.Context) attr.Type { type DataPlaneId struct { // The instance name of the data plane emitting an event. - Instance types.String `tfsdk:"instance" tf:"optional"` + Instance types.String `tfsdk:"instance"` // A sequence number, unique and increasing within the data plane instance. - SeqNo types.Int64 `tfsdk:"seq_no" tf:"optional"` + SeqNo types.Int64 `tfsdk:"seq_no"` } func (newState *DataPlaneId) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneId) { @@ -622,9 +641,11 @@ func (newState *DataPlaneId) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPl func (newState *DataPlaneId) SyncEffectiveFieldsDuringRead(existingState DataPlaneId) { } -func (c DataPlaneId) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataPlaneId) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["instance"] = attrs["instance"].SetOptional() + attrs["seq_no"] = attrs["seq_no"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneId. @@ -705,9 +726,9 @@ func (newState *DeletePipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *DeletePipelineResponse) SyncEffectiveFieldsDuringRead(existingState DeletePipelineResponse) { } -func (c DeletePipelineResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeletePipelineResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePipelineResponse. @@ -740,68 +761,68 @@ func (o DeletePipelineResponse) Type(ctx context.Context) attr.Type { type EditPipeline struct { // If false, deployment will fail if name has changed and conflicts the name // of another pipeline. - AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names" tf:"optional"` + AllowDuplicateNames types.Bool `tfsdk:"allow_duplicate_names"` // Budget policy of this pipeline. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // DLT Release Channel that specifies which version to use. - Channel types.String `tfsdk:"channel" tf:"optional"` + Channel types.String `tfsdk:"channel"` // Cluster settings for this pipeline deployment. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // String-String configuration for this pipeline execution. - Configuration types.Map `tfsdk:"configuration" tf:"optional"` + Configuration types.Map `tfsdk:"configuration"` // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous types.Bool `tfsdk:"continuous" tf:"optional"` + Continuous types.Bool `tfsdk:"continuous"` // Deployment type of this pipeline. - Deployment types.Object `tfsdk:"deployment" tf:"optional,object"` + Deployment types.Object `tfsdk:"deployment"` // Whether the pipeline is in Development mode. Defaults to false. - Development types.Bool `tfsdk:"development" tf:"optional"` + Development types.Bool `tfsdk:"development"` // Pipeline product edition. - Edition types.String `tfsdk:"edition" tf:"optional"` + Edition types.String `tfsdk:"edition"` // If present, the last-modified time of the pipeline settings before the // edit. If the settings were modified after that time, then the request // will fail with a conflict. - ExpectedLastModified types.Int64 `tfsdk:"expected_last_modified" tf:"optional"` + ExpectedLastModified types.Int64 `tfsdk:"expected_last_modified"` // Filters on which Pipeline packages to include in the deployed graph. - Filters types.Object `tfsdk:"filters" tf:"optional,object"` + Filters types.Object `tfsdk:"filters"` // The definition of a gateway pipeline to support change data capture. - GatewayDefinition types.Object `tfsdk:"gateway_definition" tf:"optional,object"` + GatewayDefinition types.Object `tfsdk:"gateway_definition"` // Unique identifier for this pipeline. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'target' or 'catalog' settings. - IngestionDefinition types.Object `tfsdk:"ingestion_definition" tf:"optional,object"` + IngestionDefinition types.Object `tfsdk:"ingestion_definition"` // Libraries or code needed by this deployment. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Friendly identifier for this pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of notification settings for this pipeline. - Notifications types.List `tfsdk:"notifications" tf:"optional"` + Notifications types.List `tfsdk:"notifications"` // Whether Photon is enabled for this pipeline. - Photon types.Bool `tfsdk:"photon" tf:"optional"` + Photon types.Bool `tfsdk:"photon"` // Unique identifier for this pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // Restart window of this pipeline. - RestartWindow types.Object `tfsdk:"restart_window" tf:"optional,object"` + RestartWindow types.Object `tfsdk:"restart_window"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Whether serverless compute is enabled for this pipeline. - Serverless types.Bool `tfsdk:"serverless" tf:"optional"` + Serverless types.Bool `tfsdk:"serverless"` // DBFS root directory for storing checkpoints and tables. - Storage types.String `tfsdk:"storage" tf:"optional"` + Storage types.String `tfsdk:"storage"` // Target schema (database) to add tables in this pipeline to. If not // specified, no data is published to the Hive metastore or Unity Catalog. // To publish to Unity Catalog, also specify `catalog`. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger types.Object `tfsdk:"trigger" tf:"optional,object"` + Trigger types.Object `tfsdk:"trigger"` } func (newState *EditPipeline) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditPipeline) { @@ -810,18 +831,35 @@ func (newState *EditPipeline) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditP func (newState *EditPipeline) SyncEffectiveFieldsDuringRead(existingState EditPipeline) { } -func (c EditPipeline) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineCluster{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) - PipelineDeployment{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - Filters{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - IngestionGatewayPipelineDefinition{}.ApplySchemaCustomizations(cs, append(path, "gateway_definition")...) - IngestionPipelineDefinition{}.ApplySchemaCustomizations(cs, append(path, "ingestion_definition")...) - PipelineLibrary{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - Notifications{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - RestartWindow{}.ApplySchemaCustomizations(cs, append(path, "restart_window")...) - PipelineTrigger{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - - return cs +func (c EditPipeline) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_duplicate_names"] = attrs["allow_duplicate_names"].SetOptional() + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["configuration"] = attrs["configuration"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["development"] = attrs["development"].SetOptional() + attrs["edition"] = attrs["edition"].SetOptional() + attrs["expected_last_modified"] = attrs["expected_last_modified"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["gateway_definition"] = attrs["gateway_definition"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["photon"] = attrs["photon"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["serverless"] = attrs["serverless"].SetOptional() + attrs["storage"] = attrs["storage"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPipeline. @@ -1205,9 +1243,9 @@ func (newState *EditPipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *EditPipelineResponse) SyncEffectiveFieldsDuringRead(existingState EditPipelineResponse) { } -func (c EditPipelineResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditPipelineResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditPipelineResponse. @@ -1239,9 +1277,9 @@ func (o EditPipelineResponse) Type(ctx context.Context) attr.Type { type ErrorDetail struct { // The exception thrown for this error, with its chain of cause. - Exceptions types.List `tfsdk:"exceptions" tf:"optional"` + Exceptions types.List `tfsdk:"exceptions"` // Whether this error is considered fatal, that is, unrecoverable. - Fatal types.Bool `tfsdk:"fatal" tf:"optional"` + Fatal types.Bool `tfsdk:"fatal"` } func (newState *ErrorDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan ErrorDetail) { @@ -1250,10 +1288,11 @@ func (newState *ErrorDetail) SyncEffectiveFieldsDuringCreateOrUpdate(plan ErrorD func (newState *ErrorDetail) SyncEffectiveFieldsDuringRead(existingState ErrorDetail) { } -func (c ErrorDetail) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SerializedException{}.ApplySchemaCustomizations(cs, append(path, "exceptions")...) +func (c ErrorDetail) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exceptions"] = attrs["exceptions"].SetOptional() + attrs["fatal"] = attrs["fatal"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ErrorDetail. @@ -1321,7 +1360,7 @@ func (o *ErrorDetail) SetExceptions(ctx context.Context, v []SerializedException type FileLibrary struct { // The absolute path of the file. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *FileLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileLibrary) { @@ -1330,9 +1369,10 @@ func (newState *FileLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan FileLi func (newState *FileLibrary) SyncEffectiveFieldsDuringRead(existingState FileLibrary) { } -func (c FileLibrary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FileLibrary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FileLibrary. @@ -1368,9 +1408,9 @@ func (o FileLibrary) Type(ctx context.Context) attr.Type { type Filters struct { // Paths to exclude. - Exclude types.List `tfsdk:"exclude" tf:"optional"` + Exclude types.List `tfsdk:"exclude"` // Paths to include. - Include types.List `tfsdk:"include" tf:"optional"` + Include types.List `tfsdk:"include"` } func (newState *Filters) SyncEffectiveFieldsDuringCreateOrUpdate(plan Filters) { @@ -1379,9 +1419,11 @@ func (newState *Filters) SyncEffectiveFieldsDuringCreateOrUpdate(plan Filters) { func (newState *Filters) SyncEffectiveFieldsDuringRead(existingState Filters) { } -func (c Filters) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Filters) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["exclude"] = attrs["exclude"].SetOptional() + attrs["include"] = attrs["include"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Filters. @@ -1515,7 +1557,7 @@ func (o GetPipelinePermissionLevelsRequest) Type(ctx context.Context) attr.Type type GetPipelinePermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetPipelinePermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPipelinePermissionLevelsResponse) { @@ -1524,10 +1566,10 @@ func (newState *GetPipelinePermissionLevelsResponse) SyncEffectiveFieldsDuringCr func (newState *GetPipelinePermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetPipelinePermissionLevelsResponse) { } -func (c GetPipelinePermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelinePermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetPipelinePermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPipelinePermissionLevelsResponse. @@ -1666,31 +1708,31 @@ func (o GetPipelineRequest) Type(ctx context.Context) attr.Type { type GetPipelineResponse struct { // An optional message detailing the cause of the pipeline state. - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // The ID of the cluster that the pipeline is running on. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The username of the pipeline creator. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // Serverless budget policy ID of this pipeline. - EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"optional"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` // The health of a pipeline. - Health types.String `tfsdk:"health" tf:"optional"` + Health types.String `tfsdk:"health"` // The last time the pipeline settings were modified or created. - LastModified types.Int64 `tfsdk:"last_modified" tf:"optional"` + LastModified types.Int64 `tfsdk:"last_modified"` // Status of the latest updates for the pipeline. Ordered with the newest // update first. - LatestUpdates types.List `tfsdk:"latest_updates" tf:"optional"` + LatestUpdates types.List `tfsdk:"latest_updates"` // A human friendly identifier for the pipeline, taken from the `spec`. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The ID of the pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // Username of the user that the pipeline will run on behalf of. - RunAsUserName types.String `tfsdk:"run_as_user_name" tf:"optional"` + RunAsUserName types.String `tfsdk:"run_as_user_name"` // The pipeline specification. This field is not returned when called by // `ListPipelines`. - Spec types.Object `tfsdk:"spec" tf:"optional,object"` + Spec types.Object `tfsdk:"spec"` // The pipeline state. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *GetPipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetPipelineResponse) { @@ -1699,11 +1741,21 @@ func (newState *GetPipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *GetPipelineResponse) SyncEffectiveFieldsDuringRead(existingState GetPipelineResponse) { } -func (c GetPipelineResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateStateInfo{}.ApplySchemaCustomizations(cs, append(path, "latest_updates")...) - PipelineSpec{}.ApplySchemaCustomizations(cs, append(path, "spec")...) +func (c GetPipelineResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["last_modified"] = attrs["last_modified"].SetOptional() + attrs["latest_updates"] = attrs["latest_updates"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() + attrs["spec"] = attrs["spec"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetPipelineResponse. @@ -1861,7 +1913,7 @@ func (o GetUpdateRequest) Type(ctx context.Context) attr.Type { type GetUpdateResponse struct { // The current update info. - Update types.Object `tfsdk:"update" tf:"optional,object"` + Update types.Object `tfsdk:"update"` } func (newState *GetUpdateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetUpdateResponse) { @@ -1870,10 +1922,10 @@ func (newState *GetUpdateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GetUpdateResponse) SyncEffectiveFieldsDuringRead(existingState GetUpdateResponse) { } -func (c GetUpdateResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateInfo{}.ApplySchemaCustomizations(cs, append(path, "update")...) +func (c GetUpdateResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["update"] = attrs["update"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetUpdateResponse. @@ -1939,11 +1991,11 @@ func (o *GetUpdateResponse) SetUpdate(ctx context.Context, v UpdateInfo) { type IngestionConfig struct { // Select a specific source report. - Report types.Object `tfsdk:"report" tf:"optional,object"` + Report types.Object `tfsdk:"report"` // Select all tables from a specific source schema. - Schema types.Object `tfsdk:"schema" tf:"optional,object"` + Schema types.Object `tfsdk:"schema"` // Select a specific source table. - Table types.Object `tfsdk:"table" tf:"optional,object"` + Table types.Object `tfsdk:"table"` } func (newState *IngestionConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan IngestionConfig) { @@ -1952,12 +2004,12 @@ func (newState *IngestionConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan In func (newState *IngestionConfig) SyncEffectiveFieldsDuringRead(existingState IngestionConfig) { } -func (c IngestionConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ReportSpec{}.ApplySchemaCustomizations(cs, append(path, "report")...) - SchemaSpec{}.ApplySchemaCustomizations(cs, append(path, "schema")...) - TableSpec{}.ApplySchemaCustomizations(cs, append(path, "table")...) +func (c IngestionConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["report"] = attrs["report"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["table"] = attrs["table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IngestionConfig. @@ -2087,21 +2139,21 @@ type IngestionGatewayPipelineDefinition struct { // [Deprecated, use connection_name instead] Immutable. The Unity Catalog // connection that this gateway pipeline uses to communicate with the // source. - ConnectionId types.String `tfsdk:"connection_id" tf:"optional"` + ConnectionId types.String `tfsdk:"connection_id"` // Immutable. The Unity Catalog connection that this gateway pipeline uses // to communicate with the source. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Required, Immutable. The name of the catalog for the gateway pipeline's // storage location. - GatewayStorageCatalog types.String `tfsdk:"gateway_storage_catalog" tf:"optional"` + GatewayStorageCatalog types.String `tfsdk:"gateway_storage_catalog"` // Optional. The Unity Catalog-compatible name for the gateway storage // location. This is the destination to use for the data that is extracted // by the gateway. Delta Live Tables system will automatically create the // storage location under the catalog and schema. - GatewayStorageName types.String `tfsdk:"gateway_storage_name" tf:"optional"` + GatewayStorageName types.String `tfsdk:"gateway_storage_name"` // Required, Immutable. The name of the schema for the gateway pipelines's // storage location. - GatewayStorageSchema types.String `tfsdk:"gateway_storage_schema" tf:"optional"` + GatewayStorageSchema types.String `tfsdk:"gateway_storage_schema"` } func (newState *IngestionGatewayPipelineDefinition) SyncEffectiveFieldsDuringCreateOrUpdate(plan IngestionGatewayPipelineDefinition) { @@ -2110,9 +2162,14 @@ func (newState *IngestionGatewayPipelineDefinition) SyncEffectiveFieldsDuringCre func (newState *IngestionGatewayPipelineDefinition) SyncEffectiveFieldsDuringRead(existingState IngestionGatewayPipelineDefinition) { } -func (c IngestionGatewayPipelineDefinition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c IngestionGatewayPipelineDefinition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connection_id"] = attrs["connection_id"].SetOptional() + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["gateway_storage_catalog"] = attrs["gateway_storage_catalog"].SetOptional() + attrs["gateway_storage_name"] = attrs["gateway_storage_name"].SetOptional() + attrs["gateway_storage_schema"] = attrs["gateway_storage_schema"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IngestionGatewayPipelineDefinition. @@ -2158,17 +2215,17 @@ type IngestionPipelineDefinition struct { // Immutable. The Unity Catalog connection that this ingestion pipeline uses // to communicate with the source. This is used with connectors for // applications like Salesforce, Workday, and so on. - ConnectionName types.String `tfsdk:"connection_name" tf:"optional"` + ConnectionName types.String `tfsdk:"connection_name"` // Immutable. Identifier for the gateway that is used by this ingestion // pipeline to communicate with the source database. This is used with // connectors to databases like SQL Server. - IngestionGatewayId types.String `tfsdk:"ingestion_gateway_id" tf:"optional"` + IngestionGatewayId types.String `tfsdk:"ingestion_gateway_id"` // Required. Settings specifying tables to replicate and the destination for // the replicated tables. - Objects types.List `tfsdk:"objects" tf:"optional"` + Objects types.List `tfsdk:"objects"` // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in the pipeline. - TableConfiguration types.Object `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.Object `tfsdk:"table_configuration"` } func (newState *IngestionPipelineDefinition) SyncEffectiveFieldsDuringCreateOrUpdate(plan IngestionPipelineDefinition) { @@ -2177,11 +2234,13 @@ func (newState *IngestionPipelineDefinition) SyncEffectiveFieldsDuringCreateOrUp func (newState *IngestionPipelineDefinition) SyncEffectiveFieldsDuringRead(existingState IngestionPipelineDefinition) { } -func (c IngestionPipelineDefinition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IngestionConfig{}.ApplySchemaCustomizations(cs, append(path, "objects")...) - TableSpecificConfig{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c IngestionPipelineDefinition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connection_name"] = attrs["connection_name"].SetOptional() + attrs["ingestion_gateway_id"] = attrs["ingestion_gateway_id"].SetOptional() + attrs["objects"] = attrs["objects"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IngestionPipelineDefinition. @@ -2378,11 +2437,11 @@ func (o *ListPipelineEventsRequest) SetOrderBy(ctx context.Context, v []types.St type ListPipelineEventsResponse struct { // The list of events matching the request criteria. - Events types.List `tfsdk:"events" tf:"optional"` + Events types.List `tfsdk:"events"` // If present, a token to fetch the next page of events. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // If present, a token to fetch the previous page of events. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` } func (newState *ListPipelineEventsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPipelineEventsResponse) { @@ -2391,10 +2450,12 @@ func (newState *ListPipelineEventsResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListPipelineEventsResponse) SyncEffectiveFieldsDuringRead(existingState ListPipelineEventsResponse) { } -func (c ListPipelineEventsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineEvent{}.ApplySchemaCustomizations(cs, append(path, "events")...) +func (c ListPipelineEventsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["events"] = attrs["events"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPipelineEventsResponse. @@ -2556,9 +2617,9 @@ func (o *ListPipelinesRequest) SetOrderBy(ctx context.Context, v []types.String) type ListPipelinesResponse struct { // If present, a token to fetch the next page of events. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // The list of events matching the request criteria. - Statuses types.List `tfsdk:"statuses" tf:"optional"` + Statuses types.List `tfsdk:"statuses"` } func (newState *ListPipelinesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPipelinesResponse) { @@ -2567,10 +2628,11 @@ func (newState *ListPipelinesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListPipelinesResponse) SyncEffectiveFieldsDuringRead(existingState ListPipelinesResponse) { } -func (c ListPipelinesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineStateInfo{}.ApplySchemaCustomizations(cs, append(path, "statuses")...) +func (c ListPipelinesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["statuses"] = attrs["statuses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPipelinesResponse. @@ -2688,12 +2750,12 @@ func (o ListUpdatesRequest) Type(ctx context.Context) attr.Type { type ListUpdatesResponse struct { // If present, then there are more results, and this a token to be used in a // subsequent request to fetch the next page. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // If present, then this token can be used in a subsequent request to fetch // the previous page. - PrevPageToken types.String `tfsdk:"prev_page_token" tf:"optional"` + PrevPageToken types.String `tfsdk:"prev_page_token"` - Updates types.List `tfsdk:"updates" tf:"optional"` + Updates types.List `tfsdk:"updates"` } func (newState *ListUpdatesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListUpdatesResponse) { @@ -2702,10 +2764,12 @@ func (newState *ListUpdatesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ListUpdatesResponse) SyncEffectiveFieldsDuringRead(existingState ListUpdatesResponse) { } -func (c ListUpdatesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateInfo{}.ApplySchemaCustomizations(cs, append(path, "updates")...) +func (c ListUpdatesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["prev_page_token"] = attrs["prev_page_token"].SetOptional() + attrs["updates"] = attrs["updates"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListUpdatesResponse. @@ -2782,9 +2846,9 @@ func (newState *ManualTrigger) SyncEffectiveFieldsDuringCreateOrUpdate(plan Manu func (newState *ManualTrigger) SyncEffectiveFieldsDuringRead(existingState ManualTrigger) { } -func (c ManualTrigger) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ManualTrigger) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ManualTrigger. @@ -2816,7 +2880,7 @@ func (o ManualTrigger) Type(ctx context.Context) attr.Type { type NotebookLibrary struct { // The absolute path of the notebook. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` } func (newState *NotebookLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotebookLibrary) { @@ -2825,9 +2889,10 @@ func (newState *NotebookLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan No func (newState *NotebookLibrary) SyncEffectiveFieldsDuringRead(existingState NotebookLibrary) { } -func (c NotebookLibrary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NotebookLibrary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotebookLibrary. @@ -2869,9 +2934,9 @@ type Notifications struct { // `on-update-failure`: Each time a pipeline update fails. * // `on-update-fatal-failure`: A pipeline update fails with a non-retryable // (fatal) error. * `on-flow-failure`: A single data flow fails. - Alerts types.List `tfsdk:"alerts" tf:"optional"` + Alerts types.List `tfsdk:"alerts"` // A list of email addresses notified when a configured alert is triggered. - EmailRecipients types.List `tfsdk:"email_recipients" tf:"optional"` + EmailRecipients types.List `tfsdk:"email_recipients"` } func (newState *Notifications) SyncEffectiveFieldsDuringCreateOrUpdate(plan Notifications) { @@ -2880,9 +2945,11 @@ func (newState *Notifications) SyncEffectiveFieldsDuringCreateOrUpdate(plan Noti func (newState *Notifications) SyncEffectiveFieldsDuringRead(existingState Notifications) { } -func (c Notifications) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Notifications) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alerts"] = attrs["alerts"].SetOptional() + attrs["email_recipients"] = attrs["email_recipients"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Notifications. @@ -2979,40 +3046,40 @@ func (o *Notifications) SetEmailRecipients(ctx context.Context, v []types.String type Origin struct { // The id of a batch. Unique within a flow. - BatchId types.Int64 `tfsdk:"batch_id" tf:"optional"` + BatchId types.Int64 `tfsdk:"batch_id"` // The cloud provider, e.g., AWS or Azure. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // The id of the cluster where an execution happens. Unique within a region. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The name of a dataset. Unique within a pipeline. - DatasetName types.String `tfsdk:"dataset_name" tf:"optional"` + DatasetName types.String `tfsdk:"dataset_name"` // The id of the flow. Globally unique. Incremental queries will generally // reuse the same id while complete queries will have a new id per update. - FlowId types.String `tfsdk:"flow_id" tf:"optional"` + FlowId types.String `tfsdk:"flow_id"` // The name of the flow. Not unique. - FlowName types.String `tfsdk:"flow_name" tf:"optional"` + FlowName types.String `tfsdk:"flow_name"` // The optional host name where the event was triggered - Host types.String `tfsdk:"host" tf:"optional"` + Host types.String `tfsdk:"host"` // The id of a maintenance run. Globally unique. - MaintenanceId types.String `tfsdk:"maintenance_id" tf:"optional"` + MaintenanceId types.String `tfsdk:"maintenance_id"` // Materialization name. - MaterializationName types.String `tfsdk:"materialization_name" tf:"optional"` + MaterializationName types.String `tfsdk:"materialization_name"` // The org id of the user. Unique within a cloud. - OrgId types.Int64 `tfsdk:"org_id" tf:"optional"` + OrgId types.Int64 `tfsdk:"org_id"` // The id of the pipeline. Globally unique. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // The name of the pipeline. Not unique. - PipelineName types.String `tfsdk:"pipeline_name" tf:"optional"` + PipelineName types.String `tfsdk:"pipeline_name"` // The cloud region. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The id of the request that caused an update. - RequestId types.String `tfsdk:"request_id" tf:"optional"` + RequestId types.String `tfsdk:"request_id"` // The id of a (delta) table. Globally unique. - TableId types.String `tfsdk:"table_id" tf:"optional"` + TableId types.String `tfsdk:"table_id"` // The Unity Catalog id of the MV or ST being updated. - UcResourceId types.String `tfsdk:"uc_resource_id" tf:"optional"` + UcResourceId types.String `tfsdk:"uc_resource_id"` // The id of an execution. Globally unique. - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` } func (newState *Origin) SyncEffectiveFieldsDuringCreateOrUpdate(plan Origin) { @@ -3021,9 +3088,26 @@ func (newState *Origin) SyncEffectiveFieldsDuringCreateOrUpdate(plan Origin) { func (newState *Origin) SyncEffectiveFieldsDuringRead(existingState Origin) { } -func (c Origin) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c Origin) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["batch_id"] = attrs["batch_id"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["dataset_name"] = attrs["dataset_name"].SetOptional() + attrs["flow_id"] = attrs["flow_id"].SetOptional() + attrs["flow_name"] = attrs["flow_name"].SetOptional() + attrs["host"] = attrs["host"].SetOptional() + attrs["maintenance_id"] = attrs["maintenance_id"].SetOptional() + attrs["materialization_name"] = attrs["materialization_name"].SetOptional() + attrs["org_id"] = attrs["org_id"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["pipeline_name"] = attrs["pipeline_name"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["request_id"] = attrs["request_id"].SetOptional() + attrs["table_id"] = attrs["table_id"].SetOptional() + attrs["uc_resource_id"] = attrs["uc_resource_id"].SetOptional() + attrs["update_id"] = attrs["update_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Origin. @@ -3091,13 +3175,13 @@ func (o Origin) Type(ctx context.Context) attr.Type { type PipelineAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PipelineAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineAccessControlRequest) { @@ -3106,9 +3190,13 @@ func (newState *PipelineAccessControlRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *PipelineAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState PipelineAccessControlRequest) { } -func (c PipelineAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineAccessControlRequest. @@ -3150,15 +3238,15 @@ func (o PipelineAccessControlRequest) Type(ctx context.Context) attr.Type { type PipelineAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *PipelineAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineAccessControlResponse) { @@ -3167,10 +3255,14 @@ func (newState *PipelineAccessControlResponse) SyncEffectiveFieldsDuringCreateOr func (newState *PipelineAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState PipelineAccessControlResponse) { } -func (c PipelineAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelinePermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c PipelineAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineAccessControlResponse. @@ -3245,24 +3337,24 @@ func (o *PipelineAccessControlResponse) SetAllPermissions(ctx context.Context, v type PipelineCluster struct { // Note: This field won't be persisted. Only API users will check this // field. - ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values" tf:"optional"` + ApplyPolicyDefaultValues types.Bool `tfsdk:"apply_policy_default_values"` // Parameters needed in order to automatically scale clusters up and down // based on load. Note: autoscaling works best with DB runtime versions 3.0 // or later. - Autoscale types.Object `tfsdk:"autoscale" tf:"optional,object"` + Autoscale types.Object `tfsdk:"autoscale"` // Attributes related to clusters running on Amazon Web Services. If not // specified at cluster creation, a set of default values will be used. - AwsAttributes types.Object `tfsdk:"aws_attributes" tf:"optional,object"` + AwsAttributes types.Object `tfsdk:"aws_attributes"` // Attributes related to clusters running on Microsoft Azure. If not // specified at cluster creation, a set of default values will be used. - AzureAttributes types.Object `tfsdk:"azure_attributes" tf:"optional,object"` + AzureAttributes types.Object `tfsdk:"azure_attributes"` // The configuration for delivering spark logs to a long-term storage // destination. Only dbfs destinations are supported. Only one destination // can be specified for one cluster. If the conf is given, the logs will be // delivered to the destination every `5 mins`. The destination of driver // logs is `$destination/$clusterId/driver`, while the destination of // executor logs is `$destination/$clusterId/executor`. - ClusterLogConf types.Object `tfsdk:"cluster_log_conf" tf:"optional,object"` + ClusterLogConf types.Object `tfsdk:"cluster_log_conf"` // Additional tags for cluster resources. Databricks will tag all cluster // resources (e.g., AWS instances and EBS volumes) with these tags in // addition to `default_tags`. Notes: @@ -3271,37 +3363,37 @@ type PipelineCluster struct { // // - Clusters can only reuse cloud resources if the resources' tags are a // subset of the cluster tags - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id // (instance_pool_id) if the driver pool is not assigned. - DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id" tf:"optional"` + DriverInstancePoolId types.String `tfsdk:"driver_instance_pool_id"` // The node type of the Spark driver. Note that this field is optional; if // unset, the driver node type will be set as the same value as // `node_type_id` defined above. - DriverNodeTypeId types.String `tfsdk:"driver_node_type_id" tf:"optional"` + DriverNodeTypeId types.String `tfsdk:"driver_node_type_id"` // Whether to enable local disk encryption for the cluster. - EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption" tf:"optional"` + EnableLocalDiskEncryption types.Bool `tfsdk:"enable_local_disk_encryption"` // Attributes related to clusters running on Google Cloud Platform. If not // specified at cluster creation, a set of default values will be used. - GcpAttributes types.Object `tfsdk:"gcp_attributes" tf:"optional,object"` + GcpAttributes types.Object `tfsdk:"gcp_attributes"` // The configuration for storing init scripts. Any number of destinations // can be specified. The scripts are executed sequentially in the order // provided. If `cluster_log_conf` is specified, init script logs are sent // to `//init_scripts`. - InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` + InitScripts types.List `tfsdk:"init_scripts"` // The optional ID of the instance pool to which the cluster belongs. - InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + InstancePoolId types.String `tfsdk:"instance_pool_id"` // A label for the cluster specification, either `default` to configure the // default cluster, or `maintenance` to configure the maintenance cluster. // This field is optional. The default value is `default`. - Label types.String `tfsdk:"label" tf:"optional"` + Label types.String `tfsdk:"label"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A // list of available node types can be retrieved by using the // :method:clusters/listNodeTypes API call. - NodeTypeId types.String `tfsdk:"node_type_id" tf:"optional"` + NodeTypeId types.String `tfsdk:"node_type_id"` // Number of worker nodes that this cluster should have. A cluster has one // Spark Driver and `num_workers` Executors for a total of `num_workers` + 1 // Spark nodes. @@ -3312,13 +3404,13 @@ type PipelineCluster struct { // field will immediately be updated to reflect the target size of 10 // workers, whereas the workers listed in `spark_info` will gradually // increase from 5 to 10 as the new nodes are provisioned. - NumWorkers types.Int64 `tfsdk:"num_workers" tf:"optional"` + NumWorkers types.Int64 `tfsdk:"num_workers"` // The ID of the cluster policy used to create the cluster if applicable. - PolicyId types.String `tfsdk:"policy_id" tf:"optional"` + PolicyId types.String `tfsdk:"policy_id"` // An object containing a set of optional, user-specified Spark // configuration key-value pairs. See :method:clusters/create for more // details. - SparkConf types.Map `tfsdk:"spark_conf" tf:"optional"` + SparkConf types.Map `tfsdk:"spark_conf"` // An object containing a set of optional, user-specified environment // variable key-value pairs. Please note that key-value pair of the form // (X,Y) will be exported as is (i.e., `export X='Y'`) while launching the @@ -3332,11 +3424,11 @@ type PipelineCluster struct { // Example Spark environment variables: `{"SPARK_WORKER_MEMORY": "28000m", // "SPARK_LOCAL_DIRS": "/local_disk0"}` or `{"SPARK_DAEMON_JAVA_OPTS": // "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` - SparkEnvVars types.Map `tfsdk:"spark_env_vars" tf:"optional"` + SparkEnvVars types.Map `tfsdk:"spark_env_vars"` // SSH public key contents that will be added to each Spark node in this // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. - SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + SshPublicKeys types.List `tfsdk:"ssh_public_keys"` } func (newState *PipelineCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineCluster) { @@ -3345,14 +3437,28 @@ func (newState *PipelineCluster) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pi func (newState *PipelineCluster) SyncEffectiveFieldsDuringRead(existingState PipelineCluster) { } -func (c PipelineCluster) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineClusterAutoscale{}.ApplySchemaCustomizations(cs, append(path, "autoscale")...) - compute_tf.AwsAttributes{}.ApplySchemaCustomizations(cs, append(path, "aws_attributes")...) - compute_tf.AzureAttributes{}.ApplySchemaCustomizations(cs, append(path, "azure_attributes")...) - compute_tf.ClusterLogConf{}.ApplySchemaCustomizations(cs, append(path, "cluster_log_conf")...) - compute_tf.GcpAttributes{}.ApplySchemaCustomizations(cs, append(path, "gcp_attributes")...) - - return cs +func (c PipelineCluster) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_policy_default_values"] = attrs["apply_policy_default_values"].SetOptional() + attrs["autoscale"] = attrs["autoscale"].SetOptional() + attrs["aws_attributes"] = attrs["aws_attributes"].SetOptional() + attrs["azure_attributes"] = attrs["azure_attributes"].SetOptional() + attrs["cluster_log_conf"] = attrs["cluster_log_conf"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["driver_instance_pool_id"] = attrs["driver_instance_pool_id"].SetOptional() + attrs["driver_node_type_id"] = attrs["driver_node_type_id"].SetOptional() + attrs["enable_local_disk_encryption"] = attrs["enable_local_disk_encryption"].SetOptional() + attrs["gcp_attributes"] = attrs["gcp_attributes"].SetOptional() + attrs["init_scripts"] = attrs["init_scripts"].SetOptional() + attrs["instance_pool_id"] = attrs["instance_pool_id"].SetOptional() + attrs["label"] = attrs["label"].SetOptional() + attrs["node_type_id"] = attrs["node_type_id"].SetOptional() + attrs["num_workers"] = attrs["num_workers"].SetOptional() + attrs["policy_id"] = attrs["policy_id"].SetOptional() + attrs["spark_conf"] = attrs["spark_conf"].SetOptional() + attrs["spark_env_vars"] = attrs["spark_env_vars"].SetOptional() + attrs["ssh_public_keys"] = attrs["ssh_public_keys"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineCluster. @@ -3716,17 +3822,17 @@ func (o *PipelineCluster) SetSshPublicKeys(ctx context.Context, v []types.String type PipelineClusterAutoscale struct { // The maximum number of workers to which the cluster can scale up when // overloaded. `max_workers` must be strictly greater than `min_workers`. - MaxWorkers types.Int64 `tfsdk:"max_workers" tf:""` + MaxWorkers types.Int64 `tfsdk:"max_workers"` // The minimum number of workers the cluster can scale down to when // underutilized. It is also the initial number of workers the cluster will // have after creation. - MinWorkers types.Int64 `tfsdk:"min_workers" tf:""` + MinWorkers types.Int64 `tfsdk:"min_workers"` // Databricks Enhanced Autoscaling optimizes cluster utilization by // automatically allocating cluster resources based on workload volume, with // minimal impact to the data processing latency of your pipelines. Enhanced // Autoscaling is available for `updates` clusters only. The legacy // autoscaling feature is used for `maintenance` clusters. - Mode types.String `tfsdk:"mode" tf:"optional"` + Mode types.String `tfsdk:"mode"` } func (newState *PipelineClusterAutoscale) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineClusterAutoscale) { @@ -3735,11 +3841,12 @@ func (newState *PipelineClusterAutoscale) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PipelineClusterAutoscale) SyncEffectiveFieldsDuringRead(existingState PipelineClusterAutoscale) { } -func (c PipelineClusterAutoscale) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "max_workers")...) - cs.SetRequired(append(path, "min_workers")...) +func (c PipelineClusterAutoscale) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["max_workers"] = attrs["max_workers"].SetRequired() + attrs["min_workers"] = attrs["min_workers"].SetRequired() + attrs["mode"] = attrs["mode"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineClusterAutoscale. @@ -3779,9 +3886,9 @@ func (o PipelineClusterAutoscale) Type(ctx context.Context) attr.Type { type PipelineDeployment struct { // The deployment method that manages the pipeline. - Kind types.String `tfsdk:"kind" tf:"optional"` + Kind types.String `tfsdk:"kind"` // The path to the file containing metadata about the deployment. - MetadataFilePath types.String `tfsdk:"metadata_file_path" tf:"optional"` + MetadataFilePath types.String `tfsdk:"metadata_file_path"` } func (newState *PipelineDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineDeployment) { @@ -3790,9 +3897,11 @@ func (newState *PipelineDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PipelineDeployment) SyncEffectiveFieldsDuringRead(existingState PipelineDeployment) { } -func (c PipelineDeployment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelineDeployment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kind"] = attrs["kind"].SetOptional() + attrs["metadata_file_path"] = attrs["metadata_file_path"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineDeployment. @@ -3830,23 +3939,23 @@ func (o PipelineDeployment) Type(ctx context.Context) attr.Type { type PipelineEvent struct { // Information about an error captured by the event. - Error types.Object `tfsdk:"error" tf:"optional,object"` + Error types.Object `tfsdk:"error"` // The event type. Should always correspond to the details - EventType types.String `tfsdk:"event_type" tf:"optional"` + EventType types.String `tfsdk:"event_type"` // A time-based, globally unique id. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The severity level of the event. - Level types.String `tfsdk:"level" tf:"optional"` + Level types.String `tfsdk:"level"` // Maturity level for event_type. - MaturityLevel types.String `tfsdk:"maturity_level" tf:"optional"` + MaturityLevel types.String `tfsdk:"maturity_level"` // The display message associated with the event. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Describes where the event originates from. - Origin types.Object `tfsdk:"origin" tf:"optional,object"` + Origin types.Object `tfsdk:"origin"` // A sequencing object to identify and order events. - Sequence types.Object `tfsdk:"sequence" tf:"optional,object"` + Sequence types.Object `tfsdk:"sequence"` // The time of the event. - Timestamp types.String `tfsdk:"timestamp" tf:"optional"` + Timestamp types.String `tfsdk:"timestamp"` } func (newState *PipelineEvent) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineEvent) { @@ -3855,12 +3964,18 @@ func (newState *PipelineEvent) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pipe func (newState *PipelineEvent) SyncEffectiveFieldsDuringRead(existingState PipelineEvent) { } -func (c PipelineEvent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ErrorDetail{}.ApplySchemaCustomizations(cs, append(path, "error")...) - Origin{}.ApplySchemaCustomizations(cs, append(path, "origin")...) - Sequencing{}.ApplySchemaCustomizations(cs, append(path, "sequence")...) +func (c PipelineEvent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["event_type"] = attrs["event_type"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["level"] = attrs["level"].SetOptional() + attrs["maturity_level"] = attrs["maturity_level"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["origin"] = attrs["origin"].SetOptional() + attrs["sequence"] = attrs["sequence"].SetOptional() + attrs["timestamp"] = attrs["timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineEvent. @@ -4001,16 +4116,16 @@ func (o *PipelineEvent) SetSequence(ctx context.Context, v Sequencing) { type PipelineLibrary struct { // The path to a file that defines a pipeline and is stored in the // Databricks Repos. - File types.Object `tfsdk:"file" tf:"optional,object"` + File types.Object `tfsdk:"file"` // URI of the jar to be installed. Currently only DBFS is supported. - Jar types.String `tfsdk:"jar" tf:"optional"` + Jar types.String `tfsdk:"jar"` // Specification of a maven library to be installed. - Maven types.Object `tfsdk:"maven" tf:"optional,object"` + Maven types.Object `tfsdk:"maven"` // The path to a notebook that defines a pipeline and is stored in the // Databricks workspace. - Notebook types.Object `tfsdk:"notebook" tf:"optional,object"` + Notebook types.Object `tfsdk:"notebook"` // URI of the whl to be installed. - Whl types.String `tfsdk:"whl" tf:"optional"` + Whl types.String `tfsdk:"whl"` } func (newState *PipelineLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineLibrary) { @@ -4019,12 +4134,14 @@ func (newState *PipelineLibrary) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pi func (newState *PipelineLibrary) SyncEffectiveFieldsDuringRead(existingState PipelineLibrary) { } -func (c PipelineLibrary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - FileLibrary{}.ApplySchemaCustomizations(cs, append(path, "file")...) - compute_tf.MavenLibrary{}.ApplySchemaCustomizations(cs, append(path, "maven")...) - NotebookLibrary{}.ApplySchemaCustomizations(cs, append(path, "notebook")...) +func (c PipelineLibrary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["file"] = attrs["file"].SetOptional() + attrs["jar"] = attrs["jar"].SetOptional() + attrs["maven"] = attrs["maven"].SetOptional() + attrs["notebook"] = attrs["notebook"].SetOptional() + attrs["whl"] = attrs["whl"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineLibrary. @@ -4155,11 +4272,11 @@ func (o *PipelineLibrary) SetNotebook(ctx context.Context, v NotebookLibrary) { } type PipelinePermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PipelinePermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelinePermission) { @@ -4168,9 +4285,12 @@ func (newState *PipelinePermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PipelinePermission) SyncEffectiveFieldsDuringRead(existingState PipelinePermission) { } -func (c PipelinePermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelinePermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermission. @@ -4239,11 +4359,11 @@ func (o *PipelinePermission) SetInheritedFromObject(ctx context.Context, v []typ } type PipelinePermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *PipelinePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelinePermissions) { @@ -4252,10 +4372,12 @@ func (newState *PipelinePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *PipelinePermissions) SyncEffectiveFieldsDuringRead(existingState PipelinePermissions) { } -func (c PipelinePermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c PipelinePermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermissions. @@ -4324,9 +4446,9 @@ func (o *PipelinePermissions) SetAccessControlList(ctx context.Context, v []Pipe } type PipelinePermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *PipelinePermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelinePermissionsDescription) { @@ -4335,9 +4457,11 @@ func (newState *PipelinePermissionsDescription) SyncEffectiveFieldsDuringCreateO func (newState *PipelinePermissionsDescription) SyncEffectiveFieldsDuringRead(existingState PipelinePermissionsDescription) { } -func (c PipelinePermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PipelinePermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermissionsDescription. @@ -4374,7 +4498,7 @@ func (o PipelinePermissionsDescription) Type(ctx context.Context) attr.Type { } type PipelinePermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The pipeline for which to get or manage permissions. PipelineId types.String `tfsdk:"-"` } @@ -4385,11 +4509,11 @@ func (newState *PipelinePermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpd func (newState *PipelinePermissionsRequest) SyncEffectiveFieldsDuringRead(existingState PipelinePermissionsRequest) { } -func (c PipelinePermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "pipeline_id")...) +func (c PipelinePermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelinePermissionsRequest. @@ -4457,60 +4581,60 @@ func (o *PipelinePermissionsRequest) SetAccessControlList(ctx context.Context, v type PipelineSpec struct { // Budget policy of this pipeline. - BudgetPolicyId types.String `tfsdk:"budget_policy_id" tf:"optional"` + BudgetPolicyId types.String `tfsdk:"budget_policy_id"` // A catalog in Unity Catalog to publish data from this pipeline to. If // `target` is specified, tables in this pipeline are published to a // `target` schema inside `catalog` (for example, // `catalog`.`target`.`table`). If `target` is not specified, no data is // published to Unity Catalog. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // DLT Release Channel that specifies which version to use. - Channel types.String `tfsdk:"channel" tf:"optional"` + Channel types.String `tfsdk:"channel"` // Cluster settings for this pipeline deployment. - Clusters types.List `tfsdk:"clusters" tf:"optional"` + Clusters types.List `tfsdk:"clusters"` // String-String configuration for this pipeline execution. - Configuration types.Map `tfsdk:"configuration" tf:"optional"` + Configuration types.Map `tfsdk:"configuration"` // Whether the pipeline is continuous or triggered. This replaces `trigger`. - Continuous types.Bool `tfsdk:"continuous" tf:"optional"` + Continuous types.Bool `tfsdk:"continuous"` // Deployment type of this pipeline. - Deployment types.Object `tfsdk:"deployment" tf:"optional,object"` + Deployment types.Object `tfsdk:"deployment"` // Whether the pipeline is in Development mode. Defaults to false. - Development types.Bool `tfsdk:"development" tf:"optional"` + Development types.Bool `tfsdk:"development"` // Pipeline product edition. - Edition types.String `tfsdk:"edition" tf:"optional"` + Edition types.String `tfsdk:"edition"` // Filters on which Pipeline packages to include in the deployed graph. - Filters types.Object `tfsdk:"filters" tf:"optional,object"` + Filters types.Object `tfsdk:"filters"` // The definition of a gateway pipeline to support change data capture. - GatewayDefinition types.Object `tfsdk:"gateway_definition" tf:"optional,object"` + GatewayDefinition types.Object `tfsdk:"gateway_definition"` // Unique identifier for this pipeline. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The configuration for a managed ingestion pipeline. These settings cannot // be used with the 'libraries', 'target' or 'catalog' settings. - IngestionDefinition types.Object `tfsdk:"ingestion_definition" tf:"optional,object"` + IngestionDefinition types.Object `tfsdk:"ingestion_definition"` // Libraries or code needed by this deployment. - Libraries types.List `tfsdk:"libraries" tf:"optional"` + Libraries types.List `tfsdk:"libraries"` // Friendly identifier for this pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // List of notification settings for this pipeline. - Notifications types.List `tfsdk:"notifications" tf:"optional"` + Notifications types.List `tfsdk:"notifications"` // Whether Photon is enabled for this pipeline. - Photon types.Bool `tfsdk:"photon" tf:"optional"` + Photon types.Bool `tfsdk:"photon"` // Restart window of this pipeline. - RestartWindow types.Object `tfsdk:"restart_window" tf:"optional,object"` + RestartWindow types.Object `tfsdk:"restart_window"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // Whether serverless compute is enabled for this pipeline. - Serverless types.Bool `tfsdk:"serverless" tf:"optional"` + Serverless types.Bool `tfsdk:"serverless"` // DBFS root directory for storing checkpoints and tables. - Storage types.String `tfsdk:"storage" tf:"optional"` + Storage types.String `tfsdk:"storage"` // Target schema (database) to add tables in this pipeline to. If not // specified, no data is published to the Hive metastore or Unity Catalog. // To publish to Unity Catalog, also specify `catalog`. - Target types.String `tfsdk:"target" tf:"optional"` + Target types.String `tfsdk:"target"` // Which pipeline trigger to use. Deprecated: Use `continuous` instead. - Trigger types.Object `tfsdk:"trigger" tf:"optional,object"` + Trigger types.Object `tfsdk:"trigger"` } func (newState *PipelineSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineSpec) { @@ -4519,18 +4643,32 @@ func (newState *PipelineSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pipel func (newState *PipelineSpec) SyncEffectiveFieldsDuringRead(existingState PipelineSpec) { } -func (c PipelineSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineCluster{}.ApplySchemaCustomizations(cs, append(path, "clusters")...) - PipelineDeployment{}.ApplySchemaCustomizations(cs, append(path, "deployment")...) - Filters{}.ApplySchemaCustomizations(cs, append(path, "filters")...) - IngestionGatewayPipelineDefinition{}.ApplySchemaCustomizations(cs, append(path, "gateway_definition")...) - IngestionPipelineDefinition{}.ApplySchemaCustomizations(cs, append(path, "ingestion_definition")...) - PipelineLibrary{}.ApplySchemaCustomizations(cs, append(path, "libraries")...) - Notifications{}.ApplySchemaCustomizations(cs, append(path, "notifications")...) - RestartWindow{}.ApplySchemaCustomizations(cs, append(path, "restart_window")...) - PipelineTrigger{}.ApplySchemaCustomizations(cs, append(path, "trigger")...) - - return cs +func (c PipelineSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["budget_policy_id"] = attrs["budget_policy_id"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["clusters"] = attrs["clusters"].SetOptional() + attrs["configuration"] = attrs["configuration"].SetOptional() + attrs["continuous"] = attrs["continuous"].SetOptional() + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["development"] = attrs["development"].SetOptional() + attrs["edition"] = attrs["edition"].SetOptional() + attrs["filters"] = attrs["filters"].SetOptional() + attrs["gateway_definition"] = attrs["gateway_definition"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["ingestion_definition"] = attrs["ingestion_definition"].SetOptional() + attrs["libraries"] = attrs["libraries"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["notifications"] = attrs["notifications"].SetOptional() + attrs["photon"] = attrs["photon"].SetOptional() + attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["serverless"] = attrs["serverless"].SetOptional() + attrs["storage"] = attrs["storage"].SetOptional() + attrs["target"] = attrs["target"].SetOptional() + attrs["trigger"] = attrs["trigger"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineSpec. @@ -4901,23 +5039,23 @@ func (o *PipelineSpec) SetTrigger(ctx context.Context, v PipelineTrigger) { type PipelineStateInfo struct { // The unique identifier of the cluster running the pipeline. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The username of the pipeline creator. - CreatorUserName types.String `tfsdk:"creator_user_name" tf:"optional"` + CreatorUserName types.String `tfsdk:"creator_user_name"` // The health of a pipeline. - Health types.String `tfsdk:"health" tf:"optional"` + Health types.String `tfsdk:"health"` // Status of the latest updates for the pipeline. Ordered with the newest // update first. - LatestUpdates types.List `tfsdk:"latest_updates" tf:"optional"` + LatestUpdates types.List `tfsdk:"latest_updates"` // The user-friendly name of the pipeline. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The unique identifier of the pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // The username that the pipeline runs as. This is a read only value derived // from the pipeline owner. - RunAsUserName types.String `tfsdk:"run_as_user_name" tf:"optional"` + RunAsUserName types.String `tfsdk:"run_as_user_name"` // The pipeline state. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *PipelineStateInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineStateInfo) { @@ -4926,10 +5064,17 @@ func (newState *PipelineStateInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PipelineStateInfo) SyncEffectiveFieldsDuringRead(existingState PipelineStateInfo) { } -func (c PipelineStateInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateStateInfo{}.ApplySchemaCustomizations(cs, append(path, "latest_updates")...) +func (c PipelineStateInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["latest_updates"] = attrs["latest_updates"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineStateInfo. @@ -5008,9 +5153,9 @@ func (o *PipelineStateInfo) SetLatestUpdates(ctx context.Context, v []UpdateStat } type PipelineTrigger struct { - Cron types.Object `tfsdk:"cron" tf:"optional,object"` + Cron types.Object `tfsdk:"cron"` - Manual types.Object `tfsdk:"manual" tf:"optional,object"` + Manual types.Object `tfsdk:"manual"` } func (newState *PipelineTrigger) SyncEffectiveFieldsDuringCreateOrUpdate(plan PipelineTrigger) { @@ -5019,11 +5164,11 @@ func (newState *PipelineTrigger) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pi func (newState *PipelineTrigger) SyncEffectiveFieldsDuringRead(existingState PipelineTrigger) { } -func (c PipelineTrigger) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CronTrigger{}.ApplySchemaCustomizations(cs, append(path, "cron")...) - ManualTrigger{}.ApplySchemaCustomizations(cs, append(path, "manual")...) +func (c PipelineTrigger) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cron"] = attrs["cron"].SetOptional() + attrs["manual"] = attrs["manual"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PipelineTrigger. @@ -5120,18 +5265,18 @@ func (o *PipelineTrigger) SetManual(ctx context.Context, v ManualTrigger) { type ReportSpec struct { // Required. Destination catalog to store table. - DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"` + DestinationCatalog types.String `tfsdk:"destination_catalog"` // Required. Destination schema to store table. - DestinationSchema types.String `tfsdk:"destination_schema" tf:"optional"` + DestinationSchema types.String `tfsdk:"destination_schema"` // Required. Destination table name. The pipeline fails if a table with that // name already exists. - DestinationTable types.String `tfsdk:"destination_table" tf:"optional"` + DestinationTable types.String `tfsdk:"destination_table"` // Required. Report URL in the source system. - SourceUrl types.String `tfsdk:"source_url" tf:"optional"` + SourceUrl types.String `tfsdk:"source_url"` // Configuration settings to control the ingestion of tables. These settings // override the table_configuration defined in the // IngestionPipelineDefinition object. - TableConfiguration types.Object `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.Object `tfsdk:"table_configuration"` } func (newState *ReportSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReportSpec) { @@ -5140,10 +5285,14 @@ func (newState *ReportSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReportS func (newState *ReportSpec) SyncEffectiveFieldsDuringRead(existingState ReportSpec) { } -func (c ReportSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSpecificConfig{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c ReportSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_catalog"] = attrs["destination_catalog"].SetOptional() + attrs["destination_schema"] = attrs["destination_schema"].SetOptional() + attrs["destination_table"] = attrs["destination_table"].SetOptional() + attrs["source_url"] = attrs["source_url"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ReportSpec. @@ -5219,15 +5368,15 @@ type RestartWindow struct { // Days of week in which the restart is allowed to happen (within a // five-hour window starting at start_hour). If not specified all days of // the week will be used. - DaysOfWeek types.List `tfsdk:"days_of_week" tf:"optional"` + DaysOfWeek types.List `tfsdk:"days_of_week"` // An integer between 0 and 23 denoting the start hour for the restart // window in the 24-hour day. Continuous pipeline restart is triggered only // within a five-hour window starting at this hour. - StartHour types.Int64 `tfsdk:"start_hour" tf:""` + StartHour types.Int64 `tfsdk:"start_hour"` // Time zone id of restart window. See // https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html // for details. If not specified, UTC will be used. - TimeZoneId types.String `tfsdk:"time_zone_id" tf:"optional"` + TimeZoneId types.String `tfsdk:"time_zone_id"` } func (newState *RestartWindow) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestartWindow) { @@ -5236,10 +5385,12 @@ func (newState *RestartWindow) SyncEffectiveFieldsDuringCreateOrUpdate(plan Rest func (newState *RestartWindow) SyncEffectiveFieldsDuringRead(existingState RestartWindow) { } -func (c RestartWindow) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "start_hour")...) +func (c RestartWindow) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["days_of_week"] = attrs["days_of_week"].SetOptional() + attrs["start_hour"] = attrs["start_hour"].SetRequired() + attrs["time_zone_id"] = attrs["time_zone_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestartWindow. @@ -5309,20 +5460,20 @@ func (o *RestartWindow) SetDaysOfWeek(ctx context.Context, v []types.String) { type SchemaSpec struct { // Required. Destination catalog to store tables. - DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"` + DestinationCatalog types.String `tfsdk:"destination_catalog"` // Required. Destination schema to store tables in. Tables with the same // name as the source tables are created in this destination schema. The // pipeline fails If a table with the same name already exists. - DestinationSchema types.String `tfsdk:"destination_schema" tf:"optional"` + DestinationSchema types.String `tfsdk:"destination_schema"` // The source catalog name. Might be optional depending on the type of // source. - SourceCatalog types.String `tfsdk:"source_catalog" tf:"optional"` + SourceCatalog types.String `tfsdk:"source_catalog"` // Required. Schema name in the source database. - SourceSchema types.String `tfsdk:"source_schema" tf:"optional"` + SourceSchema types.String `tfsdk:"source_schema"` // Configuration settings to control the ingestion of tables. These settings // are applied to all tables in this schema and override the // table_configuration defined in the IngestionPipelineDefinition object. - TableConfiguration types.Object `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.Object `tfsdk:"table_configuration"` } func (newState *SchemaSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan SchemaSpec) { @@ -5331,10 +5482,14 @@ func (newState *SchemaSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan SchemaS func (newState *SchemaSpec) SyncEffectiveFieldsDuringRead(existingState SchemaSpec) { } -func (c SchemaSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSpecificConfig{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c SchemaSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_catalog"] = attrs["destination_catalog"].SetOptional() + attrs["destination_schema"] = attrs["destination_schema"].SetOptional() + attrs["source_catalog"] = attrs["source_catalog"].SetOptional() + attrs["source_schema"] = attrs["source_schema"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SchemaSpec. @@ -5408,9 +5563,9 @@ func (o *SchemaSpec) SetTableConfiguration(ctx context.Context, v TableSpecificC type Sequencing struct { // A sequence number, unique and increasing within the control plane. - ControlPlaneSeqNo types.Int64 `tfsdk:"control_plane_seq_no" tf:"optional"` + ControlPlaneSeqNo types.Int64 `tfsdk:"control_plane_seq_no"` // the ID assigned by the data plane. - DataPlaneId types.Object `tfsdk:"data_plane_id" tf:"optional,object"` + DataPlaneId types.Object `tfsdk:"data_plane_id"` } func (newState *Sequencing) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sequencing) { @@ -5419,10 +5574,11 @@ func (newState *Sequencing) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sequenc func (newState *Sequencing) SyncEffectiveFieldsDuringRead(existingState Sequencing) { } -func (c Sequencing) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DataPlaneId{}.ApplySchemaCustomizations(cs, append(path, "data_plane_id")...) +func (c Sequencing) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["control_plane_seq_no"] = attrs["control_plane_seq_no"].SetOptional() + attrs["data_plane_id"] = attrs["data_plane_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Sequencing. @@ -5490,11 +5646,11 @@ func (o *Sequencing) SetDataPlaneId(ctx context.Context, v DataPlaneId) { type SerializedException struct { // Runtime class of the exception - ClassName types.String `tfsdk:"class_name" tf:"optional"` + ClassName types.String `tfsdk:"class_name"` // Exception message - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Stack trace consisting of a list of stack frames - Stack types.List `tfsdk:"stack" tf:"optional"` + Stack types.List `tfsdk:"stack"` } func (newState *SerializedException) SyncEffectiveFieldsDuringCreateOrUpdate(plan SerializedException) { @@ -5503,10 +5659,12 @@ func (newState *SerializedException) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *SerializedException) SyncEffectiveFieldsDuringRead(existingState SerializedException) { } -func (c SerializedException) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StackFrame{}.ApplySchemaCustomizations(cs, append(path, "stack")...) +func (c SerializedException) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["class_name"] = attrs["class_name"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["stack"] = attrs["stack"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SerializedException. @@ -5576,13 +5734,13 @@ func (o *SerializedException) SetStack(ctx context.Context, v []StackFrame) { type StackFrame struct { // Class from which the method call originated - DeclaringClass types.String `tfsdk:"declaring_class" tf:"optional"` + DeclaringClass types.String `tfsdk:"declaring_class"` // File where the method is defined - FileName types.String `tfsdk:"file_name" tf:"optional"` + FileName types.String `tfsdk:"file_name"` // Line from which the method was called - LineNumber types.Int64 `tfsdk:"line_number" tf:"optional"` + LineNumber types.Int64 `tfsdk:"line_number"` // Name of the method which was called - MethodName types.String `tfsdk:"method_name" tf:"optional"` + MethodName types.String `tfsdk:"method_name"` } func (newState *StackFrame) SyncEffectiveFieldsDuringCreateOrUpdate(plan StackFrame) { @@ -5591,9 +5749,13 @@ func (newState *StackFrame) SyncEffectiveFieldsDuringCreateOrUpdate(plan StackFr func (newState *StackFrame) SyncEffectiveFieldsDuringRead(existingState StackFrame) { } -func (c StackFrame) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StackFrame) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["declaring_class"] = attrs["declaring_class"].SetOptional() + attrs["file_name"] = attrs["file_name"].SetOptional() + attrs["line_number"] = attrs["line_number"].SetOptional() + attrs["method_name"] = attrs["method_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StackFrame. @@ -5634,24 +5796,24 @@ func (o StackFrame) Type(ctx context.Context) attr.Type { } type StartUpdate struct { - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // If true, this update will reset all tables before running. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` // A list of tables to update with fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - FullRefreshSelection types.List `tfsdk:"full_refresh_selection" tf:"optional"` + FullRefreshSelection types.List `tfsdk:"full_refresh_selection"` PipelineId types.String `tfsdk:"-"` // A list of tables to update without fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - RefreshSelection types.List `tfsdk:"refresh_selection" tf:"optional"` + RefreshSelection types.List `tfsdk:"refresh_selection"` // If true, this update only validates the correctness of pipeline source // code but does not materialize or publish any datasets. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *StartUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartUpdate) { @@ -5660,10 +5822,15 @@ func (newState *StartUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartU func (newState *StartUpdate) SyncEffectiveFieldsDuringRead(existingState StartUpdate) { } -func (c StartUpdate) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "pipeline_id")...) +func (c StartUpdate) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() + attrs["full_refresh_selection"] = attrs["full_refresh_selection"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetRequired() + attrs["refresh_selection"] = attrs["refresh_selection"].SetOptional() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartUpdate. @@ -5767,7 +5934,7 @@ func (o *StartUpdate) SetRefreshSelection(ctx context.Context, v []types.String) } type StartUpdateResponse struct { - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` } func (newState *StartUpdateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan StartUpdateResponse) { @@ -5776,9 +5943,10 @@ func (newState *StartUpdateResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *StartUpdateResponse) SyncEffectiveFieldsDuringRead(existingState StartUpdateResponse) { } -func (c StartUpdateResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StartUpdateResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["update_id"] = attrs["update_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartUpdateResponse. @@ -5821,9 +5989,9 @@ func (newState *StopPipelineResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *StopPipelineResponse) SyncEffectiveFieldsDuringRead(existingState StopPipelineResponse) { } -func (c StopPipelineResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StopPipelineResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StopPipelineResponse. @@ -5891,23 +6059,23 @@ func (o StopRequest) Type(ctx context.Context) attr.Type { type TableSpec struct { // Required. Destination catalog to store table. - DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"` + DestinationCatalog types.String `tfsdk:"destination_catalog"` // Required. Destination schema to store table. - DestinationSchema types.String `tfsdk:"destination_schema" tf:"optional"` + DestinationSchema types.String `tfsdk:"destination_schema"` // Optional. Destination table name. The pipeline fails if a table with that // name already exists. If not set, the source table name is used. - DestinationTable types.String `tfsdk:"destination_table" tf:"optional"` + DestinationTable types.String `tfsdk:"destination_table"` // Source catalog name. Might be optional depending on the type of source. - SourceCatalog types.String `tfsdk:"source_catalog" tf:"optional"` + SourceCatalog types.String `tfsdk:"source_catalog"` // Schema name in the source database. Might be optional depending on the // type of source. - SourceSchema types.String `tfsdk:"source_schema" tf:"optional"` + SourceSchema types.String `tfsdk:"source_schema"` // Required. Table name in the source database. - SourceTable types.String `tfsdk:"source_table" tf:"optional"` + SourceTable types.String `tfsdk:"source_table"` // Configuration settings to control the ingestion of tables. These settings // override the table_configuration defined in the // IngestionPipelineDefinition object and the SchemaSpec. - TableConfiguration types.Object `tfsdk:"table_configuration" tf:"optional,object"` + TableConfiguration types.Object `tfsdk:"table_configuration"` } func (newState *TableSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSpec) { @@ -5916,10 +6084,16 @@ func (newState *TableSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSpe func (newState *TableSpec) SyncEffectiveFieldsDuringRead(existingState TableSpec) { } -func (c TableSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TableSpecificConfig{}.ApplySchemaCustomizations(cs, append(path, "table_configuration")...) +func (c TableSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_catalog"] = attrs["destination_catalog"].SetOptional() + attrs["destination_schema"] = attrs["destination_schema"].SetOptional() + attrs["destination_table"] = attrs["destination_table"].SetOptional() + attrs["source_catalog"] = attrs["source_catalog"].SetOptional() + attrs["source_schema"] = attrs["source_schema"].SetOptional() + attrs["source_table"] = attrs["source_table"].SetOptional() + attrs["table_configuration"] = attrs["table_configuration"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableSpec. @@ -5997,16 +6171,16 @@ func (o *TableSpec) SetTableConfiguration(ctx context.Context, v TableSpecificCo type TableSpecificConfig struct { // The primary key of the table used to apply changes. - PrimaryKeys types.List `tfsdk:"primary_keys" tf:"optional"` + PrimaryKeys types.List `tfsdk:"primary_keys"` // If true, formula fields defined in the table are included in the // ingestion. This setting is only valid for the Salesforce connector - SalesforceIncludeFormulaFields types.Bool `tfsdk:"salesforce_include_formula_fields" tf:"optional"` + SalesforceIncludeFormulaFields types.Bool `tfsdk:"salesforce_include_formula_fields"` // The SCD type to use to ingest the table. - ScdType types.String `tfsdk:"scd_type" tf:"optional"` + ScdType types.String `tfsdk:"scd_type"` // The column names specifying the logical order of events in the source // data. Delta Live Tables uses this sequencing to handle change events that // arrive out of order. - SequenceBy types.List `tfsdk:"sequence_by" tf:"optional"` + SequenceBy types.List `tfsdk:"sequence_by"` } func (newState *TableSpecificConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan TableSpecificConfig) { @@ -6015,9 +6189,13 @@ func (newState *TableSpecificConfig) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *TableSpecificConfig) SyncEffectiveFieldsDuringRead(existingState TableSpecificConfig) { } -func (c TableSpecificConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TableSpecificConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["primary_keys"] = attrs["primary_keys"].SetOptional() + attrs["salesforce_include_formula_fields"] = attrs["salesforce_include_formula_fields"].SetOptional() + attrs["scd_type"] = attrs["scd_type"].SetOptional() + attrs["sequence_by"] = attrs["sequence_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TableSpecificConfig. @@ -6118,35 +6296,35 @@ func (o *TableSpecificConfig) SetSequenceBy(ctx context.Context, v []types.Strin type UpdateInfo struct { // What triggered this update. - Cause types.String `tfsdk:"cause" tf:"optional"` + Cause types.String `tfsdk:"cause"` // The ID of the cluster that the update is running on. - ClusterId types.String `tfsdk:"cluster_id" tf:"optional"` + ClusterId types.String `tfsdk:"cluster_id"` // The pipeline configuration with system defaults applied where unspecified // by the user. Not returned by ListUpdates. - Config types.Object `tfsdk:"config" tf:"optional,object"` + Config types.Object `tfsdk:"config"` // The time when this update was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // If true, this update will reset all tables before running. - FullRefresh types.Bool `tfsdk:"full_refresh" tf:"optional"` + FullRefresh types.Bool `tfsdk:"full_refresh"` // A list of tables to update with fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - FullRefreshSelection types.List `tfsdk:"full_refresh_selection" tf:"optional"` + FullRefreshSelection types.List `tfsdk:"full_refresh_selection"` // The ID of the pipeline. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // A list of tables to update without fullRefresh. If both refresh_selection // and full_refresh_selection are empty, this is a full graph update. Full // Refresh on a table means that the states of the table will be reset // before the refresh. - RefreshSelection types.List `tfsdk:"refresh_selection" tf:"optional"` + RefreshSelection types.List `tfsdk:"refresh_selection"` // The update state. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // The ID of this update. - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` // If true, this update only validates the correctness of pipeline source // code but does not materialize or publish any datasets. - ValidateOnly types.Bool `tfsdk:"validate_only" tf:"optional"` + ValidateOnly types.Bool `tfsdk:"validate_only"` } func (newState *UpdateInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateInfo) { @@ -6155,10 +6333,20 @@ func (newState *UpdateInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateI func (newState *UpdateInfo) SyncEffectiveFieldsDuringRead(existingState UpdateInfo) { } -func (c UpdateInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PipelineSpec{}.ApplySchemaCustomizations(cs, append(path, "config")...) +func (c UpdateInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cause"] = attrs["cause"].SetOptional() + attrs["cluster_id"] = attrs["cluster_id"].SetOptional() + attrs["config"] = attrs["config"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["full_refresh"] = attrs["full_refresh"].SetOptional() + attrs["full_refresh_selection"] = attrs["full_refresh_selection"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["refresh_selection"] = attrs["refresh_selection"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["update_id"] = attrs["update_id"].SetOptional() + attrs["validate_only"] = attrs["validate_only"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateInfo. @@ -6301,11 +6489,11 @@ func (o *UpdateInfo) SetRefreshSelection(ctx context.Context, v []types.String) } type UpdateStateInfo struct { - CreationTime types.String `tfsdk:"creation_time" tf:"optional"` + CreationTime types.String `tfsdk:"creation_time"` - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` - UpdateId types.String `tfsdk:"update_id" tf:"optional"` + UpdateId types.String `tfsdk:"update_id"` } func (newState *UpdateStateInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateStateInfo) { @@ -6314,9 +6502,12 @@ func (newState *UpdateStateInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Up func (newState *UpdateStateInfo) SyncEffectiveFieldsDuringRead(existingState UpdateStateInfo) { } -func (c UpdateStateInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateStateInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["update_id"] = attrs["update_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateStateInfo. diff --git a/internal/service/provisioning_tf/legacy_model.go b/internal/service/provisioning_tf/legacy_model.go index a58ed978a..35530bb76 100755 --- a/internal/service/provisioning_tf/legacy_model.go +++ b/internal/service/provisioning_tf/legacy_model.go @@ -17,13 +17,14 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) type AwsCredentials_SdkV2 struct { - StsRole types.List `tfsdk:"sts_role" tf:"optional,object"` + StsRole types.List `tfsdk:"sts_role"` } func (newState *AwsCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsCredentials_SdkV2) { @@ -32,10 +33,11 @@ func (newState *AwsCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AwsCredentials_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsCredentials_SdkV2) { } -func (c AwsCredentials_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StsRole_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sts_role")...) +func (c AwsCredentials_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sts_role"] = attrs["sts_role"].SetOptional() + attrs["sts_role"] = attrs["sts_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsCredentials. @@ -101,16 +103,16 @@ func (o *AwsCredentials_SdkV2) SetStsRole(ctx context.Context, v StsRole_SdkV2) type AwsKeyInfo_SdkV2 struct { // The AWS KMS key alias. - KeyAlias types.String `tfsdk:"key_alias" tf:"optional"` + KeyAlias types.String `tfsdk:"key_alias"` // The AWS KMS key's Amazon Resource Name (ARN). - KeyArn types.String `tfsdk:"key_arn" tf:""` + KeyArn types.String `tfsdk:"key_arn"` // The AWS KMS key region. - KeyRegion types.String `tfsdk:"key_region" tf:""` + KeyRegion types.String `tfsdk:"key_region"` // This field applies only if the `use_cases` property includes `STORAGE`. // If this is set to `true` or omitted, the key is also used to encrypt // cluster EBS volumes. If you do not want to use this key for encrypting // EBS volumes, set to `false`. - ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes" tf:"optional"` + ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes"` } func (newState *AwsKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsKeyInfo_SdkV2) { @@ -119,11 +121,13 @@ func (newState *AwsKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan A func (newState *AwsKeyInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState AwsKeyInfo_SdkV2) { } -func (c AwsKeyInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key_arn")...) - cs.SetRequired(append(path, "key_region")...) +func (c AwsKeyInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key_alias"] = attrs["key_alias"].SetOptional() + attrs["key_arn"] = attrs["key_arn"].SetRequired() + attrs["key_region"] = attrs["key_region"].SetRequired() + attrs["reuse_key_for_cluster_volumes"] = attrs["reuse_key_for_cluster_volumes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsKeyInfo. @@ -165,9 +169,9 @@ func (o AwsKeyInfo_SdkV2) Type(ctx context.Context) attr.Type { type AzureWorkspaceInfo_SdkV2 struct { // Azure Resource Group name - ResourceGroup types.String `tfsdk:"resource_group" tf:"optional"` + ResourceGroup types.String `tfsdk:"resource_group"` // Azure Subscription ID - SubscriptionId types.String `tfsdk:"subscription_id" tf:"optional"` + SubscriptionId types.String `tfsdk:"subscription_id"` } func (newState *AzureWorkspaceInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureWorkspaceInfo_SdkV2) { @@ -176,9 +180,11 @@ func (newState *AzureWorkspaceInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AzureWorkspaceInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureWorkspaceInfo_SdkV2) { } -func (c AzureWorkspaceInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AzureWorkspaceInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["resource_group"] = attrs["resource_group"].SetOptional() + attrs["subscription_id"] = attrs["subscription_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureWorkspaceInfo. @@ -217,7 +223,7 @@ func (o AzureWorkspaceInfo_SdkV2) Type(ctx context.Context) attr.Type { // The general workspace configurations that are specific to cloud providers. type CloudResourceContainer_SdkV2 struct { // The general workspace configurations that are specific to Google Cloud. - Gcp types.List `tfsdk:"gcp" tf:"optional,object"` + Gcp types.List `tfsdk:"gcp"` } func (newState *CloudResourceContainer_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloudResourceContainer_SdkV2) { @@ -226,10 +232,11 @@ func (newState *CloudResourceContainer_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CloudResourceContainer_SdkV2) SyncEffectiveFieldsDuringRead(existingState CloudResourceContainer_SdkV2) { } -func (c CloudResourceContainer_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CustomerFacingGcpCloudResourceContainer_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp")...) +func (c CloudResourceContainer_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gcp"] = attrs["gcp"].SetOptional() + attrs["gcp"] = attrs["gcp"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloudResourceContainer. @@ -295,15 +302,15 @@ func (o *CloudResourceContainer_SdkV2) SetGcp(ctx context.Context, v CustomerFac type CreateAwsKeyInfo_SdkV2 struct { // The AWS KMS key alias. - KeyAlias types.String `tfsdk:"key_alias" tf:"optional"` + KeyAlias types.String `tfsdk:"key_alias"` // The AWS KMS key's Amazon Resource Name (ARN). Note that the key's AWS // region is inferred from the ARN. - KeyArn types.String `tfsdk:"key_arn" tf:""` + KeyArn types.String `tfsdk:"key_arn"` // This field applies only if the `use_cases` property includes `STORAGE`. // If this is set to `true` or omitted, the key is also used to encrypt // cluster EBS volumes. To not use this key also for encrypting EBS volumes, // set this to `false`. - ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes" tf:"optional"` + ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes"` } func (newState *CreateAwsKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAwsKeyInfo_SdkV2) { @@ -312,10 +319,12 @@ func (newState *CreateAwsKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateAwsKeyInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateAwsKeyInfo_SdkV2) { } -func (c CreateAwsKeyInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key_arn")...) +func (c CreateAwsKeyInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key_alias"] = attrs["key_alias"].SetOptional() + attrs["key_arn"] = attrs["key_arn"].SetRequired() + attrs["reuse_key_for_cluster_volumes"] = attrs["reuse_key_for_cluster_volumes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAwsKeyInfo. @@ -354,7 +363,7 @@ func (o CreateAwsKeyInfo_SdkV2) Type(ctx context.Context) attr.Type { } type CreateCredentialAwsCredentials_SdkV2 struct { - StsRole types.List `tfsdk:"sts_role" tf:"optional,object"` + StsRole types.List `tfsdk:"sts_role"` } func (newState *CreateCredentialAwsCredentials_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialAwsCredentials_SdkV2) { @@ -363,10 +372,11 @@ func (newState *CreateCredentialAwsCredentials_SdkV2) SyncEffectiveFieldsDuringC func (newState *CreateCredentialAwsCredentials_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCredentialAwsCredentials_SdkV2) { } -func (c CreateCredentialAwsCredentials_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateCredentialStsRole_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sts_role")...) +func (c CreateCredentialAwsCredentials_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sts_role"] = attrs["sts_role"].SetOptional() + attrs["sts_role"] = attrs["sts_role"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialAwsCredentials. @@ -431,9 +441,9 @@ func (o *CreateCredentialAwsCredentials_SdkV2) SetStsRole(ctx context.Context, v } type CreateCredentialRequest_SdkV2 struct { - AwsCredentials types.List `tfsdk:"aws_credentials" tf:"object"` + AwsCredentials types.List `tfsdk:"aws_credentials"` // The human-readable name of the credential configuration object. - CredentialsName types.String `tfsdk:"credentials_name" tf:""` + CredentialsName types.String `tfsdk:"credentials_name"` } func (newState *CreateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialRequest_SdkV2) { @@ -442,12 +452,12 @@ func (newState *CreateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateCredentialRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCredentialRequest_SdkV2) { } -func (c CreateCredentialRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aws_credentials")...) - CreateCredentialAwsCredentials_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_credentials")...) - cs.SetRequired(append(path, "credentials_name")...) +func (c CreateCredentialRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_credentials"] = attrs["aws_credentials"].SetRequired() + attrs["aws_credentials"] = attrs["aws_credentials"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["credentials_name"] = attrs["credentials_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialRequest. @@ -515,7 +525,7 @@ func (o *CreateCredentialRequest_SdkV2) SetAwsCredentials(ctx context.Context, v type CreateCredentialStsRole_SdkV2 struct { // The Amazon Resource Name (ARN) of the cross account role. - RoleArn types.String `tfsdk:"role_arn" tf:"optional"` + RoleArn types.String `tfsdk:"role_arn"` } func (newState *CreateCredentialStsRole_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialStsRole_SdkV2) { @@ -524,9 +534,10 @@ func (newState *CreateCredentialStsRole_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateCredentialStsRole_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCredentialStsRole_SdkV2) { } -func (c CreateCredentialStsRole_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateCredentialStsRole_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["role_arn"] = attrs["role_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialStsRole. @@ -561,11 +572,11 @@ func (o CreateCredentialStsRole_SdkV2) Type(ctx context.Context) attr.Type { } type CreateCustomerManagedKeyRequest_SdkV2 struct { - AwsKeyInfo types.List `tfsdk:"aws_key_info" tf:"optional,object"` + AwsKeyInfo types.List `tfsdk:"aws_key_info"` - GcpKeyInfo types.List `tfsdk:"gcp_key_info" tf:"optional,object"` + GcpKeyInfo types.List `tfsdk:"gcp_key_info"` // The cases that the key can be used for. - UseCases types.List `tfsdk:"use_cases" tf:""` + UseCases types.List `tfsdk:"use_cases"` } func (newState *CreateCustomerManagedKeyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCustomerManagedKeyRequest_SdkV2) { @@ -574,12 +585,14 @@ func (newState *CreateCustomerManagedKeyRequest_SdkV2) SyncEffectiveFieldsDuring func (newState *CreateCustomerManagedKeyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCustomerManagedKeyRequest_SdkV2) { } -func (c CreateCustomerManagedKeyRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateAwsKeyInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_key_info")...) - CreateGcpKeyInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_key_info")...) - cs.SetRequired(append(path, "use_cases")...) +func (c CreateCustomerManagedKeyRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_key_info"] = attrs["aws_key_info"].SetOptional() + attrs["aws_key_info"] = attrs["aws_key_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gcp_key_info"] = attrs["gcp_key_info"].SetOptional() + attrs["gcp_key_info"] = attrs["gcp_key_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["use_cases"] = attrs["use_cases"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCustomerManagedKeyRequest. @@ -707,7 +720,7 @@ func (o *CreateCustomerManagedKeyRequest_SdkV2) SetUseCases(ctx context.Context, type CreateGcpKeyInfo_SdkV2 struct { // The GCP KMS key's resource name - KmsKeyId types.String `tfsdk:"kms_key_id" tf:""` + KmsKeyId types.String `tfsdk:"kms_key_id"` } func (newState *CreateGcpKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateGcpKeyInfo_SdkV2) { @@ -716,10 +729,10 @@ func (newState *CreateGcpKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateGcpKeyInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateGcpKeyInfo_SdkV2) { } -func (c CreateGcpKeyInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "kms_key_id")...) +func (c CreateGcpKeyInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kms_key_id"] = attrs["kms_key_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateGcpKeyInfo. @@ -756,23 +769,23 @@ func (o CreateGcpKeyInfo_SdkV2) Type(ctx context.Context) attr.Type { type CreateNetworkRequest_SdkV2 struct { // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). - GcpNetworkInfo types.List `tfsdk:"gcp_network_info" tf:"optional,object"` + GcpNetworkInfo types.List `tfsdk:"gcp_network_info"` // The human-readable name of the network configuration. - NetworkName types.String `tfsdk:"network_name" tf:""` + NetworkName types.String `tfsdk:"network_name"` // IDs of one to five security groups associated with this network. Security // group IDs **cannot** be used in multiple network configurations. - SecurityGroupIds types.List `tfsdk:"security_group_ids" tf:"optional"` + SecurityGroupIds types.List `tfsdk:"security_group_ids"` // IDs of at least two subnets associated with this network. Subnet IDs // **cannot** be used in multiple network configurations. - SubnetIds types.List `tfsdk:"subnet_ids" tf:"optional"` + SubnetIds types.List `tfsdk:"subnet_ids"` // If specified, contains the VPC endpoints used to allow cluster // communication from this VPC over [AWS PrivateLink]. // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ - VpcEndpoints types.List `tfsdk:"vpc_endpoints" tf:"optional,object"` + VpcEndpoints types.List `tfsdk:"vpc_endpoints"` // The ID of the VPC associated with this network. VPC IDs can be used in // multiple network configurations. - VpcId types.String `tfsdk:"vpc_id" tf:"optional"` + VpcId types.String `tfsdk:"vpc_id"` } func (newState *CreateNetworkRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateNetworkRequest_SdkV2) { @@ -781,12 +794,17 @@ func (newState *CreateNetworkRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateNetworkRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateNetworkRequest_SdkV2) { } -func (c CreateNetworkRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GcpNetworkInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_network_info")...) - cs.SetRequired(append(path, "network_name")...) - NetworkVpcEndpoints_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "vpc_endpoints")...) +func (c CreateNetworkRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gcp_network_info"] = attrs["gcp_network_info"].SetOptional() + attrs["gcp_network_info"] = attrs["gcp_network_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["network_name"] = attrs["network_name"].SetRequired() + attrs["security_group_ids"] = attrs["security_group_ids"].SetOptional() + attrs["subnet_ids"] = attrs["subnet_ids"].SetOptional() + attrs["vpc_endpoints"] = attrs["vpc_endpoints"].SetOptional() + attrs["vpc_endpoints"] = attrs["vpc_endpoints"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["vpc_id"] = attrs["vpc_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateNetworkRequest. @@ -949,9 +967,9 @@ func (o *CreateNetworkRequest_SdkV2) SetVpcEndpoints(ctx context.Context, v Netw type CreateStorageConfigurationRequest_SdkV2 struct { // Root S3 bucket information. - RootBucketInfo types.List `tfsdk:"root_bucket_info" tf:"object"` + RootBucketInfo types.List `tfsdk:"root_bucket_info"` // The human-readable name of the storage configuration. - StorageConfigurationName types.String `tfsdk:"storage_configuration_name" tf:""` + StorageConfigurationName types.String `tfsdk:"storage_configuration_name"` } func (newState *CreateStorageConfigurationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateStorageConfigurationRequest_SdkV2) { @@ -960,12 +978,12 @@ func (newState *CreateStorageConfigurationRequest_SdkV2) SyncEffectiveFieldsDuri func (newState *CreateStorageConfigurationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateStorageConfigurationRequest_SdkV2) { } -func (c CreateStorageConfigurationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "root_bucket_info")...) - RootBucketInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "root_bucket_info")...) - cs.SetRequired(append(path, "storage_configuration_name")...) +func (c CreateStorageConfigurationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["root_bucket_info"] = attrs["root_bucket_info"].SetRequired() + attrs["root_bucket_info"] = attrs["root_bucket_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["storage_configuration_name"] = attrs["storage_configuration_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateStorageConfigurationRequest. @@ -1033,14 +1051,14 @@ func (o *CreateStorageConfigurationRequest_SdkV2) SetRootBucketInfo(ctx context. type CreateVpcEndpointRequest_SdkV2 struct { // The ID of the VPC endpoint object in AWS. - AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id" tf:"optional"` + AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id"` // The Google Cloud specific information for this Private Service Connect // endpoint. - GcpVpcEndpointInfo types.List `tfsdk:"gcp_vpc_endpoint_info" tf:"optional,object"` + GcpVpcEndpointInfo types.List `tfsdk:"gcp_vpc_endpoint_info"` // The AWS region in which this VPC endpoint object exists. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The human-readable name of the storage configuration. - VpcEndpointName types.String `tfsdk:"vpc_endpoint_name" tf:""` + VpcEndpointName types.String `tfsdk:"vpc_endpoint_name"` } func (newState *CreateVpcEndpointRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVpcEndpointRequest_SdkV2) { @@ -1049,11 +1067,14 @@ func (newState *CreateVpcEndpointRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *CreateVpcEndpointRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateVpcEndpointRequest_SdkV2) { } -func (c CreateVpcEndpointRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GcpVpcEndpointInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_vpc_endpoint_info")...) - cs.SetRequired(append(path, "vpc_endpoint_name")...) +func (c CreateVpcEndpointRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_vpc_endpoint_id"] = attrs["aws_vpc_endpoint_id"].SetOptional() + attrs["gcp_vpc_endpoint_info"] = attrs["gcp_vpc_endpoint_info"].SetOptional() + attrs["gcp_vpc_endpoint_info"] = attrs["gcp_vpc_endpoint_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["region"] = attrs["region"].SetOptional() + attrs["vpc_endpoint_name"] = attrs["vpc_endpoint_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVpcEndpointRequest. @@ -1125,20 +1146,20 @@ func (o *CreateVpcEndpointRequest_SdkV2) SetGcpVpcEndpointInfo(ctx context.Conte type CreateWorkspaceRequest_SdkV2 struct { // The AWS region of the workspace's data plane. - AwsRegion types.String `tfsdk:"aws_region" tf:"optional"` + AwsRegion types.String `tfsdk:"aws_region"` // The cloud provider which the workspace uses. For Google Cloud workspaces, // always set this field to `gcp`. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // The general workspace configurations that are specific to cloud // providers. - CloudResourceContainer types.List `tfsdk:"cloud_resource_container" tf:"optional,object"` + CloudResourceContainer types.List `tfsdk:"cloud_resource_container"` // ID of the workspace's credential configuration object. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The deployment name defines part of the subdomain for the workspace. The // workspace URL for the web application and REST APIs is // `.cloud.databricks.com`. For example, if the @@ -1168,7 +1189,7 @@ type CreateWorkspaceRequest_SdkV2 struct { // // If a new workspace omits this property, the server generates a unique // deployment name for you with the pattern `dbc-xxxxxxxx-xxxx`. - DeploymentName types.String `tfsdk:"deployment_name" tf:"optional"` + DeploymentName types.String `tfsdk:"deployment_name"` // The network settings for the workspace. The configurations are only for // Databricks-managed VPCs. It is ignored if you specify a customer-managed // VPC in the `network_id` field.", All the IP range configurations must be @@ -1192,27 +1213,27 @@ type CreateWorkspaceRequest_SdkV2 struct { // for a new workspace]. // // [calculate subnet sizes for a new workspace]: https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/network-sizing.html - GcpManagedNetworkConfig types.List `tfsdk:"gcp_managed_network_config" tf:"optional,object"` + GcpManagedNetworkConfig types.List `tfsdk:"gcp_managed_network_config"` // The configurations for the GKE cluster of a Databricks workspace. - GkeConfig types.List `tfsdk:"gke_config" tf:"optional,object"` + GkeConfig types.List `tfsdk:"gke_config"` // Whether no public IP is enabled for the workspace. - IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled" tf:"optional"` + IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled"` // The Google Cloud region of the workspace data plane in your Google // account. For example, `us-east4`. - Location types.String `tfsdk:"location" tf:"optional"` + Location types.String `tfsdk:"location"` // The ID of the workspace's managed services encryption key configuration // object. This is used to help protect and control access to the // workspace's notebooks, secrets, Databricks SQL queries, and query // history. The provided key configuration object property `use_cases` must // contain `MANAGED_SERVICES`. - ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id" tf:"optional"` + ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id"` - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The pricing tier of the workspace. For pricing tier information, see [AWS // Pricing]. // // [AWS Pricing]: https://databricks.com/product/aws-pricing - PricingTier types.String `tfsdk:"pricing_tier" tf:"optional"` + PricingTier types.String `tfsdk:"pricing_tier"` // ID of the workspace's private access settings object. Only used for // PrivateLink. This ID must be specified for customers using [AWS // PrivateLink] for either front-end (user-to-workspace connection), @@ -1224,16 +1245,16 @@ type CreateWorkspaceRequest_SdkV2 struct { // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ // [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // The ID of the workspace's storage configuration object. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // The ID of the workspace's storage encryption key configuration object. // This is used to encrypt the workspace's root S3 bucket (root DBFS and // system data) and, optionally, cluster EBS volumes. The provided key // configuration object property `use_cases` must contain `STORAGE`. - StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id" tf:"optional"` + StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id"` // The workspace's human-readable name. - WorkspaceName types.String `tfsdk:"workspace_name" tf:""` + WorkspaceName types.String `tfsdk:"workspace_name"` } func (newState *CreateWorkspaceRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWorkspaceRequest_SdkV2) { @@ -1242,13 +1263,29 @@ func (newState *CreateWorkspaceRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateWorkspaceRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateWorkspaceRequest_SdkV2) { } -func (c CreateWorkspaceRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CloudResourceContainer_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cloud_resource_container")...) - GcpManagedNetworkConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_managed_network_config")...) - GkeConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gke_config")...) - cs.SetRequired(append(path, "workspace_name")...) - - return cs +func (c CreateWorkspaceRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_region"] = attrs["aws_region"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["cloud_resource_container"] = attrs["cloud_resource_container"].SetOptional() + attrs["cloud_resource_container"] = attrs["cloud_resource_container"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["deployment_name"] = attrs["deployment_name"].SetOptional() + attrs["gcp_managed_network_config"] = attrs["gcp_managed_network_config"].SetOptional() + attrs["gcp_managed_network_config"] = attrs["gcp_managed_network_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gke_config"] = attrs["gke_config"].SetOptional() + attrs["gke_config"] = attrs["gke_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["is_no_public_ip_enabled"] = attrs["is_no_public_ip_enabled"].SetOptional() + attrs["location"] = attrs["location"].SetOptional() + attrs["managed_services_customer_managed_key_id"] = attrs["managed_services_customer_managed_key_id"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["pricing_tier"] = attrs["pricing_tier"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_customer_managed_key_id"] = attrs["storage_customer_managed_key_id"].SetOptional() + attrs["workspace_name"] = attrs["workspace_name"].SetRequired() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWorkspaceRequest. @@ -1433,15 +1470,15 @@ func (o *CreateWorkspaceRequest_SdkV2) SetGkeConfig(ctx context.Context, v GkeCo type Credential_SdkV2 struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` - AwsCredentials types.List `tfsdk:"aws_credentials" tf:"optional,object"` + AwsCredentials types.List `tfsdk:"aws_credentials"` // Time in epoch milliseconds when the credential was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Databricks credential configuration ID. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The human-readable name of the credential configuration object. - CredentialsName types.String `tfsdk:"credentials_name" tf:"optional"` + CredentialsName types.String `tfsdk:"credentials_name"` } func (newState *Credential_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Credential_SdkV2) { @@ -1450,11 +1487,15 @@ func (newState *Credential_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *Credential_SdkV2) SyncEffectiveFieldsDuringRead(existingState Credential_SdkV2) { } -func (c Credential_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsCredentials_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_credentials")...) - cs.SetComputed(append(path, "creation_time")...) +func (c Credential_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_credentials"] = attrs["aws_credentials"].SetOptional() + attrs["aws_credentials"] = attrs["aws_credentials"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["credentials_name"] = attrs["credentials_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Credential. @@ -1530,7 +1571,7 @@ func (o *Credential_SdkV2) SetAwsCredentials(ctx context.Context, v AwsCredentia type CustomerFacingGcpCloudResourceContainer_SdkV2 struct { // The Google Cloud project ID, which the workspace uses to instantiate // cloud resources for your workspace. - ProjectId types.String `tfsdk:"project_id" tf:"optional"` + ProjectId types.String `tfsdk:"project_id"` } func (newState *CustomerFacingGcpCloudResourceContainer_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CustomerFacingGcpCloudResourceContainer_SdkV2) { @@ -1539,9 +1580,10 @@ func (newState *CustomerFacingGcpCloudResourceContainer_SdkV2) SyncEffectiveFiel func (newState *CustomerFacingGcpCloudResourceContainer_SdkV2) SyncEffectiveFieldsDuringRead(existingState CustomerFacingGcpCloudResourceContainer_SdkV2) { } -func (c CustomerFacingGcpCloudResourceContainer_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CustomerFacingGcpCloudResourceContainer_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["project_id"] = attrs["project_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CustomerFacingGcpCloudResourceContainer. @@ -1577,17 +1619,17 @@ func (o CustomerFacingGcpCloudResourceContainer_SdkV2) Type(ctx context.Context) type CustomerManagedKey_SdkV2 struct { // The Databricks account ID that holds the customer-managed key. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` - AwsKeyInfo types.List `tfsdk:"aws_key_info" tf:"optional,object"` + AwsKeyInfo types.List `tfsdk:"aws_key_info"` // Time in epoch milliseconds when the customer key was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // ID of the encryption key configuration object. - CustomerManagedKeyId types.String `tfsdk:"customer_managed_key_id" tf:"optional"` + CustomerManagedKeyId types.String `tfsdk:"customer_managed_key_id"` - GcpKeyInfo types.List `tfsdk:"gcp_key_info" tf:"optional,object"` + GcpKeyInfo types.List `tfsdk:"gcp_key_info"` // The cases that the key can be used for. - UseCases types.List `tfsdk:"use_cases" tf:"optional"` + UseCases types.List `tfsdk:"use_cases"` } func (newState *CustomerManagedKey_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CustomerManagedKey_SdkV2) { @@ -1596,12 +1638,17 @@ func (newState *CustomerManagedKey_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CustomerManagedKey_SdkV2) SyncEffectiveFieldsDuringRead(existingState CustomerManagedKey_SdkV2) { } -func (c CustomerManagedKey_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsKeyInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_key_info")...) - cs.SetComputed(append(path, "creation_time")...) - GcpKeyInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_key_info")...) +func (c CustomerManagedKey_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_key_info"] = attrs["aws_key_info"].SetOptional() + attrs["aws_key_info"] = attrs["aws_key_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["customer_managed_key_id"] = attrs["customer_managed_key_id"].SetOptional() + attrs["gcp_key_info"] = attrs["gcp_key_info"].SetOptional() + attrs["gcp_key_info"] = attrs["gcp_key_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["use_cases"] = attrs["use_cases"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CustomerManagedKey. @@ -2024,11 +2071,11 @@ func (o DeleteWorkspaceRequest_SdkV2) Type(ctx context.Context) attr.Type { type ExternalCustomerInfo_SdkV2 struct { // Email of the authoritative user. - AuthoritativeUserEmail types.String `tfsdk:"authoritative_user_email" tf:"optional"` + AuthoritativeUserEmail types.String `tfsdk:"authoritative_user_email"` // The authoritative user full name. - AuthoritativeUserFullName types.String `tfsdk:"authoritative_user_full_name" tf:"optional"` + AuthoritativeUserFullName types.String `tfsdk:"authoritative_user_full_name"` // The legal entity name for the external workspace - CustomerName types.String `tfsdk:"customer_name" tf:"optional"` + CustomerName types.String `tfsdk:"customer_name"` } func (newState *ExternalCustomerInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalCustomerInfo_SdkV2) { @@ -2037,9 +2084,12 @@ func (newState *ExternalCustomerInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ExternalCustomerInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExternalCustomerInfo_SdkV2) { } -func (c ExternalCustomerInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExternalCustomerInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authoritative_user_email"] = attrs["authoritative_user_email"].SetOptional() + attrs["authoritative_user_full_name"] = attrs["authoritative_user_full_name"].SetOptional() + attrs["customer_name"] = attrs["customer_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalCustomerInfo. @@ -2079,7 +2129,7 @@ func (o ExternalCustomerInfo_SdkV2) Type(ctx context.Context) attr.Type { type GcpKeyInfo_SdkV2 struct { // The GCP KMS key's resource name - KmsKeyId types.String `tfsdk:"kms_key_id" tf:""` + KmsKeyId types.String `tfsdk:"kms_key_id"` } func (newState *GcpKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpKeyInfo_SdkV2) { @@ -2088,10 +2138,10 @@ func (newState *GcpKeyInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan G func (newState *GcpKeyInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcpKeyInfo_SdkV2) { } -func (c GcpKeyInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "kms_key_id")...) +func (c GcpKeyInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kms_key_id"] = attrs["kms_key_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpKeyInfo. @@ -2151,13 +2201,13 @@ func (o GcpKeyInfo_SdkV2) Type(ctx context.Context) attr.Type { type GcpManagedNetworkConfig_SdkV2 struct { // The IP range from which to allocate GKE cluster pods. No bigger than `/9` // and no smaller than `/21`. - GkeClusterPodIpRange types.String `tfsdk:"gke_cluster_pod_ip_range" tf:"optional"` + GkeClusterPodIpRange types.String `tfsdk:"gke_cluster_pod_ip_range"` // The IP range from which to allocate GKE cluster services. No bigger than // `/16` and no smaller than `/27`. - GkeClusterServiceIpRange types.String `tfsdk:"gke_cluster_service_ip_range" tf:"optional"` + GkeClusterServiceIpRange types.String `tfsdk:"gke_cluster_service_ip_range"` // The IP range from which to allocate GKE cluster nodes. No bigger than // `/9` and no smaller than `/29`. - SubnetCidr types.String `tfsdk:"subnet_cidr" tf:"optional"` + SubnetCidr types.String `tfsdk:"subnet_cidr"` } func (newState *GcpManagedNetworkConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpManagedNetworkConfig_SdkV2) { @@ -2166,9 +2216,12 @@ func (newState *GcpManagedNetworkConfig_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *GcpManagedNetworkConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcpManagedNetworkConfig_SdkV2) { } -func (c GcpManagedNetworkConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GcpManagedNetworkConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gke_cluster_pod_ip_range"] = attrs["gke_cluster_pod_ip_range"].SetOptional() + attrs["gke_cluster_service_ip_range"] = attrs["gke_cluster_service_ip_range"].SetOptional() + attrs["subnet_cidr"] = attrs["subnet_cidr"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpManagedNetworkConfig. @@ -2210,23 +2263,23 @@ func (o GcpManagedNetworkConfig_SdkV2) Type(ctx context.Context) attr.Type { // ID, subnet ID, and secondary IP ranges). type GcpNetworkInfo_SdkV2 struct { // The Google Cloud project ID of the VPC network. - NetworkProjectId types.String `tfsdk:"network_project_id" tf:""` + NetworkProjectId types.String `tfsdk:"network_project_id"` // The name of the secondary IP range for pods. A Databricks-managed GKE // cluster uses this IP range for its pods. This secondary IP range can be // used by only one workspace. - PodIpRangeName types.String `tfsdk:"pod_ip_range_name" tf:""` + PodIpRangeName types.String `tfsdk:"pod_ip_range_name"` // The name of the secondary IP range for services. A Databricks-managed GKE // cluster uses this IP range for its services. This secondary IP range can // be used by only one workspace. - ServiceIpRangeName types.String `tfsdk:"service_ip_range_name" tf:""` + ServiceIpRangeName types.String `tfsdk:"service_ip_range_name"` // The ID of the subnet associated with this network. - SubnetId types.String `tfsdk:"subnet_id" tf:""` + SubnetId types.String `tfsdk:"subnet_id"` // The Google Cloud region of the workspace data plane (for example, // `us-east4`). - SubnetRegion types.String `tfsdk:"subnet_region" tf:""` + SubnetRegion types.String `tfsdk:"subnet_region"` // The ID of the VPC associated with this network. VPC IDs can be used in // multiple network configurations. - VpcId types.String `tfsdk:"vpc_id" tf:""` + VpcId types.String `tfsdk:"vpc_id"` } func (newState *GcpNetworkInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpNetworkInfo_SdkV2) { @@ -2235,15 +2288,15 @@ func (newState *GcpNetworkInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *GcpNetworkInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcpNetworkInfo_SdkV2) { } -func (c GcpNetworkInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "network_project_id")...) - cs.SetRequired(append(path, "pod_ip_range_name")...) - cs.SetRequired(append(path, "service_ip_range_name")...) - cs.SetRequired(append(path, "subnet_id")...) - cs.SetRequired(append(path, "subnet_region")...) - cs.SetRequired(append(path, "vpc_id")...) +func (c GcpNetworkInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["network_project_id"] = attrs["network_project_id"].SetRequired() + attrs["pod_ip_range_name"] = attrs["pod_ip_range_name"].SetRequired() + attrs["service_ip_range_name"] = attrs["service_ip_range_name"].SetRequired() + attrs["subnet_id"] = attrs["subnet_id"].SetRequired() + attrs["subnet_region"] = attrs["subnet_region"].SetRequired() + attrs["vpc_id"] = attrs["vpc_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpNetworkInfo. @@ -2291,16 +2344,16 @@ func (o GcpNetworkInfo_SdkV2) Type(ctx context.Context) attr.Type { // endpoint. type GcpVpcEndpointInfo_SdkV2 struct { // Region of the PSC endpoint. - EndpointRegion types.String `tfsdk:"endpoint_region" tf:""` + EndpointRegion types.String `tfsdk:"endpoint_region"` // The Google Cloud project ID of the VPC network where the PSC connection // resides. - ProjectId types.String `tfsdk:"project_id" tf:""` + ProjectId types.String `tfsdk:"project_id"` // The unique ID of this PSC connection. - PscConnectionId types.String `tfsdk:"psc_connection_id" tf:"optional"` + PscConnectionId types.String `tfsdk:"psc_connection_id"` // The name of the PSC endpoint in the Google Cloud project. - PscEndpointName types.String `tfsdk:"psc_endpoint_name" tf:""` + PscEndpointName types.String `tfsdk:"psc_endpoint_name"` // The service attachment this PSC connection connects to. - ServiceAttachmentId types.String `tfsdk:"service_attachment_id" tf:"optional"` + ServiceAttachmentId types.String `tfsdk:"service_attachment_id"` } func (newState *GcpVpcEndpointInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpVpcEndpointInfo_SdkV2) { @@ -2309,12 +2362,14 @@ func (newState *GcpVpcEndpointInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *GcpVpcEndpointInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState GcpVpcEndpointInfo_SdkV2) { } -func (c GcpVpcEndpointInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "endpoint_region")...) - cs.SetRequired(append(path, "project_id")...) - cs.SetRequired(append(path, "psc_endpoint_name")...) +func (c GcpVpcEndpointInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_region"] = attrs["endpoint_region"].SetRequired() + attrs["project_id"] = attrs["project_id"].SetRequired() + attrs["psc_connection_id"] = attrs["psc_connection_id"].SetOptional() + attrs["psc_endpoint_name"] = attrs["psc_endpoint_name"].SetRequired() + attrs["service_attachment_id"] = attrs["service_attachment_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpVpcEndpointInfo. @@ -2625,12 +2680,12 @@ type GkeConfig_SdkV2 struct { // // Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster. The nodes of // a public GKE cluster have public IP addresses. - ConnectivityType types.String `tfsdk:"connectivity_type" tf:"optional"` + ConnectivityType types.String `tfsdk:"connectivity_type"` // The IP range from which to allocate GKE cluster master resources. This // field will be ignored if GKE private cluster is not enabled. // // It must be exactly as big as `/28`. - MasterIpRange types.String `tfsdk:"master_ip_range" tf:"optional"` + MasterIpRange types.String `tfsdk:"master_ip_range"` } func (newState *GkeConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GkeConfig_SdkV2) { @@ -2639,9 +2694,11 @@ func (newState *GkeConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Gk func (newState *GkeConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState GkeConfig_SdkV2) { } -func (c GkeConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GkeConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connectivity_type"] = attrs["connectivity_type"].SetOptional() + attrs["master_ip_range"] = attrs["master_ip_range"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GkeConfig. @@ -2679,38 +2736,38 @@ func (o GkeConfig_SdkV2) Type(ctx context.Context) attr.Type { type Network_SdkV2 struct { // The Databricks account ID associated with this network configuration. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Time in epoch milliseconds when the network was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Array of error messages about the network configuration. - ErrorMessages types.List `tfsdk:"error_messages" tf:"computed"` + ErrorMessages types.List `tfsdk:"error_messages"` // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). - GcpNetworkInfo types.List `tfsdk:"gcp_network_info" tf:"optional,object"` + GcpNetworkInfo types.List `tfsdk:"gcp_network_info"` // The Databricks network configuration ID. - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The human-readable name of the network configuration. - NetworkName types.String `tfsdk:"network_name" tf:"optional"` + NetworkName types.String `tfsdk:"network_name"` - SecurityGroupIds types.List `tfsdk:"security_group_ids" tf:"optional"` + SecurityGroupIds types.List `tfsdk:"security_group_ids"` - SubnetIds types.List `tfsdk:"subnet_ids" tf:"optional"` + SubnetIds types.List `tfsdk:"subnet_ids"` // If specified, contains the VPC endpoints used to allow cluster // communication from this VPC over [AWS PrivateLink]. // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ - VpcEndpoints types.List `tfsdk:"vpc_endpoints" tf:"optional,object"` + VpcEndpoints types.List `tfsdk:"vpc_endpoints"` // The ID of the VPC associated with this network configuration. VPC IDs can // be used in multiple networks. - VpcId types.String `tfsdk:"vpc_id" tf:"optional"` + VpcId types.String `tfsdk:"vpc_id"` // The status of this network configuration object in terms of its use in a // workspace: * `UNATTACHED`: Unattached. * `VALID`: Valid. * `BROKEN`: // Broken. * `WARNED`: Warned. - VpcStatus types.String `tfsdk:"vpc_status" tf:"computed"` + VpcStatus types.String `tfsdk:"vpc_status"` // Array of warning messages about the network configuration. - WarningMessages types.List `tfsdk:"warning_messages" tf:"computed"` + WarningMessages types.List `tfsdk:"warning_messages"` // Workspace ID associated with this network configuration. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *Network_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Network_SdkV2) { @@ -2719,17 +2776,24 @@ func (newState *Network_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Netw func (newState *Network_SdkV2) SyncEffectiveFieldsDuringRead(existingState Network_SdkV2) { } -func (c Network_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "creation_time")...) - cs.SetComputed(append(path, "error_messages")...) - NetworkHealth_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "error_messages")...) - GcpNetworkInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_network_info")...) - NetworkVpcEndpoints_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "vpc_endpoints")...) - cs.SetComputed(append(path, "vpc_status")...) - cs.SetComputed(append(path, "warning_messages")...) - NetworkWarning_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "warning_messages")...) +func (c Network_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["error_messages"] = attrs["error_messages"].SetComputed() + attrs["gcp_network_info"] = attrs["gcp_network_info"].SetOptional() + attrs["gcp_network_info"] = attrs["gcp_network_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["network_name"] = attrs["network_name"].SetOptional() + attrs["security_group_ids"] = attrs["security_group_ids"].SetOptional() + attrs["subnet_ids"] = attrs["subnet_ids"].SetOptional() + attrs["vpc_endpoints"] = attrs["vpc_endpoints"].SetOptional() + attrs["vpc_endpoints"] = attrs["vpc_endpoints"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["vpc_id"] = attrs["vpc_id"].SetOptional() + attrs["vpc_status"] = attrs["vpc_status"].SetComputed() + attrs["warning_messages"] = attrs["warning_messages"].SetComputed() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Network. @@ -2964,10 +3028,10 @@ func (o *Network_SdkV2) SetWarningMessages(ctx context.Context, v []NetworkWarni type NetworkHealth_SdkV2 struct { // Details of the error. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // The AWS resource associated with this error: credentials, VPC, subnet, // security group, or network ACL. - ErrorType types.String `tfsdk:"error_type" tf:"optional"` + ErrorType types.String `tfsdk:"error_type"` } func (newState *NetworkHealth_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkHealth_SdkV2) { @@ -2976,9 +3040,11 @@ func (newState *NetworkHealth_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *NetworkHealth_SdkV2) SyncEffectiveFieldsDuringRead(existingState NetworkHealth_SdkV2) { } -func (c NetworkHealth_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NetworkHealth_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["error_type"] = attrs["error_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkHealth. @@ -3021,10 +3087,10 @@ func (o NetworkHealth_SdkV2) Type(ctx context.Context) attr.Type { type NetworkVpcEndpoints_SdkV2 struct { // The VPC endpoint ID used by this network to access the Databricks secure // cluster connectivity relay. - DataplaneRelay types.List `tfsdk:"dataplane_relay" tf:""` + DataplaneRelay types.List `tfsdk:"dataplane_relay"` // The VPC endpoint ID used by this network to access the Databricks REST // API. - RestApi types.List `tfsdk:"rest_api" tf:""` + RestApi types.List `tfsdk:"rest_api"` } func (newState *NetworkVpcEndpoints_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkVpcEndpoints_SdkV2) { @@ -3033,11 +3099,11 @@ func (newState *NetworkVpcEndpoints_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *NetworkVpcEndpoints_SdkV2) SyncEffectiveFieldsDuringRead(existingState NetworkVpcEndpoints_SdkV2) { } -func (c NetworkVpcEndpoints_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dataplane_relay")...) - cs.SetRequired(append(path, "rest_api")...) +func (c NetworkVpcEndpoints_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataplane_relay"] = attrs["dataplane_relay"].SetRequired() + attrs["rest_api"] = attrs["rest_api"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkVpcEndpoints. @@ -3134,10 +3200,10 @@ func (o *NetworkVpcEndpoints_SdkV2) SetRestApi(ctx context.Context, v []types.St type NetworkWarning_SdkV2 struct { // Details of the warning. - WarningMessage types.String `tfsdk:"warning_message" tf:"optional"` + WarningMessage types.String `tfsdk:"warning_message"` // The AWS resource associated with this warning: a subnet or a security // group. - WarningType types.String `tfsdk:"warning_type" tf:"optional"` + WarningType types.String `tfsdk:"warning_type"` } func (newState *NetworkWarning_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkWarning_SdkV2) { @@ -3146,9 +3212,11 @@ func (newState *NetworkWarning_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *NetworkWarning_SdkV2) SyncEffectiveFieldsDuringRead(existingState NetworkWarning_SdkV2) { } -func (c NetworkWarning_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NetworkWarning_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["warning_message"] = attrs["warning_message"].SetOptional() + attrs["warning_type"] = attrs["warning_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkWarning. @@ -3186,29 +3254,29 @@ func (o NetworkWarning_SdkV2) Type(ctx context.Context) attr.Type { type PrivateAccessSettings_SdkV2 struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // An array of Databricks VPC endpoint IDs. - AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids" tf:"optional"` + AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids"` // The private access level controls which VPC endpoints can connect to the // UI or API of any workspace that attaches this private access settings // object. * `ACCOUNT` level access (the default) allows only VPC endpoints // that are registered in your Databricks account connect to your workspace. // * `ENDPOINT` level access allows only specified VPC endpoints connect to // your workspace. For details, see `allowed_vpc_endpoint_ids`. - PrivateAccessLevel types.String `tfsdk:"private_access_level" tf:"optional"` + PrivateAccessLevel types.String `tfsdk:"private_access_level"` // Databricks private access settings ID. - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // The human-readable name of the private access settings object. - PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name" tf:"optional"` + PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name"` // Determines if the workspace can be accessed over public internet. For // fully private workspaces, you can optionally specify `false`, but only if // you implement both the front-end and the back-end PrivateLink // connections. Otherwise, specify `true`, which means that public access is // enabled. - PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled" tf:"optional"` + PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled"` // The cloud region for workspaces attached to this private access settings // object. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *PrivateAccessSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrivateAccessSettings_SdkV2) { @@ -3217,9 +3285,16 @@ func (newState *PrivateAccessSettings_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *PrivateAccessSettings_SdkV2) SyncEffectiveFieldsDuringRead(existingState PrivateAccessSettings_SdkV2) { } -func (c PrivateAccessSettings_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrivateAccessSettings_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["allowed_vpc_endpoint_ids"] = attrs["allowed_vpc_endpoint_ids"].SetOptional() + attrs["private_access_level"] = attrs["private_access_level"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["private_access_settings_name"] = attrs["private_access_settings_name"].SetOptional() + attrs["public_access_enabled"] = attrs["public_access_enabled"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrivateAccessSettings. @@ -3328,7 +3403,7 @@ func (o ReplaceResponse_SdkV2) Type(ctx context.Context) attr.Type { // Root S3 bucket information. type RootBucketInfo_SdkV2 struct { // The name of the S3 bucket. - BucketName types.String `tfsdk:"bucket_name" tf:"optional"` + BucketName types.String `tfsdk:"bucket_name"` } func (newState *RootBucketInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RootBucketInfo_SdkV2) { @@ -3337,9 +3412,10 @@ func (newState *RootBucketInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RootBucketInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RootBucketInfo_SdkV2) { } -func (c RootBucketInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RootBucketInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bucket_name"] = attrs["bucket_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RootBucketInfo. @@ -3375,15 +3451,15 @@ func (o RootBucketInfo_SdkV2) Type(ctx context.Context) attr.Type { type StorageConfiguration_SdkV2 struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"computed"` + AccountId types.String `tfsdk:"account_id"` // Time in epoch milliseconds when the storage configuration was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Root S3 bucket information. - RootBucketInfo types.List `tfsdk:"root_bucket_info" tf:"optional,object"` + RootBucketInfo types.List `tfsdk:"root_bucket_info"` // Databricks storage configuration ID. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // The human-readable name of the storage configuration. - StorageConfigurationName types.String `tfsdk:"storage_configuration_name" tf:"optional"` + StorageConfigurationName types.String `tfsdk:"storage_configuration_name"` } func (newState *StorageConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StorageConfiguration_SdkV2) { @@ -3392,12 +3468,15 @@ func (newState *StorageConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *StorageConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState StorageConfiguration_SdkV2) { } -func (c StorageConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "account_id")...) - cs.SetComputed(append(path, "creation_time")...) - RootBucketInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "root_bucket_info")...) +func (c StorageConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetComputed() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["root_bucket_info"] = attrs["root_bucket_info"].SetOptional() + attrs["root_bucket_info"] = attrs["root_bucket_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_configuration_name"] = attrs["storage_configuration_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StorageConfiguration. @@ -3472,9 +3551,9 @@ func (o *StorageConfiguration_SdkV2) SetRootBucketInfo(ctx context.Context, v Ro type StsRole_SdkV2 struct { // The external ID that needs to be trusted by the cross-account role. This // is always your Databricks account ID. - ExternalId types.String `tfsdk:"external_id" tf:"optional"` + ExternalId types.String `tfsdk:"external_id"` // The Amazon Resource Name (ARN) of the cross account role. - RoleArn types.String `tfsdk:"role_arn" tf:"optional"` + RoleArn types.String `tfsdk:"role_arn"` } func (newState *StsRole_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StsRole_SdkV2) { @@ -3483,9 +3562,11 @@ func (newState *StsRole_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StsR func (newState *StsRole_SdkV2) SyncEffectiveFieldsDuringRead(existingState StsRole_SdkV2) { } -func (c StsRole_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StsRole_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_id"] = attrs["external_id"].SetOptional() + attrs["role_arn"] = attrs["role_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StsRole. @@ -3554,34 +3635,34 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateWorkspaceRequest_SdkV2 struct { // The AWS region of the workspace's data plane (for example, `us-west-2`). // This parameter is available only for updating failed workspaces. - AwsRegion types.String `tfsdk:"aws_region" tf:"optional"` + AwsRegion types.String `tfsdk:"aws_region"` // ID of the workspace's credential configuration object. This parameter is // available for updating both failed and running workspaces. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The ID of the workspace's managed services encryption key configuration // object. This parameter is available only for updating failed workspaces. - ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id" tf:"optional"` + ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id"` - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"optional"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id"` // The ID of the workspace's network configuration object. Used only if you // already use a customer-managed VPC. For failed workspaces only, you can // switch from a Databricks-managed VPC to a customer-managed VPC by // updating the workspace to add a network configuration ID. - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The ID of the workspace's private access settings configuration object. // This parameter is available only for updating failed workspaces. - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // The ID of the workspace's storage configuration object. This parameter is // available only for updating failed workspaces. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // The ID of the key configuration object for workspace storage. This // parameter is available for updating both failed and running workspaces. - StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id" tf:"optional"` + StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id"` // Workspace ID. WorkspaceId types.Int64 `tfsdk:"-"` } @@ -3592,10 +3673,19 @@ func (newState *UpdateWorkspaceRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateWorkspaceRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceRequest_SdkV2) { } -func (c UpdateWorkspaceRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "workspace_id")...) +func (c UpdateWorkspaceRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_region"] = attrs["aws_region"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["managed_services_customer_managed_key_id"] = attrs["managed_services_customer_managed_key_id"].SetOptional() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_customer_managed_key_id"] = attrs["storage_customer_managed_key_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceRequest. @@ -3692,27 +3782,27 @@ type UpsertPrivateAccessSettingsRequest_SdkV2 struct { // public internet, see [IP access lists]. // // [IP access lists]: https://docs.databricks.com/security/network/ip-access-list.html - AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids" tf:"optional"` + AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids"` // The private access level controls which VPC endpoints can connect to the // UI or API of any workspace that attaches this private access settings // object. * `ACCOUNT` level access (the default) allows only VPC endpoints // that are registered in your Databricks account connect to your workspace. // * `ENDPOINT` level access allows only specified VPC endpoints connect to // your workspace. For details, see `allowed_vpc_endpoint_ids`. - PrivateAccessLevel types.String `tfsdk:"private_access_level" tf:"optional"` + PrivateAccessLevel types.String `tfsdk:"private_access_level"` // Databricks Account API private access settings ID. PrivateAccessSettingsId types.String `tfsdk:"-"` // The human-readable name of the private access settings object. - PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name" tf:""` + PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name"` // Determines if the workspace can be accessed over public internet. For // fully private workspaces, you can optionally specify `false`, but only if // you implement both the front-end and the back-end PrivateLink // connections. Otherwise, specify `true`, which means that public access is // enabled. - PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled" tf:"optional"` + PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled"` // The cloud region for workspaces associated with this private access // settings object. - Region types.String `tfsdk:"region" tf:""` + Region types.String `tfsdk:"region"` } func (newState *UpsertPrivateAccessSettingsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertPrivateAccessSettingsRequest_SdkV2) { @@ -3721,12 +3811,15 @@ func (newState *UpsertPrivateAccessSettingsRequest_SdkV2) SyncEffectiveFieldsDur func (newState *UpsertPrivateAccessSettingsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpsertPrivateAccessSettingsRequest_SdkV2) { } -func (c UpsertPrivateAccessSettingsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "private_access_settings_id")...) - cs.SetRequired(append(path, "private_access_settings_name")...) - cs.SetRequired(append(path, "region")...) +func (c UpsertPrivateAccessSettingsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_vpc_endpoint_ids"] = attrs["allowed_vpc_endpoint_ids"].SetOptional() + attrs["private_access_level"] = attrs["private_access_level"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetRequired() + attrs["private_access_settings_name"] = attrs["private_access_settings_name"].SetRequired() + attrs["public_access_enabled"] = attrs["public_access_enabled"].SetOptional() + attrs["region"] = attrs["region"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertPrivateAccessSettingsRequest. @@ -3802,40 +3895,40 @@ func (o *UpsertPrivateAccessSettingsRequest_SdkV2) SetAllowedVpcEndpointIds(ctx type VpcEndpoint_SdkV2 struct { // The Databricks account ID that hosts the VPC endpoint configuration. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // The AWS Account in which the VPC endpoint object exists. - AwsAccountId types.String `tfsdk:"aws_account_id" tf:"optional"` + AwsAccountId types.String `tfsdk:"aws_account_id"` // The ID of the Databricks [endpoint service] that this VPC endpoint is // connected to. For a list of endpoint service IDs for each supported AWS // region, see the [Databricks PrivateLink documentation]. // // [Databricks PrivateLink documentation]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html - AwsEndpointServiceId types.String `tfsdk:"aws_endpoint_service_id" tf:"optional"` + AwsEndpointServiceId types.String `tfsdk:"aws_endpoint_service_id"` // The ID of the VPC endpoint object in AWS. - AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id" tf:"optional"` + AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id"` // The Google Cloud specific information for this Private Service Connect // endpoint. - GcpVpcEndpointInfo types.List `tfsdk:"gcp_vpc_endpoint_info" tf:"optional,object"` + GcpVpcEndpointInfo types.List `tfsdk:"gcp_vpc_endpoint_info"` // The AWS region in which this VPC endpoint object exists. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The current state (such as `available` or `rejected`) of the VPC // endpoint. Derived from AWS. For the full set of values, see [AWS // DescribeVpcEndpoint documentation]. // // [AWS DescribeVpcEndpoint documentation]: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // This enumeration represents the type of Databricks VPC [endpoint service] // that was used when creating this VPC endpoint. // // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html - UseCase types.String `tfsdk:"use_case" tf:"optional"` + UseCase types.String `tfsdk:"use_case"` // Databricks VPC endpoint ID. This is the Databricks-specific name of the // VPC endpoint. Do not confuse this with the `aws_vpc_endpoint_id`, which // is the ID within AWS of the VPC endpoint. - VpcEndpointId types.String `tfsdk:"vpc_endpoint_id" tf:"optional"` + VpcEndpointId types.String `tfsdk:"vpc_endpoint_id"` // The human-readable name of the storage configuration. - VpcEndpointName types.String `tfsdk:"vpc_endpoint_name" tf:"optional"` + VpcEndpointName types.String `tfsdk:"vpc_endpoint_name"` } func (newState *VpcEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan VpcEndpoint_SdkV2) { @@ -3844,10 +3937,20 @@ func (newState *VpcEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *VpcEndpoint_SdkV2) SyncEffectiveFieldsDuringRead(existingState VpcEndpoint_SdkV2) { } -func (c VpcEndpoint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GcpVpcEndpointInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_vpc_endpoint_info")...) +func (c VpcEndpoint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_account_id"] = attrs["aws_account_id"].SetOptional() + attrs["aws_endpoint_service_id"] = attrs["aws_endpoint_service_id"].SetOptional() + attrs["aws_vpc_endpoint_id"] = attrs["aws_vpc_endpoint_id"].SetOptional() + attrs["gcp_vpc_endpoint_info"] = attrs["gcp_vpc_endpoint_info"].SetOptional() + attrs["gcp_vpc_endpoint_info"] = attrs["gcp_vpc_endpoint_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["region"] = attrs["region"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["use_case"] = attrs["use_case"].SetOptional() + attrs["vpc_endpoint_id"] = attrs["vpc_endpoint_id"].SetOptional() + attrs["vpc_endpoint_name"] = attrs["vpc_endpoint_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VpcEndpoint. @@ -3931,36 +4034,36 @@ func (o *VpcEndpoint_SdkV2) SetGcpVpcEndpointInfo(ctx context.Context, v GcpVpcE type Workspace_SdkV2 struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // The AWS region of the workspace data plane (for example, `us-west-2`). - AwsRegion types.String `tfsdk:"aws_region" tf:"optional"` + AwsRegion types.String `tfsdk:"aws_region"` - AzureWorkspaceInfo types.List `tfsdk:"azure_workspace_info" tf:"optional,object"` + AzureWorkspaceInfo types.List `tfsdk:"azure_workspace_info"` // The cloud name. This field always has the value `gcp`. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // The general workspace configurations that are specific to cloud // providers. - CloudResourceContainer types.List `tfsdk:"cloud_resource_container" tf:"optional,object"` + CloudResourceContainer types.List `tfsdk:"cloud_resource_container"` // Time in epoch milliseconds when the workspace was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // ID of the workspace's credential configuration object. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The deployment name defines part of the subdomain for the workspace. The // workspace URL for web application and REST APIs is // `.cloud.databricks.com`. // // This value must be unique across all non-deleted deployments across all // AWS regions. - DeploymentName types.String `tfsdk:"deployment_name" tf:"optional"` + DeploymentName types.String `tfsdk:"deployment_name"` // If this workspace is for a external customer, then external_customer_info // is populated. If this workspace is not for a external customer, then // external_customer_info is empty. - ExternalCustomerInfo types.List `tfsdk:"external_customer_info" tf:"optional,object"` + ExternalCustomerInfo types.List `tfsdk:"external_customer_info"` // The network settings for the workspace. The configurations are only for // Databricks-managed VPCs. It is ignored if you specify a customer-managed // VPC in the `network_id` field.", All the IP range configurations must be @@ -3984,24 +4087,24 @@ type Workspace_SdkV2 struct { // for a new workspace]. // // [calculate subnet sizes for a new workspace]: https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/network-sizing.html - GcpManagedNetworkConfig types.List `tfsdk:"gcp_managed_network_config" tf:"optional,object"` + GcpManagedNetworkConfig types.List `tfsdk:"gcp_managed_network_config"` // The configurations for the GKE cluster of a Databricks workspace. - GkeConfig types.List `tfsdk:"gke_config" tf:"optional,object"` + GkeConfig types.List `tfsdk:"gke_config"` // Whether no public IP is enabled for the workspace. - IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled" tf:"optional"` + IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled"` // The Google Cloud region of the workspace data plane in your Google // account (for example, `us-east4`). - Location types.String `tfsdk:"location" tf:"optional"` + Location types.String `tfsdk:"location"` // ID of the key configuration for encrypting managed services. - ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id" tf:"optional"` + ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id"` // The network configuration ID that is attached to the workspace. This // field is available only if the network is a customer-managed network. - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The pricing tier of the workspace. For pricing tier information, see [AWS // Pricing]. // // [AWS Pricing]: https://databricks.com/product/aws-pricing - PricingTier types.String `tfsdk:"pricing_tier" tf:"optional"` + PricingTier types.String `tfsdk:"pricing_tier"` // ID of the workspace's private access settings object. Only used for // PrivateLink. You must specify this ID if you are using [AWS PrivateLink] // for either front-end (user-to-workspace connection), back-end (data plane @@ -4012,21 +4115,21 @@ type Workspace_SdkV2 struct { // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ // [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // ID of the workspace's storage configuration object. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // ID of the key configuration for encrypting workspace storage. - StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id" tf:"optional"` + StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id"` // A unique integer ID for the workspace - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` // The human-readable name of the workspace. - WorkspaceName types.String `tfsdk:"workspace_name" tf:"optional"` + WorkspaceName types.String `tfsdk:"workspace_name"` // The status of the workspace. For workspace creation, usually it is set to // `PROVISIONING` initially. Continue to check the status until the status // is `RUNNING`. - WorkspaceStatus types.String `tfsdk:"workspace_status" tf:"computed"` + WorkspaceStatus types.String `tfsdk:"workspace_status"` // Message describing the current workspace status. - WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message" tf:"computed"` + WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message"` } func (newState *Workspace_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Workspace_SdkV2) { @@ -4035,17 +4138,38 @@ func (newState *Workspace_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Wo func (newState *Workspace_SdkV2) SyncEffectiveFieldsDuringRead(existingState Workspace_SdkV2) { } -func (c Workspace_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AzureWorkspaceInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_workspace_info")...) - CloudResourceContainer_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cloud_resource_container")...) - cs.SetComputed(append(path, "creation_time")...) - ExternalCustomerInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "external_customer_info")...) - GcpManagedNetworkConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gcp_managed_network_config")...) - GkeConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "gke_config")...) - cs.SetComputed(append(path, "workspace_status")...) - cs.SetComputed(append(path, "workspace_status_message")...) - - return cs +func (c Workspace_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_region"] = attrs["aws_region"].SetOptional() + attrs["azure_workspace_info"] = attrs["azure_workspace_info"].SetOptional() + attrs["azure_workspace_info"] = attrs["azure_workspace_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["cloud_resource_container"] = attrs["cloud_resource_container"].SetOptional() + attrs["cloud_resource_container"] = attrs["cloud_resource_container"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["deployment_name"] = attrs["deployment_name"].SetOptional() + attrs["external_customer_info"] = attrs["external_customer_info"].SetOptional() + attrs["external_customer_info"] = attrs["external_customer_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gcp_managed_network_config"] = attrs["gcp_managed_network_config"].SetOptional() + attrs["gcp_managed_network_config"] = attrs["gcp_managed_network_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["gke_config"] = attrs["gke_config"].SetOptional() + attrs["gke_config"] = attrs["gke_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["is_no_public_ip_enabled"] = attrs["is_no_public_ip_enabled"].SetOptional() + attrs["location"] = attrs["location"].SetOptional() + attrs["managed_services_customer_managed_key_id"] = attrs["managed_services_customer_managed_key_id"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["pricing_tier"] = attrs["pricing_tier"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_customer_managed_key_id"] = attrs["storage_customer_managed_key_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() + attrs["workspace_name"] = attrs["workspace_name"].SetOptional() + attrs["workspace_status"] = attrs["workspace_status"].SetComputed() + attrs["workspace_status_message"] = attrs["workspace_status_message"].SetComputed() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Workspace. diff --git a/internal/service/provisioning_tf/model.go b/internal/service/provisioning_tf/model.go index 12fff7798..b1be7dc18 100755 --- a/internal/service/provisioning_tf/model.go +++ b/internal/service/provisioning_tf/model.go @@ -23,7 +23,7 @@ import ( ) type AwsCredentials struct { - StsRole types.Object `tfsdk:"sts_role" tf:"optional,object"` + StsRole types.Object `tfsdk:"sts_role"` } func (newState *AwsCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsCredentials) { @@ -32,10 +32,10 @@ func (newState *AwsCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan Aws func (newState *AwsCredentials) SyncEffectiveFieldsDuringRead(existingState AwsCredentials) { } -func (c AwsCredentials) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StsRole{}.ApplySchemaCustomizations(cs, append(path, "sts_role")...) +func (c AwsCredentials) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sts_role"] = attrs["sts_role"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsCredentials. @@ -101,16 +101,16 @@ func (o *AwsCredentials) SetStsRole(ctx context.Context, v StsRole) { type AwsKeyInfo struct { // The AWS KMS key alias. - KeyAlias types.String `tfsdk:"key_alias" tf:"optional"` + KeyAlias types.String `tfsdk:"key_alias"` // The AWS KMS key's Amazon Resource Name (ARN). - KeyArn types.String `tfsdk:"key_arn" tf:""` + KeyArn types.String `tfsdk:"key_arn"` // The AWS KMS key region. - KeyRegion types.String `tfsdk:"key_region" tf:""` + KeyRegion types.String `tfsdk:"key_region"` // This field applies only if the `use_cases` property includes `STORAGE`. // If this is set to `true` or omitted, the key is also used to encrypt // cluster EBS volumes. If you do not want to use this key for encrypting // EBS volumes, set to `false`. - ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes" tf:"optional"` + ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes"` } func (newState *AwsKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsKeyInfo) { @@ -119,11 +119,13 @@ func (newState *AwsKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsKeyI func (newState *AwsKeyInfo) SyncEffectiveFieldsDuringRead(existingState AwsKeyInfo) { } -func (c AwsKeyInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key_arn")...) - cs.SetRequired(append(path, "key_region")...) +func (c AwsKeyInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key_alias"] = attrs["key_alias"].SetOptional() + attrs["key_arn"] = attrs["key_arn"].SetRequired() + attrs["key_region"] = attrs["key_region"].SetRequired() + attrs["reuse_key_for_cluster_volumes"] = attrs["reuse_key_for_cluster_volumes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AwsKeyInfo. @@ -165,9 +167,9 @@ func (o AwsKeyInfo) Type(ctx context.Context) attr.Type { type AzureWorkspaceInfo struct { // Azure Resource Group name - ResourceGroup types.String `tfsdk:"resource_group" tf:"optional"` + ResourceGroup types.String `tfsdk:"resource_group"` // Azure Subscription ID - SubscriptionId types.String `tfsdk:"subscription_id" tf:"optional"` + SubscriptionId types.String `tfsdk:"subscription_id"` } func (newState *AzureWorkspaceInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureWorkspaceInfo) { @@ -176,9 +178,11 @@ func (newState *AzureWorkspaceInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AzureWorkspaceInfo) SyncEffectiveFieldsDuringRead(existingState AzureWorkspaceInfo) { } -func (c AzureWorkspaceInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AzureWorkspaceInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["resource_group"] = attrs["resource_group"].SetOptional() + attrs["subscription_id"] = attrs["subscription_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureWorkspaceInfo. @@ -217,7 +221,7 @@ func (o AzureWorkspaceInfo) Type(ctx context.Context) attr.Type { // The general workspace configurations that are specific to cloud providers. type CloudResourceContainer struct { // The general workspace configurations that are specific to Google Cloud. - Gcp types.Object `tfsdk:"gcp" tf:"optional,object"` + Gcp types.Object `tfsdk:"gcp"` } func (newState *CloudResourceContainer) SyncEffectiveFieldsDuringCreateOrUpdate(plan CloudResourceContainer) { @@ -226,10 +230,10 @@ func (newState *CloudResourceContainer) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CloudResourceContainer) SyncEffectiveFieldsDuringRead(existingState CloudResourceContainer) { } -func (c CloudResourceContainer) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CustomerFacingGcpCloudResourceContainer{}.ApplySchemaCustomizations(cs, append(path, "gcp")...) +func (c CloudResourceContainer) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gcp"] = attrs["gcp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CloudResourceContainer. @@ -295,15 +299,15 @@ func (o *CloudResourceContainer) SetGcp(ctx context.Context, v CustomerFacingGcp type CreateAwsKeyInfo struct { // The AWS KMS key alias. - KeyAlias types.String `tfsdk:"key_alias" tf:"optional"` + KeyAlias types.String `tfsdk:"key_alias"` // The AWS KMS key's Amazon Resource Name (ARN). Note that the key's AWS // region is inferred from the ARN. - KeyArn types.String `tfsdk:"key_arn" tf:""` + KeyArn types.String `tfsdk:"key_arn"` // This field applies only if the `use_cases` property includes `STORAGE`. // If this is set to `true` or omitted, the key is also used to encrypt // cluster EBS volumes. To not use this key also for encrypting EBS volumes, // set this to `false`. - ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes" tf:"optional"` + ReuseKeyForClusterVolumes types.Bool `tfsdk:"reuse_key_for_cluster_volumes"` } func (newState *CreateAwsKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAwsKeyInfo) { @@ -312,10 +316,12 @@ func (newState *CreateAwsKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *CreateAwsKeyInfo) SyncEffectiveFieldsDuringRead(existingState CreateAwsKeyInfo) { } -func (c CreateAwsKeyInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key_arn")...) +func (c CreateAwsKeyInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key_alias"] = attrs["key_alias"].SetOptional() + attrs["key_arn"] = attrs["key_arn"].SetRequired() + attrs["reuse_key_for_cluster_volumes"] = attrs["reuse_key_for_cluster_volumes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAwsKeyInfo. @@ -354,7 +360,7 @@ func (o CreateAwsKeyInfo) Type(ctx context.Context) attr.Type { } type CreateCredentialAwsCredentials struct { - StsRole types.Object `tfsdk:"sts_role" tf:"optional,object"` + StsRole types.Object `tfsdk:"sts_role"` } func (newState *CreateCredentialAwsCredentials) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialAwsCredentials) { @@ -363,10 +369,10 @@ func (newState *CreateCredentialAwsCredentials) SyncEffectiveFieldsDuringCreateO func (newState *CreateCredentialAwsCredentials) SyncEffectiveFieldsDuringRead(existingState CreateCredentialAwsCredentials) { } -func (c CreateCredentialAwsCredentials) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateCredentialStsRole{}.ApplySchemaCustomizations(cs, append(path, "sts_role")...) +func (c CreateCredentialAwsCredentials) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["sts_role"] = attrs["sts_role"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialAwsCredentials. @@ -431,9 +437,9 @@ func (o *CreateCredentialAwsCredentials) SetStsRole(ctx context.Context, v Creat } type CreateCredentialRequest struct { - AwsCredentials types.Object `tfsdk:"aws_credentials" tf:"object"` + AwsCredentials types.Object `tfsdk:"aws_credentials"` // The human-readable name of the credential configuration object. - CredentialsName types.String `tfsdk:"credentials_name" tf:""` + CredentialsName types.String `tfsdk:"credentials_name"` } func (newState *CreateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialRequest) { @@ -442,12 +448,11 @@ func (newState *CreateCredentialRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateCredentialRequest) SyncEffectiveFieldsDuringRead(existingState CreateCredentialRequest) { } -func (c CreateCredentialRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aws_credentials")...) - CreateCredentialAwsCredentials{}.ApplySchemaCustomizations(cs, append(path, "aws_credentials")...) - cs.SetRequired(append(path, "credentials_name")...) +func (c CreateCredentialRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_credentials"] = attrs["aws_credentials"].SetRequired() + attrs["credentials_name"] = attrs["credentials_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialRequest. @@ -515,7 +520,7 @@ func (o *CreateCredentialRequest) SetAwsCredentials(ctx context.Context, v Creat type CreateCredentialStsRole struct { // The Amazon Resource Name (ARN) of the cross account role. - RoleArn types.String `tfsdk:"role_arn" tf:"optional"` + RoleArn types.String `tfsdk:"role_arn"` } func (newState *CreateCredentialStsRole) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialStsRole) { @@ -524,9 +529,10 @@ func (newState *CreateCredentialStsRole) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateCredentialStsRole) SyncEffectiveFieldsDuringRead(existingState CreateCredentialStsRole) { } -func (c CreateCredentialStsRole) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateCredentialStsRole) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["role_arn"] = attrs["role_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialStsRole. @@ -561,11 +567,11 @@ func (o CreateCredentialStsRole) Type(ctx context.Context) attr.Type { } type CreateCustomerManagedKeyRequest struct { - AwsKeyInfo types.Object `tfsdk:"aws_key_info" tf:"optional,object"` + AwsKeyInfo types.Object `tfsdk:"aws_key_info"` - GcpKeyInfo types.Object `tfsdk:"gcp_key_info" tf:"optional,object"` + GcpKeyInfo types.Object `tfsdk:"gcp_key_info"` // The cases that the key can be used for. - UseCases types.List `tfsdk:"use_cases" tf:""` + UseCases types.List `tfsdk:"use_cases"` } func (newState *CreateCustomerManagedKeyRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCustomerManagedKeyRequest) { @@ -574,12 +580,12 @@ func (newState *CreateCustomerManagedKeyRequest) SyncEffectiveFieldsDuringCreate func (newState *CreateCustomerManagedKeyRequest) SyncEffectiveFieldsDuringRead(existingState CreateCustomerManagedKeyRequest) { } -func (c CreateCustomerManagedKeyRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateAwsKeyInfo{}.ApplySchemaCustomizations(cs, append(path, "aws_key_info")...) - CreateGcpKeyInfo{}.ApplySchemaCustomizations(cs, append(path, "gcp_key_info")...) - cs.SetRequired(append(path, "use_cases")...) +func (c CreateCustomerManagedKeyRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_key_info"] = attrs["aws_key_info"].SetOptional() + attrs["gcp_key_info"] = attrs["gcp_key_info"].SetOptional() + attrs["use_cases"] = attrs["use_cases"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCustomerManagedKeyRequest. @@ -707,7 +713,7 @@ func (o *CreateCustomerManagedKeyRequest) SetUseCases(ctx context.Context, v []t type CreateGcpKeyInfo struct { // The GCP KMS key's resource name - KmsKeyId types.String `tfsdk:"kms_key_id" tf:""` + KmsKeyId types.String `tfsdk:"kms_key_id"` } func (newState *CreateGcpKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateGcpKeyInfo) { @@ -716,10 +722,10 @@ func (newState *CreateGcpKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *CreateGcpKeyInfo) SyncEffectiveFieldsDuringRead(existingState CreateGcpKeyInfo) { } -func (c CreateGcpKeyInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "kms_key_id")...) +func (c CreateGcpKeyInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kms_key_id"] = attrs["kms_key_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateGcpKeyInfo. @@ -756,23 +762,23 @@ func (o CreateGcpKeyInfo) Type(ctx context.Context) attr.Type { type CreateNetworkRequest struct { // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). - GcpNetworkInfo types.Object `tfsdk:"gcp_network_info" tf:"optional,object"` + GcpNetworkInfo types.Object `tfsdk:"gcp_network_info"` // The human-readable name of the network configuration. - NetworkName types.String `tfsdk:"network_name" tf:""` + NetworkName types.String `tfsdk:"network_name"` // IDs of one to five security groups associated with this network. Security // group IDs **cannot** be used in multiple network configurations. - SecurityGroupIds types.List `tfsdk:"security_group_ids" tf:"optional"` + SecurityGroupIds types.List `tfsdk:"security_group_ids"` // IDs of at least two subnets associated with this network. Subnet IDs // **cannot** be used in multiple network configurations. - SubnetIds types.List `tfsdk:"subnet_ids" tf:"optional"` + SubnetIds types.List `tfsdk:"subnet_ids"` // If specified, contains the VPC endpoints used to allow cluster // communication from this VPC over [AWS PrivateLink]. // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ - VpcEndpoints types.Object `tfsdk:"vpc_endpoints" tf:"optional,object"` + VpcEndpoints types.Object `tfsdk:"vpc_endpoints"` // The ID of the VPC associated with this network. VPC IDs can be used in // multiple network configurations. - VpcId types.String `tfsdk:"vpc_id" tf:"optional"` + VpcId types.String `tfsdk:"vpc_id"` } func (newState *CreateNetworkRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateNetworkRequest) { @@ -781,12 +787,15 @@ func (newState *CreateNetworkRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateNetworkRequest) SyncEffectiveFieldsDuringRead(existingState CreateNetworkRequest) { } -func (c CreateNetworkRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GcpNetworkInfo{}.ApplySchemaCustomizations(cs, append(path, "gcp_network_info")...) - cs.SetRequired(append(path, "network_name")...) - NetworkVpcEndpoints{}.ApplySchemaCustomizations(cs, append(path, "vpc_endpoints")...) +func (c CreateNetworkRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gcp_network_info"] = attrs["gcp_network_info"].SetOptional() + attrs["network_name"] = attrs["network_name"].SetRequired() + attrs["security_group_ids"] = attrs["security_group_ids"].SetOptional() + attrs["subnet_ids"] = attrs["subnet_ids"].SetOptional() + attrs["vpc_endpoints"] = attrs["vpc_endpoints"].SetOptional() + attrs["vpc_id"] = attrs["vpc_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateNetworkRequest. @@ -949,9 +958,9 @@ func (o *CreateNetworkRequest) SetVpcEndpoints(ctx context.Context, v NetworkVpc type CreateStorageConfigurationRequest struct { // Root S3 bucket information. - RootBucketInfo types.Object `tfsdk:"root_bucket_info" tf:"object"` + RootBucketInfo types.Object `tfsdk:"root_bucket_info"` // The human-readable name of the storage configuration. - StorageConfigurationName types.String `tfsdk:"storage_configuration_name" tf:""` + StorageConfigurationName types.String `tfsdk:"storage_configuration_name"` } func (newState *CreateStorageConfigurationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateStorageConfigurationRequest) { @@ -960,12 +969,11 @@ func (newState *CreateStorageConfigurationRequest) SyncEffectiveFieldsDuringCrea func (newState *CreateStorageConfigurationRequest) SyncEffectiveFieldsDuringRead(existingState CreateStorageConfigurationRequest) { } -func (c CreateStorageConfigurationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "root_bucket_info")...) - RootBucketInfo{}.ApplySchemaCustomizations(cs, append(path, "root_bucket_info")...) - cs.SetRequired(append(path, "storage_configuration_name")...) +func (c CreateStorageConfigurationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["root_bucket_info"] = attrs["root_bucket_info"].SetRequired() + attrs["storage_configuration_name"] = attrs["storage_configuration_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateStorageConfigurationRequest. @@ -1033,14 +1041,14 @@ func (o *CreateStorageConfigurationRequest) SetRootBucketInfo(ctx context.Contex type CreateVpcEndpointRequest struct { // The ID of the VPC endpoint object in AWS. - AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id" tf:"optional"` + AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id"` // The Google Cloud specific information for this Private Service Connect // endpoint. - GcpVpcEndpointInfo types.Object `tfsdk:"gcp_vpc_endpoint_info" tf:"optional,object"` + GcpVpcEndpointInfo types.Object `tfsdk:"gcp_vpc_endpoint_info"` // The AWS region in which this VPC endpoint object exists. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The human-readable name of the storage configuration. - VpcEndpointName types.String `tfsdk:"vpc_endpoint_name" tf:""` + VpcEndpointName types.String `tfsdk:"vpc_endpoint_name"` } func (newState *CreateVpcEndpointRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVpcEndpointRequest) { @@ -1049,11 +1057,13 @@ func (newState *CreateVpcEndpointRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateVpcEndpointRequest) SyncEffectiveFieldsDuringRead(existingState CreateVpcEndpointRequest) { } -func (c CreateVpcEndpointRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GcpVpcEndpointInfo{}.ApplySchemaCustomizations(cs, append(path, "gcp_vpc_endpoint_info")...) - cs.SetRequired(append(path, "vpc_endpoint_name")...) +func (c CreateVpcEndpointRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_vpc_endpoint_id"] = attrs["aws_vpc_endpoint_id"].SetOptional() + attrs["gcp_vpc_endpoint_info"] = attrs["gcp_vpc_endpoint_info"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["vpc_endpoint_name"] = attrs["vpc_endpoint_name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVpcEndpointRequest. @@ -1125,20 +1135,20 @@ func (o *CreateVpcEndpointRequest) SetGcpVpcEndpointInfo(ctx context.Context, v type CreateWorkspaceRequest struct { // The AWS region of the workspace's data plane. - AwsRegion types.String `tfsdk:"aws_region" tf:"optional"` + AwsRegion types.String `tfsdk:"aws_region"` // The cloud provider which the workspace uses. For Google Cloud workspaces, // always set this field to `gcp`. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // The general workspace configurations that are specific to cloud // providers. - CloudResourceContainer types.Object `tfsdk:"cloud_resource_container" tf:"optional,object"` + CloudResourceContainer types.Object `tfsdk:"cloud_resource_container"` // ID of the workspace's credential configuration object. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The deployment name defines part of the subdomain for the workspace. The // workspace URL for the web application and REST APIs is // `.cloud.databricks.com`. For example, if the @@ -1168,7 +1178,7 @@ type CreateWorkspaceRequest struct { // // If a new workspace omits this property, the server generates a unique // deployment name for you with the pattern `dbc-xxxxxxxx-xxxx`. - DeploymentName types.String `tfsdk:"deployment_name" tf:"optional"` + DeploymentName types.String `tfsdk:"deployment_name"` // The network settings for the workspace. The configurations are only for // Databricks-managed VPCs. It is ignored if you specify a customer-managed // VPC in the `network_id` field.", All the IP range configurations must be @@ -1192,27 +1202,27 @@ type CreateWorkspaceRequest struct { // for a new workspace]. // // [calculate subnet sizes for a new workspace]: https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/network-sizing.html - GcpManagedNetworkConfig types.Object `tfsdk:"gcp_managed_network_config" tf:"optional,object"` + GcpManagedNetworkConfig types.Object `tfsdk:"gcp_managed_network_config"` // The configurations for the GKE cluster of a Databricks workspace. - GkeConfig types.Object `tfsdk:"gke_config" tf:"optional,object"` + GkeConfig types.Object `tfsdk:"gke_config"` // Whether no public IP is enabled for the workspace. - IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled" tf:"optional"` + IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled"` // The Google Cloud region of the workspace data plane in your Google // account. For example, `us-east4`. - Location types.String `tfsdk:"location" tf:"optional"` + Location types.String `tfsdk:"location"` // The ID of the workspace's managed services encryption key configuration // object. This is used to help protect and control access to the // workspace's notebooks, secrets, Databricks SQL queries, and query // history. The provided key configuration object property `use_cases` must // contain `MANAGED_SERVICES`. - ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id" tf:"optional"` + ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id"` - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The pricing tier of the workspace. For pricing tier information, see [AWS // Pricing]. // // [AWS Pricing]: https://databricks.com/product/aws-pricing - PricingTier types.String `tfsdk:"pricing_tier" tf:"optional"` + PricingTier types.String `tfsdk:"pricing_tier"` // ID of the workspace's private access settings object. Only used for // PrivateLink. This ID must be specified for customers using [AWS // PrivateLink] for either front-end (user-to-workspace connection), @@ -1224,16 +1234,16 @@ type CreateWorkspaceRequest struct { // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ // [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // The ID of the workspace's storage configuration object. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // The ID of the workspace's storage encryption key configuration object. // This is used to encrypt the workspace's root S3 bucket (root DBFS and // system data) and, optionally, cluster EBS volumes. The provided key // configuration object property `use_cases` must contain `STORAGE`. - StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id" tf:"optional"` + StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id"` // The workspace's human-readable name. - WorkspaceName types.String `tfsdk:"workspace_name" tf:""` + WorkspaceName types.String `tfsdk:"workspace_name"` } func (newState *CreateWorkspaceRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWorkspaceRequest) { @@ -1242,13 +1252,26 @@ func (newState *CreateWorkspaceRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateWorkspaceRequest) SyncEffectiveFieldsDuringRead(existingState CreateWorkspaceRequest) { } -func (c CreateWorkspaceRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CloudResourceContainer{}.ApplySchemaCustomizations(cs, append(path, "cloud_resource_container")...) - GcpManagedNetworkConfig{}.ApplySchemaCustomizations(cs, append(path, "gcp_managed_network_config")...) - GkeConfig{}.ApplySchemaCustomizations(cs, append(path, "gke_config")...) - cs.SetRequired(append(path, "workspace_name")...) - - return cs +func (c CreateWorkspaceRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_region"] = attrs["aws_region"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["cloud_resource_container"] = attrs["cloud_resource_container"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["deployment_name"] = attrs["deployment_name"].SetOptional() + attrs["gcp_managed_network_config"] = attrs["gcp_managed_network_config"].SetOptional() + attrs["gke_config"] = attrs["gke_config"].SetOptional() + attrs["is_no_public_ip_enabled"] = attrs["is_no_public_ip_enabled"].SetOptional() + attrs["location"] = attrs["location"].SetOptional() + attrs["managed_services_customer_managed_key_id"] = attrs["managed_services_customer_managed_key_id"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["pricing_tier"] = attrs["pricing_tier"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_customer_managed_key_id"] = attrs["storage_customer_managed_key_id"].SetOptional() + attrs["workspace_name"] = attrs["workspace_name"].SetRequired() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWorkspaceRequest. @@ -1433,15 +1456,15 @@ func (o *CreateWorkspaceRequest) SetGkeConfig(ctx context.Context, v GkeConfig) type Credential struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` - AwsCredentials types.Object `tfsdk:"aws_credentials" tf:"optional,object"` + AwsCredentials types.Object `tfsdk:"aws_credentials"` // Time in epoch milliseconds when the credential was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Databricks credential configuration ID. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The human-readable name of the credential configuration object. - CredentialsName types.String `tfsdk:"credentials_name" tf:"optional"` + CredentialsName types.String `tfsdk:"credentials_name"` } func (newState *Credential) SyncEffectiveFieldsDuringCreateOrUpdate(plan Credential) { @@ -1450,11 +1473,14 @@ func (newState *Credential) SyncEffectiveFieldsDuringCreateOrUpdate(plan Credent func (newState *Credential) SyncEffectiveFieldsDuringRead(existingState Credential) { } -func (c Credential) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsCredentials{}.ApplySchemaCustomizations(cs, append(path, "aws_credentials")...) - cs.SetComputed(append(path, "creation_time")...) +func (c Credential) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_credentials"] = attrs["aws_credentials"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["credentials_name"] = attrs["credentials_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Credential. @@ -1530,7 +1556,7 @@ func (o *Credential) SetAwsCredentials(ctx context.Context, v AwsCredentials) { type CustomerFacingGcpCloudResourceContainer struct { // The Google Cloud project ID, which the workspace uses to instantiate // cloud resources for your workspace. - ProjectId types.String `tfsdk:"project_id" tf:"optional"` + ProjectId types.String `tfsdk:"project_id"` } func (newState *CustomerFacingGcpCloudResourceContainer) SyncEffectiveFieldsDuringCreateOrUpdate(plan CustomerFacingGcpCloudResourceContainer) { @@ -1539,9 +1565,10 @@ func (newState *CustomerFacingGcpCloudResourceContainer) SyncEffectiveFieldsDuri func (newState *CustomerFacingGcpCloudResourceContainer) SyncEffectiveFieldsDuringRead(existingState CustomerFacingGcpCloudResourceContainer) { } -func (c CustomerFacingGcpCloudResourceContainer) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CustomerFacingGcpCloudResourceContainer) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["project_id"] = attrs["project_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CustomerFacingGcpCloudResourceContainer. @@ -1577,17 +1604,17 @@ func (o CustomerFacingGcpCloudResourceContainer) Type(ctx context.Context) attr. type CustomerManagedKey struct { // The Databricks account ID that holds the customer-managed key. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` - AwsKeyInfo types.Object `tfsdk:"aws_key_info" tf:"optional,object"` + AwsKeyInfo types.Object `tfsdk:"aws_key_info"` // Time in epoch milliseconds when the customer key was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // ID of the encryption key configuration object. - CustomerManagedKeyId types.String `tfsdk:"customer_managed_key_id" tf:"optional"` + CustomerManagedKeyId types.String `tfsdk:"customer_managed_key_id"` - GcpKeyInfo types.Object `tfsdk:"gcp_key_info" tf:"optional,object"` + GcpKeyInfo types.Object `tfsdk:"gcp_key_info"` // The cases that the key can be used for. - UseCases types.List `tfsdk:"use_cases" tf:"optional"` + UseCases types.List `tfsdk:"use_cases"` } func (newState *CustomerManagedKey) SyncEffectiveFieldsDuringCreateOrUpdate(plan CustomerManagedKey) { @@ -1596,12 +1623,15 @@ func (newState *CustomerManagedKey) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CustomerManagedKey) SyncEffectiveFieldsDuringRead(existingState CustomerManagedKey) { } -func (c CustomerManagedKey) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AwsKeyInfo{}.ApplySchemaCustomizations(cs, append(path, "aws_key_info")...) - cs.SetComputed(append(path, "creation_time")...) - GcpKeyInfo{}.ApplySchemaCustomizations(cs, append(path, "gcp_key_info")...) +func (c CustomerManagedKey) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_key_info"] = attrs["aws_key_info"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["customer_managed_key_id"] = attrs["customer_managed_key_id"].SetOptional() + attrs["gcp_key_info"] = attrs["gcp_key_info"].SetOptional() + attrs["use_cases"] = attrs["use_cases"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CustomerManagedKey. @@ -2024,11 +2054,11 @@ func (o DeleteWorkspaceRequest) Type(ctx context.Context) attr.Type { type ExternalCustomerInfo struct { // Email of the authoritative user. - AuthoritativeUserEmail types.String `tfsdk:"authoritative_user_email" tf:"optional"` + AuthoritativeUserEmail types.String `tfsdk:"authoritative_user_email"` // The authoritative user full name. - AuthoritativeUserFullName types.String `tfsdk:"authoritative_user_full_name" tf:"optional"` + AuthoritativeUserFullName types.String `tfsdk:"authoritative_user_full_name"` // The legal entity name for the external workspace - CustomerName types.String `tfsdk:"customer_name" tf:"optional"` + CustomerName types.String `tfsdk:"customer_name"` } func (newState *ExternalCustomerInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalCustomerInfo) { @@ -2037,9 +2067,12 @@ func (newState *ExternalCustomerInfo) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ExternalCustomerInfo) SyncEffectiveFieldsDuringRead(existingState ExternalCustomerInfo) { } -func (c ExternalCustomerInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExternalCustomerInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authoritative_user_email"] = attrs["authoritative_user_email"].SetOptional() + attrs["authoritative_user_full_name"] = attrs["authoritative_user_full_name"].SetOptional() + attrs["customer_name"] = attrs["customer_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalCustomerInfo. @@ -2079,7 +2112,7 @@ func (o ExternalCustomerInfo) Type(ctx context.Context) attr.Type { type GcpKeyInfo struct { // The GCP KMS key's resource name - KmsKeyId types.String `tfsdk:"kms_key_id" tf:""` + KmsKeyId types.String `tfsdk:"kms_key_id"` } func (newState *GcpKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpKeyInfo) { @@ -2088,10 +2121,10 @@ func (newState *GcpKeyInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpKeyI func (newState *GcpKeyInfo) SyncEffectiveFieldsDuringRead(existingState GcpKeyInfo) { } -func (c GcpKeyInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "kms_key_id")...) +func (c GcpKeyInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["kms_key_id"] = attrs["kms_key_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpKeyInfo. @@ -2151,13 +2184,13 @@ func (o GcpKeyInfo) Type(ctx context.Context) attr.Type { type GcpManagedNetworkConfig struct { // The IP range from which to allocate GKE cluster pods. No bigger than `/9` // and no smaller than `/21`. - GkeClusterPodIpRange types.String `tfsdk:"gke_cluster_pod_ip_range" tf:"optional"` + GkeClusterPodIpRange types.String `tfsdk:"gke_cluster_pod_ip_range"` // The IP range from which to allocate GKE cluster services. No bigger than // `/16` and no smaller than `/27`. - GkeClusterServiceIpRange types.String `tfsdk:"gke_cluster_service_ip_range" tf:"optional"` + GkeClusterServiceIpRange types.String `tfsdk:"gke_cluster_service_ip_range"` // The IP range from which to allocate GKE cluster nodes. No bigger than // `/9` and no smaller than `/29`. - SubnetCidr types.String `tfsdk:"subnet_cidr" tf:"optional"` + SubnetCidr types.String `tfsdk:"subnet_cidr"` } func (newState *GcpManagedNetworkConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpManagedNetworkConfig) { @@ -2166,9 +2199,12 @@ func (newState *GcpManagedNetworkConfig) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GcpManagedNetworkConfig) SyncEffectiveFieldsDuringRead(existingState GcpManagedNetworkConfig) { } -func (c GcpManagedNetworkConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GcpManagedNetworkConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["gke_cluster_pod_ip_range"] = attrs["gke_cluster_pod_ip_range"].SetOptional() + attrs["gke_cluster_service_ip_range"] = attrs["gke_cluster_service_ip_range"].SetOptional() + attrs["subnet_cidr"] = attrs["subnet_cidr"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpManagedNetworkConfig. @@ -2210,23 +2246,23 @@ func (o GcpManagedNetworkConfig) Type(ctx context.Context) attr.Type { // ID, subnet ID, and secondary IP ranges). type GcpNetworkInfo struct { // The Google Cloud project ID of the VPC network. - NetworkProjectId types.String `tfsdk:"network_project_id" tf:""` + NetworkProjectId types.String `tfsdk:"network_project_id"` // The name of the secondary IP range for pods. A Databricks-managed GKE // cluster uses this IP range for its pods. This secondary IP range can be // used by only one workspace. - PodIpRangeName types.String `tfsdk:"pod_ip_range_name" tf:""` + PodIpRangeName types.String `tfsdk:"pod_ip_range_name"` // The name of the secondary IP range for services. A Databricks-managed GKE // cluster uses this IP range for its services. This secondary IP range can // be used by only one workspace. - ServiceIpRangeName types.String `tfsdk:"service_ip_range_name" tf:""` + ServiceIpRangeName types.String `tfsdk:"service_ip_range_name"` // The ID of the subnet associated with this network. - SubnetId types.String `tfsdk:"subnet_id" tf:""` + SubnetId types.String `tfsdk:"subnet_id"` // The Google Cloud region of the workspace data plane (for example, // `us-east4`). - SubnetRegion types.String `tfsdk:"subnet_region" tf:""` + SubnetRegion types.String `tfsdk:"subnet_region"` // The ID of the VPC associated with this network. VPC IDs can be used in // multiple network configurations. - VpcId types.String `tfsdk:"vpc_id" tf:""` + VpcId types.String `tfsdk:"vpc_id"` } func (newState *GcpNetworkInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpNetworkInfo) { @@ -2235,15 +2271,15 @@ func (newState *GcpNetworkInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Gcp func (newState *GcpNetworkInfo) SyncEffectiveFieldsDuringRead(existingState GcpNetworkInfo) { } -func (c GcpNetworkInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "network_project_id")...) - cs.SetRequired(append(path, "pod_ip_range_name")...) - cs.SetRequired(append(path, "service_ip_range_name")...) - cs.SetRequired(append(path, "subnet_id")...) - cs.SetRequired(append(path, "subnet_region")...) - cs.SetRequired(append(path, "vpc_id")...) +func (c GcpNetworkInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["network_project_id"] = attrs["network_project_id"].SetRequired() + attrs["pod_ip_range_name"] = attrs["pod_ip_range_name"].SetRequired() + attrs["service_ip_range_name"] = attrs["service_ip_range_name"].SetRequired() + attrs["subnet_id"] = attrs["subnet_id"].SetRequired() + attrs["subnet_region"] = attrs["subnet_region"].SetRequired() + attrs["vpc_id"] = attrs["vpc_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpNetworkInfo. @@ -2291,16 +2327,16 @@ func (o GcpNetworkInfo) Type(ctx context.Context) attr.Type { // endpoint. type GcpVpcEndpointInfo struct { // Region of the PSC endpoint. - EndpointRegion types.String `tfsdk:"endpoint_region" tf:""` + EndpointRegion types.String `tfsdk:"endpoint_region"` // The Google Cloud project ID of the VPC network where the PSC connection // resides. - ProjectId types.String `tfsdk:"project_id" tf:""` + ProjectId types.String `tfsdk:"project_id"` // The unique ID of this PSC connection. - PscConnectionId types.String `tfsdk:"psc_connection_id" tf:"optional"` + PscConnectionId types.String `tfsdk:"psc_connection_id"` // The name of the PSC endpoint in the Google Cloud project. - PscEndpointName types.String `tfsdk:"psc_endpoint_name" tf:""` + PscEndpointName types.String `tfsdk:"psc_endpoint_name"` // The service attachment this PSC connection connects to. - ServiceAttachmentId types.String `tfsdk:"service_attachment_id" tf:"optional"` + ServiceAttachmentId types.String `tfsdk:"service_attachment_id"` } func (newState *GcpVpcEndpointInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan GcpVpcEndpointInfo) { @@ -2309,12 +2345,14 @@ func (newState *GcpVpcEndpointInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GcpVpcEndpointInfo) SyncEffectiveFieldsDuringRead(existingState GcpVpcEndpointInfo) { } -func (c GcpVpcEndpointInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "endpoint_region")...) - cs.SetRequired(append(path, "project_id")...) - cs.SetRequired(append(path, "psc_endpoint_name")...) +func (c GcpVpcEndpointInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_region"] = attrs["endpoint_region"].SetRequired() + attrs["project_id"] = attrs["project_id"].SetRequired() + attrs["psc_connection_id"] = attrs["psc_connection_id"].SetOptional() + attrs["psc_endpoint_name"] = attrs["psc_endpoint_name"].SetRequired() + attrs["service_attachment_id"] = attrs["service_attachment_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GcpVpcEndpointInfo. @@ -2625,12 +2663,12 @@ type GkeConfig struct { // // Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster. The nodes of // a public GKE cluster have public IP addresses. - ConnectivityType types.String `tfsdk:"connectivity_type" tf:"optional"` + ConnectivityType types.String `tfsdk:"connectivity_type"` // The IP range from which to allocate GKE cluster master resources. This // field will be ignored if GKE private cluster is not enabled. // // It must be exactly as big as `/28`. - MasterIpRange types.String `tfsdk:"master_ip_range" tf:"optional"` + MasterIpRange types.String `tfsdk:"master_ip_range"` } func (newState *GkeConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan GkeConfig) { @@ -2639,9 +2677,11 @@ func (newState *GkeConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan GkeConfi func (newState *GkeConfig) SyncEffectiveFieldsDuringRead(existingState GkeConfig) { } -func (c GkeConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GkeConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connectivity_type"] = attrs["connectivity_type"].SetOptional() + attrs["master_ip_range"] = attrs["master_ip_range"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GkeConfig. @@ -2679,38 +2719,38 @@ func (o GkeConfig) Type(ctx context.Context) attr.Type { type Network struct { // The Databricks account ID associated with this network configuration. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Time in epoch milliseconds when the network was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Array of error messages about the network configuration. - ErrorMessages types.List `tfsdk:"error_messages" tf:"computed"` + ErrorMessages types.List `tfsdk:"error_messages"` // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). - GcpNetworkInfo types.Object `tfsdk:"gcp_network_info" tf:"optional,object"` + GcpNetworkInfo types.Object `tfsdk:"gcp_network_info"` // The Databricks network configuration ID. - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The human-readable name of the network configuration. - NetworkName types.String `tfsdk:"network_name" tf:"optional"` + NetworkName types.String `tfsdk:"network_name"` - SecurityGroupIds types.List `tfsdk:"security_group_ids" tf:"optional"` + SecurityGroupIds types.List `tfsdk:"security_group_ids"` - SubnetIds types.List `tfsdk:"subnet_ids" tf:"optional"` + SubnetIds types.List `tfsdk:"subnet_ids"` // If specified, contains the VPC endpoints used to allow cluster // communication from this VPC over [AWS PrivateLink]. // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ - VpcEndpoints types.Object `tfsdk:"vpc_endpoints" tf:"optional,object"` + VpcEndpoints types.Object `tfsdk:"vpc_endpoints"` // The ID of the VPC associated with this network configuration. VPC IDs can // be used in multiple networks. - VpcId types.String `tfsdk:"vpc_id" tf:"optional"` + VpcId types.String `tfsdk:"vpc_id"` // The status of this network configuration object in terms of its use in a // workspace: * `UNATTACHED`: Unattached. * `VALID`: Valid. * `BROKEN`: // Broken. * `WARNED`: Warned. - VpcStatus types.String `tfsdk:"vpc_status" tf:"computed"` + VpcStatus types.String `tfsdk:"vpc_status"` // Array of warning messages about the network configuration. - WarningMessages types.List `tfsdk:"warning_messages" tf:"computed"` + WarningMessages types.List `tfsdk:"warning_messages"` // Workspace ID associated with this network configuration. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *Network) SyncEffectiveFieldsDuringCreateOrUpdate(plan Network) { @@ -2719,17 +2759,22 @@ func (newState *Network) SyncEffectiveFieldsDuringCreateOrUpdate(plan Network) { func (newState *Network) SyncEffectiveFieldsDuringRead(existingState Network) { } -func (c Network) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "creation_time")...) - cs.SetComputed(append(path, "error_messages")...) - NetworkHealth{}.ApplySchemaCustomizations(cs, append(path, "error_messages")...) - GcpNetworkInfo{}.ApplySchemaCustomizations(cs, append(path, "gcp_network_info")...) - NetworkVpcEndpoints{}.ApplySchemaCustomizations(cs, append(path, "vpc_endpoints")...) - cs.SetComputed(append(path, "vpc_status")...) - cs.SetComputed(append(path, "warning_messages")...) - NetworkWarning{}.ApplySchemaCustomizations(cs, append(path, "warning_messages")...) +func (c Network) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["error_messages"] = attrs["error_messages"].SetComputed() + attrs["gcp_network_info"] = attrs["gcp_network_info"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["network_name"] = attrs["network_name"].SetOptional() + attrs["security_group_ids"] = attrs["security_group_ids"].SetOptional() + attrs["subnet_ids"] = attrs["subnet_ids"].SetOptional() + attrs["vpc_endpoints"] = attrs["vpc_endpoints"].SetOptional() + attrs["vpc_id"] = attrs["vpc_id"].SetOptional() + attrs["vpc_status"] = attrs["vpc_status"].SetComputed() + attrs["warning_messages"] = attrs["warning_messages"].SetComputed() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Network. @@ -2964,10 +3009,10 @@ func (o *Network) SetWarningMessages(ctx context.Context, v []NetworkWarning) { type NetworkHealth struct { // Details of the error. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // The AWS resource associated with this error: credentials, VPC, subnet, // security group, or network ACL. - ErrorType types.String `tfsdk:"error_type" tf:"optional"` + ErrorType types.String `tfsdk:"error_type"` } func (newState *NetworkHealth) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkHealth) { @@ -2976,9 +3021,11 @@ func (newState *NetworkHealth) SyncEffectiveFieldsDuringCreateOrUpdate(plan Netw func (newState *NetworkHealth) SyncEffectiveFieldsDuringRead(existingState NetworkHealth) { } -func (c NetworkHealth) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NetworkHealth) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["error_type"] = attrs["error_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkHealth. @@ -3021,10 +3068,10 @@ func (o NetworkHealth) Type(ctx context.Context) attr.Type { type NetworkVpcEndpoints struct { // The VPC endpoint ID used by this network to access the Databricks secure // cluster connectivity relay. - DataplaneRelay types.List `tfsdk:"dataplane_relay" tf:""` + DataplaneRelay types.List `tfsdk:"dataplane_relay"` // The VPC endpoint ID used by this network to access the Databricks REST // API. - RestApi types.List `tfsdk:"rest_api" tf:""` + RestApi types.List `tfsdk:"rest_api"` } func (newState *NetworkVpcEndpoints) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkVpcEndpoints) { @@ -3033,11 +3080,11 @@ func (newState *NetworkVpcEndpoints) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *NetworkVpcEndpoints) SyncEffectiveFieldsDuringRead(existingState NetworkVpcEndpoints) { } -func (c NetworkVpcEndpoints) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dataplane_relay")...) - cs.SetRequired(append(path, "rest_api")...) +func (c NetworkVpcEndpoints) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataplane_relay"] = attrs["dataplane_relay"].SetRequired() + attrs["rest_api"] = attrs["rest_api"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkVpcEndpoints. @@ -3134,10 +3181,10 @@ func (o *NetworkVpcEndpoints) SetRestApi(ctx context.Context, v []types.String) type NetworkWarning struct { // Details of the warning. - WarningMessage types.String `tfsdk:"warning_message" tf:"optional"` + WarningMessage types.String `tfsdk:"warning_message"` // The AWS resource associated with this warning: a subnet or a security // group. - WarningType types.String `tfsdk:"warning_type" tf:"optional"` + WarningType types.String `tfsdk:"warning_type"` } func (newState *NetworkWarning) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkWarning) { @@ -3146,9 +3193,11 @@ func (newState *NetworkWarning) SyncEffectiveFieldsDuringCreateOrUpdate(plan Net func (newState *NetworkWarning) SyncEffectiveFieldsDuringRead(existingState NetworkWarning) { } -func (c NetworkWarning) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NetworkWarning) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["warning_message"] = attrs["warning_message"].SetOptional() + attrs["warning_type"] = attrs["warning_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkWarning. @@ -3186,29 +3235,29 @@ func (o NetworkWarning) Type(ctx context.Context) attr.Type { type PrivateAccessSettings struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // An array of Databricks VPC endpoint IDs. - AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids" tf:"optional"` + AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids"` // The private access level controls which VPC endpoints can connect to the // UI or API of any workspace that attaches this private access settings // object. * `ACCOUNT` level access (the default) allows only VPC endpoints // that are registered in your Databricks account connect to your workspace. // * `ENDPOINT` level access allows only specified VPC endpoints connect to // your workspace. For details, see `allowed_vpc_endpoint_ids`. - PrivateAccessLevel types.String `tfsdk:"private_access_level" tf:"optional"` + PrivateAccessLevel types.String `tfsdk:"private_access_level"` // Databricks private access settings ID. - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // The human-readable name of the private access settings object. - PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name" tf:"optional"` + PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name"` // Determines if the workspace can be accessed over public internet. For // fully private workspaces, you can optionally specify `false`, but only if // you implement both the front-end and the back-end PrivateLink // connections. Otherwise, specify `true`, which means that public access is // enabled. - PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled" tf:"optional"` + PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled"` // The cloud region for workspaces attached to this private access settings // object. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *PrivateAccessSettings) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrivateAccessSettings) { @@ -3217,9 +3266,16 @@ func (newState *PrivateAccessSettings) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PrivateAccessSettings) SyncEffectiveFieldsDuringRead(existingState PrivateAccessSettings) { } -func (c PrivateAccessSettings) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrivateAccessSettings) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["allowed_vpc_endpoint_ids"] = attrs["allowed_vpc_endpoint_ids"].SetOptional() + attrs["private_access_level"] = attrs["private_access_level"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["private_access_settings_name"] = attrs["private_access_settings_name"].SetOptional() + attrs["public_access_enabled"] = attrs["public_access_enabled"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrivateAccessSettings. @@ -3328,7 +3384,7 @@ func (o ReplaceResponse) Type(ctx context.Context) attr.Type { // Root S3 bucket information. type RootBucketInfo struct { // The name of the S3 bucket. - BucketName types.String `tfsdk:"bucket_name" tf:"optional"` + BucketName types.String `tfsdk:"bucket_name"` } func (newState *RootBucketInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RootBucketInfo) { @@ -3337,9 +3393,10 @@ func (newState *RootBucketInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Roo func (newState *RootBucketInfo) SyncEffectiveFieldsDuringRead(existingState RootBucketInfo) { } -func (c RootBucketInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RootBucketInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bucket_name"] = attrs["bucket_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RootBucketInfo. @@ -3375,15 +3432,15 @@ func (o RootBucketInfo) Type(ctx context.Context) attr.Type { type StorageConfiguration struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"computed"` + AccountId types.String `tfsdk:"account_id"` // Time in epoch milliseconds when the storage configuration was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Root S3 bucket information. - RootBucketInfo types.Object `tfsdk:"root_bucket_info" tf:"optional,object"` + RootBucketInfo types.Object `tfsdk:"root_bucket_info"` // Databricks storage configuration ID. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // The human-readable name of the storage configuration. - StorageConfigurationName types.String `tfsdk:"storage_configuration_name" tf:"optional"` + StorageConfigurationName types.String `tfsdk:"storage_configuration_name"` } func (newState *StorageConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan StorageConfiguration) { @@ -3392,12 +3449,14 @@ func (newState *StorageConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *StorageConfiguration) SyncEffectiveFieldsDuringRead(existingState StorageConfiguration) { } -func (c StorageConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "account_id")...) - cs.SetComputed(append(path, "creation_time")...) - RootBucketInfo{}.ApplySchemaCustomizations(cs, append(path, "root_bucket_info")...) +func (c StorageConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetComputed() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["root_bucket_info"] = attrs["root_bucket_info"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_configuration_name"] = attrs["storage_configuration_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StorageConfiguration. @@ -3472,9 +3531,9 @@ func (o *StorageConfiguration) SetRootBucketInfo(ctx context.Context, v RootBuck type StsRole struct { // The external ID that needs to be trusted by the cross-account role. This // is always your Databricks account ID. - ExternalId types.String `tfsdk:"external_id" tf:"optional"` + ExternalId types.String `tfsdk:"external_id"` // The Amazon Resource Name (ARN) of the cross account role. - RoleArn types.String `tfsdk:"role_arn" tf:"optional"` + RoleArn types.String `tfsdk:"role_arn"` } func (newState *StsRole) SyncEffectiveFieldsDuringCreateOrUpdate(plan StsRole) { @@ -3483,9 +3542,11 @@ func (newState *StsRole) SyncEffectiveFieldsDuringCreateOrUpdate(plan StsRole) { func (newState *StsRole) SyncEffectiveFieldsDuringRead(existingState StsRole) { } -func (c StsRole) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StsRole) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["external_id"] = attrs["external_id"].SetOptional() + attrs["role_arn"] = attrs["role_arn"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StsRole. @@ -3554,34 +3615,34 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type UpdateWorkspaceRequest struct { // The AWS region of the workspace's data plane (for example, `us-west-2`). // This parameter is available only for updating failed workspaces. - AwsRegion types.String `tfsdk:"aws_region" tf:"optional"` + AwsRegion types.String `tfsdk:"aws_region"` // ID of the workspace's credential configuration object. This parameter is // available for updating both failed and running workspaces. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The ID of the workspace's managed services encryption key configuration // object. This parameter is available only for updating failed workspaces. - ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id" tf:"optional"` + ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id"` - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"optional"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id"` // The ID of the workspace's network configuration object. Used only if you // already use a customer-managed VPC. For failed workspaces only, you can // switch from a Databricks-managed VPC to a customer-managed VPC by // updating the workspace to add a network configuration ID. - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The ID of the workspace's private access settings configuration object. // This parameter is available only for updating failed workspaces. - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // The ID of the workspace's storage configuration object. This parameter is // available only for updating failed workspaces. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // The ID of the key configuration object for workspace storage. This // parameter is available for updating both failed and running workspaces. - StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id" tf:"optional"` + StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id"` // Workspace ID. WorkspaceId types.Int64 `tfsdk:"-"` } @@ -3592,10 +3653,19 @@ func (newState *UpdateWorkspaceRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateWorkspaceRequest) SyncEffectiveFieldsDuringRead(existingState UpdateWorkspaceRequest) { } -func (c UpdateWorkspaceRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "workspace_id")...) +func (c UpdateWorkspaceRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_region"] = attrs["aws_region"].SetOptional() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["managed_services_customer_managed_key_id"] = attrs["managed_services_customer_managed_key_id"].SetOptional() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_customer_managed_key_id"] = attrs["storage_customer_managed_key_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateWorkspaceRequest. @@ -3692,27 +3762,27 @@ type UpsertPrivateAccessSettingsRequest struct { // public internet, see [IP access lists]. // // [IP access lists]: https://docs.databricks.com/security/network/ip-access-list.html - AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids" tf:"optional"` + AllowedVpcEndpointIds types.List `tfsdk:"allowed_vpc_endpoint_ids"` // The private access level controls which VPC endpoints can connect to the // UI or API of any workspace that attaches this private access settings // object. * `ACCOUNT` level access (the default) allows only VPC endpoints // that are registered in your Databricks account connect to your workspace. // * `ENDPOINT` level access allows only specified VPC endpoints connect to // your workspace. For details, see `allowed_vpc_endpoint_ids`. - PrivateAccessLevel types.String `tfsdk:"private_access_level" tf:"optional"` + PrivateAccessLevel types.String `tfsdk:"private_access_level"` // Databricks Account API private access settings ID. PrivateAccessSettingsId types.String `tfsdk:"-"` // The human-readable name of the private access settings object. - PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name" tf:""` + PrivateAccessSettingsName types.String `tfsdk:"private_access_settings_name"` // Determines if the workspace can be accessed over public internet. For // fully private workspaces, you can optionally specify `false`, but only if // you implement both the front-end and the back-end PrivateLink // connections. Otherwise, specify `true`, which means that public access is // enabled. - PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled" tf:"optional"` + PublicAccessEnabled types.Bool `tfsdk:"public_access_enabled"` // The cloud region for workspaces associated with this private access // settings object. - Region types.String `tfsdk:"region" tf:""` + Region types.String `tfsdk:"region"` } func (newState *UpsertPrivateAccessSettingsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertPrivateAccessSettingsRequest) { @@ -3721,12 +3791,15 @@ func (newState *UpsertPrivateAccessSettingsRequest) SyncEffectiveFieldsDuringCre func (newState *UpsertPrivateAccessSettingsRequest) SyncEffectiveFieldsDuringRead(existingState UpsertPrivateAccessSettingsRequest) { } -func (c UpsertPrivateAccessSettingsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "private_access_settings_id")...) - cs.SetRequired(append(path, "private_access_settings_name")...) - cs.SetRequired(append(path, "region")...) +func (c UpsertPrivateAccessSettingsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_vpc_endpoint_ids"] = attrs["allowed_vpc_endpoint_ids"].SetOptional() + attrs["private_access_level"] = attrs["private_access_level"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetRequired() + attrs["private_access_settings_name"] = attrs["private_access_settings_name"].SetRequired() + attrs["public_access_enabled"] = attrs["public_access_enabled"].SetOptional() + attrs["region"] = attrs["region"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertPrivateAccessSettingsRequest. @@ -3802,40 +3875,40 @@ func (o *UpsertPrivateAccessSettingsRequest) SetAllowedVpcEndpointIds(ctx contex type VpcEndpoint struct { // The Databricks account ID that hosts the VPC endpoint configuration. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // The AWS Account in which the VPC endpoint object exists. - AwsAccountId types.String `tfsdk:"aws_account_id" tf:"optional"` + AwsAccountId types.String `tfsdk:"aws_account_id"` // The ID of the Databricks [endpoint service] that this VPC endpoint is // connected to. For a list of endpoint service IDs for each supported AWS // region, see the [Databricks PrivateLink documentation]. // // [Databricks PrivateLink documentation]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html - AwsEndpointServiceId types.String `tfsdk:"aws_endpoint_service_id" tf:"optional"` + AwsEndpointServiceId types.String `tfsdk:"aws_endpoint_service_id"` // The ID of the VPC endpoint object in AWS. - AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id" tf:"optional"` + AwsVpcEndpointId types.String `tfsdk:"aws_vpc_endpoint_id"` // The Google Cloud specific information for this Private Service Connect // endpoint. - GcpVpcEndpointInfo types.Object `tfsdk:"gcp_vpc_endpoint_info" tf:"optional,object"` + GcpVpcEndpointInfo types.Object `tfsdk:"gcp_vpc_endpoint_info"` // The AWS region in which this VPC endpoint object exists. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The current state (such as `available` or `rejected`) of the VPC // endpoint. Derived from AWS. For the full set of values, see [AWS // DescribeVpcEndpoint documentation]. // // [AWS DescribeVpcEndpoint documentation]: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // This enumeration represents the type of Databricks VPC [endpoint service] // that was used when creating this VPC endpoint. // // [endpoint service]: https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-service.html - UseCase types.String `tfsdk:"use_case" tf:"optional"` + UseCase types.String `tfsdk:"use_case"` // Databricks VPC endpoint ID. This is the Databricks-specific name of the // VPC endpoint. Do not confuse this with the `aws_vpc_endpoint_id`, which // is the ID within AWS of the VPC endpoint. - VpcEndpointId types.String `tfsdk:"vpc_endpoint_id" tf:"optional"` + VpcEndpointId types.String `tfsdk:"vpc_endpoint_id"` // The human-readable name of the storage configuration. - VpcEndpointName types.String `tfsdk:"vpc_endpoint_name" tf:"optional"` + VpcEndpointName types.String `tfsdk:"vpc_endpoint_name"` } func (newState *VpcEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan VpcEndpoint) { @@ -3844,10 +3917,19 @@ func (newState *VpcEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan VpcEnd func (newState *VpcEndpoint) SyncEffectiveFieldsDuringRead(existingState VpcEndpoint) { } -func (c VpcEndpoint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - GcpVpcEndpointInfo{}.ApplySchemaCustomizations(cs, append(path, "gcp_vpc_endpoint_info")...) +func (c VpcEndpoint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_account_id"] = attrs["aws_account_id"].SetOptional() + attrs["aws_endpoint_service_id"] = attrs["aws_endpoint_service_id"].SetOptional() + attrs["aws_vpc_endpoint_id"] = attrs["aws_vpc_endpoint_id"].SetOptional() + attrs["gcp_vpc_endpoint_info"] = attrs["gcp_vpc_endpoint_info"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["use_case"] = attrs["use_case"].SetOptional() + attrs["vpc_endpoint_id"] = attrs["vpc_endpoint_id"].SetOptional() + attrs["vpc_endpoint_name"] = attrs["vpc_endpoint_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VpcEndpoint. @@ -3931,36 +4013,36 @@ func (o *VpcEndpoint) SetGcpVpcEndpointInfo(ctx context.Context, v GcpVpcEndpoin type Workspace struct { // Databricks account ID. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // The AWS region of the workspace data plane (for example, `us-west-2`). - AwsRegion types.String `tfsdk:"aws_region" tf:"optional"` + AwsRegion types.String `tfsdk:"aws_region"` - AzureWorkspaceInfo types.Object `tfsdk:"azure_workspace_info" tf:"optional,object"` + AzureWorkspaceInfo types.Object `tfsdk:"azure_workspace_info"` // The cloud name. This field always has the value `gcp`. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // The general workspace configurations that are specific to cloud // providers. - CloudResourceContainer types.Object `tfsdk:"cloud_resource_container" tf:"optional,object"` + CloudResourceContainer types.Object `tfsdk:"cloud_resource_container"` // Time in epoch milliseconds when the workspace was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // ID of the workspace's credential configuration object. - CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` + CredentialsId types.String `tfsdk:"credentials_id"` // The custom tags key-value pairing that is attached to this workspace. The // key-value pair is a string of utf-8 characters. The value can be an empty // string, with maximum length of 255 characters. The key can be of maximum // length of 127 characters, and cannot be empty. - CustomTags types.Map `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.Map `tfsdk:"custom_tags"` // The deployment name defines part of the subdomain for the workspace. The // workspace URL for web application and REST APIs is // `.cloud.databricks.com`. // // This value must be unique across all non-deleted deployments across all // AWS regions. - DeploymentName types.String `tfsdk:"deployment_name" tf:"optional"` + DeploymentName types.String `tfsdk:"deployment_name"` // If this workspace is for a external customer, then external_customer_info // is populated. If this workspace is not for a external customer, then // external_customer_info is empty. - ExternalCustomerInfo types.Object `tfsdk:"external_customer_info" tf:"optional,object"` + ExternalCustomerInfo types.Object `tfsdk:"external_customer_info"` // The network settings for the workspace. The configurations are only for // Databricks-managed VPCs. It is ignored if you specify a customer-managed // VPC in the `network_id` field.", All the IP range configurations must be @@ -3984,24 +4066,24 @@ type Workspace struct { // for a new workspace]. // // [calculate subnet sizes for a new workspace]: https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/network-sizing.html - GcpManagedNetworkConfig types.Object `tfsdk:"gcp_managed_network_config" tf:"optional,object"` + GcpManagedNetworkConfig types.Object `tfsdk:"gcp_managed_network_config"` // The configurations for the GKE cluster of a Databricks workspace. - GkeConfig types.Object `tfsdk:"gke_config" tf:"optional,object"` + GkeConfig types.Object `tfsdk:"gke_config"` // Whether no public IP is enabled for the workspace. - IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled" tf:"optional"` + IsNoPublicIpEnabled types.Bool `tfsdk:"is_no_public_ip_enabled"` // The Google Cloud region of the workspace data plane in your Google // account (for example, `us-east4`). - Location types.String `tfsdk:"location" tf:"optional"` + Location types.String `tfsdk:"location"` // ID of the key configuration for encrypting managed services. - ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id" tf:"optional"` + ManagedServicesCustomerManagedKeyId types.String `tfsdk:"managed_services_customer_managed_key_id"` // The network configuration ID that is attached to the workspace. This // field is available only if the network is a customer-managed network. - NetworkId types.String `tfsdk:"network_id" tf:"optional"` + NetworkId types.String `tfsdk:"network_id"` // The pricing tier of the workspace. For pricing tier information, see [AWS // Pricing]. // // [AWS Pricing]: https://databricks.com/product/aws-pricing - PricingTier types.String `tfsdk:"pricing_tier" tf:"optional"` + PricingTier types.String `tfsdk:"pricing_tier"` // ID of the workspace's private access settings object. Only used for // PrivateLink. You must specify this ID if you are using [AWS PrivateLink] // for either front-end (user-to-workspace connection), back-end (data plane @@ -4012,21 +4094,21 @@ type Workspace struct { // // [AWS PrivateLink]: https://aws.amazon.com/privatelink/ // [Databricks article about PrivateLink]: https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html - PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id" tf:"optional"` + PrivateAccessSettingsId types.String `tfsdk:"private_access_settings_id"` // ID of the workspace's storage configuration object. - StorageConfigurationId types.String `tfsdk:"storage_configuration_id" tf:"optional"` + StorageConfigurationId types.String `tfsdk:"storage_configuration_id"` // ID of the key configuration for encrypting workspace storage. - StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id" tf:"optional"` + StorageCustomerManagedKeyId types.String `tfsdk:"storage_customer_managed_key_id"` // A unique integer ID for the workspace - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` // The human-readable name of the workspace. - WorkspaceName types.String `tfsdk:"workspace_name" tf:"optional"` + WorkspaceName types.String `tfsdk:"workspace_name"` // The status of the workspace. For workspace creation, usually it is set to // `PROVISIONING` initially. Continue to check the status until the status // is `RUNNING`. - WorkspaceStatus types.String `tfsdk:"workspace_status" tf:"computed"` + WorkspaceStatus types.String `tfsdk:"workspace_status"` // Message describing the current workspace status. - WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message" tf:"computed"` + WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message"` } func (newState *Workspace) SyncEffectiveFieldsDuringCreateOrUpdate(plan Workspace) { @@ -4035,17 +4117,33 @@ func (newState *Workspace) SyncEffectiveFieldsDuringCreateOrUpdate(plan Workspac func (newState *Workspace) SyncEffectiveFieldsDuringRead(existingState Workspace) { } -func (c Workspace) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AzureWorkspaceInfo{}.ApplySchemaCustomizations(cs, append(path, "azure_workspace_info")...) - CloudResourceContainer{}.ApplySchemaCustomizations(cs, append(path, "cloud_resource_container")...) - cs.SetComputed(append(path, "creation_time")...) - ExternalCustomerInfo{}.ApplySchemaCustomizations(cs, append(path, "external_customer_info")...) - GcpManagedNetworkConfig{}.ApplySchemaCustomizations(cs, append(path, "gcp_managed_network_config")...) - GkeConfig{}.ApplySchemaCustomizations(cs, append(path, "gke_config")...) - cs.SetComputed(append(path, "workspace_status")...) - cs.SetComputed(append(path, "workspace_status_message")...) - - return cs +func (c Workspace) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["aws_region"] = attrs["aws_region"].SetOptional() + attrs["azure_workspace_info"] = attrs["azure_workspace_info"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["cloud_resource_container"] = attrs["cloud_resource_container"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["credentials_id"] = attrs["credentials_id"].SetOptional() + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() + attrs["deployment_name"] = attrs["deployment_name"].SetOptional() + attrs["external_customer_info"] = attrs["external_customer_info"].SetOptional() + attrs["gcp_managed_network_config"] = attrs["gcp_managed_network_config"].SetOptional() + attrs["gke_config"] = attrs["gke_config"].SetOptional() + attrs["is_no_public_ip_enabled"] = attrs["is_no_public_ip_enabled"].SetOptional() + attrs["location"] = attrs["location"].SetOptional() + attrs["managed_services_customer_managed_key_id"] = attrs["managed_services_customer_managed_key_id"].SetOptional() + attrs["network_id"] = attrs["network_id"].SetOptional() + attrs["pricing_tier"] = attrs["pricing_tier"].SetOptional() + attrs["private_access_settings_id"] = attrs["private_access_settings_id"].SetOptional() + attrs["storage_configuration_id"] = attrs["storage_configuration_id"].SetOptional() + attrs["storage_customer_managed_key_id"] = attrs["storage_customer_managed_key_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() + attrs["workspace_name"] = attrs["workspace_name"].SetOptional() + attrs["workspace_status"] = attrs["workspace_status"].SetComputed() + attrs["workspace_status_message"] = attrs["workspace_status_message"].SetComputed() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Workspace. diff --git a/internal/service/serving_tf/legacy_model.go b/internal/service/serving_tf/legacy_model.go index 9ebb753aa..6fc82d372 100755 --- a/internal/service/serving_tf/legacy_model.go +++ b/internal/service/serving_tf/legacy_model.go @@ -18,6 +18,7 @@ import ( "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" "github.com/databricks/terraform-provider-databricks/internal/service/oauth2_tf" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -28,12 +29,12 @@ type Ai21LabsConfig_SdkV2 struct { // prefer to paste your API key directly, see `ai21labs_api_key_plaintext`. // You must provide an API key using one of the following fields: // `ai21labs_api_key` or `ai21labs_api_key_plaintext`. - Ai21labsApiKey types.String `tfsdk:"ai21labs_api_key" tf:"optional"` + Ai21labsApiKey types.String `tfsdk:"ai21labs_api_key"` // An AI21 Labs API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `ai21labs_api_key`. You // must provide an API key using one of the following fields: // `ai21labs_api_key` or `ai21labs_api_key_plaintext`. - Ai21labsApiKeyPlaintext types.String `tfsdk:"ai21labs_api_key_plaintext" tf:"optional"` + Ai21labsApiKeyPlaintext types.String `tfsdk:"ai21labs_api_key_plaintext"` } func (newState *Ai21LabsConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ai21LabsConfig_SdkV2) { @@ -42,9 +43,11 @@ func (newState *Ai21LabsConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *Ai21LabsConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState Ai21LabsConfig_SdkV2) { } -func (c Ai21LabsConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Ai21LabsConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai21labs_api_key"] = attrs["ai21labs_api_key"].SetOptional() + attrs["ai21labs_api_key_plaintext"] = attrs["ai21labs_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Ai21LabsConfig. @@ -83,17 +86,17 @@ func (o Ai21LabsConfig_SdkV2) Type(ctx context.Context) attr.Type { type AiGatewayConfig_SdkV2 struct { // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails types.List `tfsdk:"guardrails" tf:"optional,object"` + Guardrails types.List `tfsdk:"guardrails"` // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig types.List `tfsdk:"inference_table_config" tf:"optional,object"` + InferenceTableConfig types.List `tfsdk:"inference_table_config"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig types.List `tfsdk:"usage_tracking_config" tf:"optional,object"` + UsageTrackingConfig types.List `tfsdk:"usage_tracking_config"` } func (newState *AiGatewayConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayConfig_SdkV2) { @@ -102,13 +105,16 @@ func (newState *AiGatewayConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AiGatewayConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayConfig_SdkV2) { } -func (c AiGatewayConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayGuardrails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "guardrails")...) - AiGatewayInferenceTableConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "inference_table_config")...) - AiGatewayRateLimit_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "rate_limits")...) - AiGatewayUsageTrackingConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "usage_tracking_config")...) +func (c AiGatewayConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["guardrails"] = attrs["guardrails"].SetOptional() + attrs["guardrails"] = attrs["guardrails"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["inference_table_config"] = attrs["inference_table_config"].SetOptional() + attrs["inference_table_config"] = attrs["inference_table_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["rate_limits"] = attrs["rate_limits"].SetOptional() + attrs["usage_tracking_config"] = attrs["usage_tracking_config"].SetOptional() + attrs["usage_tracking_config"] = attrs["usage_tracking_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayConfig. @@ -268,14 +274,14 @@ func (o *AiGatewayConfig_SdkV2) SetUsageTrackingConfig(ctx context.Context, v Ai type AiGatewayGuardrailParameters_SdkV2 struct { // List of invalid keywords. AI guardrail uses keyword or string matching to // decide if the keyword exists in the request or response content. - InvalidKeywords types.List `tfsdk:"invalid_keywords" tf:"optional"` + InvalidKeywords types.List `tfsdk:"invalid_keywords"` // Configuration for guardrail PII filter. - Pii types.List `tfsdk:"pii" tf:"optional,object"` + Pii types.List `tfsdk:"pii"` // Indicates whether the safety filter is enabled. - Safety types.Bool `tfsdk:"safety" tf:"optional"` + Safety types.Bool `tfsdk:"safety"` // The list of allowed topics. Given a chat request, this guardrail flags // the request if its topic is not in the allowed topics. - ValidTopics types.List `tfsdk:"valid_topics" tf:"optional"` + ValidTopics types.List `tfsdk:"valid_topics"` } func (newState *AiGatewayGuardrailParameters_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayGuardrailParameters_SdkV2) { @@ -284,10 +290,14 @@ func (newState *AiGatewayGuardrailParameters_SdkV2) SyncEffectiveFieldsDuringCre func (newState *AiGatewayGuardrailParameters_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayGuardrailParameters_SdkV2) { } -func (c AiGatewayGuardrailParameters_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayGuardrailPiiBehavior_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pii")...) +func (c AiGatewayGuardrailParameters_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["invalid_keywords"] = attrs["invalid_keywords"].SetOptional() + attrs["pii"] = attrs["pii"].SetOptional() + attrs["pii"] = attrs["pii"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["safety"] = attrs["safety"].SetOptional() + attrs["valid_topics"] = attrs["valid_topics"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayGuardrailParameters. @@ -422,7 +432,7 @@ type AiGatewayGuardrailPiiBehavior_SdkV2 struct { // 'BLOCK' is set for the output guardrail and the model response contains // PII, the PII info in the response is redacted and 400 status code is // returned. - Behavior types.String `tfsdk:"behavior" tf:""` + Behavior types.String `tfsdk:"behavior"` } func (newState *AiGatewayGuardrailPiiBehavior_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayGuardrailPiiBehavior_SdkV2) { @@ -431,10 +441,10 @@ func (newState *AiGatewayGuardrailPiiBehavior_SdkV2) SyncEffectiveFieldsDuringCr func (newState *AiGatewayGuardrailPiiBehavior_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayGuardrailPiiBehavior_SdkV2) { } -func (c AiGatewayGuardrailPiiBehavior_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "behavior")...) +func (c AiGatewayGuardrailPiiBehavior_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["behavior"] = attrs["behavior"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayGuardrailPiiBehavior. @@ -470,9 +480,9 @@ func (o AiGatewayGuardrailPiiBehavior_SdkV2) Type(ctx context.Context) attr.Type type AiGatewayGuardrails_SdkV2 struct { // Configuration for input guardrail filters. - Input types.List `tfsdk:"input" tf:"optional,object"` + Input types.List `tfsdk:"input"` // Configuration for output guardrail filters. - Output types.List `tfsdk:"output" tf:"optional,object"` + Output types.List `tfsdk:"output"` } func (newState *AiGatewayGuardrails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayGuardrails_SdkV2) { @@ -481,11 +491,13 @@ func (newState *AiGatewayGuardrails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *AiGatewayGuardrails_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayGuardrails_SdkV2) { } -func (c AiGatewayGuardrails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayGuardrailParameters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "input")...) - AiGatewayGuardrailParameters_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "output")...) +func (c AiGatewayGuardrails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["input"] = attrs["input"].SetOptional() + attrs["input"] = attrs["input"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["output"] = attrs["output"].SetOptional() + attrs["output"] = attrs["output"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayGuardrails. @@ -584,16 +596,16 @@ type AiGatewayInferenceTableConfig_SdkV2 struct { // The name of the catalog in Unity Catalog. Required when enabling // inference tables. NOTE: On update, you have to disable inference table // first in order to change the catalog name. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // Indicates whether the inference table is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the schema in Unity Catalog. Required when enabling inference // tables. NOTE: On update, you have to disable inference table first in // order to change the schema name. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The prefix of the table in Unity Catalog. NOTE: On update, you have to // disable inference table first in order to change the prefix name. - TableNamePrefix types.String `tfsdk:"table_name_prefix" tf:"optional"` + TableNamePrefix types.String `tfsdk:"table_name_prefix"` } func (newState *AiGatewayInferenceTableConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayInferenceTableConfig_SdkV2) { @@ -602,9 +614,13 @@ func (newState *AiGatewayInferenceTableConfig_SdkV2) SyncEffectiveFieldsDuringCr func (newState *AiGatewayInferenceTableConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayInferenceTableConfig_SdkV2) { } -func (c AiGatewayInferenceTableConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AiGatewayInferenceTableConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["table_name_prefix"] = attrs["table_name_prefix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayInferenceTableConfig. @@ -647,13 +663,13 @@ func (o AiGatewayInferenceTableConfig_SdkV2) Type(ctx context.Context) attr.Type type AiGatewayRateLimit_SdkV2 struct { // Used to specify how many calls are allowed for a key within the // renewal_period. - Calls types.Int64 `tfsdk:"calls" tf:""` + Calls types.Int64 `tfsdk:"calls"` // Key field for a rate limit. Currently, only 'user' and 'endpoint' are // supported, with 'endpoint' being the default if not specified. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Renewal period field for a rate limit. Currently, only 'minute' is // supported. - RenewalPeriod types.String `tfsdk:"renewal_period" tf:""` + RenewalPeriod types.String `tfsdk:"renewal_period"` } func (newState *AiGatewayRateLimit_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayRateLimit_SdkV2) { @@ -662,11 +678,12 @@ func (newState *AiGatewayRateLimit_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AiGatewayRateLimit_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayRateLimit_SdkV2) { } -func (c AiGatewayRateLimit_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "calls")...) - cs.SetRequired(append(path, "renewal_period")...) +func (c AiGatewayRateLimit_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["calls"] = attrs["calls"].SetRequired() + attrs["key"] = attrs["key"].SetOptional() + attrs["renewal_period"] = attrs["renewal_period"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayRateLimit. @@ -706,7 +723,7 @@ func (o AiGatewayRateLimit_SdkV2) Type(ctx context.Context) attr.Type { type AiGatewayUsageTrackingConfig_SdkV2 struct { // Whether to enable usage tracking. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` } func (newState *AiGatewayUsageTrackingConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayUsageTrackingConfig_SdkV2) { @@ -715,9 +732,10 @@ func (newState *AiGatewayUsageTrackingConfig_SdkV2) SyncEffectiveFieldsDuringCre func (newState *AiGatewayUsageTrackingConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState AiGatewayUsageTrackingConfig_SdkV2) { } -func (c AiGatewayUsageTrackingConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AiGatewayUsageTrackingConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayUsageTrackingConfig. @@ -757,32 +775,32 @@ type AmazonBedrockConfig_SdkV2 struct { // your API key directly, see `aws_access_key_id`. You must provide an API // key using one of the following fields: `aws_access_key_id` or // `aws_access_key_id_plaintext`. - AwsAccessKeyId types.String `tfsdk:"aws_access_key_id" tf:"optional"` + AwsAccessKeyId types.String `tfsdk:"aws_access_key_id"` // An AWS access key ID with permissions to interact with Bedrock services // provided as a plaintext string. If you prefer to reference your key using // Databricks Secrets, see `aws_access_key_id`. You must provide an API key // using one of the following fields: `aws_access_key_id` or // `aws_access_key_id_plaintext`. - AwsAccessKeyIdPlaintext types.String `tfsdk:"aws_access_key_id_plaintext" tf:"optional"` + AwsAccessKeyIdPlaintext types.String `tfsdk:"aws_access_key_id_plaintext"` // The AWS region to use. Bedrock has to be enabled there. - AwsRegion types.String `tfsdk:"aws_region" tf:""` + AwsRegion types.String `tfsdk:"aws_region"` // The Databricks secret key reference for an AWS secret access key paired // with the access key ID, with permissions to interact with Bedrock // services. If you prefer to paste your API key directly, see // `aws_secret_access_key_plaintext`. You must provide an API key using one // of the following fields: `aws_secret_access_key` or // `aws_secret_access_key_plaintext`. - AwsSecretAccessKey types.String `tfsdk:"aws_secret_access_key" tf:"optional"` + AwsSecretAccessKey types.String `tfsdk:"aws_secret_access_key"` // An AWS secret access key paired with the access key ID, with permissions // to interact with Bedrock services provided as a plaintext string. If you // prefer to reference your key using Databricks Secrets, see // `aws_secret_access_key`. You must provide an API key using one of the // following fields: `aws_secret_access_key` or // `aws_secret_access_key_plaintext`. - AwsSecretAccessKeyPlaintext types.String `tfsdk:"aws_secret_access_key_plaintext" tf:"optional"` + AwsSecretAccessKeyPlaintext types.String `tfsdk:"aws_secret_access_key_plaintext"` // The underlying provider in Amazon Bedrock. Supported values (case // insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. - BedrockProvider types.String `tfsdk:"bedrock_provider" tf:""` + BedrockProvider types.String `tfsdk:"bedrock_provider"` } func (newState *AmazonBedrockConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AmazonBedrockConfig_SdkV2) { @@ -791,11 +809,15 @@ func (newState *AmazonBedrockConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *AmazonBedrockConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState AmazonBedrockConfig_SdkV2) { } -func (c AmazonBedrockConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aws_region")...) - cs.SetRequired(append(path, "bedrock_provider")...) +func (c AmazonBedrockConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_access_key_id"] = attrs["aws_access_key_id"].SetOptional() + attrs["aws_access_key_id_plaintext"] = attrs["aws_access_key_id_plaintext"].SetOptional() + attrs["aws_region"] = attrs["aws_region"].SetRequired() + attrs["aws_secret_access_key"] = attrs["aws_secret_access_key"].SetOptional() + attrs["aws_secret_access_key_plaintext"] = attrs["aws_secret_access_key_plaintext"].SetOptional() + attrs["bedrock_provider"] = attrs["bedrock_provider"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AmazonBedrockConfig. @@ -844,12 +866,12 @@ type AnthropicConfig_SdkV2 struct { // prefer to paste your API key directly, see `anthropic_api_key_plaintext`. // You must provide an API key using one of the following fields: // `anthropic_api_key` or `anthropic_api_key_plaintext`. - AnthropicApiKey types.String `tfsdk:"anthropic_api_key" tf:"optional"` + AnthropicApiKey types.String `tfsdk:"anthropic_api_key"` // The Anthropic API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `anthropic_api_key`. You // must provide an API key using one of the following fields: // `anthropic_api_key` or `anthropic_api_key_plaintext`. - AnthropicApiKeyPlaintext types.String `tfsdk:"anthropic_api_key_plaintext" tf:"optional"` + AnthropicApiKeyPlaintext types.String `tfsdk:"anthropic_api_key_plaintext"` } func (newState *AnthropicConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AnthropicConfig_SdkV2) { @@ -858,9 +880,11 @@ func (newState *AnthropicConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AnthropicConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState AnthropicConfig_SdkV2) { } -func (c AnthropicConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AnthropicConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["anthropic_api_key"] = attrs["anthropic_api_key"].SetOptional() + attrs["anthropic_api_key_plaintext"] = attrs["anthropic_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AnthropicConfig. @@ -899,15 +923,15 @@ func (o AnthropicConfig_SdkV2) Type(ctx context.Context) attr.Type { type AutoCaptureConfigInput_SdkV2 struct { // The name of the catalog in Unity Catalog. NOTE: On update, you cannot // change the catalog name if the inference table is already enabled. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // Indicates whether the inference table is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the schema in Unity Catalog. NOTE: On update, you cannot // change the schema name if the inference table is already enabled. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The prefix of the table in Unity Catalog. NOTE: On update, you cannot // change the prefix name if the inference table is already enabled. - TableNamePrefix types.String `tfsdk:"table_name_prefix" tf:"optional"` + TableNamePrefix types.String `tfsdk:"table_name_prefix"` } func (newState *AutoCaptureConfigInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoCaptureConfigInput_SdkV2) { @@ -916,9 +940,13 @@ func (newState *AutoCaptureConfigInput_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *AutoCaptureConfigInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState AutoCaptureConfigInput_SdkV2) { } -func (c AutoCaptureConfigInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AutoCaptureConfigInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["table_name_prefix"] = attrs["table_name_prefix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoCaptureConfigInput. @@ -960,15 +988,15 @@ func (o AutoCaptureConfigInput_SdkV2) Type(ctx context.Context) attr.Type { type AutoCaptureConfigOutput_SdkV2 struct { // The name of the catalog in Unity Catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // Indicates whether the inference table is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the schema in Unity Catalog. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The prefix of the table in Unity Catalog. - TableNamePrefix types.String `tfsdk:"table_name_prefix" tf:"optional"` + TableNamePrefix types.String `tfsdk:"table_name_prefix"` } func (newState *AutoCaptureConfigOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoCaptureConfigOutput_SdkV2) { @@ -977,10 +1005,15 @@ func (newState *AutoCaptureConfigOutput_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *AutoCaptureConfigOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState AutoCaptureConfigOutput_SdkV2) { } -func (c AutoCaptureConfigOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) +func (c AutoCaptureConfigOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["table_name_prefix"] = attrs["table_name_prefix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoCaptureConfigOutput. @@ -1053,7 +1086,7 @@ func (o *AutoCaptureConfigOutput_SdkV2) SetState(ctx context.Context, v AutoCapt } type AutoCaptureState_SdkV2 struct { - PayloadTable types.List `tfsdk:"payload_table" tf:"optional,object"` + PayloadTable types.List `tfsdk:"payload_table"` } func (newState *AutoCaptureState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoCaptureState_SdkV2) { @@ -1062,10 +1095,11 @@ func (newState *AutoCaptureState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *AutoCaptureState_SdkV2) SyncEffectiveFieldsDuringRead(existingState AutoCaptureState_SdkV2) { } -func (c AutoCaptureState_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PayloadTable_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "payload_table")...) +func (c AutoCaptureState_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["payload_table"] = attrs["payload_table"].SetOptional() + attrs["payload_table"] = attrs["payload_table"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoCaptureState. @@ -1174,7 +1208,7 @@ func (o BuildLogsRequest_SdkV2) Type(ctx context.Context) attr.Type { type BuildLogsResponse_SdkV2 struct { // The logs associated with building the served entity's environment. - Logs types.String `tfsdk:"logs" tf:""` + Logs types.String `tfsdk:"logs"` } func (newState *BuildLogsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BuildLogsResponse_SdkV2) { @@ -1183,10 +1217,10 @@ func (newState *BuildLogsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *BuildLogsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState BuildLogsResponse_SdkV2) { } -func (c BuildLogsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "logs")...) +func (c BuildLogsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["logs"] = attrs["logs"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BuildLogsResponse. @@ -1222,9 +1256,9 @@ func (o BuildLogsResponse_SdkV2) Type(ctx context.Context) attr.Type { type ChatMessage_SdkV2 struct { // The content of the message. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // The role of the message. One of [system, user, assistant]. - Role types.String `tfsdk:"role" tf:"optional"` + Role types.String `tfsdk:"role"` } func (newState *ChatMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChatMessage_SdkV2) { @@ -1233,9 +1267,11 @@ func (newState *ChatMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ChatMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState ChatMessage_SdkV2) { } -func (c ChatMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ChatMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["role"] = attrs["role"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChatMessage. @@ -1274,17 +1310,17 @@ func (o ChatMessage_SdkV2) Type(ctx context.Context) attr.Type { type CohereConfig_SdkV2 struct { // This is an optional field to provide a customized base URL for the Cohere // API. If left unspecified, the standard Cohere base URL is used. - CohereApiBase types.String `tfsdk:"cohere_api_base" tf:"optional"` + CohereApiBase types.String `tfsdk:"cohere_api_base"` // The Databricks secret key reference for a Cohere API key. If you prefer // to paste your API key directly, see `cohere_api_key_plaintext`. You must // provide an API key using one of the following fields: `cohere_api_key` or // `cohere_api_key_plaintext`. - CohereApiKey types.String `tfsdk:"cohere_api_key" tf:"optional"` + CohereApiKey types.String `tfsdk:"cohere_api_key"` // The Cohere API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `cohere_api_key`. You // must provide an API key using one of the following fields: // `cohere_api_key` or `cohere_api_key_plaintext`. - CohereApiKeyPlaintext types.String `tfsdk:"cohere_api_key_plaintext" tf:"optional"` + CohereApiKeyPlaintext types.String `tfsdk:"cohere_api_key_plaintext"` } func (newState *CohereConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CohereConfig_SdkV2) { @@ -1293,9 +1329,12 @@ func (newState *CohereConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CohereConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState CohereConfig_SdkV2) { } -func (c CohereConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CohereConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cohere_api_base"] = attrs["cohere_api_base"].SetOptional() + attrs["cohere_api_key"] = attrs["cohere_api_key"].SetOptional() + attrs["cohere_api_key_plaintext"] = attrs["cohere_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CohereConfig. @@ -1336,21 +1375,21 @@ func (o CohereConfig_SdkV2) Type(ctx context.Context) attr.Type { type CreateServingEndpoint_SdkV2 struct { // The AI Gateway configuration for the serving endpoint. NOTE: only // external model endpoints are supported as of now. - AiGateway types.List `tfsdk:"ai_gateway" tf:"optional,object"` + AiGateway types.List `tfsdk:"ai_gateway"` // The core config of the serving endpoint. - Config types.List `tfsdk:"config" tf:"object"` + Config types.List `tfsdk:"config"` // The name of the serving endpoint. This field is required and must be // unique across a Databricks workspace. An endpoint name can consist of // alphanumeric characters, dashes, and underscores. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Rate limits to be applied to the serving endpoint. NOTE: this field is // deprecated, please use AI Gateway to manage rate limits. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Enable route optimization for the serving endpoint. - RouteOptimized types.Bool `tfsdk:"route_optimized" tf:"optional"` + RouteOptimized types.Bool `tfsdk:"route_optimized"` // Tags to be attached to the serving endpoint and automatically propagated // to billing logs. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateServingEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateServingEndpoint_SdkV2) { @@ -1359,15 +1398,17 @@ func (newState *CreateServingEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateServingEndpoint_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateServingEndpoint_SdkV2) { } -func (c CreateServingEndpoint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ai_gateway")...) - cs.SetRequired(append(path, "config")...) - EndpointCoreConfigInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) - cs.SetRequired(append(path, "name")...) - RateLimit_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "rate_limits")...) - EndpointTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateServingEndpoint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai_gateway"] = attrs["ai_gateway"].SetOptional() + attrs["ai_gateway"] = attrs["ai_gateway"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config"] = attrs["config"].SetRequired() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["rate_limits"] = attrs["rate_limits"].SetOptional() + attrs["route_optimized"] = attrs["route_optimized"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateServingEndpoint. @@ -1535,17 +1576,17 @@ type DatabricksModelServingConfig_SdkV2 struct { // to paste your API key directly, see `databricks_api_token_plaintext`. You // must provide an API key using one of the following fields: // `databricks_api_token` or `databricks_api_token_plaintext`. - DatabricksApiToken types.String `tfsdk:"databricks_api_token" tf:"optional"` + DatabricksApiToken types.String `tfsdk:"databricks_api_token"` // The Databricks API token that corresponds to a user or service principal // with Can Query access to the model serving endpoint pointed to by this // external model provided as a plaintext string. If you prefer to reference // your key using Databricks Secrets, see `databricks_api_token`. You must // provide an API key using one of the following fields: // `databricks_api_token` or `databricks_api_token_plaintext`. - DatabricksApiTokenPlaintext types.String `tfsdk:"databricks_api_token_plaintext" tf:"optional"` + DatabricksApiTokenPlaintext types.String `tfsdk:"databricks_api_token_plaintext"` // The URL of the Databricks workspace containing the model serving endpoint // pointed to by this external model. - DatabricksWorkspaceUrl types.String `tfsdk:"databricks_workspace_url" tf:""` + DatabricksWorkspaceUrl types.String `tfsdk:"databricks_workspace_url"` } func (newState *DatabricksModelServingConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatabricksModelServingConfig_SdkV2) { @@ -1554,10 +1595,12 @@ func (newState *DatabricksModelServingConfig_SdkV2) SyncEffectiveFieldsDuringCre func (newState *DatabricksModelServingConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState DatabricksModelServingConfig_SdkV2) { } -func (c DatabricksModelServingConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "databricks_workspace_url")...) +func (c DatabricksModelServingConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["databricks_api_token"] = attrs["databricks_api_token"].SetOptional() + attrs["databricks_api_token_plaintext"] = attrs["databricks_api_token_plaintext"].SetOptional() + attrs["databricks_workspace_url"] = attrs["databricks_workspace_url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksModelServingConfig. @@ -1596,11 +1639,11 @@ func (o DatabricksModelServingConfig_SdkV2) Type(ctx context.Context) attr.Type } type DataframeSplitInput_SdkV2 struct { - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` - Data types.List `tfsdk:"data" tf:"optional"` + Data types.List `tfsdk:"data"` - Index types.List `tfsdk:"index" tf:"optional"` + Index types.List `tfsdk:"index"` } func (newState *DataframeSplitInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataframeSplitInput_SdkV2) { @@ -1609,9 +1652,12 @@ func (newState *DataframeSplitInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *DataframeSplitInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataframeSplitInput_SdkV2) { } -func (c DataframeSplitInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataframeSplitInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() + attrs["index"] = attrs["index"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataframeSplitInput. @@ -1805,11 +1851,11 @@ func (o DeleteServingEndpointRequest_SdkV2) Type(ctx context.Context) attr.Type } type EmbeddingsV1ResponseEmbeddingElement_SdkV2 struct { - Embedding types.List `tfsdk:"embedding" tf:"optional"` + Embedding types.List `tfsdk:"embedding"` // The index of the embedding in the response. - Index types.Int64 `tfsdk:"index" tf:"optional"` + Index types.Int64 `tfsdk:"index"` // This will always be 'embedding'. - Object types.String `tfsdk:"object" tf:"optional"` + Object types.String `tfsdk:"object"` } func (newState *EmbeddingsV1ResponseEmbeddingElement_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmbeddingsV1ResponseEmbeddingElement_SdkV2) { @@ -1818,9 +1864,12 @@ func (newState *EmbeddingsV1ResponseEmbeddingElement_SdkV2) SyncEffectiveFieldsD func (newState *EmbeddingsV1ResponseEmbeddingElement_SdkV2) SyncEffectiveFieldsDuringRead(existingState EmbeddingsV1ResponseEmbeddingElement_SdkV2) { } -func (c EmbeddingsV1ResponseEmbeddingElement_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmbeddingsV1ResponseEmbeddingElement_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding"] = attrs["embedding"].SetOptional() + attrs["index"] = attrs["index"].SetOptional() + attrs["object"] = attrs["object"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmbeddingsV1ResponseEmbeddingElement. @@ -1891,18 +1940,18 @@ func (o *EmbeddingsV1ResponseEmbeddingElement_SdkV2) SetEmbedding(ctx context.Co type EndpointCoreConfigInput_SdkV2 struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. - AutoCaptureConfig types.List `tfsdk:"auto_capture_config" tf:"optional,object"` + AutoCaptureConfig types.List `tfsdk:"auto_capture_config"` // The name of the serving endpoint to update. This field is required. Name types.String `tfsdk:"-"` // A list of served entities for the endpoint to serve. A serving endpoint // can have up to 15 served entities. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) A list of served models for the // endpoint to serve. A serving endpoint can have up to 15 served models. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` // The traffic config defining how invocations to the serving endpoint // should be routed. - TrafficConfig types.List `tfsdk:"traffic_config" tf:"optional,object"` + TrafficConfig types.List `tfsdk:"traffic_config"` } func (newState *EndpointCoreConfigInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointCoreConfigInput_SdkV2) { @@ -1911,14 +1960,16 @@ func (newState *EndpointCoreConfigInput_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *EndpointCoreConfigInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointCoreConfigInput_SdkV2) { } -func (c EndpointCoreConfigInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureConfigInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "auto_capture_config")...) - cs.SetRequired(append(path, "name")...) - ServedEntityInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) - TrafficConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "traffic_config")...) +func (c EndpointCoreConfigInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_capture_config"] = attrs["auto_capture_config"].SetOptional() + attrs["auto_capture_config"] = attrs["auto_capture_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointCoreConfigInput. @@ -2080,16 +2131,16 @@ func (o *EndpointCoreConfigInput_SdkV2) SetTrafficConfig(ctx context.Context, v type EndpointCoreConfigOutput_SdkV2 struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. - AutoCaptureConfig types.List `tfsdk:"auto_capture_config" tf:"optional,object"` + AutoCaptureConfig types.List `tfsdk:"auto_capture_config"` // The config version that the serving endpoint is currently serving. - ConfigVersion types.Int64 `tfsdk:"config_version" tf:"optional"` + ConfigVersion types.Int64 `tfsdk:"config_version"` // The list of served entities under the serving endpoint config. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` // The traffic configuration associated with the serving endpoint config. - TrafficConfig types.List `tfsdk:"traffic_config" tf:"optional,object"` + TrafficConfig types.List `tfsdk:"traffic_config"` } func (newState *EndpointCoreConfigOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointCoreConfigOutput_SdkV2) { @@ -2098,13 +2149,16 @@ func (newState *EndpointCoreConfigOutput_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *EndpointCoreConfigOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointCoreConfigOutput_SdkV2) { } -func (c EndpointCoreConfigOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureConfigOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "auto_capture_config")...) - ServedEntityOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) - TrafficConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "traffic_config")...) +func (c EndpointCoreConfigOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_capture_config"] = attrs["auto_capture_config"].SetOptional() + attrs["auto_capture_config"] = attrs["auto_capture_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config_version"] = attrs["config_version"].SetOptional() + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointCoreConfigOutput. @@ -2265,10 +2319,10 @@ func (o *EndpointCoreConfigOutput_SdkV2) SetTrafficConfig(ctx context.Context, v type EndpointCoreConfigSummary_SdkV2 struct { // The list of served entities under the serving endpoint config. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` } func (newState *EndpointCoreConfigSummary_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointCoreConfigSummary_SdkV2) { @@ -2277,11 +2331,11 @@ func (newState *EndpointCoreConfigSummary_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *EndpointCoreConfigSummary_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointCoreConfigSummary_SdkV2) { } -func (c EndpointCoreConfigSummary_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServedEntitySpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) +func (c EndpointCoreConfigSummary_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointCoreConfigSummary. @@ -2379,20 +2433,20 @@ func (o *EndpointCoreConfigSummary_SdkV2) SetServedModels(ctx context.Context, v type EndpointPendingConfig_SdkV2 struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. - AutoCaptureConfig types.List `tfsdk:"auto_capture_config" tf:"optional,object"` + AutoCaptureConfig types.List `tfsdk:"auto_capture_config"` // The config version that the serving endpoint is currently serving. - ConfigVersion types.Int64 `tfsdk:"config_version" tf:"optional"` + ConfigVersion types.Int64 `tfsdk:"config_version"` // The list of served entities belonging to the last issued update to the // serving endpoint. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) The list of served models // belonging to the last issued update to the serving endpoint. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` // The timestamp when the update to the pending config started. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // The traffic config defining how invocations to the serving endpoint // should be routed. - TrafficConfig types.List `tfsdk:"traffic_config" tf:"optional,object"` + TrafficConfig types.List `tfsdk:"traffic_config"` } func (newState *EndpointPendingConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointPendingConfig_SdkV2) { @@ -2401,13 +2455,17 @@ func (newState *EndpointPendingConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *EndpointPendingConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointPendingConfig_SdkV2) { } -func (c EndpointPendingConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureConfigOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "auto_capture_config")...) - ServedEntityOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) - TrafficConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "traffic_config")...) +func (c EndpointPendingConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_capture_config"] = attrs["auto_capture_config"].SetOptional() + attrs["auto_capture_config"] = attrs["auto_capture_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config_version"] = attrs["config_version"].SetOptional() + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointPendingConfig. @@ -2574,12 +2632,12 @@ type EndpointState_SdkV2 struct { // update in progress. Note that if the endpoint's config_update state value // is IN_PROGRESS, another update can not be made until the update completes // or fails." - ConfigUpdate types.String `tfsdk:"config_update" tf:"optional"` + ConfigUpdate types.String `tfsdk:"config_update"` // The state of an endpoint, indicating whether or not the endpoint is // queryable. An endpoint is READY if all of the served entities in its // active configuration are ready. If any of the actively served entities // are in a non-ready state, the endpoint state will be NOT_READY. - Ready types.String `tfsdk:"ready" tf:"optional"` + Ready types.String `tfsdk:"ready"` } func (newState *EndpointState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointState_SdkV2) { @@ -2588,9 +2646,11 @@ func (newState *EndpointState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *EndpointState_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointState_SdkV2) { } -func (c EndpointState_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointState_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config_update"] = attrs["config_update"].SetOptional() + attrs["ready"] = attrs["ready"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointState. @@ -2628,9 +2688,9 @@ func (o EndpointState_SdkV2) Type(ctx context.Context) attr.Type { type EndpointTag_SdkV2 struct { // Key field for a serving endpoint tag. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Optional value field for a serving endpoint tag. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *EndpointTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointTag_SdkV2) { @@ -2639,10 +2699,11 @@ func (newState *EndpointTag_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EndpointTag_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointTag_SdkV2) { } -func (c EndpointTag_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) +func (c EndpointTag_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointTag. @@ -2753,32 +2814,32 @@ func (o ExportMetricsResponse_SdkV2) Type(ctx context.Context) attr.Type { type ExternalModel_SdkV2 struct { // AI21Labs Config. Only required if the provider is 'ai21labs'. - Ai21labsConfig types.List `tfsdk:"ai21labs_config" tf:"optional,object"` + Ai21labsConfig types.List `tfsdk:"ai21labs_config"` // Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. - AmazonBedrockConfig types.List `tfsdk:"amazon_bedrock_config" tf:"optional,object"` + AmazonBedrockConfig types.List `tfsdk:"amazon_bedrock_config"` // Anthropic Config. Only required if the provider is 'anthropic'. - AnthropicConfig types.List `tfsdk:"anthropic_config" tf:"optional,object"` + AnthropicConfig types.List `tfsdk:"anthropic_config"` // Cohere Config. Only required if the provider is 'cohere'. - CohereConfig types.List `tfsdk:"cohere_config" tf:"optional,object"` + CohereConfig types.List `tfsdk:"cohere_config"` // Databricks Model Serving Config. Only required if the provider is // 'databricks-model-serving'. - DatabricksModelServingConfig types.List `tfsdk:"databricks_model_serving_config" tf:"optional,object"` + DatabricksModelServingConfig types.List `tfsdk:"databricks_model_serving_config"` // Google Cloud Vertex AI Config. Only required if the provider is // 'google-cloud-vertex-ai'. - GoogleCloudVertexAiConfig types.List `tfsdk:"google_cloud_vertex_ai_config" tf:"optional,object"` + GoogleCloudVertexAiConfig types.List `tfsdk:"google_cloud_vertex_ai_config"` // The name of the external model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // OpenAI Config. Only required if the provider is 'openai'. - OpenaiConfig types.List `tfsdk:"openai_config" tf:"optional,object"` + OpenaiConfig types.List `tfsdk:"openai_config"` // PaLM Config. Only required if the provider is 'palm'. - PalmConfig types.List `tfsdk:"palm_config" tf:"optional,object"` + PalmConfig types.List `tfsdk:"palm_config"` // The name of the provider for the external model. Currently, the supported // providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', // 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', and // 'palm'.", - Provider types.String `tfsdk:"provider" tf:""` + Provider types.String `tfsdk:"provider"` // The task type of the external model. - Task types.String `tfsdk:"task" tf:""` + Task types.String `tfsdk:"task"` } func (newState *ExternalModel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalModel_SdkV2) { @@ -2787,20 +2848,28 @@ func (newState *ExternalModel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ExternalModel_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExternalModel_SdkV2) { } -func (c ExternalModel_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Ai21LabsConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ai21labs_config")...) - AmazonBedrockConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "amazon_bedrock_config")...) - AnthropicConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "anthropic_config")...) - CohereConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "cohere_config")...) - DatabricksModelServingConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "databricks_model_serving_config")...) - GoogleCloudVertexAiConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "google_cloud_vertex_ai_config")...) - cs.SetRequired(append(path, "name")...) - OpenAiConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "openai_config")...) - PaLmConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "palm_config")...) - cs.SetRequired(append(path, "provider")...) - cs.SetRequired(append(path, "task")...) - - return cs +func (c ExternalModel_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai21labs_config"] = attrs["ai21labs_config"].SetOptional() + attrs["ai21labs_config"] = attrs["ai21labs_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["amazon_bedrock_config"] = attrs["amazon_bedrock_config"].SetOptional() + attrs["amazon_bedrock_config"] = attrs["amazon_bedrock_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["anthropic_config"] = attrs["anthropic_config"].SetOptional() + attrs["anthropic_config"] = attrs["anthropic_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cohere_config"] = attrs["cohere_config"].SetOptional() + attrs["cohere_config"] = attrs["cohere_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["databricks_model_serving_config"] = attrs["databricks_model_serving_config"].SetOptional() + attrs["databricks_model_serving_config"] = attrs["databricks_model_serving_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["google_cloud_vertex_ai_config"] = attrs["google_cloud_vertex_ai_config"].SetOptional() + attrs["google_cloud_vertex_ai_config"] = attrs["google_cloud_vertex_ai_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["openai_config"] = attrs["openai_config"].SetOptional() + attrs["openai_config"] = attrs["openai_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["palm_config"] = attrs["palm_config"].SetOptional() + attrs["palm_config"] = attrs["palm_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["provider"] = attrs["provider"].SetRequired() + attrs["task"] = attrs["task"].SetRequired() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalModel. @@ -3089,11 +3158,11 @@ func (o *ExternalModel_SdkV2) SetPalmConfig(ctx context.Context, v PaLmConfig_Sd type ExternalModelUsageElement_SdkV2 struct { // The number of tokens in the chat/completions response. - CompletionTokens types.Int64 `tfsdk:"completion_tokens" tf:"optional"` + CompletionTokens types.Int64 `tfsdk:"completion_tokens"` // The number of tokens in the prompt. - PromptTokens types.Int64 `tfsdk:"prompt_tokens" tf:"optional"` + PromptTokens types.Int64 `tfsdk:"prompt_tokens"` // The total number of tokens in the prompt and response. - TotalTokens types.Int64 `tfsdk:"total_tokens" tf:"optional"` + TotalTokens types.Int64 `tfsdk:"total_tokens"` } func (newState *ExternalModelUsageElement_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalModelUsageElement_SdkV2) { @@ -3102,9 +3171,12 @@ func (newState *ExternalModelUsageElement_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ExternalModelUsageElement_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExternalModelUsageElement_SdkV2) { } -func (c ExternalModelUsageElement_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExternalModelUsageElement_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["completion_tokens"] = attrs["completion_tokens"].SetOptional() + attrs["prompt_tokens"] = attrs["prompt_tokens"].SetOptional() + attrs["total_tokens"] = attrs["total_tokens"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalModelUsageElement. @@ -3144,13 +3216,13 @@ func (o ExternalModelUsageElement_SdkV2) Type(ctx context.Context) attr.Type { type FoundationModel_SdkV2 struct { // The description of the foundation model. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The display name of the foundation model. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The URL to the documentation of the foundation model. - Docs types.String `tfsdk:"docs" tf:"optional"` + Docs types.String `tfsdk:"docs"` // The name of the foundation model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *FoundationModel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FoundationModel_SdkV2) { @@ -3159,9 +3231,13 @@ func (newState *FoundationModel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *FoundationModel_SdkV2) SyncEffectiveFieldsDuringRead(existingState FoundationModel_SdkV2) { } -func (c FoundationModel_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FoundationModel_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["docs"] = attrs["docs"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FoundationModel. @@ -3310,7 +3386,7 @@ func (o GetServingEndpointPermissionLevelsRequest_SdkV2) Type(ctx context.Contex type GetServingEndpointPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetServingEndpointPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetServingEndpointPermissionLevelsResponse_SdkV2) { @@ -3319,10 +3395,10 @@ func (newState *GetServingEndpointPermissionLevelsResponse_SdkV2) SyncEffectiveF func (newState *GetServingEndpointPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetServingEndpointPermissionLevelsResponse_SdkV2) { } -func (c GetServingEndpointPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetServingEndpointPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetServingEndpointPermissionLevelsResponse. @@ -3469,7 +3545,7 @@ type GoogleCloudVertexAiConfig_SdkV2 struct { // `private_key_plaintext` // // [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys - PrivateKey types.String `tfsdk:"private_key" tf:"optional"` + PrivateKey types.String `tfsdk:"private_key"` // The private key for the service account which has access to the Google // Cloud Vertex AI Service provided as a plaintext secret. See [Best // practices for managing service account keys]. If you prefer to reference @@ -3478,16 +3554,16 @@ type GoogleCloudVertexAiConfig_SdkV2 struct { // `private_key_plaintext`. // // [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys - PrivateKeyPlaintext types.String `tfsdk:"private_key_plaintext" tf:"optional"` + PrivateKeyPlaintext types.String `tfsdk:"private_key_plaintext"` // This is the Google Cloud project id that the service account is // associated with. - ProjectId types.String `tfsdk:"project_id" tf:"optional"` + ProjectId types.String `tfsdk:"project_id"` // This is the region for the Google Cloud Vertex AI Service. See [supported // regions] for more details. Some models are only available in specific // regions. // // [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *GoogleCloudVertexAiConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GoogleCloudVertexAiConfig_SdkV2) { @@ -3496,9 +3572,13 @@ func (newState *GoogleCloudVertexAiConfig_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *GoogleCloudVertexAiConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState GoogleCloudVertexAiConfig_SdkV2) { } -func (c GoogleCloudVertexAiConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GoogleCloudVertexAiConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["private_key"] = attrs["private_key"].SetOptional() + attrs["private_key_plaintext"] = attrs["private_key_plaintext"].SetOptional() + attrs["project_id"] = attrs["project_id"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GoogleCloudVertexAiConfig. @@ -3540,7 +3620,7 @@ func (o GoogleCloudVertexAiConfig_SdkV2) Type(ctx context.Context) attr.Type { type ListEndpointsResponse_SdkV2 struct { // The list of endpoints. - Endpoints types.List `tfsdk:"endpoints" tf:"optional"` + Endpoints types.List `tfsdk:"endpoints"` } func (newState *ListEndpointsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListEndpointsResponse_SdkV2) { @@ -3549,10 +3629,10 @@ func (newState *ListEndpointsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListEndpointsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListEndpointsResponse_SdkV2) { } -func (c ListEndpointsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpoint_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "endpoints")...) +func (c ListEndpointsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoints"] = attrs["endpoints"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListEndpointsResponse. @@ -3661,7 +3741,7 @@ func (o LogsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ModelDataPlaneInfo_SdkV2 struct { // Information required to query DataPlane API 'query' endpoint. - QueryInfo types.List `tfsdk:"query_info" tf:"optional,object"` + QueryInfo types.List `tfsdk:"query_info"` } func (newState *ModelDataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelDataPlaneInfo_SdkV2) { @@ -3670,10 +3750,11 @@ func (newState *ModelDataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ModelDataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ModelDataPlaneInfo_SdkV2) { } -func (c ModelDataPlaneInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - oauth2_tf.DataPlaneInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query_info")...) +func (c ModelDataPlaneInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query_info"] = attrs["query_info"].SetOptional() + attrs["query_info"] = attrs["query_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelDataPlaneInfo. @@ -3740,55 +3821,55 @@ func (o *ModelDataPlaneInfo_SdkV2) SetQueryInfo(ctx context.Context, v oauth2_tf type OpenAiConfig_SdkV2 struct { // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Client ID. - MicrosoftEntraClientId types.String `tfsdk:"microsoft_entra_client_id" tf:"optional"` + MicrosoftEntraClientId types.String `tfsdk:"microsoft_entra_client_id"` // The Databricks secret key reference for a client secret used for // Microsoft Entra ID authentication. If you prefer to paste your client // secret directly, see `microsoft_entra_client_secret_plaintext`. You must // provide an API key using one of the following fields: // `microsoft_entra_client_secret` or // `microsoft_entra_client_secret_plaintext`. - MicrosoftEntraClientSecret types.String `tfsdk:"microsoft_entra_client_secret" tf:"optional"` + MicrosoftEntraClientSecret types.String `tfsdk:"microsoft_entra_client_secret"` // The client secret used for Microsoft Entra ID authentication provided as // a plaintext string. If you prefer to reference your key using Databricks // Secrets, see `microsoft_entra_client_secret`. You must provide an API key // using one of the following fields: `microsoft_entra_client_secret` or // `microsoft_entra_client_secret_plaintext`. - MicrosoftEntraClientSecretPlaintext types.String `tfsdk:"microsoft_entra_client_secret_plaintext" tf:"optional"` + MicrosoftEntraClientSecretPlaintext types.String `tfsdk:"microsoft_entra_client_secret_plaintext"` // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Tenant ID. - MicrosoftEntraTenantId types.String `tfsdk:"microsoft_entra_tenant_id" tf:"optional"` + MicrosoftEntraTenantId types.String `tfsdk:"microsoft_entra_tenant_id"` // This is a field to provide a customized base URl for the OpenAI API. For // Azure OpenAI, this field is required, and is the base URL for the Azure // OpenAI API service provided by Azure. For other OpenAI API types, this // field is optional, and if left unspecified, the standard OpenAI base URL // is used. - OpenaiApiBase types.String `tfsdk:"openai_api_base" tf:"optional"` + OpenaiApiBase types.String `tfsdk:"openai_api_base"` // The Databricks secret key reference for an OpenAI API key using the // OpenAI or Azure service. If you prefer to paste your API key directly, // see `openai_api_key_plaintext`. You must provide an API key using one of // the following fields: `openai_api_key` or `openai_api_key_plaintext`. - OpenaiApiKey types.String `tfsdk:"openai_api_key" tf:"optional"` + OpenaiApiKey types.String `tfsdk:"openai_api_key"` // The OpenAI API key using the OpenAI or Azure service provided as a // plaintext string. If you prefer to reference your key using Databricks // Secrets, see `openai_api_key`. You must provide an API key using one of // the following fields: `openai_api_key` or `openai_api_key_plaintext`. - OpenaiApiKeyPlaintext types.String `tfsdk:"openai_api_key_plaintext" tf:"optional"` + OpenaiApiKeyPlaintext types.String `tfsdk:"openai_api_key_plaintext"` // This is an optional field to specify the type of OpenAI API to use. For // Azure OpenAI, this field is required, and adjust this parameter to // represent the preferred security access validation protocol. For access // token validation, use azure. For authentication using Azure Active // Directory (Azure AD) use, azuread. - OpenaiApiType types.String `tfsdk:"openai_api_type" tf:"optional"` + OpenaiApiType types.String `tfsdk:"openai_api_type"` // This is an optional field to specify the OpenAI API version. For Azure // OpenAI, this field is required, and is the version of the Azure OpenAI // service to utilize, specified by a date. - OpenaiApiVersion types.String `tfsdk:"openai_api_version" tf:"optional"` + OpenaiApiVersion types.String `tfsdk:"openai_api_version"` // This field is only required for Azure OpenAI and is the name of the // deployment resource for the Azure OpenAI service. - OpenaiDeploymentName types.String `tfsdk:"openai_deployment_name" tf:"optional"` + OpenaiDeploymentName types.String `tfsdk:"openai_deployment_name"` // This is an optional field to specify the organization in OpenAI or Azure // OpenAI. - OpenaiOrganization types.String `tfsdk:"openai_organization" tf:"optional"` + OpenaiOrganization types.String `tfsdk:"openai_organization"` } func (newState *OpenAiConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OpenAiConfig_SdkV2) { @@ -3797,9 +3878,20 @@ func (newState *OpenAiConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *OpenAiConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState OpenAiConfig_SdkV2) { } -func (c OpenAiConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OpenAiConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["microsoft_entra_client_id"] = attrs["microsoft_entra_client_id"].SetOptional() + attrs["microsoft_entra_client_secret"] = attrs["microsoft_entra_client_secret"].SetOptional() + attrs["microsoft_entra_client_secret_plaintext"] = attrs["microsoft_entra_client_secret_plaintext"].SetOptional() + attrs["microsoft_entra_tenant_id"] = attrs["microsoft_entra_tenant_id"].SetOptional() + attrs["openai_api_base"] = attrs["openai_api_base"].SetOptional() + attrs["openai_api_key"] = attrs["openai_api_key"].SetOptional() + attrs["openai_api_key_plaintext"] = attrs["openai_api_key_plaintext"].SetOptional() + attrs["openai_api_type"] = attrs["openai_api_type"].SetOptional() + attrs["openai_api_version"] = attrs["openai_api_version"].SetOptional() + attrs["openai_deployment_name"] = attrs["openai_deployment_name"].SetOptional() + attrs["openai_organization"] = attrs["openai_organization"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OpenAiConfig. @@ -3858,12 +3950,12 @@ type PaLmConfig_SdkV2 struct { // paste your API key directly, see `palm_api_key_plaintext`. You must // provide an API key using one of the following fields: `palm_api_key` or // `palm_api_key_plaintext`. - PalmApiKey types.String `tfsdk:"palm_api_key" tf:"optional"` + PalmApiKey types.String `tfsdk:"palm_api_key"` // The PaLM API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `palm_api_key`. You must // provide an API key using one of the following fields: `palm_api_key` or // `palm_api_key_plaintext`. - PalmApiKeyPlaintext types.String `tfsdk:"palm_api_key_plaintext" tf:"optional"` + PalmApiKeyPlaintext types.String `tfsdk:"palm_api_key_plaintext"` } func (newState *PaLmConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PaLmConfig_SdkV2) { @@ -3872,9 +3964,11 @@ func (newState *PaLmConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan P func (newState *PaLmConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState PaLmConfig_SdkV2) { } -func (c PaLmConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PaLmConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["palm_api_key"] = attrs["palm_api_key"].SetOptional() + attrs["palm_api_key_plaintext"] = attrs["palm_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PaLmConfig. @@ -3912,9 +4006,9 @@ func (o PaLmConfig_SdkV2) Type(ctx context.Context) attr.Type { type PatchServingEndpointTags_SdkV2 struct { // List of endpoint tags to add - AddTags types.List `tfsdk:"add_tags" tf:"optional"` + AddTags types.List `tfsdk:"add_tags"` // List of tag keys to delete - DeleteTags types.List `tfsdk:"delete_tags" tf:"optional"` + DeleteTags types.List `tfsdk:"delete_tags"` // The name of the serving endpoint who's tags to patch. This field is // required. Name types.String `tfsdk:"-"` @@ -3926,11 +4020,12 @@ func (newState *PatchServingEndpointTags_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *PatchServingEndpointTags_SdkV2) SyncEffectiveFieldsDuringRead(existingState PatchServingEndpointTags_SdkV2) { } -func (c PatchServingEndpointTags_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "add_tags")...) - cs.SetRequired(append(path, "name")...) +func (c PatchServingEndpointTags_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["add_tags"] = attrs["add_tags"].SetOptional() + attrs["delete_tags"] = attrs["delete_tags"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PatchServingEndpointTags. @@ -4029,11 +4124,11 @@ func (o *PatchServingEndpointTags_SdkV2) SetDeleteTags(ctx context.Context, v [] type PayloadTable_SdkV2 struct { // The name of the payload table. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The status of the payload table. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The status message of the payload table. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` } func (newState *PayloadTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PayloadTable_SdkV2) { @@ -4042,9 +4137,12 @@ func (newState *PayloadTable_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PayloadTable_SdkV2) SyncEffectiveFieldsDuringRead(existingState PayloadTable_SdkV2) { } -func (c PayloadTable_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PayloadTable_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PayloadTable. @@ -4086,20 +4184,20 @@ func (o PayloadTable_SdkV2) Type(ctx context.Context) attr.Type { type PutAiGatewayRequest_SdkV2 struct { // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails types.List `tfsdk:"guardrails" tf:"optional,object"` + Guardrails types.List `tfsdk:"guardrails"` // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig types.List `tfsdk:"inference_table_config" tf:"optional,object"` + InferenceTableConfig types.List `tfsdk:"inference_table_config"` // The name of the serving endpoint whose AI Gateway is being updated. This // field is required. Name types.String `tfsdk:"-"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig types.List `tfsdk:"usage_tracking_config" tf:"optional,object"` + UsageTrackingConfig types.List `tfsdk:"usage_tracking_config"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutAiGatewayRequest. @@ -4261,17 +4359,17 @@ func (o *PutAiGatewayRequest_SdkV2) SetUsageTrackingConfig(ctx context.Context, type PutAiGatewayResponse_SdkV2 struct { // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails types.List `tfsdk:"guardrails" tf:"optional,object"` + Guardrails types.List `tfsdk:"guardrails"` // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality . - InferenceTableConfig types.List `tfsdk:"inference_table_config" tf:"optional,object"` + InferenceTableConfig types.List `tfsdk:"inference_table_config"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig types.List `tfsdk:"usage_tracking_config" tf:"optional,object"` + UsageTrackingConfig types.List `tfsdk:"usage_tracking_config"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutAiGatewayResponse. @@ -4434,7 +4532,7 @@ type PutRequest_SdkV2 struct { // This field is required. Name types.String `tfsdk:"-"` // The list of endpoint rate limits. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutRequest. @@ -4502,7 +4600,7 @@ func (o *PutRequest_SdkV2) SetRateLimits(ctx context.Context, v []RateLimit_SdkV type PutResponse_SdkV2 struct { // The list of endpoint rate limits. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutResponse. @@ -4568,54 +4666,54 @@ func (o *PutResponse_SdkV2) SetRateLimits(ctx context.Context, v []RateLimit_Sdk type QueryEndpointInput_SdkV2 struct { // Pandas Dataframe input in the records orientation. - DataframeRecords types.List `tfsdk:"dataframe_records" tf:"optional"` + DataframeRecords types.List `tfsdk:"dataframe_records"` // Pandas Dataframe input in the split orientation. - DataframeSplit types.List `tfsdk:"dataframe_split" tf:"optional,object"` + DataframeSplit types.List `tfsdk:"dataframe_split"` // The extra parameters field used ONLY for __completions, chat,__ and // __embeddings external & foundation model__ serving endpoints. This is a // map of strings and should only be used with other external/foundation // model query fields. - ExtraParams types.Map `tfsdk:"extra_params" tf:"optional"` + ExtraParams types.Map `tfsdk:"extra_params"` // The input string (or array of strings) field used ONLY for __embeddings // external & foundation model__ serving endpoints and is the only field // (along with extra_params if needed) used by embeddings queries. - Input types.Object `tfsdk:"input" tf:"optional"` + Input types.Object `tfsdk:"input"` // Tensor-based input in columnar format. - Inputs types.Object `tfsdk:"inputs" tf:"optional"` + Inputs types.Object `tfsdk:"inputs"` // Tensor-based input in row format. - Instances types.List `tfsdk:"instances" tf:"optional"` + Instances types.List `tfsdk:"instances"` // The max tokens field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is an integer and should only // be used with other chat/completions query fields. - MaxTokens types.Int64 `tfsdk:"max_tokens" tf:"optional"` + MaxTokens types.Int64 `tfsdk:"max_tokens"` // The messages field used ONLY for __chat external & foundation model__ // serving endpoints. This is a map of strings and should only be used with // other chat query fields. - Messages types.List `tfsdk:"messages" tf:"optional"` + Messages types.List `tfsdk:"messages"` // The n (number of candidates) field used ONLY for __completions__ and // __chat external & foundation model__ serving endpoints. This is an // integer between 1 and 5 with a default of 1 and should only be used with // other chat/completions query fields. - N types.Int64 `tfsdk:"n" tf:"optional"` + N types.Int64 `tfsdk:"n"` // The name of the serving endpoint. This field is required. Name types.String `tfsdk:"-"` // The prompt string (or array of strings) field used ONLY for __completions // external & foundation model__ serving endpoints and should only be used // with other completions query fields. - Prompt types.Object `tfsdk:"prompt" tf:"optional"` + Prompt types.Object `tfsdk:"prompt"` // The stop sequences field used ONLY for __completions__ and __chat // external & foundation model__ serving endpoints. This is a list of // strings and should only be used with other chat/completions query fields. - Stop types.List `tfsdk:"stop" tf:"optional"` + Stop types.List `tfsdk:"stop"` // The stream field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is a boolean defaulting to // false and should only be used with other chat/completions query fields. - Stream types.Bool `tfsdk:"stream" tf:"optional"` + Stream types.Bool `tfsdk:"stream"` // The temperature field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is a float between 0.0 and 2.0 // with a default of 1.0 and should only be used with other chat/completions // query fields. - Temperature types.Float64 `tfsdk:"temperature" tf:"optional"` + Temperature types.Float64 `tfsdk:"temperature"` } func (newState *QueryEndpointInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryEndpointInput_SdkV2) { @@ -4624,12 +4722,24 @@ func (newState *QueryEndpointInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *QueryEndpointInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryEndpointInput_SdkV2) { } -func (c QueryEndpointInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DataframeSplitInput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "dataframe_split")...) - ChatMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "messages")...) - cs.SetRequired(append(path, "name")...) +func (c QueryEndpointInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataframe_records"] = attrs["dataframe_records"].SetOptional() + attrs["dataframe_split"] = attrs["dataframe_split"].SetOptional() + attrs["dataframe_split"] = attrs["dataframe_split"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["extra_params"] = attrs["extra_params"].SetOptional() + attrs["input"] = attrs["input"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetOptional() + attrs["instances"] = attrs["instances"].SetOptional() + attrs["max_tokens"] = attrs["max_tokens"].SetOptional() + attrs["messages"] = attrs["messages"].SetOptional() + attrs["n"] = attrs["n"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["prompt"] = attrs["prompt"].SetOptional() + attrs["stop"] = attrs["stop"].SetOptional() + attrs["stream"] = attrs["stream"].SetOptional() + attrs["temperature"] = attrs["temperature"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryEndpointInput. @@ -4867,32 +4977,32 @@ func (o *QueryEndpointInput_SdkV2) SetStop(ctx context.Context, v []types.String type QueryEndpointResponse_SdkV2 struct { // The list of choices returned by the __chat or completions // external/foundation model__ serving endpoint. - Choices types.List `tfsdk:"choices" tf:"optional"` + Choices types.List `tfsdk:"choices"` // The timestamp in seconds when the query was created in Unix time returned // by a __completions or chat external/foundation model__ serving endpoint. - Created types.Int64 `tfsdk:"created" tf:"optional"` + Created types.Int64 `tfsdk:"created"` // The list of the embeddings returned by the __embeddings // external/foundation model__ serving endpoint. - Data types.List `tfsdk:"data" tf:"optional"` + Data types.List `tfsdk:"data"` // The ID of the query that may be returned by a __completions or chat // external/foundation model__ serving endpoint. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The name of the __external/foundation model__ used for querying. This is // the name of the model that was specified in the endpoint config. - Model types.String `tfsdk:"model" tf:"optional"` + Model types.String `tfsdk:"model"` // The type of object returned by the __external/foundation model__ serving // endpoint, one of [text_completion, chat.completion, list (of // embeddings)]. - Object types.String `tfsdk:"object" tf:"optional"` + Object types.String `tfsdk:"object"` // The predictions returned by the serving endpoint. - Predictions types.List `tfsdk:"predictions" tf:"optional"` + Predictions types.List `tfsdk:"predictions"` // The name of the served model that served the request. This is useful when // there are multiple models behind the same endpoint with traffic split. ServedModelName types.String `tfsdk:"-"` // The usage object that may be returned by the __external/foundation // model__ serving endpoint. This contains information about the number of // tokens used in the prompt and response. - Usage types.List `tfsdk:"usage" tf:"optional,object"` + Usage types.List `tfsdk:"usage"` } func (newState *QueryEndpointResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryEndpointResponse_SdkV2) { @@ -4901,12 +5011,19 @@ func (newState *QueryEndpointResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *QueryEndpointResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryEndpointResponse_SdkV2) { } -func (c QueryEndpointResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - V1ResponseChoiceElement_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "choices")...) - EmbeddingsV1ResponseEmbeddingElement_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data")...) - ExternalModelUsageElement_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "usage")...) +func (c QueryEndpointResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["choices"] = attrs["choices"].SetOptional() + attrs["created"] = attrs["created"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["model"] = attrs["model"].SetOptional() + attrs["object"] = attrs["object"].SetOptional() + attrs["predictions"] = attrs["predictions"].SetOptional() + attrs["served-model-name"] = attrs["served-model-name"].SetOptional() + attrs["usage"] = attrs["usage"].SetOptional() + attrs["usage"] = attrs["usage"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryEndpointResponse. @@ -5076,14 +5193,14 @@ func (o *QueryEndpointResponse_SdkV2) SetUsage(ctx context.Context, v ExternalMo type RateLimit_SdkV2 struct { // Used to specify how many calls are allowed for a key within the // renewal_period. - Calls types.Int64 `tfsdk:"calls" tf:""` + Calls types.Int64 `tfsdk:"calls"` // Key field for a serving endpoint rate limit. Currently, only 'user' and // 'endpoint' are supported, with 'endpoint' being the default if not // specified. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Renewal period field for a serving endpoint rate limit. Currently, only // 'minute' is supported. - RenewalPeriod types.String `tfsdk:"renewal_period" tf:""` + RenewalPeriod types.String `tfsdk:"renewal_period"` } func (newState *RateLimit_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RateLimit_SdkV2) { @@ -5092,11 +5209,12 @@ func (newState *RateLimit_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ra func (newState *RateLimit_SdkV2) SyncEffectiveFieldsDuringRead(existingState RateLimit_SdkV2) { } -func (c RateLimit_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "calls")...) - cs.SetRequired(append(path, "renewal_period")...) +func (c RateLimit_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["calls"] = attrs["calls"].SetRequired() + attrs["key"] = attrs["key"].SetOptional() + attrs["renewal_period"] = attrs["renewal_period"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RateLimit. @@ -5136,10 +5254,10 @@ func (o RateLimit_SdkV2) Type(ctx context.Context) attr.Type { type Route_SdkV2 struct { // The name of the served model this route configures traffic for. - ServedModelName types.String `tfsdk:"served_model_name" tf:""` + ServedModelName types.String `tfsdk:"served_model_name"` // The percentage of endpoint traffic to send to this route. It must be an // integer between 0 and 100 inclusive. - TrafficPercentage types.Int64 `tfsdk:"traffic_percentage" tf:""` + TrafficPercentage types.Int64 `tfsdk:"traffic_percentage"` } func (newState *Route_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Route_SdkV2) { @@ -5148,11 +5266,11 @@ func (newState *Route_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Route_ func (newState *Route_SdkV2) SyncEffectiveFieldsDuringRead(existingState Route_SdkV2) { } -func (c Route_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "served_model_name")...) - cs.SetRequired(append(path, "traffic_percentage")...) +func (c Route_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["served_model_name"] = attrs["served_model_name"].SetRequired() + attrs["traffic_percentage"] = attrs["traffic_percentage"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Route. @@ -5194,17 +5312,17 @@ type ServedEntityInput_SdkV2 struct { // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object should be given in the form of // __catalog_name__.__schema_name__.__model_name__. - EntityName types.String `tfsdk:"entity_name" tf:"optional"` + EntityName types.String `tfsdk:"entity_name"` // The version of the model in Databricks Model Registry to be served or // empty if the entity is a FEATURE_SPEC. - EntityVersion types.String `tfsdk:"entity_version" tf:"optional"` + EntityVersion types.String `tfsdk:"entity_version"` // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // The external model to be served. NOTE: Only one of external_model and // (entity_name, entity_version, workload_size, workload_type, and // scale_to_zero_enabled) can be specified with the latter set being used @@ -5213,24 +5331,24 @@ type ServedEntityInput_SdkV2 struct { // endpoint without external_model. If the endpoint is created without // external_model, users cannot update it to add external_model later. The // task type of all external models within an endpoint must be the same. - ExternalModel types.List `tfsdk:"external_model" tf:"optional,object"` + ExternalModel types.List `tfsdk:"external_model"` // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput" tf:"optional"` + MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput"` // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput" tf:"optional"` + MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput"` // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to // -. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:"optional"` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -5238,7 +5356,7 @@ type ServedEntityInput_SdkV2 struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size is 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5246,7 +5364,7 @@ type ServedEntityInput_SdkV2 struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedEntityInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedEntityInput_SdkV2) { @@ -5255,10 +5373,21 @@ func (newState *ServedEntityInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ServedEntityInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedEntityInput_SdkV2) { } -func (c ServedEntityInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalModel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "external_model")...) +func (c ServedEntityInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["entity_name"] = attrs["entity_name"].SetOptional() + attrs["entity_version"] = attrs["entity_version"].SetOptional() + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["external_model"] = attrs["external_model"].SetOptional() + attrs["external_model"] = attrs["external_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_provisioned_throughput"] = attrs["max_provisioned_throughput"].SetOptional() + attrs["min_provisioned_throughput"] = attrs["min_provisioned_throughput"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetOptional() + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedEntityInput. @@ -5373,49 +5502,49 @@ func (o *ServedEntityInput_SdkV2) SetExternalModel(ctx context.Context, v Extern type ServedEntityOutput_SdkV2 struct { // The creation timestamp of the served entity in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the served entity. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // The name of the entity served. The entity may be a model in the // Databricks Model Registry, a model in the Unity Catalog (UC), or a // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object is given in the form of // __catalog_name__.__schema_name__.__model_name__. - EntityName types.String `tfsdk:"entity_name" tf:"optional"` + EntityName types.String `tfsdk:"entity_name"` // The version of the served entity in Databricks Model Registry or empty if // the entity is a FEATURE_SPEC. - EntityVersion types.String `tfsdk:"entity_version" tf:"optional"` + EntityVersion types.String `tfsdk:"entity_version"` // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // The external model that is served. NOTE: Only one of external_model, // foundation_model, and (entity_name, entity_version, workload_size, // workload_type, and scale_to_zero_enabled) is returned based on the // endpoint type. - ExternalModel types.List `tfsdk:"external_model" tf:"optional,object"` + ExternalModel types.List `tfsdk:"external_model"` // The foundation model that is served. NOTE: Only one of foundation_model, // external_model, and (entity_name, entity_version, workload_size, // workload_type, and scale_to_zero_enabled) is returned based on the // endpoint type. - FoundationModel types.List `tfsdk:"foundation_model" tf:"optional,object"` + FoundationModel types.List `tfsdk:"foundation_model"` // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput" tf:"optional"` + MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput"` // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput" tf:"optional"` + MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput"` // The name of the served entity. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:"optional"` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // Information corresponding to the state of the served entity. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -5423,7 +5552,7 @@ type ServedEntityOutput_SdkV2 struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size will be 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5431,7 +5560,7 @@ type ServedEntityOutput_SdkV2 struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedEntityOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedEntityOutput_SdkV2) { @@ -5440,12 +5569,27 @@ func (newState *ServedEntityOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ServedEntityOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedEntityOutput_SdkV2) { } -func (c ServedEntityOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalModel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "external_model")...) - FoundationModel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "foundation_model")...) - ServedModelState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - - return cs +func (c ServedEntityOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["entity_name"] = attrs["entity_name"].SetOptional() + attrs["entity_version"] = attrs["entity_version"].SetOptional() + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["external_model"] = attrs["external_model"].SetOptional() + attrs["external_model"] = attrs["external_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["foundation_model"] = attrs["foundation_model"].SetOptional() + attrs["foundation_model"] = attrs["foundation_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_provisioned_throughput"] = attrs["max_provisioned_throughput"].SetOptional() + attrs["min_provisioned_throughput"] = attrs["min_provisioned_throughput"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedEntityOutput. @@ -5630,20 +5774,20 @@ type ServedEntitySpec_SdkV2 struct { // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object is given in the form of // __catalog_name__.__schema_name__.__model_name__. - EntityName types.String `tfsdk:"entity_name" tf:"optional"` + EntityName types.String `tfsdk:"entity_name"` // The version of the served entity in Databricks Model Registry or empty if // the entity is a FEATURE_SPEC. - EntityVersion types.String `tfsdk:"entity_version" tf:"optional"` + EntityVersion types.String `tfsdk:"entity_version"` // The external model that is served. NOTE: Only one of external_model, // foundation_model, and (entity_name, entity_version) is returned based on // the endpoint type. - ExternalModel types.List `tfsdk:"external_model" tf:"optional,object"` + ExternalModel types.List `tfsdk:"external_model"` // The foundation model that is served. NOTE: Only one of foundation_model, // external_model, and (entity_name, entity_version) is returned based on // the endpoint type. - FoundationModel types.List `tfsdk:"foundation_model" tf:"optional,object"` + FoundationModel types.List `tfsdk:"foundation_model"` // The name of the served entity. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ServedEntitySpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedEntitySpec_SdkV2) { @@ -5652,11 +5796,16 @@ func (newState *ServedEntitySpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ServedEntitySpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedEntitySpec_SdkV2) { } -func (c ServedEntitySpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalModel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "external_model")...) - FoundationModel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "foundation_model")...) +func (c ServedEntitySpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["entity_name"] = attrs["entity_name"].SetOptional() + attrs["entity_version"] = attrs["entity_version"].SetOptional() + attrs["external_model"] = attrs["external_model"].SetOptional() + attrs["external_model"] = attrs["external_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["foundation_model"] = attrs["foundation_model"].SetOptional() + attrs["foundation_model"] = attrs["foundation_model"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedEntitySpec. @@ -5764,29 +5913,29 @@ type ServedModelInput_SdkV2 struct { // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // ARN of the instance profile that the served model will use to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput" tf:"optional"` + MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput"` // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput" tf:"optional"` + MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput"` // The name of the model in Databricks Model Registry to be served or if the // model resides in Unity Catalog, the full name of model, in the form of // __catalog_name__.__schema_name__.__model_name__. - ModelName types.String `tfsdk:"model_name" tf:""` + ModelName types.String `tfsdk:"model_name"` // The version of the model in Databricks Model Registry or Unity Catalog to // be served. - ModelVersion types.String `tfsdk:"model_version" tf:""` + ModelVersion types.String `tfsdk:"model_version"` // The name of a served model. It must be unique across an endpoint. If not // specified, this field will default to -. A // served model name can consist of alphanumeric characters, dashes, and // underscores. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the served model should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:""` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // The workload size of the served model. The workload size corresponds to a // range of provisioned concurrency that the compute will autoscale between. // A single unit of provisioned concurrency can process one request at a @@ -5794,7 +5943,7 @@ type ServedModelInput_SdkV2 struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size will be 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served model. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5802,7 +5951,7 @@ type ServedModelInput_SdkV2 struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedModelInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelInput_SdkV2) { @@ -5811,12 +5960,19 @@ func (newState *ServedModelInput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ServedModelInput_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedModelInput_SdkV2) { } -func (c ServedModelInput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "model_name")...) - cs.SetRequired(append(path, "model_version")...) - cs.SetRequired(append(path, "scale_to_zero_enabled")...) +func (c ServedModelInput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_provisioned_throughput"] = attrs["max_provisioned_throughput"].SetOptional() + attrs["min_provisioned_throughput"] = attrs["min_provisioned_throughput"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetRequired() + attrs["model_version"] = attrs["model_version"].SetRequired() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetRequired() + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelInput. @@ -5900,32 +6056,32 @@ func (o *ServedModelInput_SdkV2) SetEnvironmentVars(ctx context.Context, v map[s type ServedModelOutput_SdkV2 struct { // The creation timestamp of the served model in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the served model. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this model. Note: this is an // experimental feature and subject to change. Example model environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // ARN of the instance profile that the served model will use to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The name of the model in Databricks Model Registry or the full name of // the model in Unity Catalog. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // The version of the model in Databricks Model Registry or Unity Catalog to // be served. - ModelVersion types.String `tfsdk:"model_version" tf:"optional"` + ModelVersion types.String `tfsdk:"model_version"` // The name of the served model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the Served Model should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:"optional"` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // Information corresponding to the state of the Served Model. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // The workload size of the served model. The workload size corresponds to a // range of provisioned concurrency that the compute will autoscale between. // A single unit of provisioned concurrency can process one request at a @@ -5933,7 +6089,7 @@ type ServedModelOutput_SdkV2 struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size will be 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served model. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5941,7 +6097,7 @@ type ServedModelOutput_SdkV2 struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedModelOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelOutput_SdkV2) { @@ -5950,10 +6106,21 @@ func (newState *ServedModelOutput_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ServedModelOutput_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedModelOutput_SdkV2) { } -func (c ServedModelOutput_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServedModelState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) +func (c ServedModelOutput_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["model_version"] = attrs["model_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelOutput. @@ -6069,12 +6236,12 @@ func (o *ServedModelOutput_SdkV2) SetState(ctx context.Context, v ServedModelSta type ServedModelSpec_SdkV2 struct { // The name of the model in Databricks Model Registry or the full name of // the model in Unity Catalog. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // The version of the model in Databricks Model Registry or Unity Catalog to // be served. - ModelVersion types.String `tfsdk:"model_version" tf:"optional"` + ModelVersion types.String `tfsdk:"model_version"` // The name of the served model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ServedModelSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelSpec_SdkV2) { @@ -6083,9 +6250,12 @@ func (newState *ServedModelSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ServedModelSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedModelSpec_SdkV2) { } -func (c ServedModelSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServedModelSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["model_version"] = attrs["model_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelSpec. @@ -6136,9 +6306,9 @@ type ServedModelState_SdkV2 struct { // etc.) DEPLOYMENT_ABORTED indicates that the deployment was terminated // likely due to a failure in bringing up another served entity under the // same endpoint and config version. - Deployment types.String `tfsdk:"deployment" tf:"optional"` + Deployment types.String `tfsdk:"deployment"` // More information about the state of the served entity, if available. - DeploymentStateMessage types.String `tfsdk:"deployment_state_message" tf:"optional"` + DeploymentStateMessage types.String `tfsdk:"deployment_state_message"` } func (newState *ServedModelState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelState_SdkV2) { @@ -6147,9 +6317,11 @@ func (newState *ServedModelState_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ServedModelState_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServedModelState_SdkV2) { } -func (c ServedModelState_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServedModelState_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment_state_message"] = attrs["deployment_state_message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelState. @@ -6188,7 +6360,7 @@ func (o ServedModelState_SdkV2) Type(ctx context.Context) attr.Type { type ServerLogsResponse_SdkV2 struct { // The most recent log lines of the model server processing invocation // requests. - Logs types.String `tfsdk:"logs" tf:""` + Logs types.String `tfsdk:"logs"` } func (newState *ServerLogsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServerLogsResponse_SdkV2) { @@ -6197,10 +6369,10 @@ func (newState *ServerLogsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ServerLogsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServerLogsResponse_SdkV2) { } -func (c ServerLogsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "logs")...) +func (c ServerLogsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["logs"] = attrs["logs"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServerLogsResponse. @@ -6237,26 +6409,26 @@ func (o ServerLogsResponse_SdkV2) Type(ctx context.Context) attr.Type { type ServingEndpoint_SdkV2 struct { // The AI Gateway configuration for the serving endpoint. NOTE: Only // external model endpoints are currently supported. - AiGateway types.List `tfsdk:"ai_gateway" tf:"optional,object"` + AiGateway types.List `tfsdk:"ai_gateway"` // The config that is currently being served by the endpoint. - Config types.List `tfsdk:"config" tf:"optional,object"` + Config types.List `tfsdk:"config"` // The timestamp when the endpoint was created in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the serving endpoint. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // System-generated ID of the endpoint. This is used to refer to the // endpoint in the Permissions API - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The timestamp when the endpoint was last updated by a user in Unix time. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The name of the serving endpoint. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Information corresponding to the state of the serving endpoint. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // Tags attached to the serving endpoint. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The task type of the serving endpoint. - Task types.String `tfsdk:"task" tf:"optional"` + Task types.String `tfsdk:"task"` } func (newState *ServingEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpoint_SdkV2) { @@ -6265,13 +6437,22 @@ func (newState *ServingEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ServingEndpoint_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpoint_SdkV2) { } -func (c ServingEndpoint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ai_gateway")...) - EndpointCoreConfigSummary_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) - EndpointState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - EndpointTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ServingEndpoint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai_gateway"] = attrs["ai_gateway"].SetOptional() + attrs["ai_gateway"] = attrs["ai_gateway"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config"] = attrs["config"].SetOptional() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpoint. @@ -6442,13 +6623,13 @@ func (o *ServingEndpoint_SdkV2) SetTags(ctx context.Context, v []EndpointTag_Sdk type ServingEndpointAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ServingEndpointAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointAccessControlRequest_SdkV2) { @@ -6457,9 +6638,13 @@ func (newState *ServingEndpointAccessControlRequest_SdkV2) SyncEffectiveFieldsDu func (newState *ServingEndpointAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointAccessControlRequest_SdkV2) { } -func (c ServingEndpointAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServingEndpointAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointAccessControlRequest. @@ -6501,15 +6686,15 @@ func (o ServingEndpointAccessControlRequest_SdkV2) Type(ctx context.Context) att type ServingEndpointAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ServingEndpointAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointAccessControlResponse_SdkV2) { @@ -6518,10 +6703,14 @@ func (newState *ServingEndpointAccessControlResponse_SdkV2) SyncEffectiveFieldsD func (newState *ServingEndpointAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointAccessControlResponse_SdkV2) { } -func (c ServingEndpointAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ServingEndpointAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointAccessControlResponse. @@ -6596,37 +6785,37 @@ func (o *ServingEndpointAccessControlResponse_SdkV2) SetAllPermissions(ctx conte type ServingEndpointDetailed_SdkV2 struct { // The AI Gateway configuration for the serving endpoint. NOTE: Only // external model endpoints are currently supported. - AiGateway types.List `tfsdk:"ai_gateway" tf:"optional,object"` + AiGateway types.List `tfsdk:"ai_gateway"` // The config that is currently being served by the endpoint. - Config types.List `tfsdk:"config" tf:"optional,object"` + Config types.List `tfsdk:"config"` // The timestamp when the endpoint was created in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the serving endpoint. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // Information required to query DataPlane APIs. - DataPlaneInfo types.List `tfsdk:"data_plane_info" tf:"optional,object"` + DataPlaneInfo types.List `tfsdk:"data_plane_info"` // Endpoint invocation url if route optimization is enabled for endpoint - EndpointUrl types.String `tfsdk:"endpoint_url" tf:"optional"` + EndpointUrl types.String `tfsdk:"endpoint_url"` // System-generated ID of the endpoint. This is used to refer to the // endpoint in the Permissions API - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The timestamp when the endpoint was last updated by a user in Unix time. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The name of the serving endpoint. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The config that the endpoint is attempting to update to. - PendingConfig types.List `tfsdk:"pending_config" tf:"optional,object"` + PendingConfig types.List `tfsdk:"pending_config"` // The permission level of the principal making the request. - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // Boolean representing if route optimization has been enabled for the // endpoint - RouteOptimized types.Bool `tfsdk:"route_optimized" tf:"optional"` + RouteOptimized types.Bool `tfsdk:"route_optimized"` // Information corresponding to the state of the serving endpoint. - State types.List `tfsdk:"state" tf:"optional,object"` + State types.List `tfsdk:"state"` // Tags attached to the serving endpoint. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The task type of the serving endpoint. - Task types.String `tfsdk:"task" tf:"optional"` + Task types.String `tfsdk:"task"` } func (newState *ServingEndpointDetailed_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointDetailed_SdkV2) { @@ -6635,15 +6824,29 @@ func (newState *ServingEndpointDetailed_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ServingEndpointDetailed_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointDetailed_SdkV2) { } -func (c ServingEndpointDetailed_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ai_gateway")...) - EndpointCoreConfigOutput_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) - ModelDataPlaneInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_plane_info")...) - EndpointPendingConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pending_config")...) - EndpointState_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "state")...) - EndpointTag_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - - return cs +func (c ServingEndpointDetailed_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai_gateway"] = attrs["ai_gateway"].SetOptional() + attrs["ai_gateway"] = attrs["ai_gateway"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config"] = attrs["config"].SetOptional() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["data_plane_info"] = attrs["data_plane_info"].SetOptional() + attrs["data_plane_info"] = attrs["data_plane_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pending_config"] = attrs["pending_config"].SetOptional() + attrs["pending_config"] = attrs["pending_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["route_optimized"] = attrs["route_optimized"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["state"] = attrs["state"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointDetailed. @@ -6881,11 +7084,11 @@ func (o *ServingEndpointDetailed_SdkV2) SetTags(ctx context.Context, v []Endpoin } type ServingEndpointPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ServingEndpointPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointPermission_SdkV2) { @@ -6894,9 +7097,12 @@ func (newState *ServingEndpointPermission_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ServingEndpointPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermission_SdkV2) { } -func (c ServingEndpointPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServingEndpointPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermission. @@ -6965,11 +7171,11 @@ func (o *ServingEndpointPermission_SdkV2) SetInheritedFromObject(ctx context.Con } type ServingEndpointPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ServingEndpointPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointPermissions_SdkV2) { @@ -6978,10 +7184,12 @@ func (newState *ServingEndpointPermissions_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ServingEndpointPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermissions_SdkV2) { } -func (c ServingEndpointPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ServingEndpointPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermissions. @@ -7050,9 +7258,9 @@ func (o *ServingEndpointPermissions_SdkV2) SetAccessControlList(ctx context.Cont } type ServingEndpointPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ServingEndpointPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointPermissionsDescription_SdkV2) { @@ -7061,9 +7269,11 @@ func (newState *ServingEndpointPermissionsDescription_SdkV2) SyncEffectiveFields func (newState *ServingEndpointPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermissionsDescription_SdkV2) { } -func (c ServingEndpointPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServingEndpointPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermissionsDescription. @@ -7100,7 +7310,7 @@ func (o ServingEndpointPermissionsDescription_SdkV2) Type(ctx context.Context) a } type ServingEndpointPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The serving endpoint for which to get or manage permissions. ServingEndpointId types.String `tfsdk:"-"` } @@ -7111,11 +7321,11 @@ func (newState *ServingEndpointPermissionsRequest_SdkV2) SyncEffectiveFieldsDuri func (newState *ServingEndpointPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermissionsRequest_SdkV2) { } -func (c ServingEndpointPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "serving_endpoint_id")...) +func (c ServingEndpointPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["serving_endpoint_id"] = attrs["serving_endpoint_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermissionsRequest. @@ -7183,7 +7393,7 @@ func (o *ServingEndpointPermissionsRequest_SdkV2) SetAccessControlList(ctx conte type TrafficConfig_SdkV2 struct { // The list of routes that define traffic to each served entity. - Routes types.List `tfsdk:"routes" tf:"optional"` + Routes types.List `tfsdk:"routes"` } func (newState *TrafficConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TrafficConfig_SdkV2) { @@ -7192,10 +7402,10 @@ func (newState *TrafficConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *TrafficConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState TrafficConfig_SdkV2) { } -func (c TrafficConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Route_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "routes")...) +func (c TrafficConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["routes"] = attrs["routes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TrafficConfig. @@ -7261,15 +7471,15 @@ func (o *TrafficConfig_SdkV2) SetRoutes(ctx context.Context, v []Route_SdkV2) { type V1ResponseChoiceElement_SdkV2 struct { // The finish reason returned by the endpoint. - FinishReason types.String `tfsdk:"finishReason" tf:"optional"` + FinishReason types.String `tfsdk:"finishReason"` // The index of the choice in the __chat or completions__ response. - Index types.Int64 `tfsdk:"index" tf:"optional"` + Index types.Int64 `tfsdk:"index"` // The logprobs returned only by the __completions__ endpoint. - Logprobs types.Int64 `tfsdk:"logprobs" tf:"optional"` + Logprobs types.Int64 `tfsdk:"logprobs"` // The message response from the __chat__ endpoint. - Message types.List `tfsdk:"message" tf:"optional,object"` + Message types.List `tfsdk:"message"` // The text response from the __completions__ endpoint. - Text types.String `tfsdk:"text" tf:"optional"` + Text types.String `tfsdk:"text"` } func (newState *V1ResponseChoiceElement_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan V1ResponseChoiceElement_SdkV2) { @@ -7278,10 +7488,15 @@ func (newState *V1ResponseChoiceElement_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *V1ResponseChoiceElement_SdkV2) SyncEffectiveFieldsDuringRead(existingState V1ResponseChoiceElement_SdkV2) { } -func (c V1ResponseChoiceElement_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ChatMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "message")...) +func (c V1ResponseChoiceElement_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["finishReason"] = attrs["finishReason"].SetOptional() + attrs["index"] = attrs["index"].SetOptional() + attrs["logprobs"] = attrs["logprobs"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["message"] = attrs["message"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["text"] = attrs["text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in V1ResponseChoiceElement. diff --git a/internal/service/serving_tf/model.go b/internal/service/serving_tf/model.go index 1e6fd5655..7421441ba 100755 --- a/internal/service/serving_tf/model.go +++ b/internal/service/serving_tf/model.go @@ -28,12 +28,12 @@ type Ai21LabsConfig struct { // prefer to paste your API key directly, see `ai21labs_api_key_plaintext`. // You must provide an API key using one of the following fields: // `ai21labs_api_key` or `ai21labs_api_key_plaintext`. - Ai21labsApiKey types.String `tfsdk:"ai21labs_api_key" tf:"optional"` + Ai21labsApiKey types.String `tfsdk:"ai21labs_api_key"` // An AI21 Labs API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `ai21labs_api_key`. You // must provide an API key using one of the following fields: // `ai21labs_api_key` or `ai21labs_api_key_plaintext`. - Ai21labsApiKeyPlaintext types.String `tfsdk:"ai21labs_api_key_plaintext" tf:"optional"` + Ai21labsApiKeyPlaintext types.String `tfsdk:"ai21labs_api_key_plaintext"` } func (newState *Ai21LabsConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ai21LabsConfig) { @@ -42,9 +42,11 @@ func (newState *Ai21LabsConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ai2 func (newState *Ai21LabsConfig) SyncEffectiveFieldsDuringRead(existingState Ai21LabsConfig) { } -func (c Ai21LabsConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Ai21LabsConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai21labs_api_key"] = attrs["ai21labs_api_key"].SetOptional() + attrs["ai21labs_api_key_plaintext"] = attrs["ai21labs_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Ai21LabsConfig. @@ -83,17 +85,17 @@ func (o Ai21LabsConfig) Type(ctx context.Context) attr.Type { type AiGatewayConfig struct { // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails types.Object `tfsdk:"guardrails" tf:"optional,object"` + Guardrails types.Object `tfsdk:"guardrails"` // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig types.Object `tfsdk:"inference_table_config" tf:"optional,object"` + InferenceTableConfig types.Object `tfsdk:"inference_table_config"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig types.Object `tfsdk:"usage_tracking_config" tf:"optional,object"` + UsageTrackingConfig types.Object `tfsdk:"usage_tracking_config"` } func (newState *AiGatewayConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayConfig) { @@ -102,13 +104,13 @@ func (newState *AiGatewayConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ai func (newState *AiGatewayConfig) SyncEffectiveFieldsDuringRead(existingState AiGatewayConfig) { } -func (c AiGatewayConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayGuardrails{}.ApplySchemaCustomizations(cs, append(path, "guardrails")...) - AiGatewayInferenceTableConfig{}.ApplySchemaCustomizations(cs, append(path, "inference_table_config")...) - AiGatewayRateLimit{}.ApplySchemaCustomizations(cs, append(path, "rate_limits")...) - AiGatewayUsageTrackingConfig{}.ApplySchemaCustomizations(cs, append(path, "usage_tracking_config")...) +func (c AiGatewayConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["guardrails"] = attrs["guardrails"].SetOptional() + attrs["inference_table_config"] = attrs["inference_table_config"].SetOptional() + attrs["rate_limits"] = attrs["rate_limits"].SetOptional() + attrs["usage_tracking_config"] = attrs["usage_tracking_config"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayConfig. @@ -268,14 +270,14 @@ func (o *AiGatewayConfig) SetUsageTrackingConfig(ctx context.Context, v AiGatewa type AiGatewayGuardrailParameters struct { // List of invalid keywords. AI guardrail uses keyword or string matching to // decide if the keyword exists in the request or response content. - InvalidKeywords types.List `tfsdk:"invalid_keywords" tf:"optional"` + InvalidKeywords types.List `tfsdk:"invalid_keywords"` // Configuration for guardrail PII filter. - Pii types.Object `tfsdk:"pii" tf:"optional,object"` + Pii types.Object `tfsdk:"pii"` // Indicates whether the safety filter is enabled. - Safety types.Bool `tfsdk:"safety" tf:"optional"` + Safety types.Bool `tfsdk:"safety"` // The list of allowed topics. Given a chat request, this guardrail flags // the request if its topic is not in the allowed topics. - ValidTopics types.List `tfsdk:"valid_topics" tf:"optional"` + ValidTopics types.List `tfsdk:"valid_topics"` } func (newState *AiGatewayGuardrailParameters) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayGuardrailParameters) { @@ -284,10 +286,13 @@ func (newState *AiGatewayGuardrailParameters) SyncEffectiveFieldsDuringCreateOrU func (newState *AiGatewayGuardrailParameters) SyncEffectiveFieldsDuringRead(existingState AiGatewayGuardrailParameters) { } -func (c AiGatewayGuardrailParameters) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayGuardrailPiiBehavior{}.ApplySchemaCustomizations(cs, append(path, "pii")...) +func (c AiGatewayGuardrailParameters) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["invalid_keywords"] = attrs["invalid_keywords"].SetOptional() + attrs["pii"] = attrs["pii"].SetOptional() + attrs["safety"] = attrs["safety"].SetOptional() + attrs["valid_topics"] = attrs["valid_topics"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayGuardrailParameters. @@ -422,7 +427,7 @@ type AiGatewayGuardrailPiiBehavior struct { // 'BLOCK' is set for the output guardrail and the model response contains // PII, the PII info in the response is redacted and 400 status code is // returned. - Behavior types.String `tfsdk:"behavior" tf:""` + Behavior types.String `tfsdk:"behavior"` } func (newState *AiGatewayGuardrailPiiBehavior) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayGuardrailPiiBehavior) { @@ -431,10 +436,10 @@ func (newState *AiGatewayGuardrailPiiBehavior) SyncEffectiveFieldsDuringCreateOr func (newState *AiGatewayGuardrailPiiBehavior) SyncEffectiveFieldsDuringRead(existingState AiGatewayGuardrailPiiBehavior) { } -func (c AiGatewayGuardrailPiiBehavior) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "behavior")...) +func (c AiGatewayGuardrailPiiBehavior) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["behavior"] = attrs["behavior"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayGuardrailPiiBehavior. @@ -470,9 +475,9 @@ func (o AiGatewayGuardrailPiiBehavior) Type(ctx context.Context) attr.Type { type AiGatewayGuardrails struct { // Configuration for input guardrail filters. - Input types.Object `tfsdk:"input" tf:"optional,object"` + Input types.Object `tfsdk:"input"` // Configuration for output guardrail filters. - Output types.Object `tfsdk:"output" tf:"optional,object"` + Output types.Object `tfsdk:"output"` } func (newState *AiGatewayGuardrails) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayGuardrails) { @@ -481,11 +486,11 @@ func (newState *AiGatewayGuardrails) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AiGatewayGuardrails) SyncEffectiveFieldsDuringRead(existingState AiGatewayGuardrails) { } -func (c AiGatewayGuardrails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayGuardrailParameters{}.ApplySchemaCustomizations(cs, append(path, "input")...) - AiGatewayGuardrailParameters{}.ApplySchemaCustomizations(cs, append(path, "output")...) +func (c AiGatewayGuardrails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["input"] = attrs["input"].SetOptional() + attrs["output"] = attrs["output"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayGuardrails. @@ -584,16 +589,16 @@ type AiGatewayInferenceTableConfig struct { // The name of the catalog in Unity Catalog. Required when enabling // inference tables. NOTE: On update, you have to disable inference table // first in order to change the catalog name. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // Indicates whether the inference table is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the schema in Unity Catalog. Required when enabling inference // tables. NOTE: On update, you have to disable inference table first in // order to change the schema name. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The prefix of the table in Unity Catalog. NOTE: On update, you have to // disable inference table first in order to change the prefix name. - TableNamePrefix types.String `tfsdk:"table_name_prefix" tf:"optional"` + TableNamePrefix types.String `tfsdk:"table_name_prefix"` } func (newState *AiGatewayInferenceTableConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayInferenceTableConfig) { @@ -602,9 +607,13 @@ func (newState *AiGatewayInferenceTableConfig) SyncEffectiveFieldsDuringCreateOr func (newState *AiGatewayInferenceTableConfig) SyncEffectiveFieldsDuringRead(existingState AiGatewayInferenceTableConfig) { } -func (c AiGatewayInferenceTableConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AiGatewayInferenceTableConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["table_name_prefix"] = attrs["table_name_prefix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayInferenceTableConfig. @@ -647,13 +656,13 @@ func (o AiGatewayInferenceTableConfig) Type(ctx context.Context) attr.Type { type AiGatewayRateLimit struct { // Used to specify how many calls are allowed for a key within the // renewal_period. - Calls types.Int64 `tfsdk:"calls" tf:""` + Calls types.Int64 `tfsdk:"calls"` // Key field for a rate limit. Currently, only 'user' and 'endpoint' are // supported, with 'endpoint' being the default if not specified. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Renewal period field for a rate limit. Currently, only 'minute' is // supported. - RenewalPeriod types.String `tfsdk:"renewal_period" tf:""` + RenewalPeriod types.String `tfsdk:"renewal_period"` } func (newState *AiGatewayRateLimit) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayRateLimit) { @@ -662,11 +671,12 @@ func (newState *AiGatewayRateLimit) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AiGatewayRateLimit) SyncEffectiveFieldsDuringRead(existingState AiGatewayRateLimit) { } -func (c AiGatewayRateLimit) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "calls")...) - cs.SetRequired(append(path, "renewal_period")...) +func (c AiGatewayRateLimit) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["calls"] = attrs["calls"].SetRequired() + attrs["key"] = attrs["key"].SetOptional() + attrs["renewal_period"] = attrs["renewal_period"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayRateLimit. @@ -706,7 +716,7 @@ func (o AiGatewayRateLimit) Type(ctx context.Context) attr.Type { type AiGatewayUsageTrackingConfig struct { // Whether to enable usage tracking. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` } func (newState *AiGatewayUsageTrackingConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan AiGatewayUsageTrackingConfig) { @@ -715,9 +725,10 @@ func (newState *AiGatewayUsageTrackingConfig) SyncEffectiveFieldsDuringCreateOrU func (newState *AiGatewayUsageTrackingConfig) SyncEffectiveFieldsDuringRead(existingState AiGatewayUsageTrackingConfig) { } -func (c AiGatewayUsageTrackingConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AiGatewayUsageTrackingConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AiGatewayUsageTrackingConfig. @@ -757,32 +768,32 @@ type AmazonBedrockConfig struct { // your API key directly, see `aws_access_key_id`. You must provide an API // key using one of the following fields: `aws_access_key_id` or // `aws_access_key_id_plaintext`. - AwsAccessKeyId types.String `tfsdk:"aws_access_key_id" tf:"optional"` + AwsAccessKeyId types.String `tfsdk:"aws_access_key_id"` // An AWS access key ID with permissions to interact with Bedrock services // provided as a plaintext string. If you prefer to reference your key using // Databricks Secrets, see `aws_access_key_id`. You must provide an API key // using one of the following fields: `aws_access_key_id` or // `aws_access_key_id_plaintext`. - AwsAccessKeyIdPlaintext types.String `tfsdk:"aws_access_key_id_plaintext" tf:"optional"` + AwsAccessKeyIdPlaintext types.String `tfsdk:"aws_access_key_id_plaintext"` // The AWS region to use. Bedrock has to be enabled there. - AwsRegion types.String `tfsdk:"aws_region" tf:""` + AwsRegion types.String `tfsdk:"aws_region"` // The Databricks secret key reference for an AWS secret access key paired // with the access key ID, with permissions to interact with Bedrock // services. If you prefer to paste your API key directly, see // `aws_secret_access_key_plaintext`. You must provide an API key using one // of the following fields: `aws_secret_access_key` or // `aws_secret_access_key_plaintext`. - AwsSecretAccessKey types.String `tfsdk:"aws_secret_access_key" tf:"optional"` + AwsSecretAccessKey types.String `tfsdk:"aws_secret_access_key"` // An AWS secret access key paired with the access key ID, with permissions // to interact with Bedrock services provided as a plaintext string. If you // prefer to reference your key using Databricks Secrets, see // `aws_secret_access_key`. You must provide an API key using one of the // following fields: `aws_secret_access_key` or // `aws_secret_access_key_plaintext`. - AwsSecretAccessKeyPlaintext types.String `tfsdk:"aws_secret_access_key_plaintext" tf:"optional"` + AwsSecretAccessKeyPlaintext types.String `tfsdk:"aws_secret_access_key_plaintext"` // The underlying provider in Amazon Bedrock. Supported values (case // insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. - BedrockProvider types.String `tfsdk:"bedrock_provider" tf:""` + BedrockProvider types.String `tfsdk:"bedrock_provider"` } func (newState *AmazonBedrockConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan AmazonBedrockConfig) { @@ -791,11 +802,15 @@ func (newState *AmazonBedrockConfig) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AmazonBedrockConfig) SyncEffectiveFieldsDuringRead(existingState AmazonBedrockConfig) { } -func (c AmazonBedrockConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aws_region")...) - cs.SetRequired(append(path, "bedrock_provider")...) +func (c AmazonBedrockConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_access_key_id"] = attrs["aws_access_key_id"].SetOptional() + attrs["aws_access_key_id_plaintext"] = attrs["aws_access_key_id_plaintext"].SetOptional() + attrs["aws_region"] = attrs["aws_region"].SetRequired() + attrs["aws_secret_access_key"] = attrs["aws_secret_access_key"].SetOptional() + attrs["aws_secret_access_key_plaintext"] = attrs["aws_secret_access_key_plaintext"].SetOptional() + attrs["bedrock_provider"] = attrs["bedrock_provider"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AmazonBedrockConfig. @@ -844,12 +859,12 @@ type AnthropicConfig struct { // prefer to paste your API key directly, see `anthropic_api_key_plaintext`. // You must provide an API key using one of the following fields: // `anthropic_api_key` or `anthropic_api_key_plaintext`. - AnthropicApiKey types.String `tfsdk:"anthropic_api_key" tf:"optional"` + AnthropicApiKey types.String `tfsdk:"anthropic_api_key"` // The Anthropic API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `anthropic_api_key`. You // must provide an API key using one of the following fields: // `anthropic_api_key` or `anthropic_api_key_plaintext`. - AnthropicApiKeyPlaintext types.String `tfsdk:"anthropic_api_key_plaintext" tf:"optional"` + AnthropicApiKeyPlaintext types.String `tfsdk:"anthropic_api_key_plaintext"` } func (newState *AnthropicConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan AnthropicConfig) { @@ -858,9 +873,11 @@ func (newState *AnthropicConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan An func (newState *AnthropicConfig) SyncEffectiveFieldsDuringRead(existingState AnthropicConfig) { } -func (c AnthropicConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AnthropicConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["anthropic_api_key"] = attrs["anthropic_api_key"].SetOptional() + attrs["anthropic_api_key_plaintext"] = attrs["anthropic_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AnthropicConfig. @@ -899,15 +916,15 @@ func (o AnthropicConfig) Type(ctx context.Context) attr.Type { type AutoCaptureConfigInput struct { // The name of the catalog in Unity Catalog. NOTE: On update, you cannot // change the catalog name if the inference table is already enabled. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // Indicates whether the inference table is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the schema in Unity Catalog. NOTE: On update, you cannot // change the schema name if the inference table is already enabled. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` // The prefix of the table in Unity Catalog. NOTE: On update, you cannot // change the prefix name if the inference table is already enabled. - TableNamePrefix types.String `tfsdk:"table_name_prefix" tf:"optional"` + TableNamePrefix types.String `tfsdk:"table_name_prefix"` } func (newState *AutoCaptureConfigInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoCaptureConfigInput) { @@ -916,9 +933,13 @@ func (newState *AutoCaptureConfigInput) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *AutoCaptureConfigInput) SyncEffectiveFieldsDuringRead(existingState AutoCaptureConfigInput) { } -func (c AutoCaptureConfigInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AutoCaptureConfigInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["table_name_prefix"] = attrs["table_name_prefix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoCaptureConfigInput. @@ -960,15 +981,15 @@ func (o AutoCaptureConfigInput) Type(ctx context.Context) attr.Type { type AutoCaptureConfigOutput struct { // The name of the catalog in Unity Catalog. - CatalogName types.String `tfsdk:"catalog_name" tf:"optional"` + CatalogName types.String `tfsdk:"catalog_name"` // Indicates whether the inference table is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The name of the schema in Unity Catalog. - SchemaName types.String `tfsdk:"schema_name" tf:"optional"` + SchemaName types.String `tfsdk:"schema_name"` - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The prefix of the table in Unity Catalog. - TableNamePrefix types.String `tfsdk:"table_name_prefix" tf:"optional"` + TableNamePrefix types.String `tfsdk:"table_name_prefix"` } func (newState *AutoCaptureConfigOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoCaptureConfigOutput) { @@ -977,10 +998,14 @@ func (newState *AutoCaptureConfigOutput) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AutoCaptureConfigOutput) SyncEffectiveFieldsDuringRead(existingState AutoCaptureConfigOutput) { } -func (c AutoCaptureConfigOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureState{}.ApplySchemaCustomizations(cs, append(path, "state")...) +func (c AutoCaptureConfigOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["schema_name"] = attrs["schema_name"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["table_name_prefix"] = attrs["table_name_prefix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoCaptureConfigOutput. @@ -1053,7 +1078,7 @@ func (o *AutoCaptureConfigOutput) SetState(ctx context.Context, v AutoCaptureSta } type AutoCaptureState struct { - PayloadTable types.Object `tfsdk:"payload_table" tf:"optional,object"` + PayloadTable types.Object `tfsdk:"payload_table"` } func (newState *AutoCaptureState) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutoCaptureState) { @@ -1062,10 +1087,10 @@ func (newState *AutoCaptureState) SyncEffectiveFieldsDuringCreateOrUpdate(plan A func (newState *AutoCaptureState) SyncEffectiveFieldsDuringRead(existingState AutoCaptureState) { } -func (c AutoCaptureState) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PayloadTable{}.ApplySchemaCustomizations(cs, append(path, "payload_table")...) +func (c AutoCaptureState) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["payload_table"] = attrs["payload_table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutoCaptureState. @@ -1174,7 +1199,7 @@ func (o BuildLogsRequest) Type(ctx context.Context) attr.Type { type BuildLogsResponse struct { // The logs associated with building the served entity's environment. - Logs types.String `tfsdk:"logs" tf:""` + Logs types.String `tfsdk:"logs"` } func (newState *BuildLogsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan BuildLogsResponse) { @@ -1183,10 +1208,10 @@ func (newState *BuildLogsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *BuildLogsResponse) SyncEffectiveFieldsDuringRead(existingState BuildLogsResponse) { } -func (c BuildLogsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "logs")...) +func (c BuildLogsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["logs"] = attrs["logs"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BuildLogsResponse. @@ -1222,9 +1247,9 @@ func (o BuildLogsResponse) Type(ctx context.Context) attr.Type { type ChatMessage struct { // The content of the message. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // The role of the message. One of [system, user, assistant]. - Role types.String `tfsdk:"role" tf:"optional"` + Role types.String `tfsdk:"role"` } func (newState *ChatMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChatMessage) { @@ -1233,9 +1258,11 @@ func (newState *ChatMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChatMe func (newState *ChatMessage) SyncEffectiveFieldsDuringRead(existingState ChatMessage) { } -func (c ChatMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ChatMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["role"] = attrs["role"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChatMessage. @@ -1274,17 +1301,17 @@ func (o ChatMessage) Type(ctx context.Context) attr.Type { type CohereConfig struct { // This is an optional field to provide a customized base URL for the Cohere // API. If left unspecified, the standard Cohere base URL is used. - CohereApiBase types.String `tfsdk:"cohere_api_base" tf:"optional"` + CohereApiBase types.String `tfsdk:"cohere_api_base"` // The Databricks secret key reference for a Cohere API key. If you prefer // to paste your API key directly, see `cohere_api_key_plaintext`. You must // provide an API key using one of the following fields: `cohere_api_key` or // `cohere_api_key_plaintext`. - CohereApiKey types.String `tfsdk:"cohere_api_key" tf:"optional"` + CohereApiKey types.String `tfsdk:"cohere_api_key"` // The Cohere API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `cohere_api_key`. You // must provide an API key using one of the following fields: // `cohere_api_key` or `cohere_api_key_plaintext`. - CohereApiKeyPlaintext types.String `tfsdk:"cohere_api_key_plaintext" tf:"optional"` + CohereApiKeyPlaintext types.String `tfsdk:"cohere_api_key_plaintext"` } func (newState *CohereConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan CohereConfig) { @@ -1293,9 +1320,12 @@ func (newState *CohereConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Coher func (newState *CohereConfig) SyncEffectiveFieldsDuringRead(existingState CohereConfig) { } -func (c CohereConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CohereConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cohere_api_base"] = attrs["cohere_api_base"].SetOptional() + attrs["cohere_api_key"] = attrs["cohere_api_key"].SetOptional() + attrs["cohere_api_key_plaintext"] = attrs["cohere_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CohereConfig. @@ -1336,21 +1366,21 @@ func (o CohereConfig) Type(ctx context.Context) attr.Type { type CreateServingEndpoint struct { // The AI Gateway configuration for the serving endpoint. NOTE: only // external model endpoints are supported as of now. - AiGateway types.Object `tfsdk:"ai_gateway" tf:"optional,object"` + AiGateway types.Object `tfsdk:"ai_gateway"` // The core config of the serving endpoint. - Config types.Object `tfsdk:"config" tf:"object"` + Config types.Object `tfsdk:"config"` // The name of the serving endpoint. This field is required and must be // unique across a Databricks workspace. An endpoint name can consist of // alphanumeric characters, dashes, and underscores. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Rate limits to be applied to the serving endpoint. NOTE: this field is // deprecated, please use AI Gateway to manage rate limits. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Enable route optimization for the serving endpoint. - RouteOptimized types.Bool `tfsdk:"route_optimized" tf:"optional"` + RouteOptimized types.Bool `tfsdk:"route_optimized"` // Tags to be attached to the serving endpoint and automatically propagated // to billing logs. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *CreateServingEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateServingEndpoint) { @@ -1359,15 +1389,15 @@ func (newState *CreateServingEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateServingEndpoint) SyncEffectiveFieldsDuringRead(existingState CreateServingEndpoint) { } -func (c CreateServingEndpoint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayConfig{}.ApplySchemaCustomizations(cs, append(path, "ai_gateway")...) - cs.SetRequired(append(path, "config")...) - EndpointCoreConfigInput{}.ApplySchemaCustomizations(cs, append(path, "config")...) - cs.SetRequired(append(path, "name")...) - RateLimit{}.ApplySchemaCustomizations(cs, append(path, "rate_limits")...) - EndpointTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateServingEndpoint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai_gateway"] = attrs["ai_gateway"].SetOptional() + attrs["config"] = attrs["config"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["rate_limits"] = attrs["rate_limits"].SetOptional() + attrs["route_optimized"] = attrs["route_optimized"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateServingEndpoint. @@ -1535,17 +1565,17 @@ type DatabricksModelServingConfig struct { // to paste your API key directly, see `databricks_api_token_plaintext`. You // must provide an API key using one of the following fields: // `databricks_api_token` or `databricks_api_token_plaintext`. - DatabricksApiToken types.String `tfsdk:"databricks_api_token" tf:"optional"` + DatabricksApiToken types.String `tfsdk:"databricks_api_token"` // The Databricks API token that corresponds to a user or service principal // with Can Query access to the model serving endpoint pointed to by this // external model provided as a plaintext string. If you prefer to reference // your key using Databricks Secrets, see `databricks_api_token`. You must // provide an API key using one of the following fields: // `databricks_api_token` or `databricks_api_token_plaintext`. - DatabricksApiTokenPlaintext types.String `tfsdk:"databricks_api_token_plaintext" tf:"optional"` + DatabricksApiTokenPlaintext types.String `tfsdk:"databricks_api_token_plaintext"` // The URL of the Databricks workspace containing the model serving endpoint // pointed to by this external model. - DatabricksWorkspaceUrl types.String `tfsdk:"databricks_workspace_url" tf:""` + DatabricksWorkspaceUrl types.String `tfsdk:"databricks_workspace_url"` } func (newState *DatabricksModelServingConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan DatabricksModelServingConfig) { @@ -1554,10 +1584,12 @@ func (newState *DatabricksModelServingConfig) SyncEffectiveFieldsDuringCreateOrU func (newState *DatabricksModelServingConfig) SyncEffectiveFieldsDuringRead(existingState DatabricksModelServingConfig) { } -func (c DatabricksModelServingConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "databricks_workspace_url")...) +func (c DatabricksModelServingConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["databricks_api_token"] = attrs["databricks_api_token"].SetOptional() + attrs["databricks_api_token_plaintext"] = attrs["databricks_api_token_plaintext"].SetOptional() + attrs["databricks_workspace_url"] = attrs["databricks_workspace_url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DatabricksModelServingConfig. @@ -1596,11 +1628,11 @@ func (o DatabricksModelServingConfig) Type(ctx context.Context) attr.Type { } type DataframeSplitInput struct { - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` - Data types.List `tfsdk:"data" tf:"optional"` + Data types.List `tfsdk:"data"` - Index types.List `tfsdk:"index" tf:"optional"` + Index types.List `tfsdk:"index"` } func (newState *DataframeSplitInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataframeSplitInput) { @@ -1609,9 +1641,12 @@ func (newState *DataframeSplitInput) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *DataframeSplitInput) SyncEffectiveFieldsDuringRead(existingState DataframeSplitInput) { } -func (c DataframeSplitInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataframeSplitInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() + attrs["index"] = attrs["index"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataframeSplitInput. @@ -1805,11 +1840,11 @@ func (o DeleteServingEndpointRequest) Type(ctx context.Context) attr.Type { } type EmbeddingsV1ResponseEmbeddingElement struct { - Embedding types.List `tfsdk:"embedding" tf:"optional"` + Embedding types.List `tfsdk:"embedding"` // The index of the embedding in the response. - Index types.Int64 `tfsdk:"index" tf:"optional"` + Index types.Int64 `tfsdk:"index"` // This will always be 'embedding'. - Object types.String `tfsdk:"object" tf:"optional"` + Object types.String `tfsdk:"object"` } func (newState *EmbeddingsV1ResponseEmbeddingElement) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmbeddingsV1ResponseEmbeddingElement) { @@ -1818,9 +1853,12 @@ func (newState *EmbeddingsV1ResponseEmbeddingElement) SyncEffectiveFieldsDuringC func (newState *EmbeddingsV1ResponseEmbeddingElement) SyncEffectiveFieldsDuringRead(existingState EmbeddingsV1ResponseEmbeddingElement) { } -func (c EmbeddingsV1ResponseEmbeddingElement) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmbeddingsV1ResponseEmbeddingElement) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding"] = attrs["embedding"].SetOptional() + attrs["index"] = attrs["index"].SetOptional() + attrs["object"] = attrs["object"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmbeddingsV1ResponseEmbeddingElement. @@ -1891,18 +1929,18 @@ func (o *EmbeddingsV1ResponseEmbeddingElement) SetEmbedding(ctx context.Context, type EndpointCoreConfigInput struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. - AutoCaptureConfig types.Object `tfsdk:"auto_capture_config" tf:"optional,object"` + AutoCaptureConfig types.Object `tfsdk:"auto_capture_config"` // The name of the serving endpoint to update. This field is required. Name types.String `tfsdk:"-"` // A list of served entities for the endpoint to serve. A serving endpoint // can have up to 15 served entities. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) A list of served models for the // endpoint to serve. A serving endpoint can have up to 15 served models. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` // The traffic config defining how invocations to the serving endpoint // should be routed. - TrafficConfig types.Object `tfsdk:"traffic_config" tf:"optional,object"` + TrafficConfig types.Object `tfsdk:"traffic_config"` } func (newState *EndpointCoreConfigInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointCoreConfigInput) { @@ -1911,14 +1949,14 @@ func (newState *EndpointCoreConfigInput) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *EndpointCoreConfigInput) SyncEffectiveFieldsDuringRead(existingState EndpointCoreConfigInput) { } -func (c EndpointCoreConfigInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureConfigInput{}.ApplySchemaCustomizations(cs, append(path, "auto_capture_config")...) - cs.SetRequired(append(path, "name")...) - ServedEntityInput{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelInput{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) - TrafficConfig{}.ApplySchemaCustomizations(cs, append(path, "traffic_config")...) +func (c EndpointCoreConfigInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_capture_config"] = attrs["auto_capture_config"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointCoreConfigInput. @@ -2080,16 +2118,16 @@ func (o *EndpointCoreConfigInput) SetTrafficConfig(ctx context.Context, v Traffi type EndpointCoreConfigOutput struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. - AutoCaptureConfig types.Object `tfsdk:"auto_capture_config" tf:"optional,object"` + AutoCaptureConfig types.Object `tfsdk:"auto_capture_config"` // The config version that the serving endpoint is currently serving. - ConfigVersion types.Int64 `tfsdk:"config_version" tf:"optional"` + ConfigVersion types.Int64 `tfsdk:"config_version"` // The list of served entities under the serving endpoint config. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` // The traffic configuration associated with the serving endpoint config. - TrafficConfig types.Object `tfsdk:"traffic_config" tf:"optional,object"` + TrafficConfig types.Object `tfsdk:"traffic_config"` } func (newState *EndpointCoreConfigOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointCoreConfigOutput) { @@ -2098,13 +2136,14 @@ func (newState *EndpointCoreConfigOutput) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *EndpointCoreConfigOutput) SyncEffectiveFieldsDuringRead(existingState EndpointCoreConfigOutput) { } -func (c EndpointCoreConfigOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureConfigOutput{}.ApplySchemaCustomizations(cs, append(path, "auto_capture_config")...) - ServedEntityOutput{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelOutput{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) - TrafficConfig{}.ApplySchemaCustomizations(cs, append(path, "traffic_config")...) +func (c EndpointCoreConfigOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_capture_config"] = attrs["auto_capture_config"].SetOptional() + attrs["config_version"] = attrs["config_version"].SetOptional() + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointCoreConfigOutput. @@ -2265,10 +2304,10 @@ func (o *EndpointCoreConfigOutput) SetTrafficConfig(ctx context.Context, v Traff type EndpointCoreConfigSummary struct { // The list of served entities under the serving endpoint config. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) The list of served models under // the serving endpoint config. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` } func (newState *EndpointCoreConfigSummary) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointCoreConfigSummary) { @@ -2277,11 +2316,11 @@ func (newState *EndpointCoreConfigSummary) SyncEffectiveFieldsDuringCreateOrUpda func (newState *EndpointCoreConfigSummary) SyncEffectiveFieldsDuringRead(existingState EndpointCoreConfigSummary) { } -func (c EndpointCoreConfigSummary) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServedEntitySpec{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelSpec{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) +func (c EndpointCoreConfigSummary) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointCoreConfigSummary. @@ -2379,20 +2418,20 @@ func (o *EndpointCoreConfigSummary) SetServedModels(ctx context.Context, v []Ser type EndpointPendingConfig struct { // Configuration for Inference Tables which automatically logs requests and // responses to Unity Catalog. - AutoCaptureConfig types.Object `tfsdk:"auto_capture_config" tf:"optional,object"` + AutoCaptureConfig types.Object `tfsdk:"auto_capture_config"` // The config version that the serving endpoint is currently serving. - ConfigVersion types.Int64 `tfsdk:"config_version" tf:"optional"` + ConfigVersion types.Int64 `tfsdk:"config_version"` // The list of served entities belonging to the last issued update to the // serving endpoint. - ServedEntities types.List `tfsdk:"served_entities" tf:"optional"` + ServedEntities types.List `tfsdk:"served_entities"` // (Deprecated, use served_entities instead) The list of served models // belonging to the last issued update to the serving endpoint. - ServedModels types.List `tfsdk:"served_models" tf:"optional"` + ServedModels types.List `tfsdk:"served_models"` // The timestamp when the update to the pending config started. - StartTime types.Int64 `tfsdk:"start_time" tf:"optional"` + StartTime types.Int64 `tfsdk:"start_time"` // The traffic config defining how invocations to the serving endpoint // should be routed. - TrafficConfig types.Object `tfsdk:"traffic_config" tf:"optional,object"` + TrafficConfig types.Object `tfsdk:"traffic_config"` } func (newState *EndpointPendingConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointPendingConfig) { @@ -2401,13 +2440,15 @@ func (newState *EndpointPendingConfig) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *EndpointPendingConfig) SyncEffectiveFieldsDuringRead(existingState EndpointPendingConfig) { } -func (c EndpointPendingConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AutoCaptureConfigOutput{}.ApplySchemaCustomizations(cs, append(path, "auto_capture_config")...) - ServedEntityOutput{}.ApplySchemaCustomizations(cs, append(path, "served_entities")...) - ServedModelOutput{}.ApplySchemaCustomizations(cs, append(path, "served_models")...) - TrafficConfig{}.ApplySchemaCustomizations(cs, append(path, "traffic_config")...) +func (c EndpointPendingConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_capture_config"] = attrs["auto_capture_config"].SetOptional() + attrs["config_version"] = attrs["config_version"].SetOptional() + attrs["served_entities"] = attrs["served_entities"].SetOptional() + attrs["served_models"] = attrs["served_models"].SetOptional() + attrs["start_time"] = attrs["start_time"].SetOptional() + attrs["traffic_config"] = attrs["traffic_config"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointPendingConfig. @@ -2574,12 +2615,12 @@ type EndpointState struct { // update in progress. Note that if the endpoint's config_update state value // is IN_PROGRESS, another update can not be made until the update completes // or fails." - ConfigUpdate types.String `tfsdk:"config_update" tf:"optional"` + ConfigUpdate types.String `tfsdk:"config_update"` // The state of an endpoint, indicating whether or not the endpoint is // queryable. An endpoint is READY if all of the served entities in its // active configuration are ready. If any of the actively served entities // are in a non-ready state, the endpoint state will be NOT_READY. - Ready types.String `tfsdk:"ready" tf:"optional"` + Ready types.String `tfsdk:"ready"` } func (newState *EndpointState) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointState) { @@ -2588,9 +2629,11 @@ func (newState *EndpointState) SyncEffectiveFieldsDuringCreateOrUpdate(plan Endp func (newState *EndpointState) SyncEffectiveFieldsDuringRead(existingState EndpointState) { } -func (c EndpointState) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointState) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config_update"] = attrs["config_update"].SetOptional() + attrs["ready"] = attrs["ready"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointState. @@ -2628,9 +2671,9 @@ func (o EndpointState) Type(ctx context.Context) attr.Type { type EndpointTag struct { // Key field for a serving endpoint tag. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // Optional value field for a serving endpoint tag. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *EndpointTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointTag) { @@ -2639,10 +2682,11 @@ func (newState *EndpointTag) SyncEffectiveFieldsDuringCreateOrUpdate(plan Endpoi func (newState *EndpointTag) SyncEffectiveFieldsDuringRead(existingState EndpointTag) { } -func (c EndpointTag) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) +func (c EndpointTag) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointTag. @@ -2753,32 +2797,32 @@ func (o ExportMetricsResponse) Type(ctx context.Context) attr.Type { type ExternalModel struct { // AI21Labs Config. Only required if the provider is 'ai21labs'. - Ai21labsConfig types.Object `tfsdk:"ai21labs_config" tf:"optional,object"` + Ai21labsConfig types.Object `tfsdk:"ai21labs_config"` // Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. - AmazonBedrockConfig types.Object `tfsdk:"amazon_bedrock_config" tf:"optional,object"` + AmazonBedrockConfig types.Object `tfsdk:"amazon_bedrock_config"` // Anthropic Config. Only required if the provider is 'anthropic'. - AnthropicConfig types.Object `tfsdk:"anthropic_config" tf:"optional,object"` + AnthropicConfig types.Object `tfsdk:"anthropic_config"` // Cohere Config. Only required if the provider is 'cohere'. - CohereConfig types.Object `tfsdk:"cohere_config" tf:"optional,object"` + CohereConfig types.Object `tfsdk:"cohere_config"` // Databricks Model Serving Config. Only required if the provider is // 'databricks-model-serving'. - DatabricksModelServingConfig types.Object `tfsdk:"databricks_model_serving_config" tf:"optional,object"` + DatabricksModelServingConfig types.Object `tfsdk:"databricks_model_serving_config"` // Google Cloud Vertex AI Config. Only required if the provider is // 'google-cloud-vertex-ai'. - GoogleCloudVertexAiConfig types.Object `tfsdk:"google_cloud_vertex_ai_config" tf:"optional,object"` + GoogleCloudVertexAiConfig types.Object `tfsdk:"google_cloud_vertex_ai_config"` // The name of the external model. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // OpenAI Config. Only required if the provider is 'openai'. - OpenaiConfig types.Object `tfsdk:"openai_config" tf:"optional,object"` + OpenaiConfig types.Object `tfsdk:"openai_config"` // PaLM Config. Only required if the provider is 'palm'. - PalmConfig types.Object `tfsdk:"palm_config" tf:"optional,object"` + PalmConfig types.Object `tfsdk:"palm_config"` // The name of the provider for the external model. Currently, the supported // providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', // 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', and // 'palm'.", - Provider types.String `tfsdk:"provider" tf:""` + Provider types.String `tfsdk:"provider"` // The task type of the external model. - Task types.String `tfsdk:"task" tf:""` + Task types.String `tfsdk:"task"` } func (newState *ExternalModel) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalModel) { @@ -2787,20 +2831,20 @@ func (newState *ExternalModel) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exte func (newState *ExternalModel) SyncEffectiveFieldsDuringRead(existingState ExternalModel) { } -func (c ExternalModel) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Ai21LabsConfig{}.ApplySchemaCustomizations(cs, append(path, "ai21labs_config")...) - AmazonBedrockConfig{}.ApplySchemaCustomizations(cs, append(path, "amazon_bedrock_config")...) - AnthropicConfig{}.ApplySchemaCustomizations(cs, append(path, "anthropic_config")...) - CohereConfig{}.ApplySchemaCustomizations(cs, append(path, "cohere_config")...) - DatabricksModelServingConfig{}.ApplySchemaCustomizations(cs, append(path, "databricks_model_serving_config")...) - GoogleCloudVertexAiConfig{}.ApplySchemaCustomizations(cs, append(path, "google_cloud_vertex_ai_config")...) - cs.SetRequired(append(path, "name")...) - OpenAiConfig{}.ApplySchemaCustomizations(cs, append(path, "openai_config")...) - PaLmConfig{}.ApplySchemaCustomizations(cs, append(path, "palm_config")...) - cs.SetRequired(append(path, "provider")...) - cs.SetRequired(append(path, "task")...) +func (c ExternalModel) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai21labs_config"] = attrs["ai21labs_config"].SetOptional() + attrs["amazon_bedrock_config"] = attrs["amazon_bedrock_config"].SetOptional() + attrs["anthropic_config"] = attrs["anthropic_config"].SetOptional() + attrs["cohere_config"] = attrs["cohere_config"].SetOptional() + attrs["databricks_model_serving_config"] = attrs["databricks_model_serving_config"].SetOptional() + attrs["google_cloud_vertex_ai_config"] = attrs["google_cloud_vertex_ai_config"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["openai_config"] = attrs["openai_config"].SetOptional() + attrs["palm_config"] = attrs["palm_config"].SetOptional() + attrs["provider"] = attrs["provider"].SetRequired() + attrs["task"] = attrs["task"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalModel. @@ -3089,11 +3133,11 @@ func (o *ExternalModel) SetPalmConfig(ctx context.Context, v PaLmConfig) { type ExternalModelUsageElement struct { // The number of tokens in the chat/completions response. - CompletionTokens types.Int64 `tfsdk:"completion_tokens" tf:"optional"` + CompletionTokens types.Int64 `tfsdk:"completion_tokens"` // The number of tokens in the prompt. - PromptTokens types.Int64 `tfsdk:"prompt_tokens" tf:"optional"` + PromptTokens types.Int64 `tfsdk:"prompt_tokens"` // The total number of tokens in the prompt and response. - TotalTokens types.Int64 `tfsdk:"total_tokens" tf:"optional"` + TotalTokens types.Int64 `tfsdk:"total_tokens"` } func (newState *ExternalModelUsageElement) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalModelUsageElement) { @@ -3102,9 +3146,12 @@ func (newState *ExternalModelUsageElement) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ExternalModelUsageElement) SyncEffectiveFieldsDuringRead(existingState ExternalModelUsageElement) { } -func (c ExternalModelUsageElement) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExternalModelUsageElement) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["completion_tokens"] = attrs["completion_tokens"].SetOptional() + attrs["prompt_tokens"] = attrs["prompt_tokens"].SetOptional() + attrs["total_tokens"] = attrs["total_tokens"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalModelUsageElement. @@ -3144,13 +3191,13 @@ func (o ExternalModelUsageElement) Type(ctx context.Context) attr.Type { type FoundationModel struct { // The description of the foundation model. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The display name of the foundation model. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The URL to the documentation of the foundation model. - Docs types.String `tfsdk:"docs" tf:"optional"` + Docs types.String `tfsdk:"docs"` // The name of the foundation model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *FoundationModel) SyncEffectiveFieldsDuringCreateOrUpdate(plan FoundationModel) { @@ -3159,9 +3206,13 @@ func (newState *FoundationModel) SyncEffectiveFieldsDuringCreateOrUpdate(plan Fo func (newState *FoundationModel) SyncEffectiveFieldsDuringRead(existingState FoundationModel) { } -func (c FoundationModel) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c FoundationModel) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["docs"] = attrs["docs"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FoundationModel. @@ -3310,7 +3361,7 @@ func (o GetServingEndpointPermissionLevelsRequest) Type(ctx context.Context) att type GetServingEndpointPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetServingEndpointPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetServingEndpointPermissionLevelsResponse) { @@ -3319,10 +3370,10 @@ func (newState *GetServingEndpointPermissionLevelsResponse) SyncEffectiveFieldsD func (newState *GetServingEndpointPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetServingEndpointPermissionLevelsResponse) { } -func (c GetServingEndpointPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetServingEndpointPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetServingEndpointPermissionLevelsResponse. @@ -3469,7 +3520,7 @@ type GoogleCloudVertexAiConfig struct { // `private_key_plaintext` // // [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys - PrivateKey types.String `tfsdk:"private_key" tf:"optional"` + PrivateKey types.String `tfsdk:"private_key"` // The private key for the service account which has access to the Google // Cloud Vertex AI Service provided as a plaintext secret. See [Best // practices for managing service account keys]. If you prefer to reference @@ -3478,16 +3529,16 @@ type GoogleCloudVertexAiConfig struct { // `private_key_plaintext`. // // [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys - PrivateKeyPlaintext types.String `tfsdk:"private_key_plaintext" tf:"optional"` + PrivateKeyPlaintext types.String `tfsdk:"private_key_plaintext"` // This is the Google Cloud project id that the service account is // associated with. - ProjectId types.String `tfsdk:"project_id" tf:"optional"` + ProjectId types.String `tfsdk:"project_id"` // This is the region for the Google Cloud Vertex AI Service. See [supported // regions] for more details. Some models are only available in specific // regions. // // [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` } func (newState *GoogleCloudVertexAiConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan GoogleCloudVertexAiConfig) { @@ -3496,9 +3547,13 @@ func (newState *GoogleCloudVertexAiConfig) SyncEffectiveFieldsDuringCreateOrUpda func (newState *GoogleCloudVertexAiConfig) SyncEffectiveFieldsDuringRead(existingState GoogleCloudVertexAiConfig) { } -func (c GoogleCloudVertexAiConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GoogleCloudVertexAiConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["private_key"] = attrs["private_key"].SetOptional() + attrs["private_key_plaintext"] = attrs["private_key_plaintext"].SetOptional() + attrs["project_id"] = attrs["project_id"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GoogleCloudVertexAiConfig. @@ -3540,7 +3595,7 @@ func (o GoogleCloudVertexAiConfig) Type(ctx context.Context) attr.Type { type ListEndpointsResponse struct { // The list of endpoints. - Endpoints types.List `tfsdk:"endpoints" tf:"optional"` + Endpoints types.List `tfsdk:"endpoints"` } func (newState *ListEndpointsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListEndpointsResponse) { @@ -3549,10 +3604,10 @@ func (newState *ListEndpointsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListEndpointsResponse) SyncEffectiveFieldsDuringRead(existingState ListEndpointsResponse) { } -func (c ListEndpointsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpoint{}.ApplySchemaCustomizations(cs, append(path, "endpoints")...) +func (c ListEndpointsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoints"] = attrs["endpoints"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListEndpointsResponse. @@ -3661,7 +3716,7 @@ func (o LogsRequest) Type(ctx context.Context) attr.Type { type ModelDataPlaneInfo struct { // Information required to query DataPlane API 'query' endpoint. - QueryInfo types.Object `tfsdk:"query_info" tf:"optional,object"` + QueryInfo types.Object `tfsdk:"query_info"` } func (newState *ModelDataPlaneInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ModelDataPlaneInfo) { @@ -3670,10 +3725,10 @@ func (newState *ModelDataPlaneInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ModelDataPlaneInfo) SyncEffectiveFieldsDuringRead(existingState ModelDataPlaneInfo) { } -func (c ModelDataPlaneInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - oauth2_tf.DataPlaneInfo{}.ApplySchemaCustomizations(cs, append(path, "query_info")...) +func (c ModelDataPlaneInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query_info"] = attrs["query_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ModelDataPlaneInfo. @@ -3740,55 +3795,55 @@ func (o *ModelDataPlaneInfo) SetQueryInfo(ctx context.Context, v oauth2_tf.DataP type OpenAiConfig struct { // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Client ID. - MicrosoftEntraClientId types.String `tfsdk:"microsoft_entra_client_id" tf:"optional"` + MicrosoftEntraClientId types.String `tfsdk:"microsoft_entra_client_id"` // The Databricks secret key reference for a client secret used for // Microsoft Entra ID authentication. If you prefer to paste your client // secret directly, see `microsoft_entra_client_secret_plaintext`. You must // provide an API key using one of the following fields: // `microsoft_entra_client_secret` or // `microsoft_entra_client_secret_plaintext`. - MicrosoftEntraClientSecret types.String `tfsdk:"microsoft_entra_client_secret" tf:"optional"` + MicrosoftEntraClientSecret types.String `tfsdk:"microsoft_entra_client_secret"` // The client secret used for Microsoft Entra ID authentication provided as // a plaintext string. If you prefer to reference your key using Databricks // Secrets, see `microsoft_entra_client_secret`. You must provide an API key // using one of the following fields: `microsoft_entra_client_secret` or // `microsoft_entra_client_secret_plaintext`. - MicrosoftEntraClientSecretPlaintext types.String `tfsdk:"microsoft_entra_client_secret_plaintext" tf:"optional"` + MicrosoftEntraClientSecretPlaintext types.String `tfsdk:"microsoft_entra_client_secret_plaintext"` // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Tenant ID. - MicrosoftEntraTenantId types.String `tfsdk:"microsoft_entra_tenant_id" tf:"optional"` + MicrosoftEntraTenantId types.String `tfsdk:"microsoft_entra_tenant_id"` // This is a field to provide a customized base URl for the OpenAI API. For // Azure OpenAI, this field is required, and is the base URL for the Azure // OpenAI API service provided by Azure. For other OpenAI API types, this // field is optional, and if left unspecified, the standard OpenAI base URL // is used. - OpenaiApiBase types.String `tfsdk:"openai_api_base" tf:"optional"` + OpenaiApiBase types.String `tfsdk:"openai_api_base"` // The Databricks secret key reference for an OpenAI API key using the // OpenAI or Azure service. If you prefer to paste your API key directly, // see `openai_api_key_plaintext`. You must provide an API key using one of // the following fields: `openai_api_key` or `openai_api_key_plaintext`. - OpenaiApiKey types.String `tfsdk:"openai_api_key" tf:"optional"` + OpenaiApiKey types.String `tfsdk:"openai_api_key"` // The OpenAI API key using the OpenAI or Azure service provided as a // plaintext string. If you prefer to reference your key using Databricks // Secrets, see `openai_api_key`. You must provide an API key using one of // the following fields: `openai_api_key` or `openai_api_key_plaintext`. - OpenaiApiKeyPlaintext types.String `tfsdk:"openai_api_key_plaintext" tf:"optional"` + OpenaiApiKeyPlaintext types.String `tfsdk:"openai_api_key_plaintext"` // This is an optional field to specify the type of OpenAI API to use. For // Azure OpenAI, this field is required, and adjust this parameter to // represent the preferred security access validation protocol. For access // token validation, use azure. For authentication using Azure Active // Directory (Azure AD) use, azuread. - OpenaiApiType types.String `tfsdk:"openai_api_type" tf:"optional"` + OpenaiApiType types.String `tfsdk:"openai_api_type"` // This is an optional field to specify the OpenAI API version. For Azure // OpenAI, this field is required, and is the version of the Azure OpenAI // service to utilize, specified by a date. - OpenaiApiVersion types.String `tfsdk:"openai_api_version" tf:"optional"` + OpenaiApiVersion types.String `tfsdk:"openai_api_version"` // This field is only required for Azure OpenAI and is the name of the // deployment resource for the Azure OpenAI service. - OpenaiDeploymentName types.String `tfsdk:"openai_deployment_name" tf:"optional"` + OpenaiDeploymentName types.String `tfsdk:"openai_deployment_name"` // This is an optional field to specify the organization in OpenAI or Azure // OpenAI. - OpenaiOrganization types.String `tfsdk:"openai_organization" tf:"optional"` + OpenaiOrganization types.String `tfsdk:"openai_organization"` } func (newState *OpenAiConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan OpenAiConfig) { @@ -3797,9 +3852,20 @@ func (newState *OpenAiConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan OpenA func (newState *OpenAiConfig) SyncEffectiveFieldsDuringRead(existingState OpenAiConfig) { } -func (c OpenAiConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OpenAiConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["microsoft_entra_client_id"] = attrs["microsoft_entra_client_id"].SetOptional() + attrs["microsoft_entra_client_secret"] = attrs["microsoft_entra_client_secret"].SetOptional() + attrs["microsoft_entra_client_secret_plaintext"] = attrs["microsoft_entra_client_secret_plaintext"].SetOptional() + attrs["microsoft_entra_tenant_id"] = attrs["microsoft_entra_tenant_id"].SetOptional() + attrs["openai_api_base"] = attrs["openai_api_base"].SetOptional() + attrs["openai_api_key"] = attrs["openai_api_key"].SetOptional() + attrs["openai_api_key_plaintext"] = attrs["openai_api_key_plaintext"].SetOptional() + attrs["openai_api_type"] = attrs["openai_api_type"].SetOptional() + attrs["openai_api_version"] = attrs["openai_api_version"].SetOptional() + attrs["openai_deployment_name"] = attrs["openai_deployment_name"].SetOptional() + attrs["openai_organization"] = attrs["openai_organization"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OpenAiConfig. @@ -3858,12 +3924,12 @@ type PaLmConfig struct { // paste your API key directly, see `palm_api_key_plaintext`. You must // provide an API key using one of the following fields: `palm_api_key` or // `palm_api_key_plaintext`. - PalmApiKey types.String `tfsdk:"palm_api_key" tf:"optional"` + PalmApiKey types.String `tfsdk:"palm_api_key"` // The PaLM API key provided as a plaintext string. If you prefer to // reference your key using Databricks Secrets, see `palm_api_key`. You must // provide an API key using one of the following fields: `palm_api_key` or // `palm_api_key_plaintext`. - PalmApiKeyPlaintext types.String `tfsdk:"palm_api_key_plaintext" tf:"optional"` + PalmApiKeyPlaintext types.String `tfsdk:"palm_api_key_plaintext"` } func (newState *PaLmConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan PaLmConfig) { @@ -3872,9 +3938,11 @@ func (newState *PaLmConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan PaLmCon func (newState *PaLmConfig) SyncEffectiveFieldsDuringRead(existingState PaLmConfig) { } -func (c PaLmConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PaLmConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["palm_api_key"] = attrs["palm_api_key"].SetOptional() + attrs["palm_api_key_plaintext"] = attrs["palm_api_key_plaintext"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PaLmConfig. @@ -3912,9 +3980,9 @@ func (o PaLmConfig) Type(ctx context.Context) attr.Type { type PatchServingEndpointTags struct { // List of endpoint tags to add - AddTags types.List `tfsdk:"add_tags" tf:"optional"` + AddTags types.List `tfsdk:"add_tags"` // List of tag keys to delete - DeleteTags types.List `tfsdk:"delete_tags" tf:"optional"` + DeleteTags types.List `tfsdk:"delete_tags"` // The name of the serving endpoint who's tags to patch. This field is // required. Name types.String `tfsdk:"-"` @@ -3926,11 +3994,12 @@ func (newState *PatchServingEndpointTags) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *PatchServingEndpointTags) SyncEffectiveFieldsDuringRead(existingState PatchServingEndpointTags) { } -func (c PatchServingEndpointTags) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointTag{}.ApplySchemaCustomizations(cs, append(path, "add_tags")...) - cs.SetRequired(append(path, "name")...) +func (c PatchServingEndpointTags) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["add_tags"] = attrs["add_tags"].SetOptional() + attrs["delete_tags"] = attrs["delete_tags"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PatchServingEndpointTags. @@ -4029,11 +4098,11 @@ func (o *PatchServingEndpointTags) SetDeleteTags(ctx context.Context, v []types. type PayloadTable struct { // The name of the payload table. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The status of the payload table. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The status message of the payload table. - StatusMessage types.String `tfsdk:"status_message" tf:"optional"` + StatusMessage types.String `tfsdk:"status_message"` } func (newState *PayloadTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan PayloadTable) { @@ -4042,9 +4111,12 @@ func (newState *PayloadTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan Paylo func (newState *PayloadTable) SyncEffectiveFieldsDuringRead(existingState PayloadTable) { } -func (c PayloadTable) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PayloadTable) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status_message"] = attrs["status_message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PayloadTable. @@ -4086,20 +4158,20 @@ func (o PayloadTable) Type(ctx context.Context) attr.Type { type PutAiGatewayRequest struct { // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails types.Object `tfsdk:"guardrails" tf:"optional,object"` + Guardrails types.Object `tfsdk:"guardrails"` // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality. - InferenceTableConfig types.Object `tfsdk:"inference_table_config" tf:"optional,object"` + InferenceTableConfig types.Object `tfsdk:"inference_table_config"` // The name of the serving endpoint whose AI Gateway is being updated. This // field is required. Name types.String `tfsdk:"-"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig types.Object `tfsdk:"usage_tracking_config" tf:"optional,object"` + UsageTrackingConfig types.Object `tfsdk:"usage_tracking_config"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutAiGatewayRequest. @@ -4261,17 +4333,17 @@ func (o *PutAiGatewayRequest) SetUsageTrackingConfig(ctx context.Context, v AiGa type PutAiGatewayResponse struct { // Configuration for AI Guardrails to prevent unwanted data and unsafe data // in requests and responses. - Guardrails types.Object `tfsdk:"guardrails" tf:"optional,object"` + Guardrails types.Object `tfsdk:"guardrails"` // Configuration for payload logging using inference tables. Use these // tables to monitor and audit data being sent to and received from model // APIs and to improve model quality . - InferenceTableConfig types.Object `tfsdk:"inference_table_config" tf:"optional,object"` + InferenceTableConfig types.Object `tfsdk:"inference_table_config"` // Configuration for rate limits which can be set to limit endpoint traffic. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` // Configuration to enable usage tracking using system tables. These tables // allow you to monitor operational usage on endpoints and their associated // costs. - UsageTrackingConfig types.Object `tfsdk:"usage_tracking_config" tf:"optional,object"` + UsageTrackingConfig types.Object `tfsdk:"usage_tracking_config"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutAiGatewayResponse. @@ -4434,7 +4506,7 @@ type PutRequest struct { // This field is required. Name types.String `tfsdk:"-"` // The list of endpoint rate limits. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutRequest. @@ -4502,7 +4574,7 @@ func (o *PutRequest) SetRateLimits(ctx context.Context, v []RateLimit) { type PutResponse struct { // The list of endpoint rate limits. - RateLimits types.List `tfsdk:"rate_limits" tf:"optional"` + RateLimits types.List `tfsdk:"rate_limits"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutResponse. @@ -4568,54 +4640,54 @@ func (o *PutResponse) SetRateLimits(ctx context.Context, v []RateLimit) { type QueryEndpointInput struct { // Pandas Dataframe input in the records orientation. - DataframeRecords types.List `tfsdk:"dataframe_records" tf:"optional"` + DataframeRecords types.List `tfsdk:"dataframe_records"` // Pandas Dataframe input in the split orientation. - DataframeSplit types.Object `tfsdk:"dataframe_split" tf:"optional,object"` + DataframeSplit types.Object `tfsdk:"dataframe_split"` // The extra parameters field used ONLY for __completions, chat,__ and // __embeddings external & foundation model__ serving endpoints. This is a // map of strings and should only be used with other external/foundation // model query fields. - ExtraParams types.Map `tfsdk:"extra_params" tf:"optional"` + ExtraParams types.Map `tfsdk:"extra_params"` // The input string (or array of strings) field used ONLY for __embeddings // external & foundation model__ serving endpoints and is the only field // (along with extra_params if needed) used by embeddings queries. - Input types.Object `tfsdk:"input" tf:"optional"` + Input types.Object `tfsdk:"input"` // Tensor-based input in columnar format. - Inputs types.Object `tfsdk:"inputs" tf:"optional"` + Inputs types.Object `tfsdk:"inputs"` // Tensor-based input in row format. - Instances types.List `tfsdk:"instances" tf:"optional"` + Instances types.List `tfsdk:"instances"` // The max tokens field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is an integer and should only // be used with other chat/completions query fields. - MaxTokens types.Int64 `tfsdk:"max_tokens" tf:"optional"` + MaxTokens types.Int64 `tfsdk:"max_tokens"` // The messages field used ONLY for __chat external & foundation model__ // serving endpoints. This is a map of strings and should only be used with // other chat query fields. - Messages types.List `tfsdk:"messages" tf:"optional"` + Messages types.List `tfsdk:"messages"` // The n (number of candidates) field used ONLY for __completions__ and // __chat external & foundation model__ serving endpoints. This is an // integer between 1 and 5 with a default of 1 and should only be used with // other chat/completions query fields. - N types.Int64 `tfsdk:"n" tf:"optional"` + N types.Int64 `tfsdk:"n"` // The name of the serving endpoint. This field is required. Name types.String `tfsdk:"-"` // The prompt string (or array of strings) field used ONLY for __completions // external & foundation model__ serving endpoints and should only be used // with other completions query fields. - Prompt types.Object `tfsdk:"prompt" tf:"optional"` + Prompt types.Object `tfsdk:"prompt"` // The stop sequences field used ONLY for __completions__ and __chat // external & foundation model__ serving endpoints. This is a list of // strings and should only be used with other chat/completions query fields. - Stop types.List `tfsdk:"stop" tf:"optional"` + Stop types.List `tfsdk:"stop"` // The stream field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is a boolean defaulting to // false and should only be used with other chat/completions query fields. - Stream types.Bool `tfsdk:"stream" tf:"optional"` + Stream types.Bool `tfsdk:"stream"` // The temperature field used ONLY for __completions__ and __chat external & // foundation model__ serving endpoints. This is a float between 0.0 and 2.0 // with a default of 1.0 and should only be used with other chat/completions // query fields. - Temperature types.Float64 `tfsdk:"temperature" tf:"optional"` + Temperature types.Float64 `tfsdk:"temperature"` } func (newState *QueryEndpointInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryEndpointInput) { @@ -4624,12 +4696,23 @@ func (newState *QueryEndpointInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QueryEndpointInput) SyncEffectiveFieldsDuringRead(existingState QueryEndpointInput) { } -func (c QueryEndpointInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DataframeSplitInput{}.ApplySchemaCustomizations(cs, append(path, "dataframe_split")...) - ChatMessage{}.ApplySchemaCustomizations(cs, append(path, "messages")...) - cs.SetRequired(append(path, "name")...) +func (c QueryEndpointInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dataframe_records"] = attrs["dataframe_records"].SetOptional() + attrs["dataframe_split"] = attrs["dataframe_split"].SetOptional() + attrs["extra_params"] = attrs["extra_params"].SetOptional() + attrs["input"] = attrs["input"].SetOptional() + attrs["inputs"] = attrs["inputs"].SetOptional() + attrs["instances"] = attrs["instances"].SetOptional() + attrs["max_tokens"] = attrs["max_tokens"].SetOptional() + attrs["messages"] = attrs["messages"].SetOptional() + attrs["n"] = attrs["n"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["prompt"] = attrs["prompt"].SetOptional() + attrs["stop"] = attrs["stop"].SetOptional() + attrs["stream"] = attrs["stream"].SetOptional() + attrs["temperature"] = attrs["temperature"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryEndpointInput. @@ -4867,32 +4950,32 @@ func (o *QueryEndpointInput) SetStop(ctx context.Context, v []types.String) { type QueryEndpointResponse struct { // The list of choices returned by the __chat or completions // external/foundation model__ serving endpoint. - Choices types.List `tfsdk:"choices" tf:"optional"` + Choices types.List `tfsdk:"choices"` // The timestamp in seconds when the query was created in Unix time returned // by a __completions or chat external/foundation model__ serving endpoint. - Created types.Int64 `tfsdk:"created" tf:"optional"` + Created types.Int64 `tfsdk:"created"` // The list of the embeddings returned by the __embeddings // external/foundation model__ serving endpoint. - Data types.List `tfsdk:"data" tf:"optional"` + Data types.List `tfsdk:"data"` // The ID of the query that may be returned by a __completions or chat // external/foundation model__ serving endpoint. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The name of the __external/foundation model__ used for querying. This is // the name of the model that was specified in the endpoint config. - Model types.String `tfsdk:"model" tf:"optional"` + Model types.String `tfsdk:"model"` // The type of object returned by the __external/foundation model__ serving // endpoint, one of [text_completion, chat.completion, list (of // embeddings)]. - Object types.String `tfsdk:"object" tf:"optional"` + Object types.String `tfsdk:"object"` // The predictions returned by the serving endpoint. - Predictions types.List `tfsdk:"predictions" tf:"optional"` + Predictions types.List `tfsdk:"predictions"` // The name of the served model that served the request. This is useful when // there are multiple models behind the same endpoint with traffic split. ServedModelName types.String `tfsdk:"-"` // The usage object that may be returned by the __external/foundation // model__ serving endpoint. This contains information about the number of // tokens used in the prompt and response. - Usage types.Object `tfsdk:"usage" tf:"optional,object"` + Usage types.Object `tfsdk:"usage"` } func (newState *QueryEndpointResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryEndpointResponse) { @@ -4901,12 +4984,18 @@ func (newState *QueryEndpointResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *QueryEndpointResponse) SyncEffectiveFieldsDuringRead(existingState QueryEndpointResponse) { } -func (c QueryEndpointResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - V1ResponseChoiceElement{}.ApplySchemaCustomizations(cs, append(path, "choices")...) - EmbeddingsV1ResponseEmbeddingElement{}.ApplySchemaCustomizations(cs, append(path, "data")...) - ExternalModelUsageElement{}.ApplySchemaCustomizations(cs, append(path, "usage")...) +func (c QueryEndpointResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["choices"] = attrs["choices"].SetOptional() + attrs["created"] = attrs["created"].SetOptional() + attrs["data"] = attrs["data"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["model"] = attrs["model"].SetOptional() + attrs["object"] = attrs["object"].SetOptional() + attrs["predictions"] = attrs["predictions"].SetOptional() + attrs["served-model-name"] = attrs["served-model-name"].SetOptional() + attrs["usage"] = attrs["usage"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryEndpointResponse. @@ -5076,14 +5165,14 @@ func (o *QueryEndpointResponse) SetUsage(ctx context.Context, v ExternalModelUsa type RateLimit struct { // Used to specify how many calls are allowed for a key within the // renewal_period. - Calls types.Int64 `tfsdk:"calls" tf:""` + Calls types.Int64 `tfsdk:"calls"` // Key field for a serving endpoint rate limit. Currently, only 'user' and // 'endpoint' are supported, with 'endpoint' being the default if not // specified. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Renewal period field for a serving endpoint rate limit. Currently, only // 'minute' is supported. - RenewalPeriod types.String `tfsdk:"renewal_period" tf:""` + RenewalPeriod types.String `tfsdk:"renewal_period"` } func (newState *RateLimit) SyncEffectiveFieldsDuringCreateOrUpdate(plan RateLimit) { @@ -5092,11 +5181,12 @@ func (newState *RateLimit) SyncEffectiveFieldsDuringCreateOrUpdate(plan RateLimi func (newState *RateLimit) SyncEffectiveFieldsDuringRead(existingState RateLimit) { } -func (c RateLimit) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "calls")...) - cs.SetRequired(append(path, "renewal_period")...) +func (c RateLimit) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["calls"] = attrs["calls"].SetRequired() + attrs["key"] = attrs["key"].SetOptional() + attrs["renewal_period"] = attrs["renewal_period"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RateLimit. @@ -5136,10 +5226,10 @@ func (o RateLimit) Type(ctx context.Context) attr.Type { type Route struct { // The name of the served model this route configures traffic for. - ServedModelName types.String `tfsdk:"served_model_name" tf:""` + ServedModelName types.String `tfsdk:"served_model_name"` // The percentage of endpoint traffic to send to this route. It must be an // integer between 0 and 100 inclusive. - TrafficPercentage types.Int64 `tfsdk:"traffic_percentage" tf:""` + TrafficPercentage types.Int64 `tfsdk:"traffic_percentage"` } func (newState *Route) SyncEffectiveFieldsDuringCreateOrUpdate(plan Route) { @@ -5148,11 +5238,11 @@ func (newState *Route) SyncEffectiveFieldsDuringCreateOrUpdate(plan Route) { func (newState *Route) SyncEffectiveFieldsDuringRead(existingState Route) { } -func (c Route) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "served_model_name")...) - cs.SetRequired(append(path, "traffic_percentage")...) +func (c Route) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["served_model_name"] = attrs["served_model_name"].SetRequired() + attrs["traffic_percentage"] = attrs["traffic_percentage"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Route. @@ -5194,17 +5284,17 @@ type ServedEntityInput struct { // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object should be given in the form of // __catalog_name__.__schema_name__.__model_name__. - EntityName types.String `tfsdk:"entity_name" tf:"optional"` + EntityName types.String `tfsdk:"entity_name"` // The version of the model in Databricks Model Registry to be served or // empty if the entity is a FEATURE_SPEC. - EntityVersion types.String `tfsdk:"entity_version" tf:"optional"` + EntityVersion types.String `tfsdk:"entity_version"` // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // The external model to be served. NOTE: Only one of external_model and // (entity_name, entity_version, workload_size, workload_type, and // scale_to_zero_enabled) can be specified with the latter set being used @@ -5213,24 +5303,24 @@ type ServedEntityInput struct { // endpoint without external_model. If the endpoint is created without // external_model, users cannot update it to add external_model later. The // task type of all external models within an endpoint must be the same. - ExternalModel types.Object `tfsdk:"external_model" tf:"optional,object"` + ExternalModel types.Object `tfsdk:"external_model"` // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput" tf:"optional"` + MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput"` // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput" tf:"optional"` + MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput"` // The name of a served entity. It must be unique across an endpoint. A // served entity name can consist of alphanumeric characters, dashes, and // underscores. If not specified for an external model, this field defaults // to external_model.name, with '.' and ':' replaced with '-', and if not // specified for other entities, it defaults to // -. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:"optional"` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -5238,7 +5328,7 @@ type ServedEntityInput struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size is 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5246,7 +5336,7 @@ type ServedEntityInput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedEntityInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedEntityInput) { @@ -5255,10 +5345,20 @@ func (newState *ServedEntityInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ServedEntityInput) SyncEffectiveFieldsDuringRead(existingState ServedEntityInput) { } -func (c ServedEntityInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalModel{}.ApplySchemaCustomizations(cs, append(path, "external_model")...) +func (c ServedEntityInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["entity_name"] = attrs["entity_name"].SetOptional() + attrs["entity_version"] = attrs["entity_version"].SetOptional() + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["external_model"] = attrs["external_model"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_provisioned_throughput"] = attrs["max_provisioned_throughput"].SetOptional() + attrs["min_provisioned_throughput"] = attrs["min_provisioned_throughput"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetOptional() + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedEntityInput. @@ -5373,49 +5473,49 @@ func (o *ServedEntityInput) SetExternalModel(ctx context.Context, v ExternalMode type ServedEntityOutput struct { // The creation timestamp of the served entity in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the served entity. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // The name of the entity served. The entity may be a model in the // Databricks Model Registry, a model in the Unity Catalog (UC), or a // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object is given in the form of // __catalog_name__.__schema_name__.__model_name__. - EntityName types.String `tfsdk:"entity_name" tf:"optional"` + EntityName types.String `tfsdk:"entity_name"` // The version of the served entity in Databricks Model Registry or empty if // the entity is a FEATURE_SPEC. - EntityVersion types.String `tfsdk:"entity_version" tf:"optional"` + EntityVersion types.String `tfsdk:"entity_version"` // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this entity. Note: this is an // experimental feature and subject to change. Example entity environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // The external model that is served. NOTE: Only one of external_model, // foundation_model, and (entity_name, entity_version, workload_size, // workload_type, and scale_to_zero_enabled) is returned based on the // endpoint type. - ExternalModel types.Object `tfsdk:"external_model" tf:"optional,object"` + ExternalModel types.Object `tfsdk:"external_model"` // The foundation model that is served. NOTE: Only one of foundation_model, // external_model, and (entity_name, entity_version, workload_size, // workload_type, and scale_to_zero_enabled) is returned based on the // endpoint type. - FoundationModel types.Object `tfsdk:"foundation_model" tf:"optional,object"` + FoundationModel types.Object `tfsdk:"foundation_model"` // ARN of the instance profile that the served entity uses to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput" tf:"optional"` + MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput"` // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput" tf:"optional"` + MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput"` // The name of the served entity. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the served entity should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:"optional"` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // Information corresponding to the state of the served entity. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The workload size of the served entity. The workload size corresponds to // a range of provisioned concurrency that the compute autoscales between. A // single unit of provisioned concurrency can process one request at a time. @@ -5423,7 +5523,7 @@ type ServedEntityOutput struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size will be 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served entity. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5431,7 +5531,7 @@ type ServedEntityOutput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedEntityOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedEntityOutput) { @@ -5440,12 +5540,24 @@ func (newState *ServedEntityOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ServedEntityOutput) SyncEffectiveFieldsDuringRead(existingState ServedEntityOutput) { } -func (c ServedEntityOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalModel{}.ApplySchemaCustomizations(cs, append(path, "external_model")...) - FoundationModel{}.ApplySchemaCustomizations(cs, append(path, "foundation_model")...) - ServedModelState{}.ApplySchemaCustomizations(cs, append(path, "state")...) +func (c ServedEntityOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["entity_name"] = attrs["entity_name"].SetOptional() + attrs["entity_version"] = attrs["entity_version"].SetOptional() + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["external_model"] = attrs["external_model"].SetOptional() + attrs["foundation_model"] = attrs["foundation_model"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_provisioned_throughput"] = attrs["max_provisioned_throughput"].SetOptional() + attrs["min_provisioned_throughput"] = attrs["min_provisioned_throughput"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedEntityOutput. @@ -5630,20 +5742,20 @@ type ServedEntitySpec struct { // function of type FEATURE_SPEC in the UC. If it is a UC object, the full // name of the object is given in the form of // __catalog_name__.__schema_name__.__model_name__. - EntityName types.String `tfsdk:"entity_name" tf:"optional"` + EntityName types.String `tfsdk:"entity_name"` // The version of the served entity in Databricks Model Registry or empty if // the entity is a FEATURE_SPEC. - EntityVersion types.String `tfsdk:"entity_version" tf:"optional"` + EntityVersion types.String `tfsdk:"entity_version"` // The external model that is served. NOTE: Only one of external_model, // foundation_model, and (entity_name, entity_version) is returned based on // the endpoint type. - ExternalModel types.Object `tfsdk:"external_model" tf:"optional,object"` + ExternalModel types.Object `tfsdk:"external_model"` // The foundation model that is served. NOTE: Only one of foundation_model, // external_model, and (entity_name, entity_version) is returned based on // the endpoint type. - FoundationModel types.Object `tfsdk:"foundation_model" tf:"optional,object"` + FoundationModel types.Object `tfsdk:"foundation_model"` // The name of the served entity. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ServedEntitySpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedEntitySpec) { @@ -5652,11 +5764,14 @@ func (newState *ServedEntitySpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *ServedEntitySpec) SyncEffectiveFieldsDuringRead(existingState ServedEntitySpec) { } -func (c ServedEntitySpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalModel{}.ApplySchemaCustomizations(cs, append(path, "external_model")...) - FoundationModel{}.ApplySchemaCustomizations(cs, append(path, "foundation_model")...) +func (c ServedEntitySpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["entity_name"] = attrs["entity_name"].SetOptional() + attrs["entity_version"] = attrs["entity_version"].SetOptional() + attrs["external_model"] = attrs["external_model"].SetOptional() + attrs["foundation_model"] = attrs["foundation_model"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedEntitySpec. @@ -5764,29 +5879,29 @@ type ServedModelInput struct { // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // ARN of the instance profile that the served model will use to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The maximum tokens per second that the endpoint can scale up to. - MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput" tf:"optional"` + MaxProvisionedThroughput types.Int64 `tfsdk:"max_provisioned_throughput"` // The minimum tokens per second that the endpoint can scale down to. - MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput" tf:"optional"` + MinProvisionedThroughput types.Int64 `tfsdk:"min_provisioned_throughput"` // The name of the model in Databricks Model Registry to be served or if the // model resides in Unity Catalog, the full name of model, in the form of // __catalog_name__.__schema_name__.__model_name__. - ModelName types.String `tfsdk:"model_name" tf:""` + ModelName types.String `tfsdk:"model_name"` // The version of the model in Databricks Model Registry or Unity Catalog to // be served. - ModelVersion types.String `tfsdk:"model_version" tf:""` + ModelVersion types.String `tfsdk:"model_version"` // The name of a served model. It must be unique across an endpoint. If not // specified, this field will default to -. A // served model name can consist of alphanumeric characters, dashes, and // underscores. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the served model should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:""` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // The workload size of the served model. The workload size corresponds to a // range of provisioned concurrency that the compute will autoscale between. // A single unit of provisioned concurrency can process one request at a @@ -5794,7 +5909,7 @@ type ServedModelInput struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size will be 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served model. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5802,7 +5917,7 @@ type ServedModelInput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedModelInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelInput) { @@ -5811,12 +5926,19 @@ func (newState *ServedModelInput) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *ServedModelInput) SyncEffectiveFieldsDuringRead(existingState ServedModelInput) { } -func (c ServedModelInput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "model_name")...) - cs.SetRequired(append(path, "model_version")...) - cs.SetRequired(append(path, "scale_to_zero_enabled")...) +func (c ServedModelInput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_provisioned_throughput"] = attrs["max_provisioned_throughput"].SetOptional() + attrs["min_provisioned_throughput"] = attrs["min_provisioned_throughput"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetRequired() + attrs["model_version"] = attrs["model_version"].SetRequired() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetRequired() + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelInput. @@ -5900,32 +6022,32 @@ func (o *ServedModelInput) SetEnvironmentVars(ctx context.Context, v map[string] type ServedModelOutput struct { // The creation timestamp of the served model in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the served model. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // An object containing a set of optional, user-specified environment // variable key-value pairs used for serving this model. Note: this is an // experimental feature and subject to change. Example model environment // variables that refer to Databricks secrets: `{"OPENAI_API_KEY": // "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": // "{{secrets/my_scope2/my_key2}}"}` - EnvironmentVars types.Map `tfsdk:"environment_vars" tf:"optional"` + EnvironmentVars types.Map `tfsdk:"environment_vars"` // ARN of the instance profile that the served model will use to access AWS // resources. - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // The name of the model in Databricks Model Registry or the full name of // the model in Unity Catalog. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // The version of the model in Databricks Model Registry or Unity Catalog to // be served. - ModelVersion types.String `tfsdk:"model_version" tf:"optional"` + ModelVersion types.String `tfsdk:"model_version"` // The name of the served model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Whether the compute resources for the Served Model should scale down to // zero. - ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled" tf:"optional"` + ScaleToZeroEnabled types.Bool `tfsdk:"scale_to_zero_enabled"` // Information corresponding to the state of the Served Model. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // The workload size of the served model. The workload size corresponds to a // range of provisioned concurrency that the compute will autoscale between. // A single unit of provisioned concurrency can process one request at a @@ -5933,7 +6055,7 @@ type ServedModelOutput struct { // "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 // provisioned concurrency). If scale-to-zero is enabled, the lower bound of // the provisioned concurrency for each workload size will be 0. - WorkloadSize types.String `tfsdk:"workload_size" tf:"optional"` + WorkloadSize types.String `tfsdk:"workload_size"` // The workload type of the served model. The workload type selects which // type of compute to use in the endpoint. The default value for this // parameter is "CPU". For deep learning workloads, GPU acceleration is @@ -5941,7 +6063,7 @@ type ServedModelOutput struct { // available [GPU types]. // // [GPU types]: https://docs.databricks.com/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types - WorkloadType types.String `tfsdk:"workload_type" tf:"optional"` + WorkloadType types.String `tfsdk:"workload_type"` } func (newState *ServedModelOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelOutput) { @@ -5950,10 +6072,20 @@ func (newState *ServedModelOutput) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ServedModelOutput) SyncEffectiveFieldsDuringRead(existingState ServedModelOutput) { } -func (c ServedModelOutput) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServedModelState{}.ApplySchemaCustomizations(cs, append(path, "state")...) +func (c ServedModelOutput) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["environment_vars"] = attrs["environment_vars"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["model_version"] = attrs["model_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["scale_to_zero_enabled"] = attrs["scale_to_zero_enabled"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["workload_size"] = attrs["workload_size"].SetOptional() + attrs["workload_type"] = attrs["workload_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelOutput. @@ -6069,12 +6201,12 @@ func (o *ServedModelOutput) SetState(ctx context.Context, v ServedModelState) { type ServedModelSpec struct { // The name of the model in Databricks Model Registry or the full name of // the model in Unity Catalog. - ModelName types.String `tfsdk:"model_name" tf:"optional"` + ModelName types.String `tfsdk:"model_name"` // The version of the model in Databricks Model Registry or Unity Catalog to // be served. - ModelVersion types.String `tfsdk:"model_version" tf:"optional"` + ModelVersion types.String `tfsdk:"model_version"` // The name of the served model. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ServedModelSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelSpec) { @@ -6083,9 +6215,12 @@ func (newState *ServedModelSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan Se func (newState *ServedModelSpec) SyncEffectiveFieldsDuringRead(existingState ServedModelSpec) { } -func (c ServedModelSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServedModelSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["model_name"] = attrs["model_name"].SetOptional() + attrs["model_version"] = attrs["model_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelSpec. @@ -6136,9 +6271,9 @@ type ServedModelState struct { // etc.) DEPLOYMENT_ABORTED indicates that the deployment was terminated // likely due to a failure in bringing up another served entity under the // same endpoint and config version. - Deployment types.String `tfsdk:"deployment" tf:"optional"` + Deployment types.String `tfsdk:"deployment"` // More information about the state of the served entity, if available. - DeploymentStateMessage types.String `tfsdk:"deployment_state_message" tf:"optional"` + DeploymentStateMessage types.String `tfsdk:"deployment_state_message"` } func (newState *ServedModelState) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServedModelState) { @@ -6147,9 +6282,11 @@ func (newState *ServedModelState) SyncEffectiveFieldsDuringCreateOrUpdate(plan S func (newState *ServedModelState) SyncEffectiveFieldsDuringRead(existingState ServedModelState) { } -func (c ServedModelState) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServedModelState) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["deployment"] = attrs["deployment"].SetOptional() + attrs["deployment_state_message"] = attrs["deployment_state_message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServedModelState. @@ -6188,7 +6325,7 @@ func (o ServedModelState) Type(ctx context.Context) attr.Type { type ServerLogsResponse struct { // The most recent log lines of the model server processing invocation // requests. - Logs types.String `tfsdk:"logs" tf:""` + Logs types.String `tfsdk:"logs"` } func (newState *ServerLogsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServerLogsResponse) { @@ -6197,10 +6334,10 @@ func (newState *ServerLogsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ServerLogsResponse) SyncEffectiveFieldsDuringRead(existingState ServerLogsResponse) { } -func (c ServerLogsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "logs")...) +func (c ServerLogsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["logs"] = attrs["logs"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServerLogsResponse. @@ -6237,26 +6374,26 @@ func (o ServerLogsResponse) Type(ctx context.Context) attr.Type { type ServingEndpoint struct { // The AI Gateway configuration for the serving endpoint. NOTE: Only // external model endpoints are currently supported. - AiGateway types.Object `tfsdk:"ai_gateway" tf:"optional,object"` + AiGateway types.Object `tfsdk:"ai_gateway"` // The config that is currently being served by the endpoint. - Config types.Object `tfsdk:"config" tf:"optional,object"` + Config types.Object `tfsdk:"config"` // The timestamp when the endpoint was created in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the serving endpoint. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // System-generated ID of the endpoint. This is used to refer to the // endpoint in the Permissions API - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The timestamp when the endpoint was last updated by a user in Unix time. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The name of the serving endpoint. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Information corresponding to the state of the serving endpoint. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // Tags attached to the serving endpoint. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The task type of the serving endpoint. - Task types.String `tfsdk:"task" tf:"optional"` + Task types.String `tfsdk:"task"` } func (newState *ServingEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpoint) { @@ -6265,13 +6402,19 @@ func (newState *ServingEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan Se func (newState *ServingEndpoint) SyncEffectiveFieldsDuringRead(existingState ServingEndpoint) { } -func (c ServingEndpoint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayConfig{}.ApplySchemaCustomizations(cs, append(path, "ai_gateway")...) - EndpointCoreConfigSummary{}.ApplySchemaCustomizations(cs, append(path, "config")...) - EndpointState{}.ApplySchemaCustomizations(cs, append(path, "state")...) - EndpointTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ServingEndpoint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai_gateway"] = attrs["ai_gateway"].SetOptional() + attrs["config"] = attrs["config"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpoint. @@ -6442,13 +6585,13 @@ func (o *ServingEndpoint) SetTags(ctx context.Context, v []EndpointTag) { type ServingEndpointAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ServingEndpointAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointAccessControlRequest) { @@ -6457,9 +6600,13 @@ func (newState *ServingEndpointAccessControlRequest) SyncEffectiveFieldsDuringCr func (newState *ServingEndpointAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState ServingEndpointAccessControlRequest) { } -func (c ServingEndpointAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServingEndpointAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointAccessControlRequest. @@ -6501,15 +6648,15 @@ func (o ServingEndpointAccessControlRequest) Type(ctx context.Context) attr.Type type ServingEndpointAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *ServingEndpointAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointAccessControlResponse) { @@ -6518,10 +6665,14 @@ func (newState *ServingEndpointAccessControlResponse) SyncEffectiveFieldsDuringC func (newState *ServingEndpointAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState ServingEndpointAccessControlResponse) { } -func (c ServingEndpointAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c ServingEndpointAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointAccessControlResponse. @@ -6596,37 +6747,37 @@ func (o *ServingEndpointAccessControlResponse) SetAllPermissions(ctx context.Con type ServingEndpointDetailed struct { // The AI Gateway configuration for the serving endpoint. NOTE: Only // external model endpoints are currently supported. - AiGateway types.Object `tfsdk:"ai_gateway" tf:"optional,object"` + AiGateway types.Object `tfsdk:"ai_gateway"` // The config that is currently being served by the endpoint. - Config types.Object `tfsdk:"config" tf:"optional,object"` + Config types.Object `tfsdk:"config"` // The timestamp when the endpoint was created in Unix time. - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // The email of the user who created the serving endpoint. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // Information required to query DataPlane APIs. - DataPlaneInfo types.Object `tfsdk:"data_plane_info" tf:"optional,object"` + DataPlaneInfo types.Object `tfsdk:"data_plane_info"` // Endpoint invocation url if route optimization is enabled for endpoint - EndpointUrl types.String `tfsdk:"endpoint_url" tf:"optional"` + EndpointUrl types.String `tfsdk:"endpoint_url"` // System-generated ID of the endpoint. This is used to refer to the // endpoint in the Permissions API - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The timestamp when the endpoint was last updated by a user in Unix time. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // The name of the serving endpoint. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The config that the endpoint is attempting to update to. - PendingConfig types.Object `tfsdk:"pending_config" tf:"optional,object"` + PendingConfig types.Object `tfsdk:"pending_config"` // The permission level of the principal making the request. - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // Boolean representing if route optimization has been enabled for the // endpoint - RouteOptimized types.Bool `tfsdk:"route_optimized" tf:"optional"` + RouteOptimized types.Bool `tfsdk:"route_optimized"` // Information corresponding to the state of the serving endpoint. - State types.Object `tfsdk:"state" tf:"optional,object"` + State types.Object `tfsdk:"state"` // Tags attached to the serving endpoint. - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The task type of the serving endpoint. - Task types.String `tfsdk:"task" tf:"optional"` + Task types.String `tfsdk:"task"` } func (newState *ServingEndpointDetailed) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointDetailed) { @@ -6635,15 +6786,24 @@ func (newState *ServingEndpointDetailed) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ServingEndpointDetailed) SyncEffectiveFieldsDuringRead(existingState ServingEndpointDetailed) { } -func (c ServingEndpointDetailed) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AiGatewayConfig{}.ApplySchemaCustomizations(cs, append(path, "ai_gateway")...) - EndpointCoreConfigOutput{}.ApplySchemaCustomizations(cs, append(path, "config")...) - ModelDataPlaneInfo{}.ApplySchemaCustomizations(cs, append(path, "data_plane_info")...) - EndpointPendingConfig{}.ApplySchemaCustomizations(cs, append(path, "pending_config")...) - EndpointState{}.ApplySchemaCustomizations(cs, append(path, "state")...) - EndpointTag{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c ServingEndpointDetailed) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ai_gateway"] = attrs["ai_gateway"].SetOptional() + attrs["config"] = attrs["config"].SetOptional() + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["data_plane_info"] = attrs["data_plane_info"].SetOptional() + attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pending_config"] = attrs["pending_config"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["route_optimized"] = attrs["route_optimized"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["task"] = attrs["task"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointDetailed. @@ -6881,11 +7041,11 @@ func (o *ServingEndpointDetailed) SetTags(ctx context.Context, v []EndpointTag) } type ServingEndpointPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ServingEndpointPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointPermission) { @@ -6894,9 +7054,12 @@ func (newState *ServingEndpointPermission) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ServingEndpointPermission) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermission) { } -func (c ServingEndpointPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServingEndpointPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermission. @@ -6965,11 +7128,11 @@ func (o *ServingEndpointPermission) SetInheritedFromObject(ctx context.Context, } type ServingEndpointPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *ServingEndpointPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointPermissions) { @@ -6978,10 +7141,12 @@ func (newState *ServingEndpointPermissions) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ServingEndpointPermissions) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermissions) { } -func (c ServingEndpointPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c ServingEndpointPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermissions. @@ -7050,9 +7215,9 @@ func (o *ServingEndpointPermissions) SetAccessControlList(ctx context.Context, v } type ServingEndpointPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *ServingEndpointPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServingEndpointPermissionsDescription) { @@ -7061,9 +7226,11 @@ func (newState *ServingEndpointPermissionsDescription) SyncEffectiveFieldsDuring func (newState *ServingEndpointPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermissionsDescription) { } -func (c ServingEndpointPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServingEndpointPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermissionsDescription. @@ -7100,7 +7267,7 @@ func (o ServingEndpointPermissionsDescription) Type(ctx context.Context) attr.Ty } type ServingEndpointPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The serving endpoint for which to get or manage permissions. ServingEndpointId types.String `tfsdk:"-"` } @@ -7111,11 +7278,11 @@ func (newState *ServingEndpointPermissionsRequest) SyncEffectiveFieldsDuringCrea func (newState *ServingEndpointPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState ServingEndpointPermissionsRequest) { } -func (c ServingEndpointPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServingEndpointAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "serving_endpoint_id")...) +func (c ServingEndpointPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["serving_endpoint_id"] = attrs["serving_endpoint_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServingEndpointPermissionsRequest. @@ -7183,7 +7350,7 @@ func (o *ServingEndpointPermissionsRequest) SetAccessControlList(ctx context.Con type TrafficConfig struct { // The list of routes that define traffic to each served entity. - Routes types.List `tfsdk:"routes" tf:"optional"` + Routes types.List `tfsdk:"routes"` } func (newState *TrafficConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan TrafficConfig) { @@ -7192,10 +7359,10 @@ func (newState *TrafficConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Traf func (newState *TrafficConfig) SyncEffectiveFieldsDuringRead(existingState TrafficConfig) { } -func (c TrafficConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Route{}.ApplySchemaCustomizations(cs, append(path, "routes")...) +func (c TrafficConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["routes"] = attrs["routes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TrafficConfig. @@ -7261,15 +7428,15 @@ func (o *TrafficConfig) SetRoutes(ctx context.Context, v []Route) { type V1ResponseChoiceElement struct { // The finish reason returned by the endpoint. - FinishReason types.String `tfsdk:"finishReason" tf:"optional"` + FinishReason types.String `tfsdk:"finishReason"` // The index of the choice in the __chat or completions__ response. - Index types.Int64 `tfsdk:"index" tf:"optional"` + Index types.Int64 `tfsdk:"index"` // The logprobs returned only by the __completions__ endpoint. - Logprobs types.Int64 `tfsdk:"logprobs" tf:"optional"` + Logprobs types.Int64 `tfsdk:"logprobs"` // The message response from the __chat__ endpoint. - Message types.Object `tfsdk:"message" tf:"optional,object"` + Message types.Object `tfsdk:"message"` // The text response from the __completions__ endpoint. - Text types.String `tfsdk:"text" tf:"optional"` + Text types.String `tfsdk:"text"` } func (newState *V1ResponseChoiceElement) SyncEffectiveFieldsDuringCreateOrUpdate(plan V1ResponseChoiceElement) { @@ -7278,10 +7445,14 @@ func (newState *V1ResponseChoiceElement) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *V1ResponseChoiceElement) SyncEffectiveFieldsDuringRead(existingState V1ResponseChoiceElement) { } -func (c V1ResponseChoiceElement) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ChatMessage{}.ApplySchemaCustomizations(cs, append(path, "message")...) +func (c V1ResponseChoiceElement) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["finishReason"] = attrs["finishReason"].SetOptional() + attrs["index"] = attrs["index"].SetOptional() + attrs["logprobs"] = attrs["logprobs"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["text"] = attrs["text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in V1ResponseChoiceElement. diff --git a/internal/service/settings_tf/legacy_model.go b/internal/service/settings_tf/legacy_model.go index 23ffc3960..f5ebe3720 100755 --- a/internal/service/settings_tf/legacy_model.go +++ b/internal/service/settings_tf/legacy_model.go @@ -17,13 +17,14 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) type AibiDashboardEmbeddingAccessPolicy_SdkV2 struct { - AccessPolicyType types.String `tfsdk:"access_policy_type" tf:""` + AccessPolicyType types.String `tfsdk:"access_policy_type"` } func (newState *AibiDashboardEmbeddingAccessPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingAccessPolicy_SdkV2) { @@ -32,10 +33,10 @@ func (newState *AibiDashboardEmbeddingAccessPolicy_SdkV2) SyncEffectiveFieldsDur func (newState *AibiDashboardEmbeddingAccessPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingAccessPolicy_SdkV2) { } -func (c AibiDashboardEmbeddingAccessPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_policy_type")...) +func (c AibiDashboardEmbeddingAccessPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_policy_type"] = attrs["access_policy_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingAccessPolicy. @@ -70,7 +71,7 @@ func (o AibiDashboardEmbeddingAccessPolicy_SdkV2) Type(ctx context.Context) attr } type AibiDashboardEmbeddingAccessPolicySetting_SdkV2 struct { - AibiDashboardEmbeddingAccessPolicy types.List `tfsdk:"aibi_dashboard_embedding_access_policy" tf:"object"` + AibiDashboardEmbeddingAccessPolicy types.List `tfsdk:"aibi_dashboard_embedding_access_policy"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -78,13 +79,13 @@ type AibiDashboardEmbeddingAccessPolicySetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *AibiDashboardEmbeddingAccessPolicySetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingAccessPolicySetting_SdkV2) { @@ -93,11 +94,13 @@ func (newState *AibiDashboardEmbeddingAccessPolicySetting_SdkV2) SyncEffectiveFi func (newState *AibiDashboardEmbeddingAccessPolicySetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingAccessPolicySetting_SdkV2) { } -func (c AibiDashboardEmbeddingAccessPolicySetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aibi_dashboard_embedding_access_policy")...) - AibiDashboardEmbeddingAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aibi_dashboard_embedding_access_policy")...) +func (c AibiDashboardEmbeddingAccessPolicySetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aibi_dashboard_embedding_access_policy"] = attrs["aibi_dashboard_embedding_access_policy"].SetRequired() + attrs["aibi_dashboard_embedding_access_policy"] = attrs["aibi_dashboard_embedding_access_policy"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingAccessPolicySetting. @@ -166,7 +169,7 @@ func (o *AibiDashboardEmbeddingAccessPolicySetting_SdkV2) SetAibiDashboardEmbedd } type AibiDashboardEmbeddingApprovedDomains_SdkV2 struct { - ApprovedDomains types.List `tfsdk:"approved_domains" tf:"optional"` + ApprovedDomains types.List `tfsdk:"approved_domains"` } func (newState *AibiDashboardEmbeddingApprovedDomains_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingApprovedDomains_SdkV2) { @@ -175,9 +178,10 @@ func (newState *AibiDashboardEmbeddingApprovedDomains_SdkV2) SyncEffectiveFields func (newState *AibiDashboardEmbeddingApprovedDomains_SdkV2) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingApprovedDomains_SdkV2) { } -func (c AibiDashboardEmbeddingApprovedDomains_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AibiDashboardEmbeddingApprovedDomains_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["approved_domains"] = attrs["approved_domains"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingApprovedDomains. @@ -242,7 +246,7 @@ func (o *AibiDashboardEmbeddingApprovedDomains_SdkV2) SetApprovedDomains(ctx con } type AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2 struct { - AibiDashboardEmbeddingApprovedDomains types.List `tfsdk:"aibi_dashboard_embedding_approved_domains" tf:"object"` + AibiDashboardEmbeddingApprovedDomains types.List `tfsdk:"aibi_dashboard_embedding_approved_domains"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -250,13 +254,13 @@ type AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) { @@ -265,11 +269,13 @@ func (newState *AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) SyncEffectiv func (newState *AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) { } -func (c AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aibi_dashboard_embedding_approved_domains")...) - AibiDashboardEmbeddingApprovedDomains_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aibi_dashboard_embedding_approved_domains")...) +func (c AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aibi_dashboard_embedding_approved_domains"] = attrs["aibi_dashboard_embedding_approved_domains"].SetRequired() + attrs["aibi_dashboard_embedding_approved_domains"] = attrs["aibi_dashboard_embedding_approved_domains"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingApprovedDomainsSetting. @@ -338,7 +344,7 @@ func (o *AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2) SetAibiDashboardEmb } type AutomaticClusterUpdateSetting_SdkV2 struct { - AutomaticClusterUpdateWorkspace types.List `tfsdk:"automatic_cluster_update_workspace" tf:"object"` + AutomaticClusterUpdateWorkspace types.List `tfsdk:"automatic_cluster_update_workspace"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -346,13 +352,13 @@ type AutomaticClusterUpdateSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *AutomaticClusterUpdateSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutomaticClusterUpdateSetting_SdkV2) { @@ -361,11 +367,13 @@ func (newState *AutomaticClusterUpdateSetting_SdkV2) SyncEffectiveFieldsDuringCr func (newState *AutomaticClusterUpdateSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState AutomaticClusterUpdateSetting_SdkV2) { } -func (c AutomaticClusterUpdateSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "automatic_cluster_update_workspace")...) - ClusterAutoRestartMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "automatic_cluster_update_workspace")...) +func (c AutomaticClusterUpdateSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["automatic_cluster_update_workspace"] = attrs["automatic_cluster_update_workspace"].SetRequired() + attrs["automatic_cluster_update_workspace"] = attrs["automatic_cluster_update_workspace"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutomaticClusterUpdateSetting. @@ -434,7 +442,7 @@ func (o *AutomaticClusterUpdateSetting_SdkV2) SetAutomaticClusterUpdateWorkspace } type BooleanMessage_SdkV2 struct { - Value types.Bool `tfsdk:"value" tf:"optional"` + Value types.Bool `tfsdk:"value"` } func (newState *BooleanMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BooleanMessage_SdkV2) { @@ -443,9 +451,10 @@ func (newState *BooleanMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *BooleanMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState BooleanMessage_SdkV2) { } -func (c BooleanMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BooleanMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BooleanMessage. @@ -480,20 +489,20 @@ func (o BooleanMessage_SdkV2) Type(ctx context.Context) attr.Type { } type ClusterAutoRestartMessage_SdkV2 struct { - CanToggle types.Bool `tfsdk:"can_toggle" tf:"optional"` + CanToggle types.Bool `tfsdk:"can_toggle"` - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // Contains an information about the enablement status judging (e.g. whether // the enterprise tier is enabled) This is only additional information that // MUST NOT be used to decide whether the setting is enabled or not. This is // intended to use only for purposes like showing an error message to the // customer with the additional details. For example, using these details we // can check why exactly the feature is disabled for this customer. - EnablementDetails types.List `tfsdk:"enablement_details" tf:"optional,object"` + EnablementDetails types.List `tfsdk:"enablement_details"` - MaintenanceWindow types.List `tfsdk:"maintenance_window" tf:"optional,object"` + MaintenanceWindow types.List `tfsdk:"maintenance_window"` - RestartEvenIfNoUpdatesAvailable types.Bool `tfsdk:"restart_even_if_no_updates_available" tf:"optional"` + RestartEvenIfNoUpdatesAvailable types.Bool `tfsdk:"restart_even_if_no_updates_available"` } func (newState *ClusterAutoRestartMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessage_SdkV2) { @@ -502,11 +511,16 @@ func (newState *ClusterAutoRestartMessage_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ClusterAutoRestartMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessage_SdkV2) { } -func (c ClusterAutoRestartMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAutoRestartMessageEnablementDetails_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "enablement_details")...) - ClusterAutoRestartMessageMaintenanceWindow_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "maintenance_window")...) +func (c ClusterAutoRestartMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["can_toggle"] = attrs["can_toggle"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["enablement_details"] = attrs["enablement_details"].SetOptional() + attrs["enablement_details"] = attrs["enablement_details"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["maintenance_window"] = attrs["maintenance_window"].SetOptional() + attrs["maintenance_window"] = attrs["maintenance_window"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["restart_even_if_no_updates_available"] = attrs["restart_even_if_no_updates_available"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessage. @@ -615,12 +629,12 @@ func (o *ClusterAutoRestartMessage_SdkV2) SetMaintenanceWindow(ctx context.Conte // the feature is disabled for this customer. type ClusterAutoRestartMessageEnablementDetails_SdkV2 struct { // The feature is force enabled if compliance mode is active - ForcedForComplianceMode types.Bool `tfsdk:"forced_for_compliance_mode" tf:"optional"` + ForcedForComplianceMode types.Bool `tfsdk:"forced_for_compliance_mode"` // The feature is unavailable if the corresponding entitlement disabled (see // getShieldEntitlementEnable) - UnavailableForDisabledEntitlement types.Bool `tfsdk:"unavailable_for_disabled_entitlement" tf:"optional"` + UnavailableForDisabledEntitlement types.Bool `tfsdk:"unavailable_for_disabled_entitlement"` // The feature is unavailable if the customer doesn't have enterprise tier - UnavailableForNonEnterpriseTier types.Bool `tfsdk:"unavailable_for_non_enterprise_tier" tf:"optional"` + UnavailableForNonEnterpriseTier types.Bool `tfsdk:"unavailable_for_non_enterprise_tier"` } func (newState *ClusterAutoRestartMessageEnablementDetails_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageEnablementDetails_SdkV2) { @@ -629,9 +643,12 @@ func (newState *ClusterAutoRestartMessageEnablementDetails_SdkV2) SyncEffectiveF func (newState *ClusterAutoRestartMessageEnablementDetails_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageEnablementDetails_SdkV2) { } -func (c ClusterAutoRestartMessageEnablementDetails_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterAutoRestartMessageEnablementDetails_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["forced_for_compliance_mode"] = attrs["forced_for_compliance_mode"].SetOptional() + attrs["unavailable_for_disabled_entitlement"] = attrs["unavailable_for_disabled_entitlement"].SetOptional() + attrs["unavailable_for_non_enterprise_tier"] = attrs["unavailable_for_non_enterprise_tier"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageEnablementDetails. @@ -670,7 +687,7 @@ func (o ClusterAutoRestartMessageEnablementDetails_SdkV2) Type(ctx context.Conte } type ClusterAutoRestartMessageMaintenanceWindow_SdkV2 struct { - WeekDayBasedSchedule types.List `tfsdk:"week_day_based_schedule" tf:"optional,object"` + WeekDayBasedSchedule types.List `tfsdk:"week_day_based_schedule"` } func (newState *ClusterAutoRestartMessageMaintenanceWindow_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageMaintenanceWindow_SdkV2) { @@ -679,10 +696,11 @@ func (newState *ClusterAutoRestartMessageMaintenanceWindow_SdkV2) SyncEffectiveF func (newState *ClusterAutoRestartMessageMaintenanceWindow_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageMaintenanceWindow_SdkV2) { } -func (c ClusterAutoRestartMessageMaintenanceWindow_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "week_day_based_schedule")...) +func (c ClusterAutoRestartMessageMaintenanceWindow_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["week_day_based_schedule"] = attrs["week_day_based_schedule"].SetOptional() + attrs["week_day_based_schedule"] = attrs["week_day_based_schedule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageMaintenanceWindow. @@ -747,11 +765,11 @@ func (o *ClusterAutoRestartMessageMaintenanceWindow_SdkV2) SetWeekDayBasedSchedu } type ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2 struct { - DayOfWeek types.String `tfsdk:"day_of_week" tf:"optional"` + DayOfWeek types.String `tfsdk:"day_of_week"` - Frequency types.String `tfsdk:"frequency" tf:"optional"` + Frequency types.String `tfsdk:"frequency"` - WindowStartTime types.List `tfsdk:"window_start_time" tf:"optional,object"` + WindowStartTime types.List `tfsdk:"window_start_time"` } func (newState *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) { @@ -760,10 +778,13 @@ func (newState *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_S func (newState *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) { } -func (c ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "window_start_time")...) +func (c ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["day_of_week"] = attrs["day_of_week"].SetOptional() + attrs["frequency"] = attrs["frequency"].SetOptional() + attrs["window_start_time"] = attrs["window_start_time"].SetOptional() + attrs["window_start_time"] = attrs["window_start_time"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule. @@ -832,9 +853,9 @@ func (o *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule_SdkV2) S } type ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2 struct { - Hours types.Int64 `tfsdk:"hours" tf:"optional"` + Hours types.Int64 `tfsdk:"hours"` - Minutes types.Int64 `tfsdk:"minutes" tf:"optional"` + Minutes types.Int64 `tfsdk:"minutes"` } func (newState *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) { @@ -843,9 +864,11 @@ func (newState *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) func (newState *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) { } -func (c ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["hours"] = attrs["hours"].SetOptional() + attrs["minutes"] = attrs["minutes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageMaintenanceWindowWindowStartTime. @@ -884,9 +907,9 @@ func (o ClusterAutoRestartMessageMaintenanceWindowWindowStartTime_SdkV2) Type(ct // SHIELD feature: CSP type ComplianceSecurityProfile_SdkV2 struct { // Set by customers when they request Compliance Security Profile (CSP) - ComplianceStandards types.List `tfsdk:"compliance_standards" tf:"optional"` + ComplianceStandards types.List `tfsdk:"compliance_standards"` - IsEnabled types.Bool `tfsdk:"is_enabled" tf:"optional"` + IsEnabled types.Bool `tfsdk:"is_enabled"` } func (newState *ComplianceSecurityProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplianceSecurityProfile_SdkV2) { @@ -895,9 +918,11 @@ func (newState *ComplianceSecurityProfile_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ComplianceSecurityProfile_SdkV2) SyncEffectiveFieldsDuringRead(existingState ComplianceSecurityProfile_SdkV2) { } -func (c ComplianceSecurityProfile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ComplianceSecurityProfile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_standards"] = attrs["compliance_standards"].SetOptional() + attrs["is_enabled"] = attrs["is_enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplianceSecurityProfile. @@ -965,7 +990,7 @@ func (o *ComplianceSecurityProfile_SdkV2) SetComplianceStandards(ctx context.Con type ComplianceSecurityProfileSetting_SdkV2 struct { // SHIELD feature: CSP - ComplianceSecurityProfileWorkspace types.List `tfsdk:"compliance_security_profile_workspace" tf:"object"` + ComplianceSecurityProfileWorkspace types.List `tfsdk:"compliance_security_profile_workspace"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -973,13 +998,13 @@ type ComplianceSecurityProfileSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *ComplianceSecurityProfileSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplianceSecurityProfileSetting_SdkV2) { @@ -988,11 +1013,13 @@ func (newState *ComplianceSecurityProfileSetting_SdkV2) SyncEffectiveFieldsDurin func (newState *ComplianceSecurityProfileSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState ComplianceSecurityProfileSetting_SdkV2) { } -func (c ComplianceSecurityProfileSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "compliance_security_profile_workspace")...) - ComplianceSecurityProfile_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "compliance_security_profile_workspace")...) +func (c ComplianceSecurityProfileSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_security_profile_workspace"] = attrs["compliance_security_profile_workspace"].SetRequired() + attrs["compliance_security_profile_workspace"] = attrs["compliance_security_profile_workspace"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplianceSecurityProfileSetting. @@ -1061,15 +1088,15 @@ func (o *ComplianceSecurityProfileSetting_SdkV2) SetComplianceSecurityProfileWor } type Config_SdkV2 struct { - Email types.List `tfsdk:"email" tf:"optional,object"` + Email types.List `tfsdk:"email"` - GenericWebhook types.List `tfsdk:"generic_webhook" tf:"optional,object"` + GenericWebhook types.List `tfsdk:"generic_webhook"` - MicrosoftTeams types.List `tfsdk:"microsoft_teams" tf:"optional,object"` + MicrosoftTeams types.List `tfsdk:"microsoft_teams"` - Pagerduty types.List `tfsdk:"pagerduty" tf:"optional,object"` + Pagerduty types.List `tfsdk:"pagerduty"` - Slack types.List `tfsdk:"slack" tf:"optional,object"` + Slack types.List `tfsdk:"slack"` } func (newState *Config_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Config_SdkV2) { @@ -1078,14 +1105,19 @@ func (newState *Config_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Confi func (newState *Config_SdkV2) SyncEffectiveFieldsDuringRead(existingState Config_SdkV2) { } -func (c Config_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmailConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "email")...) - GenericWebhookConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "generic_webhook")...) - MicrosoftTeamsConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "microsoft_teams")...) - PagerdutyConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "pagerduty")...) - SlackConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "slack")...) +func (c Config_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["email"] = attrs["email"].SetOptional() + attrs["email"] = attrs["email"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["generic_webhook"] = attrs["generic_webhook"].SetOptional() + attrs["generic_webhook"] = attrs["generic_webhook"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["microsoft_teams"] = attrs["microsoft_teams"].SetOptional() + attrs["microsoft_teams"] = attrs["microsoft_teams"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["pagerduty"] = attrs["pagerduty"].SetOptional() + attrs["pagerduty"] = attrs["pagerduty"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["slack"] = attrs["slack"].SetOptional() + attrs["slack"] = attrs["slack"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Config. @@ -1275,16 +1307,16 @@ func (o *Config_SdkV2) SetSlack(ctx context.Context, v SlackConfig_SdkV2) { // Details required to configure a block list or allow list. type CreateIpAccessList_SdkV2 struct { - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:""` + Label types.String `tfsdk:"label"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:""` + ListType types.String `tfsdk:"list_type"` } func (newState *CreateIpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateIpAccessList_SdkV2) { @@ -1293,11 +1325,12 @@ func (newState *CreateIpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateIpAccessList_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateIpAccessList_SdkV2) { } -func (c CreateIpAccessList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "label")...) - cs.SetRequired(append(path, "list_type")...) +func (c CreateIpAccessList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetRequired() + attrs["list_type"] = attrs["list_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateIpAccessList. @@ -1368,7 +1401,7 @@ func (o *CreateIpAccessList_SdkV2) SetIpAddresses(ctx context.Context, v []types // An IP access list was successfully created. type CreateIpAccessListResponse_SdkV2 struct { // Definition of an IP Access list - IpAccessList types.List `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.List `tfsdk:"ip_access_list"` } func (newState *CreateIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateIpAccessListResponse_SdkV2) { @@ -1377,10 +1410,11 @@ func (newState *CreateIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CreateIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateIpAccessListResponse_SdkV2) { } -func (c CreateIpAccessListResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) +func (c CreateIpAccessListResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateIpAccessListResponse. @@ -1449,11 +1483,11 @@ type CreateNetworkConnectivityConfigRequest_SdkV2 struct { // alphanumeric characters, hyphens, and underscores. The length must be // between 3 and 30 characters. The name must match the regular expression // `^[0-9a-zA-Z-_]{3,30}$`. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The region for the network connectivity configuration. Only workspaces in // the same region can be attached to the network connectivity // configuration. - Region types.String `tfsdk:"region" tf:""` + Region types.String `tfsdk:"region"` } func (newState *CreateNetworkConnectivityConfigRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateNetworkConnectivityConfigRequest_SdkV2) { @@ -1462,11 +1496,11 @@ func (newState *CreateNetworkConnectivityConfigRequest_SdkV2) SyncEffectiveField func (newState *CreateNetworkConnectivityConfigRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateNetworkConnectivityConfigRequest_SdkV2) { } -func (c CreateNetworkConnectivityConfigRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "region")...) +func (c CreateNetworkConnectivityConfigRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["region"] = attrs["region"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateNetworkConnectivityConfigRequest. @@ -1505,9 +1539,9 @@ func (o CreateNetworkConnectivityConfigRequest_SdkV2) Type(ctx context.Context) type CreateNotificationDestinationRequest_SdkV2 struct { // The configuration for the notification destination. Must wrap EXACTLY one // of the nested configs. - Config types.List `tfsdk:"config" tf:"optional,object"` + Config types.List `tfsdk:"config"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` } func (newState *CreateNotificationDestinationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateNotificationDestinationRequest_SdkV2) { @@ -1516,10 +1550,12 @@ func (newState *CreateNotificationDestinationRequest_SdkV2) SyncEffectiveFieldsD func (newState *CreateNotificationDestinationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateNotificationDestinationRequest_SdkV2) { } -func (c CreateNotificationDestinationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Config_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) +func (c CreateNotificationDestinationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config"] = attrs["config"].SetOptional() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["display_name"] = attrs["display_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateNotificationDestinationRequest. @@ -1588,11 +1624,11 @@ func (o *CreateNotificationDestinationRequest_SdkV2) SetConfig(ctx context.Conte // Configuration details for creating on-behalf tokens. type CreateOboTokenRequest_SdkV2 struct { // Application ID of the service principal. - ApplicationId types.String `tfsdk:"application_id" tf:""` + ApplicationId types.String `tfsdk:"application_id"` // Comment that describes the purpose of the token. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The number of seconds before the token expires. - LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds" tf:"optional"` + LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds"` } func (newState *CreateOboTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateOboTokenRequest_SdkV2) { @@ -1601,10 +1637,12 @@ func (newState *CreateOboTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *CreateOboTokenRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateOboTokenRequest_SdkV2) { } -func (c CreateOboTokenRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "application_id")...) +func (c CreateOboTokenRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["application_id"] = attrs["application_id"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["lifetime_seconds"] = attrs["lifetime_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateOboTokenRequest. @@ -1644,9 +1682,9 @@ func (o CreateOboTokenRequest_SdkV2) Type(ctx context.Context) attr.Type { // An on-behalf token was successfully created for the service principal. type CreateOboTokenResponse_SdkV2 struct { - TokenInfo types.List `tfsdk:"token_info" tf:"optional,object"` + TokenInfo types.List `tfsdk:"token_info"` // Value of the token. - TokenValue types.String `tfsdk:"token_value" tf:"optional"` + TokenValue types.String `tfsdk:"token_value"` } func (newState *CreateOboTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateOboTokenResponse_SdkV2) { @@ -1655,10 +1693,12 @@ func (newState *CreateOboTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateOboTokenResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateOboTokenResponse_SdkV2) { } -func (c CreateOboTokenResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_info")...) +func (c CreateOboTokenResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_info"] = attrs["token_info"].SetOptional() + attrs["token_info"] = attrs["token_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["token_value"] = attrs["token_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateOboTokenResponse. @@ -1728,11 +1768,11 @@ type CreatePrivateEndpointRuleRequest_SdkV2 struct { // The sub-resource type (group ID) of the target resource. Note that to // connect to workspace root storage (root DBFS), you need two endpoints, // one for `blob` and one for `dfs`. - GroupId types.String `tfsdk:"group_id" tf:""` + GroupId types.String `tfsdk:"group_id"` // Your Network Connectvity Configuration ID. NetworkConnectivityConfigId types.String `tfsdk:"-"` // The Azure resource ID of the target resource. - ResourceId types.String `tfsdk:"resource_id" tf:""` + ResourceId types.String `tfsdk:"resource_id"` } func (newState *CreatePrivateEndpointRuleRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePrivateEndpointRuleRequest_SdkV2) { @@ -1741,12 +1781,12 @@ func (newState *CreatePrivateEndpointRuleRequest_SdkV2) SyncEffectiveFieldsDurin func (newState *CreatePrivateEndpointRuleRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreatePrivateEndpointRuleRequest_SdkV2) { } -func (c CreatePrivateEndpointRuleRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "group_id")...) - cs.SetRequired(append(path, "network_connectivity_config_id")...) - cs.SetRequired(append(path, "resource_id")...) +func (c CreatePrivateEndpointRuleRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_id"] = attrs["group_id"].SetRequired() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetRequired() + attrs["resource_id"] = attrs["resource_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePrivateEndpointRuleRequest. @@ -1786,11 +1826,11 @@ func (o CreatePrivateEndpointRuleRequest_SdkV2) Type(ctx context.Context) attr.T type CreateTokenRequest_SdkV2 struct { // Optional description to attach to the token. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The lifetime of the token, in seconds. // // If the lifetime is not specified, this token remains valid indefinitely. - LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds" tf:"optional"` + LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds"` } func (newState *CreateTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTokenRequest_SdkV2) { @@ -1799,9 +1839,11 @@ func (newState *CreateTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateTokenRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateTokenRequest_SdkV2) { } -func (c CreateTokenRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateTokenRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["lifetime_seconds"] = attrs["lifetime_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTokenRequest. @@ -1839,9 +1881,9 @@ func (o CreateTokenRequest_SdkV2) Type(ctx context.Context) attr.Type { type CreateTokenResponse_SdkV2 struct { // The information for the new token. - TokenInfo types.List `tfsdk:"token_info" tf:"optional,object"` + TokenInfo types.List `tfsdk:"token_info"` // The value of the new token. - TokenValue types.String `tfsdk:"token_value" tf:"optional"` + TokenValue types.String `tfsdk:"token_value"` } func (newState *CreateTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTokenResponse_SdkV2) { @@ -1850,10 +1892,12 @@ func (newState *CreateTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateTokenResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateTokenResponse_SdkV2) { } -func (c CreateTokenResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PublicTokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_info")...) +func (c CreateTokenResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_info"] = attrs["token_info"].SetOptional() + attrs["token_info"] = attrs["token_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["token_value"] = attrs["token_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTokenResponse. @@ -1923,9 +1967,9 @@ func (o *CreateTokenResponse_SdkV2) SetTokenInfo(ctx context.Context, v PublicTo type CspEnablementAccount_SdkV2 struct { // Set by customers when they request Compliance Security Profile (CSP) // Invariants are enforced in Settings policy. - ComplianceStandards types.List `tfsdk:"compliance_standards" tf:"optional"` + ComplianceStandards types.List `tfsdk:"compliance_standards"` // Enforced = it cannot be overriden at workspace level. - IsEnforced types.Bool `tfsdk:"is_enforced" tf:"optional"` + IsEnforced types.Bool `tfsdk:"is_enforced"` } func (newState *CspEnablementAccount_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CspEnablementAccount_SdkV2) { @@ -1934,9 +1978,11 @@ func (newState *CspEnablementAccount_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CspEnablementAccount_SdkV2) SyncEffectiveFieldsDuringRead(existingState CspEnablementAccount_SdkV2) { } -func (c CspEnablementAccount_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CspEnablementAccount_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_standards"] = attrs["compliance_standards"].SetOptional() + attrs["is_enforced"] = attrs["is_enforced"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CspEnablementAccount. @@ -2004,7 +2050,7 @@ func (o *CspEnablementAccount_SdkV2) SetComplianceStandards(ctx context.Context, type CspEnablementAccountSetting_SdkV2 struct { // Account level policy for CSP - CspEnablementAccount types.List `tfsdk:"csp_enablement_account" tf:"object"` + CspEnablementAccount types.List `tfsdk:"csp_enablement_account"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -2012,13 +2058,13 @@ type CspEnablementAccountSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *CspEnablementAccountSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CspEnablementAccountSetting_SdkV2) { @@ -2027,11 +2073,13 @@ func (newState *CspEnablementAccountSetting_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *CspEnablementAccountSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState CspEnablementAccountSetting_SdkV2) { } -func (c CspEnablementAccountSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "csp_enablement_account")...) - CspEnablementAccount_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "csp_enablement_account")...) +func (c CspEnablementAccountSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["csp_enablement_account"] = attrs["csp_enablement_account"].SetRequired() + attrs["csp_enablement_account"] = attrs["csp_enablement_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CspEnablementAccountSetting. @@ -2116,15 +2164,15 @@ type DefaultNamespaceSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - Namespace types.List `tfsdk:"namespace" tf:"object"` + Namespace types.List `tfsdk:"namespace"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DefaultNamespaceSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DefaultNamespaceSetting_SdkV2) { @@ -2133,11 +2181,13 @@ func (newState *DefaultNamespaceSetting_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *DefaultNamespaceSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState DefaultNamespaceSetting_SdkV2) { } -func (c DefaultNamespaceSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "namespace")...) - StringMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "namespace")...) +func (c DefaultNamespaceSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["namespace"] = attrs["namespace"].SetRequired() + attrs["namespace"] = attrs["namespace"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DefaultNamespaceSetting. @@ -2294,7 +2344,7 @@ type DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) { @@ -2303,10 +2353,10 @@ func (newState *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) S func (newState *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) { } -func (c DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteAibiDashboardEmbeddingAccessPolicySettingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAibiDashboardEmbeddingAccessPolicySettingResponse. @@ -2392,7 +2442,7 @@ type DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2) { @@ -2401,10 +2451,10 @@ func (newState *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2 func (newState *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2) { } -func (c DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse. @@ -2490,7 +2540,7 @@ type DeleteDefaultNamespaceSettingResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDefaultNamespaceSettingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDefaultNamespaceSettingResponse_SdkV2) { @@ -2499,10 +2549,10 @@ func (newState *DeleteDefaultNamespaceSettingResponse_SdkV2) SyncEffectiveFields func (newState *DeleteDefaultNamespaceSettingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDefaultNamespaceSettingResponse_SdkV2) { } -func (c DeleteDefaultNamespaceSettingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDefaultNamespaceSettingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDefaultNamespaceSettingResponse. @@ -2588,7 +2638,7 @@ type DeleteDisableLegacyAccessResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDisableLegacyAccessResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDisableLegacyAccessResponse_SdkV2) { @@ -2597,10 +2647,10 @@ func (newState *DeleteDisableLegacyAccessResponse_SdkV2) SyncEffectiveFieldsDuri func (newState *DeleteDisableLegacyAccessResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDisableLegacyAccessResponse_SdkV2) { } -func (c DeleteDisableLegacyAccessResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDisableLegacyAccessResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDisableLegacyAccessResponse. @@ -2686,7 +2736,7 @@ type DeleteDisableLegacyDbfsResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDisableLegacyDbfsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDisableLegacyDbfsResponse_SdkV2) { @@ -2695,10 +2745,10 @@ func (newState *DeleteDisableLegacyDbfsResponse_SdkV2) SyncEffectiveFieldsDuring func (newState *DeleteDisableLegacyDbfsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDisableLegacyDbfsResponse_SdkV2) { } -func (c DeleteDisableLegacyDbfsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDisableLegacyDbfsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDisableLegacyDbfsResponse. @@ -2784,7 +2834,7 @@ type DeleteDisableLegacyFeaturesResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDisableLegacyFeaturesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDisableLegacyFeaturesResponse_SdkV2) { @@ -2793,10 +2843,10 @@ func (newState *DeleteDisableLegacyFeaturesResponse_SdkV2) SyncEffectiveFieldsDu func (newState *DeleteDisableLegacyFeaturesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDisableLegacyFeaturesResponse_SdkV2) { } -func (c DeleteDisableLegacyFeaturesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDisableLegacyFeaturesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDisableLegacyFeaturesResponse. @@ -3022,7 +3072,7 @@ type DeletePersonalComputeSettingResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeletePersonalComputeSettingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeletePersonalComputeSettingResponse_SdkV2) { @@ -3031,10 +3081,10 @@ func (newState *DeletePersonalComputeSettingResponse_SdkV2) SyncEffectiveFieldsD func (newState *DeletePersonalComputeSettingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeletePersonalComputeSettingResponse_SdkV2) { } -func (c DeletePersonalComputeSettingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeletePersonalComputeSettingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePersonalComputeSettingResponse. @@ -3191,7 +3241,7 @@ type DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2 struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) { @@ -3200,10 +3250,10 @@ func (newState *DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) SyncEffectiv func (newState *DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) { } -func (c DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteRestrictWorkspaceAdminsSettingResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRestrictWorkspaceAdminsSettingResponse. @@ -3275,7 +3325,7 @@ func (o DeleteTokenManagementRequest_SdkV2) Type(ctx context.Context) attr.Type } type DisableLegacyAccess_SdkV2 struct { - DisableLegacyAccess types.List `tfsdk:"disable_legacy_access" tf:"object"` + DisableLegacyAccess types.List `tfsdk:"disable_legacy_access"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -3283,13 +3333,13 @@ type DisableLegacyAccess_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DisableLegacyAccess_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DisableLegacyAccess_SdkV2) { @@ -3298,11 +3348,13 @@ func (newState *DisableLegacyAccess_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *DisableLegacyAccess_SdkV2) SyncEffectiveFieldsDuringRead(existingState DisableLegacyAccess_SdkV2) { } -func (c DisableLegacyAccess_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "disable_legacy_access")...) - BooleanMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disable_legacy_access")...) +func (c DisableLegacyAccess_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disable_legacy_access"] = attrs["disable_legacy_access"].SetRequired() + attrs["disable_legacy_access"] = attrs["disable_legacy_access"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DisableLegacyAccess. @@ -3371,7 +3423,7 @@ func (o *DisableLegacyAccess_SdkV2) SetDisableLegacyAccess(ctx context.Context, } type DisableLegacyDbfs_SdkV2 struct { - DisableLegacyDbfs types.List `tfsdk:"disable_legacy_dbfs" tf:"object"` + DisableLegacyDbfs types.List `tfsdk:"disable_legacy_dbfs"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -3379,13 +3431,13 @@ type DisableLegacyDbfs_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DisableLegacyDbfs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DisableLegacyDbfs_SdkV2) { @@ -3394,11 +3446,13 @@ func (newState *DisableLegacyDbfs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *DisableLegacyDbfs_SdkV2) SyncEffectiveFieldsDuringRead(existingState DisableLegacyDbfs_SdkV2) { } -func (c DisableLegacyDbfs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "disable_legacy_dbfs")...) - BooleanMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disable_legacy_dbfs")...) +func (c DisableLegacyDbfs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disable_legacy_dbfs"] = attrs["disable_legacy_dbfs"].SetRequired() + attrs["disable_legacy_dbfs"] = attrs["disable_legacy_dbfs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DisableLegacyDbfs. @@ -3467,7 +3521,7 @@ func (o *DisableLegacyDbfs_SdkV2) SetDisableLegacyDbfs(ctx context.Context, v Bo } type DisableLegacyFeatures_SdkV2 struct { - DisableLegacyFeatures types.List `tfsdk:"disable_legacy_features" tf:"object"` + DisableLegacyFeatures types.List `tfsdk:"disable_legacy_features"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -3475,13 +3529,13 @@ type DisableLegacyFeatures_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DisableLegacyFeatures_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DisableLegacyFeatures_SdkV2) { @@ -3490,11 +3544,13 @@ func (newState *DisableLegacyFeatures_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *DisableLegacyFeatures_SdkV2) SyncEffectiveFieldsDuringRead(existingState DisableLegacyFeatures_SdkV2) { } -func (c DisableLegacyFeatures_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "disable_legacy_features")...) - BooleanMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "disable_legacy_features")...) +func (c DisableLegacyFeatures_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disable_legacy_features"] = attrs["disable_legacy_features"].SetRequired() + attrs["disable_legacy_features"] = attrs["disable_legacy_features"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DisableLegacyFeatures. @@ -3568,7 +3624,7 @@ func (o *DisableLegacyFeatures_SdkV2) SetDisableLegacyFeatures(ctx context.Conte // dataplane, see networkconfig.textproto). type EgressNetworkPolicy_SdkV2 struct { // The access policy enforced for egress traffic to the internet. - InternetAccess types.List `tfsdk:"internet_access" tf:"optional,object"` + InternetAccess types.List `tfsdk:"internet_access"` } func (newState *EgressNetworkPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicy_SdkV2) { @@ -3577,10 +3633,11 @@ func (newState *EgressNetworkPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *EgressNetworkPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicy_SdkV2) { } -func (c EgressNetworkPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EgressNetworkPolicyInternetAccessPolicy_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "internet_access")...) +func (c EgressNetworkPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["internet_access"] = attrs["internet_access"].SetOptional() + attrs["internet_access"] = attrs["internet_access"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicy. @@ -3645,19 +3702,19 @@ func (o *EgressNetworkPolicy_SdkV2) SetInternetAccess(ctx context.Context, v Egr } type EgressNetworkPolicyInternetAccessPolicy_SdkV2 struct { - AllowedInternetDestinations types.List `tfsdk:"allowed_internet_destinations" tf:"optional"` + AllowedInternetDestinations types.List `tfsdk:"allowed_internet_destinations"` - AllowedStorageDestinations types.List `tfsdk:"allowed_storage_destinations" tf:"optional"` + AllowedStorageDestinations types.List `tfsdk:"allowed_storage_destinations"` // Optional. If not specified, assume the policy is enforced for all // workloads. - LogOnlyMode types.List `tfsdk:"log_only_mode" tf:"optional,object"` + LogOnlyMode types.List `tfsdk:"log_only_mode"` // At which level can Databricks and Databricks managed compute access // Internet. FULL_ACCESS: Databricks can access Internet. No blocking rules // will apply. RESTRICTED_ACCESS: Databricks can only access explicitly // allowed internet and storage destinations, as well as UC connections and // external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only // access destinations via private link. - RestrictionMode types.String `tfsdk:"restriction_mode" tf:"optional"` + RestrictionMode types.String `tfsdk:"restriction_mode"` } func (newState *EgressNetworkPolicyInternetAccessPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicy_SdkV2) { @@ -3666,12 +3723,14 @@ func (newState *EgressNetworkPolicyInternetAccessPolicy_SdkV2) SyncEffectiveFiel func (newState *EgressNetworkPolicyInternetAccessPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicy_SdkV2) { } -func (c EgressNetworkPolicyInternetAccessPolicy_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "allowed_internet_destinations")...) - EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "allowed_storage_destinations")...) - EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "log_only_mode")...) +func (c EgressNetworkPolicyInternetAccessPolicy_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_internet_destinations"] = attrs["allowed_internet_destinations"].SetOptional() + attrs["allowed_storage_destinations"] = attrs["allowed_storage_destinations"].SetOptional() + attrs["log_only_mode"] = attrs["log_only_mode"].SetOptional() + attrs["log_only_mode"] = attrs["log_only_mode"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["restriction_mode"] = attrs["restriction_mode"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicy. @@ -3803,15 +3862,15 @@ func (o *EgressNetworkPolicyInternetAccessPolicy_SdkV2) SetLogOnlyMode(ctx conte // restricted. We only support domain name (FQDN) destinations for the time // being, though going forwards we want to support host names and IP addresses. type EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2 struct { - Destination types.String `tfsdk:"destination" tf:"optional"` + Destination types.String `tfsdk:"destination"` // The filtering protocol used by the DP. For private and public preview, // SEG will only support TCP filtering (i.e. DNS based filtering, filtering // by destination IP address), so protocol will be set to TCP by default and // hidden from the user. In the future, users may be able to select HTTP // filtering (i.e. SNI based filtering, filtering by FQDN). - Protocol types.String `tfsdk:"protocol" tf:"optional"` + Protocol types.String `tfsdk:"protocol"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) { @@ -3820,9 +3879,12 @@ func (newState *EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2 func (newState *EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) { } -func (c EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetOptional() + attrs["protocol"] = attrs["protocol"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicyInternetDestination. @@ -3861,9 +3923,9 @@ func (o EgressNetworkPolicyInternetAccessPolicyInternetDestination_SdkV2) Type(c } type EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2 struct { - LogOnlyModeType types.String `tfsdk:"log_only_mode_type" tf:"optional"` + LogOnlyModeType types.String `tfsdk:"log_only_mode_type"` - Workloads types.List `tfsdk:"workloads" tf:"optional"` + Workloads types.List `tfsdk:"workloads"` } func (newState *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) { @@ -3872,9 +3934,11 @@ func (newState *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) SyncEf func (newState *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) { } -func (c EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_only_mode_type"] = attrs["log_only_mode_type"].SetOptional() + attrs["workloads"] = attrs["workloads"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicyLogOnlyMode. @@ -3942,21 +4006,21 @@ func (o *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode_SdkV2) SetWorkloads( // Users can specify accessible storage destinations. type EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2 struct { - AllowedPaths types.List `tfsdk:"allowed_paths" tf:"optional"` + AllowedPaths types.List `tfsdk:"allowed_paths"` - AzureContainer types.String `tfsdk:"azure_container" tf:"optional"` + AzureContainer types.String `tfsdk:"azure_container"` - AzureDnsZone types.String `tfsdk:"azure_dns_zone" tf:"optional"` + AzureDnsZone types.String `tfsdk:"azure_dns_zone"` - AzureStorageAccount types.String `tfsdk:"azure_storage_account" tf:"optional"` + AzureStorageAccount types.String `tfsdk:"azure_storage_account"` - AzureStorageService types.String `tfsdk:"azure_storage_service" tf:"optional"` + AzureStorageService types.String `tfsdk:"azure_storage_service"` - BucketName types.String `tfsdk:"bucket_name" tf:"optional"` + BucketName types.String `tfsdk:"bucket_name"` - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) { @@ -3965,9 +4029,17 @@ func (newState *EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) func (newState *EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) { } -func (c EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_paths"] = attrs["allowed_paths"].SetOptional() + attrs["azure_container"] = attrs["azure_container"].SetOptional() + attrs["azure_dns_zone"] = attrs["azure_dns_zone"].SetOptional() + attrs["azure_storage_account"] = attrs["azure_storage_account"].SetOptional() + attrs["azure_storage_service"] = attrs["azure_storage_service"].SetOptional() + attrs["bucket_name"] = attrs["bucket_name"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicyStorageDestination. @@ -4047,7 +4119,7 @@ func (o *EgressNetworkPolicyInternetAccessPolicyStorageDestination_SdkV2) SetAll type EmailConfig_SdkV2 struct { // Email addresses to notify. - Addresses types.List `tfsdk:"addresses" tf:"optional"` + Addresses types.List `tfsdk:"addresses"` } func (newState *EmailConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmailConfig_SdkV2) { @@ -4056,9 +4128,10 @@ func (newState *EmailConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EmailConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState EmailConfig_SdkV2) { } -func (c EmailConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmailConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["addresses"] = attrs["addresses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmailConfig. @@ -4131,9 +4204,9 @@ func (newState *Empty_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Empty_ func (newState *Empty_SdkV2) SyncEffectiveFieldsDuringRead(existingState Empty_SdkV2) { } -func (c Empty_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Empty_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Empty. @@ -4165,7 +4238,7 @@ func (o Empty_SdkV2) Type(ctx context.Context) attr.Type { // SHIELD feature: ESM type EnhancedSecurityMonitoring_SdkV2 struct { - IsEnabled types.Bool `tfsdk:"is_enabled" tf:"optional"` + IsEnabled types.Bool `tfsdk:"is_enabled"` } func (newState *EnhancedSecurityMonitoring_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnhancedSecurityMonitoring_SdkV2) { @@ -4174,9 +4247,10 @@ func (newState *EnhancedSecurityMonitoring_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *EnhancedSecurityMonitoring_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnhancedSecurityMonitoring_SdkV2) { } -func (c EnhancedSecurityMonitoring_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EnhancedSecurityMonitoring_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_enabled"] = attrs["is_enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnhancedSecurityMonitoring. @@ -4212,7 +4286,7 @@ func (o EnhancedSecurityMonitoring_SdkV2) Type(ctx context.Context) attr.Type { type EnhancedSecurityMonitoringSetting_SdkV2 struct { // SHIELD feature: ESM - EnhancedSecurityMonitoringWorkspace types.List `tfsdk:"enhanced_security_monitoring_workspace" tf:"object"` + EnhancedSecurityMonitoringWorkspace types.List `tfsdk:"enhanced_security_monitoring_workspace"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -4220,13 +4294,13 @@ type EnhancedSecurityMonitoringSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *EnhancedSecurityMonitoringSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnhancedSecurityMonitoringSetting_SdkV2) { @@ -4235,11 +4309,13 @@ func (newState *EnhancedSecurityMonitoringSetting_SdkV2) SyncEffectiveFieldsDuri func (newState *EnhancedSecurityMonitoringSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnhancedSecurityMonitoringSetting_SdkV2) { } -func (c EnhancedSecurityMonitoringSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "enhanced_security_monitoring_workspace")...) - EnhancedSecurityMonitoring_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "enhanced_security_monitoring_workspace")...) +func (c EnhancedSecurityMonitoringSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enhanced_security_monitoring_workspace"] = attrs["enhanced_security_monitoring_workspace"].SetRequired() + attrs["enhanced_security_monitoring_workspace"] = attrs["enhanced_security_monitoring_workspace"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnhancedSecurityMonitoringSetting. @@ -4309,7 +4385,7 @@ func (o *EnhancedSecurityMonitoringSetting_SdkV2) SetEnhancedSecurityMonitoringW // Account level policy for ESM type EsmEnablementAccount_SdkV2 struct { - IsEnforced types.Bool `tfsdk:"is_enforced" tf:"optional"` + IsEnforced types.Bool `tfsdk:"is_enforced"` } func (newState *EsmEnablementAccount_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EsmEnablementAccount_SdkV2) { @@ -4318,9 +4394,10 @@ func (newState *EsmEnablementAccount_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *EsmEnablementAccount_SdkV2) SyncEffectiveFieldsDuringRead(existingState EsmEnablementAccount_SdkV2) { } -func (c EsmEnablementAccount_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EsmEnablementAccount_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_enforced"] = attrs["is_enforced"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EsmEnablementAccount. @@ -4356,7 +4433,7 @@ func (o EsmEnablementAccount_SdkV2) Type(ctx context.Context) attr.Type { type EsmEnablementAccountSetting_SdkV2 struct { // Account level policy for ESM - EsmEnablementAccount types.List `tfsdk:"esm_enablement_account" tf:"object"` + EsmEnablementAccount types.List `tfsdk:"esm_enablement_account"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -4364,13 +4441,13 @@ type EsmEnablementAccountSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *EsmEnablementAccountSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EsmEnablementAccountSetting_SdkV2) { @@ -4379,11 +4456,13 @@ func (newState *EsmEnablementAccountSetting_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *EsmEnablementAccountSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState EsmEnablementAccountSetting_SdkV2) { } -func (c EsmEnablementAccountSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "esm_enablement_account")...) - EsmEnablementAccount_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "esm_enablement_account")...) +func (c EsmEnablementAccountSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["esm_enablement_account"] = attrs["esm_enablement_account"].SetRequired() + attrs["esm_enablement_account"] = attrs["esm_enablement_account"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EsmEnablementAccountSetting. @@ -4454,16 +4533,16 @@ func (o *EsmEnablementAccountSetting_SdkV2) SetEsmEnablementAccount(ctx context. // The exchange token is the result of the token exchange with the IdP type ExchangeToken_SdkV2 struct { // The requested token. - Credential types.String `tfsdk:"credential" tf:"optional"` + Credential types.String `tfsdk:"credential"` // The end-of-life timestamp of the token. The value is in milliseconds // since the Unix epoch. - CredentialEolTime types.Int64 `tfsdk:"credentialEolTime" tf:"optional"` + CredentialEolTime types.Int64 `tfsdk:"credentialEolTime"` // User ID of the user that owns this token. - OwnerId types.Int64 `tfsdk:"ownerId" tf:"optional"` + OwnerId types.Int64 `tfsdk:"ownerId"` // The scopes of access granted in the token. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` // The type of this exchange token - TokenType types.String `tfsdk:"tokenType" tf:"optional"` + TokenType types.String `tfsdk:"tokenType"` } func (newState *ExchangeToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeToken_SdkV2) { @@ -4472,9 +4551,14 @@ func (newState *ExchangeToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ExchangeToken_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExchangeToken_SdkV2) { } -func (c ExchangeToken_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExchangeToken_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential"] = attrs["credential"].SetOptional() + attrs["credentialEolTime"] = attrs["credentialEolTime"].SetOptional() + attrs["ownerId"] = attrs["ownerId"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() + attrs["tokenType"] = attrs["tokenType"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeToken. @@ -4549,11 +4633,11 @@ func (o *ExchangeToken_SdkV2) SetScopes(ctx context.Context, v []types.String) { // Exchange a token with the IdP type ExchangeTokenRequest_SdkV2 struct { // The partition of Credentials store - PartitionId types.List `tfsdk:"partitionId" tf:"object"` + PartitionId types.List `tfsdk:"partitionId"` // Array of scopes for the token request. - Scopes types.List `tfsdk:"scopes" tf:""` + Scopes types.List `tfsdk:"scopes"` // A list of token types being requested - TokenType types.List `tfsdk:"tokenType" tf:""` + TokenType types.List `tfsdk:"tokenType"` } func (newState *ExchangeTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeTokenRequest_SdkV2) { @@ -4562,13 +4646,13 @@ func (newState *ExchangeTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ExchangeTokenRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExchangeTokenRequest_SdkV2) { } -func (c ExchangeTokenRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "partitionId")...) - PartitionId_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "partitionId")...) - cs.SetRequired(append(path, "scopes")...) - cs.SetRequired(append(path, "tokenType")...) +func (c ExchangeTokenRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["partitionId"] = attrs["partitionId"].SetRequired() + attrs["partitionId"] = attrs["partitionId"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["scopes"] = attrs["scopes"].SetRequired() + attrs["tokenType"] = attrs["tokenType"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeTokenRequest. @@ -4696,7 +4780,7 @@ func (o *ExchangeTokenRequest_SdkV2) SetTokenType(ctx context.Context, v []types // Exhanged tokens were successfully returned. type ExchangeTokenResponse_SdkV2 struct { - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *ExchangeTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeTokenResponse_SdkV2) { @@ -4705,10 +4789,10 @@ func (newState *ExchangeTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ExchangeTokenResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExchangeTokenResponse_SdkV2) { } -func (c ExchangeTokenResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeToken_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "values")...) +func (c ExchangeTokenResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeTokenResponse. @@ -4775,7 +4859,7 @@ func (o *ExchangeTokenResponse_SdkV2) SetValues(ctx context.Context, v []Exchang // An IP access list was successfully returned. type FetchIpAccessListResponse_SdkV2 struct { // Definition of an IP Access list - IpAccessList types.List `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.List `tfsdk:"ip_access_list"` } func (newState *FetchIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FetchIpAccessListResponse_SdkV2) { @@ -4784,10 +4868,11 @@ func (newState *FetchIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *FetchIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState FetchIpAccessListResponse_SdkV2) { } -func (c FetchIpAccessListResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) +func (c FetchIpAccessListResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FetchIpAccessListResponse. @@ -4853,17 +4938,17 @@ func (o *FetchIpAccessListResponse_SdkV2) SetIpAccessList(ctx context.Context, v type GenericWebhookConfig_SdkV2 struct { // [Input-Only][Optional] Password for webhook. - Password types.String `tfsdk:"password" tf:"optional"` + Password types.String `tfsdk:"password"` // [Output-Only] Whether password is set. - PasswordSet types.Bool `tfsdk:"password_set" tf:"optional"` + PasswordSet types.Bool `tfsdk:"password_set"` // [Input-Only] URL for webhook. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` // [Output-Only] Whether URL is set. - UrlSet types.Bool `tfsdk:"url_set" tf:"optional"` + UrlSet types.Bool `tfsdk:"url_set"` // [Input-Only][Optional] Username for webhook. - Username types.String `tfsdk:"username" tf:"optional"` + Username types.String `tfsdk:"username"` // [Output-Only] Whether username is set. - UsernameSet types.Bool `tfsdk:"username_set" tf:"optional"` + UsernameSet types.Bool `tfsdk:"username_set"` } func (newState *GenericWebhookConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenericWebhookConfig_SdkV2) { @@ -4872,9 +4957,15 @@ func (newState *GenericWebhookConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *GenericWebhookConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState GenericWebhookConfig_SdkV2) { } -func (c GenericWebhookConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenericWebhookConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["password"] = attrs["password"].SetOptional() + attrs["password_set"] = attrs["password_set"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() + attrs["url_set"] = attrs["url_set"].SetOptional() + attrs["username"] = attrs["username"].SetOptional() + attrs["username_set"] = attrs["username_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenericWebhookConfig. @@ -5467,7 +5558,7 @@ func (o GetIpAccessListRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetIpAccessListResponse_SdkV2 struct { // Definition of an IP Access list - IpAccessList types.List `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.List `tfsdk:"ip_access_list"` } func (newState *GetIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetIpAccessListResponse_SdkV2) { @@ -5476,10 +5567,11 @@ func (newState *GetIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *GetIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetIpAccessListResponse_SdkV2) { } -func (c GetIpAccessListResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) +func (c GetIpAccessListResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetIpAccessListResponse. @@ -5545,7 +5637,7 @@ func (o *GetIpAccessListResponse_SdkV2) SetIpAccessList(ctx context.Context, v I // IP access lists were successfully returned. type GetIpAccessListsResponse_SdkV2 struct { - IpAccessLists types.List `tfsdk:"ip_access_lists" tf:"optional"` + IpAccessLists types.List `tfsdk:"ip_access_lists"` } func (newState *GetIpAccessListsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetIpAccessListsResponse_SdkV2) { @@ -5554,10 +5646,10 @@ func (newState *GetIpAccessListsResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *GetIpAccessListsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetIpAccessListsResponse_SdkV2) { } -func (c GetIpAccessListsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_lists")...) +func (c GetIpAccessListsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_lists"] = attrs["ip_access_lists"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetIpAccessListsResponse. @@ -5896,7 +5988,7 @@ func (o GetTokenManagementRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetTokenPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetTokenPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetTokenPermissionLevelsResponse_SdkV2) { @@ -5905,10 +5997,10 @@ func (newState *GetTokenPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDurin func (newState *GetTokenPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetTokenPermissionLevelsResponse_SdkV2) { } -func (c GetTokenPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetTokenPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetTokenPermissionLevelsResponse. @@ -5974,7 +6066,7 @@ func (o *GetTokenPermissionLevelsResponse_SdkV2) SetPermissionLevels(ctx context // Token with specified Token ID was successfully returned. type GetTokenResponse_SdkV2 struct { - TokenInfo types.List `tfsdk:"token_info" tf:"optional,object"` + TokenInfo types.List `tfsdk:"token_info"` } func (newState *GetTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetTokenResponse_SdkV2) { @@ -5983,10 +6075,11 @@ func (newState *GetTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *GetTokenResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetTokenResponse_SdkV2) { } -func (c GetTokenResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_info")...) +func (c GetTokenResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_info"] = attrs["token_info"].SetOptional() + attrs["token_info"] = attrs["token_info"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetTokenResponse. @@ -6053,30 +6146,30 @@ func (o *GetTokenResponse_SdkV2) SetTokenInfo(ctx context.Context, v TokenInfo_S // Definition of an IP Access list type IpAccessListInfo_SdkV2 struct { // Total number of IP or CIDR values. - AddressCount types.Int64 `tfsdk:"address_count" tf:"optional"` + AddressCount types.Int64 `tfsdk:"address_count"` // Creation timestamp in milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // User ID of the user who created this list. - CreatedBy types.Int64 `tfsdk:"created_by" tf:"optional"` + CreatedBy types.Int64 `tfsdk:"created_by"` // Specifies whether this IP access list is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:"optional"` + Label types.String `tfsdk:"label"` // Universally unique identifier (UUID) of the IP access list. - ListId types.String `tfsdk:"list_id" tf:"optional"` + ListId types.String `tfsdk:"list_id"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:"optional"` + ListType types.String `tfsdk:"list_type"` // Update timestamp in milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // User ID of the user who updated this list. - UpdatedBy types.Int64 `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.Int64 `tfsdk:"updated_by"` } func (newState *IpAccessListInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan IpAccessListInfo_SdkV2) { @@ -6085,9 +6178,19 @@ func (newState *IpAccessListInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *IpAccessListInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState IpAccessListInfo_SdkV2) { } -func (c IpAccessListInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c IpAccessListInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["address_count"] = attrs["address_count"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetOptional() + attrs["list_id"] = attrs["list_id"].SetOptional() + attrs["list_type"] = attrs["list_type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IpAccessListInfo. @@ -6171,7 +6274,7 @@ func (o *IpAccessListInfo_SdkV2) SetIpAddresses(ctx context.Context, v []types.S // IP access lists were successfully returned. type ListIpAccessListResponse_SdkV2 struct { - IpAccessLists types.List `tfsdk:"ip_access_lists" tf:"optional"` + IpAccessLists types.List `tfsdk:"ip_access_lists"` } func (newState *ListIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListIpAccessListResponse_SdkV2) { @@ -6180,10 +6283,10 @@ func (newState *ListIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ListIpAccessListResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListIpAccessListResponse_SdkV2) { } -func (c ListIpAccessListResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_lists")...) +func (c ListIpAccessListResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_lists"] = attrs["ip_access_lists"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListIpAccessListResponse. @@ -6248,10 +6351,10 @@ func (o *ListIpAccessListResponse_SdkV2) SetIpAccessLists(ctx context.Context, v } type ListNccAzurePrivateEndpointRulesResponse_SdkV2 struct { - Items types.List `tfsdk:"items" tf:"optional"` + Items types.List `tfsdk:"items"` // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListNccAzurePrivateEndpointRulesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNccAzurePrivateEndpointRulesResponse_SdkV2) { @@ -6260,10 +6363,11 @@ func (newState *ListNccAzurePrivateEndpointRulesResponse_SdkV2) SyncEffectiveFie func (newState *ListNccAzurePrivateEndpointRulesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListNccAzurePrivateEndpointRulesResponse_SdkV2) { } -func (c ListNccAzurePrivateEndpointRulesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NccAzurePrivateEndpointRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "items")...) +func (c ListNccAzurePrivateEndpointRulesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["items"] = attrs["items"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNccAzurePrivateEndpointRulesResponse. @@ -6367,10 +6471,10 @@ func (o ListNetworkConnectivityConfigurationsRequest_SdkV2) Type(ctx context.Con } type ListNetworkConnectivityConfigurationsResponse_SdkV2 struct { - Items types.List `tfsdk:"items" tf:"optional"` + Items types.List `tfsdk:"items"` // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListNetworkConnectivityConfigurationsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNetworkConnectivityConfigurationsResponse_SdkV2) { @@ -6379,10 +6483,11 @@ func (newState *ListNetworkConnectivityConfigurationsResponse_SdkV2) SyncEffecti func (newState *ListNetworkConnectivityConfigurationsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListNetworkConnectivityConfigurationsResponse_SdkV2) { } -func (c ListNetworkConnectivityConfigurationsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NetworkConnectivityConfiguration_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "items")...) +func (c ListNetworkConnectivityConfigurationsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["items"] = attrs["items"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNetworkConnectivityConfigurationsResponse. @@ -6490,9 +6595,9 @@ func (o ListNotificationDestinationsRequest_SdkV2) Type(ctx context.Context) att type ListNotificationDestinationsResponse_SdkV2 struct { // Page token for next of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListNotificationDestinationsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNotificationDestinationsResponse_SdkV2) { @@ -6501,10 +6606,11 @@ func (newState *ListNotificationDestinationsResponse_SdkV2) SyncEffectiveFieldsD func (newState *ListNotificationDestinationsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListNotificationDestinationsResponse_SdkV2) { } -func (c ListNotificationDestinationsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListNotificationDestinationsResult_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListNotificationDestinationsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNotificationDestinationsResponse. @@ -6573,11 +6679,11 @@ func (o *ListNotificationDestinationsResponse_SdkV2) SetResults(ctx context.Cont type ListNotificationDestinationsResult_SdkV2 struct { // [Output-only] The type of the notification destination. The type can not // be changed once set. - DestinationType types.String `tfsdk:"destination_type" tf:"optional"` + DestinationType types.String `tfsdk:"destination_type"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying notification destination. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *ListNotificationDestinationsResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNotificationDestinationsResult_SdkV2) { @@ -6586,9 +6692,12 @@ func (newState *ListNotificationDestinationsResult_SdkV2) SyncEffectiveFieldsDur func (newState *ListNotificationDestinationsResult_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListNotificationDestinationsResult_SdkV2) { } -func (c ListNotificationDestinationsResult_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListNotificationDestinationsResult_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_type"] = attrs["destination_type"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNotificationDestinationsResult. @@ -6669,7 +6778,7 @@ func (o ListPrivateEndpointRulesRequest_SdkV2) Type(ctx context.Context) attr.Ty type ListPublicTokensResponse_SdkV2 struct { // The information for each token. - TokenInfos types.List `tfsdk:"token_infos" tf:"optional"` + TokenInfos types.List `tfsdk:"token_infos"` } func (newState *ListPublicTokensResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPublicTokensResponse_SdkV2) { @@ -6678,10 +6787,10 @@ func (newState *ListPublicTokensResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ListPublicTokensResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListPublicTokensResponse_SdkV2) { } -func (c ListPublicTokensResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PublicTokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_infos")...) +func (c ListPublicTokensResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_infos"] = attrs["token_infos"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPublicTokensResponse. @@ -6789,7 +6898,7 @@ func (o ListTokenManagementRequest_SdkV2) Type(ctx context.Context) attr.Type { // Tokens were successfully returned. type ListTokensResponse_SdkV2 struct { // Token metadata of each user-created token in the workspace - TokenInfos types.List `tfsdk:"token_infos" tf:"optional"` + TokenInfos types.List `tfsdk:"token_infos"` } func (newState *ListTokensResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListTokensResponse_SdkV2) { @@ -6798,10 +6907,10 @@ func (newState *ListTokensResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListTokensResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListTokensResponse_SdkV2) { } -func (c ListTokensResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "token_infos")...) +func (c ListTokensResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_infos"] = attrs["token_infos"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTokensResponse. @@ -6867,9 +6976,9 @@ func (o *ListTokensResponse_SdkV2) SetTokenInfos(ctx context.Context, v []TokenI type MicrosoftTeamsConfig_SdkV2 struct { // [Input-Only] URL for Microsoft Teams. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` // [Output-Only] Whether URL is set. - UrlSet types.Bool `tfsdk:"url_set" tf:"optional"` + UrlSet types.Bool `tfsdk:"url_set"` } func (newState *MicrosoftTeamsConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MicrosoftTeamsConfig_SdkV2) { @@ -6878,9 +6987,11 @@ func (newState *MicrosoftTeamsConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *MicrosoftTeamsConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState MicrosoftTeamsConfig_SdkV2) { } -func (c MicrosoftTeamsConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MicrosoftTeamsConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["url"] = attrs["url"].SetOptional() + attrs["url_set"] = attrs["url_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MicrosoftTeamsConfig. @@ -6921,7 +7032,7 @@ func (o MicrosoftTeamsConfig_SdkV2) Type(ctx context.Context) attr.Type { type NccAwsStableIpRule_SdkV2 struct { // The list of stable IP CIDR blocks from which Databricks network traffic // originates when accessing your resources. - CidrBlocks types.List `tfsdk:"cidr_blocks" tf:"optional"` + CidrBlocks types.List `tfsdk:"cidr_blocks"` } func (newState *NccAwsStableIpRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAwsStableIpRule_SdkV2) { @@ -6930,9 +7041,10 @@ func (newState *NccAwsStableIpRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *NccAwsStableIpRule_SdkV2) SyncEffectiveFieldsDuringRead(existingState NccAwsStableIpRule_SdkV2) { } -func (c NccAwsStableIpRule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NccAwsStableIpRule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cidr_blocks"] = attrs["cidr_blocks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccAwsStableIpRule. @@ -7010,28 +7122,28 @@ type NccAzurePrivateEndpointRule_SdkV2 struct { // DISCONNECTED: Connection was removed by the private link resource owner, // the private endpoint becomes informative and should be deleted for // clean-up. - ConnectionState types.String `tfsdk:"connection_state" tf:"optional"` + ConnectionState types.String `tfsdk:"connection_state"` // Time in epoch milliseconds when this object was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Whether this private endpoint is deactivated. - Deactivated types.Bool `tfsdk:"deactivated" tf:"computed"` + Deactivated types.Bool `tfsdk:"deactivated"` // Time in epoch milliseconds when this object was deactivated. - DeactivatedAt types.Int64 `tfsdk:"deactivated_at" tf:"computed"` + DeactivatedAt types.Int64 `tfsdk:"deactivated_at"` // The name of the Azure private endpoint resource. - EndpointName types.String `tfsdk:"endpoint_name" tf:"computed"` + EndpointName types.String `tfsdk:"endpoint_name"` // The sub-resource type (group ID) of the target resource. Note that to // connect to workspace root storage (root DBFS), you need two endpoints, // one for `blob` and one for `dfs`. - GroupId types.String `tfsdk:"group_id" tf:"optional"` + GroupId types.String `tfsdk:"group_id"` // The ID of a network connectivity configuration, which is the parent // resource of this private endpoint rule object. - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"optional"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id"` // The Azure resource ID of the target resource. - ResourceId types.String `tfsdk:"resource_id" tf:"optional"` + ResourceId types.String `tfsdk:"resource_id"` // The ID of a private endpoint rule. - RuleId types.String `tfsdk:"rule_id" tf:"computed"` + RuleId types.String `tfsdk:"rule_id"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed"` + UpdatedTime types.Int64 `tfsdk:"updated_time"` } func (newState *NccAzurePrivateEndpointRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAzurePrivateEndpointRule_SdkV2) { @@ -7040,15 +7152,19 @@ func (newState *NccAzurePrivateEndpointRule_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *NccAzurePrivateEndpointRule_SdkV2) SyncEffectiveFieldsDuringRead(existingState NccAzurePrivateEndpointRule_SdkV2) { } -func (c NccAzurePrivateEndpointRule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "creation_time")...) - cs.SetComputed(append(path, "deactivated")...) - cs.SetComputed(append(path, "deactivated_at")...) - cs.SetComputed(append(path, "endpoint_name")...) - cs.SetComputed(append(path, "rule_id")...) - cs.SetComputed(append(path, "updated_time")...) +func (c NccAzurePrivateEndpointRule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connection_state"] = attrs["connection_state"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["deactivated"] = attrs["deactivated"].SetComputed() + attrs["deactivated_at"] = attrs["deactivated_at"].SetComputed() + attrs["endpoint_name"] = attrs["endpoint_name"].SetComputed() + attrs["group_id"] = attrs["group_id"].SetOptional() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetOptional() + attrs["resource_id"] = attrs["resource_id"].SetOptional() + attrs["rule_id"] = attrs["rule_id"].SetComputed() + attrs["updated_time"] = attrs["updated_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccAzurePrivateEndpointRule. @@ -7106,11 +7222,11 @@ func (o NccAzurePrivateEndpointRule_SdkV2) Type(ctx context.Context) attr.Type { type NccAzureServiceEndpointRule_SdkV2 struct { // The list of subnets from which Databricks network traffic originates when // accessing your Azure resources. - Subnets types.List `tfsdk:"subnets" tf:"optional"` + Subnets types.List `tfsdk:"subnets"` // The Azure region in which this service endpoint rule applies. - TargetRegion types.String `tfsdk:"target_region" tf:"optional"` + TargetRegion types.String `tfsdk:"target_region"` // The Azure services to which this service endpoint rule applies to. - TargetServices types.List `tfsdk:"target_services" tf:"optional"` + TargetServices types.List `tfsdk:"target_services"` } func (newState *NccAzureServiceEndpointRule_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAzureServiceEndpointRule_SdkV2) { @@ -7119,9 +7235,12 @@ func (newState *NccAzureServiceEndpointRule_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *NccAzureServiceEndpointRule_SdkV2) SyncEffectiveFieldsDuringRead(existingState NccAzureServiceEndpointRule_SdkV2) { } -func (c NccAzureServiceEndpointRule_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NccAzureServiceEndpointRule_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["subnets"] = attrs["subnets"].SetOptional() + attrs["target_region"] = attrs["target_region"].SetOptional() + attrs["target_services"] = attrs["target_services"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccAzureServiceEndpointRule. @@ -7224,10 +7343,10 @@ type NccEgressConfig_SdkV2 struct { // The network connectivity rules that are applied by default without // resource specific configurations. You can find the stable network // information of your serverless compute resources here. - DefaultRules types.List `tfsdk:"default_rules" tf:"computed,object"` + DefaultRules types.List `tfsdk:"default_rules"` // The network connectivity rules that configured for each destinations. // These rules override default rules. - TargetRules types.List `tfsdk:"target_rules" tf:"optional,object"` + TargetRules types.List `tfsdk:"target_rules"` } func (newState *NccEgressConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccEgressConfig_SdkV2) { @@ -7236,12 +7355,13 @@ func (newState *NccEgressConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *NccEgressConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState NccEgressConfig_SdkV2) { } -func (c NccEgressConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "default_rules")...) - NccEgressDefaultRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "default_rules")...) - NccEgressTargetRules_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "target_rules")...) +func (c NccEgressConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_rules"] = attrs["default_rules"].SetComputed() + attrs["default_rules"] = attrs["default_rules"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["target_rules"] = attrs["target_rules"].SetOptional() + attrs["target_rules"] = attrs["target_rules"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccEgressConfig. @@ -7343,11 +7463,11 @@ type NccEgressDefaultRules_SdkV2 struct { // The stable AWS IP CIDR blocks. You can use these to configure the // firewall of your resources to allow traffic from your Databricks // workspace. - AwsStableIpRule types.List `tfsdk:"aws_stable_ip_rule" tf:"optional,object"` + AwsStableIpRule types.List `tfsdk:"aws_stable_ip_rule"` // The stable Azure service endpoints. You can configure the firewall of // your Azure resources to allow traffic from your Databricks serverless // compute resources. - AzureServiceEndpointRule types.List `tfsdk:"azure_service_endpoint_rule" tf:"optional,object"` + AzureServiceEndpointRule types.List `tfsdk:"azure_service_endpoint_rule"` } func (newState *NccEgressDefaultRules_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccEgressDefaultRules_SdkV2) { @@ -7356,11 +7476,13 @@ func (newState *NccEgressDefaultRules_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *NccEgressDefaultRules_SdkV2) SyncEffectiveFieldsDuringRead(existingState NccEgressDefaultRules_SdkV2) { } -func (c NccEgressDefaultRules_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NccAwsStableIpRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "aws_stable_ip_rule")...) - NccAzureServiceEndpointRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_service_endpoint_rule")...) +func (c NccEgressDefaultRules_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_stable_ip_rule"] = attrs["aws_stable_ip_rule"].SetOptional() + attrs["aws_stable_ip_rule"] = attrs["aws_stable_ip_rule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["azure_service_endpoint_rule"] = attrs["azure_service_endpoint_rule"].SetOptional() + attrs["azure_service_endpoint_rule"] = attrs["azure_service_endpoint_rule"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccEgressDefaultRules. @@ -7458,7 +7580,7 @@ func (o *NccEgressDefaultRules_SdkV2) SetAzureServiceEndpointRule(ctx context.Co // The network connectivity rules that configured for each destinations. These // rules override default rules. type NccEgressTargetRules_SdkV2 struct { - AzurePrivateEndpointRules types.List `tfsdk:"azure_private_endpoint_rules" tf:"optional"` + AzurePrivateEndpointRules types.List `tfsdk:"azure_private_endpoint_rules"` } func (newState *NccEgressTargetRules_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccEgressTargetRules_SdkV2) { @@ -7467,10 +7589,10 @@ func (newState *NccEgressTargetRules_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *NccEgressTargetRules_SdkV2) SyncEffectiveFieldsDuringRead(existingState NccEgressTargetRules_SdkV2) { } -func (c NccEgressTargetRules_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NccAzurePrivateEndpointRule_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "azure_private_endpoint_rules")...) +func (c NccEgressTargetRules_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["azure_private_endpoint_rules"] = attrs["azure_private_endpoint_rules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccEgressTargetRules. @@ -7536,25 +7658,25 @@ func (o *NccEgressTargetRules_SdkV2) SetAzurePrivateEndpointRules(ctx context.Co type NetworkConnectivityConfiguration_SdkV2 struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Time in epoch milliseconds when this object was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // The network connectivity rules that apply to network traffic from your // serverless compute resources. - EgressConfig types.List `tfsdk:"egress_config" tf:"optional,object"` + EgressConfig types.List `tfsdk:"egress_config"` // The name of the network connectivity configuration. The name can contain // alphanumeric characters, hyphens, and underscores. The length must be // between 3 and 30 characters. The name must match the regular expression // `^[0-9a-zA-Z-_]{3,30}$`. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Databricks network connectivity configuration ID. - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"computed"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id"` // The region for the network connectivity configuration. Only workspaces in // the same region can be attached to the network connectivity // configuration. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed"` + UpdatedTime types.Int64 `tfsdk:"updated_time"` } func (newState *NetworkConnectivityConfiguration_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkConnectivityConfiguration_SdkV2) { @@ -7563,13 +7685,17 @@ func (newState *NetworkConnectivityConfiguration_SdkV2) SyncEffectiveFieldsDurin func (newState *NetworkConnectivityConfiguration_SdkV2) SyncEffectiveFieldsDuringRead(existingState NetworkConnectivityConfiguration_SdkV2) { } -func (c NetworkConnectivityConfiguration_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "creation_time")...) - NccEgressConfig_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "egress_config")...) - cs.SetComputed(append(path, "network_connectivity_config_id")...) - cs.SetComputed(append(path, "updated_time")...) +func (c NetworkConnectivityConfiguration_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["egress_config"] = attrs["egress_config"].SetOptional() + attrs["egress_config"] = attrs["egress_config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetComputed() + attrs["region"] = attrs["region"].SetOptional() + attrs["updated_time"] = attrs["updated_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkConnectivityConfiguration. @@ -7649,14 +7775,14 @@ type NotificationDestination_SdkV2 struct { // The configuration for the notification destination. Will be exactly one // of the nested configs. Only returns for users with workspace admin // permissions. - Config types.List `tfsdk:"config" tf:"optional,object"` + Config types.List `tfsdk:"config"` // [Output-only] The type of the notification destination. The type can not // be changed once set. - DestinationType types.String `tfsdk:"destination_type" tf:"optional"` + DestinationType types.String `tfsdk:"destination_type"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying notification destination. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *NotificationDestination_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotificationDestination_SdkV2) { @@ -7665,10 +7791,14 @@ func (newState *NotificationDestination_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *NotificationDestination_SdkV2) SyncEffectiveFieldsDuringRead(existingState NotificationDestination_SdkV2) { } -func (c NotificationDestination_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Config_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) +func (c NotificationDestination_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config"] = attrs["config"].SetOptional() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["destination_type"] = attrs["destination_type"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotificationDestination. @@ -7740,9 +7870,9 @@ func (o *NotificationDestination_SdkV2) SetConfig(ctx context.Context, v Config_ type PagerdutyConfig_SdkV2 struct { // [Input-Only] Integration key for PagerDuty. - IntegrationKey types.String `tfsdk:"integration_key" tf:"optional"` + IntegrationKey types.String `tfsdk:"integration_key"` // [Output-Only] Whether integration key is set. - IntegrationKeySet types.Bool `tfsdk:"integration_key_set" tf:"optional"` + IntegrationKeySet types.Bool `tfsdk:"integration_key_set"` } func (newState *PagerdutyConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PagerdutyConfig_SdkV2) { @@ -7751,9 +7881,11 @@ func (newState *PagerdutyConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PagerdutyConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState PagerdutyConfig_SdkV2) { } -func (c PagerdutyConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PagerdutyConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_key"] = attrs["integration_key"].SetOptional() + attrs["integration_key_set"] = attrs["integration_key_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PagerdutyConfig. @@ -7792,7 +7924,7 @@ func (o PagerdutyConfig_SdkV2) Type(ctx context.Context) attr.Type { // Partition by workspace or account type PartitionId_SdkV2 struct { // The ID of the workspace. - WorkspaceId types.Int64 `tfsdk:"workspaceId" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspaceId"` } func (newState *PartitionId_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartitionId_SdkV2) { @@ -7801,9 +7933,10 @@ func (newState *PartitionId_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *PartitionId_SdkV2) SyncEffectiveFieldsDuringRead(existingState PartitionId_SdkV2) { } -func (c PartitionId_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PartitionId_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["workspaceId"] = attrs["workspaceId"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartitionId. @@ -7845,7 +7978,7 @@ type PersonalComputeMessage_SdkV2 struct { // users or groups to be added to the ACLs of that workspace’s Personal // Compute default policy before they will be able to create compute // resources through that policy. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *PersonalComputeMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PersonalComputeMessage_SdkV2) { @@ -7854,10 +7987,10 @@ func (newState *PersonalComputeMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *PersonalComputeMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState PersonalComputeMessage_SdkV2) { } -func (c PersonalComputeMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "value")...) +func (c PersonalComputeMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PersonalComputeMessage. @@ -7899,15 +8032,15 @@ type PersonalComputeSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - PersonalCompute types.List `tfsdk:"personal_compute" tf:"object"` + PersonalCompute types.List `tfsdk:"personal_compute"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *PersonalComputeSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PersonalComputeSetting_SdkV2) { @@ -7916,11 +8049,13 @@ func (newState *PersonalComputeSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *PersonalComputeSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState PersonalComputeSetting_SdkV2) { } -func (c PersonalComputeSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "personal_compute")...) - PersonalComputeMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "personal_compute")...) +func (c PersonalComputeSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["personal_compute"] = attrs["personal_compute"].SetRequired() + attrs["personal_compute"] = attrs["personal_compute"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PersonalComputeSetting. @@ -7990,14 +8125,14 @@ func (o *PersonalComputeSetting_SdkV2) SetPersonalCompute(ctx context.Context, v type PublicTokenInfo_SdkV2 struct { // Comment the token was created with, if applicable. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Server time (in epoch milliseconds) when the token was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Server time (in epoch milliseconds) when the token will expire, or -1 if // not applicable. - ExpiryTime types.Int64 `tfsdk:"expiry_time" tf:"optional"` + ExpiryTime types.Int64 `tfsdk:"expiry_time"` // The ID of this token. - TokenId types.String `tfsdk:"token_id" tf:"optional"` + TokenId types.String `tfsdk:"token_id"` } func (newState *PublicTokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublicTokenInfo_SdkV2) { @@ -8006,9 +8141,13 @@ func (newState *PublicTokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *PublicTokenInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState PublicTokenInfo_SdkV2) { } -func (c PublicTokenInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PublicTokenInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["expiry_time"] = attrs["expiry_time"].SetOptional() + attrs["token_id"] = attrs["token_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublicTokenInfo. @@ -8051,20 +8190,20 @@ func (o PublicTokenInfo_SdkV2) Type(ctx context.Context) attr.Type { // Details required to replace an IP access list. type ReplaceIpAccessList_SdkV2 struct { // Specifies whether this IP access list is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:""` + Enabled types.Bool `tfsdk:"enabled"` // The ID for the corresponding IP access list IpAccessListId types.String `tfsdk:"-"` - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:""` + Label types.String `tfsdk:"label"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:""` + ListType types.String `tfsdk:"list_type"` } func (newState *ReplaceIpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReplaceIpAccessList_SdkV2) { @@ -8073,13 +8212,14 @@ func (newState *ReplaceIpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ReplaceIpAccessList_SdkV2) SyncEffectiveFieldsDuringRead(existingState ReplaceIpAccessList_SdkV2) { } -func (c ReplaceIpAccessList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "enabled")...) - cs.SetRequired(append(path, "ip_access_list_id")...) - cs.SetRequired(append(path, "label")...) - cs.SetRequired(append(path, "list_type")...) +func (c ReplaceIpAccessList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetRequired() + attrs["ip_access_list_id"] = attrs["ip_access_list_id"].SetRequired() + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetRequired() + attrs["list_type"] = attrs["list_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ReplaceIpAccessList. @@ -8182,7 +8322,7 @@ func (o ReplaceResponse_SdkV2) Type(ctx context.Context) attr.Type { } type RestrictWorkspaceAdminsMessage_SdkV2 struct { - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` } func (newState *RestrictWorkspaceAdminsMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestrictWorkspaceAdminsMessage_SdkV2) { @@ -8191,10 +8331,10 @@ func (newState *RestrictWorkspaceAdminsMessage_SdkV2) SyncEffectiveFieldsDuringC func (newState *RestrictWorkspaceAdminsMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestrictWorkspaceAdminsMessage_SdkV2) { } -func (c RestrictWorkspaceAdminsMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "status")...) +func (c RestrictWorkspaceAdminsMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["status"] = attrs["status"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestrictWorkspaceAdminsMessage. @@ -8236,15 +8376,15 @@ type RestrictWorkspaceAdminsSetting_SdkV2 struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - RestrictWorkspaceAdmins types.List `tfsdk:"restrict_workspace_admins" tf:"object"` + RestrictWorkspaceAdmins types.List `tfsdk:"restrict_workspace_admins"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *RestrictWorkspaceAdminsSetting_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestrictWorkspaceAdminsSetting_SdkV2) { @@ -8253,11 +8393,13 @@ func (newState *RestrictWorkspaceAdminsSetting_SdkV2) SyncEffectiveFieldsDuringC func (newState *RestrictWorkspaceAdminsSetting_SdkV2) SyncEffectiveFieldsDuringRead(existingState RestrictWorkspaceAdminsSetting_SdkV2) { } -func (c RestrictWorkspaceAdminsSetting_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "restrict_workspace_admins")...) - RestrictWorkspaceAdminsMessage_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "restrict_workspace_admins")...) +func (c RestrictWorkspaceAdminsSetting_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["restrict_workspace_admins"] = attrs["restrict_workspace_admins"].SetRequired() + attrs["restrict_workspace_admins"] = attrs["restrict_workspace_admins"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestrictWorkspaceAdminsSetting. @@ -8327,7 +8469,7 @@ func (o *RestrictWorkspaceAdminsSetting_SdkV2) SetRestrictWorkspaceAdmins(ctx co type RevokeTokenRequest_SdkV2 struct { // The ID of the token to be revoked. - TokenId types.String `tfsdk:"token_id" tf:""` + TokenId types.String `tfsdk:"token_id"` } func (newState *RevokeTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RevokeTokenRequest_SdkV2) { @@ -8336,10 +8478,10 @@ func (newState *RevokeTokenRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *RevokeTokenRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RevokeTokenRequest_SdkV2) { } -func (c RevokeTokenRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "token_id")...) +func (c RevokeTokenRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_id"] = attrs["token_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RevokeTokenRequest. @@ -8382,9 +8524,9 @@ func (newState *RevokeTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RevokeTokenResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RevokeTokenResponse_SdkV2) { } -func (c RevokeTokenResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RevokeTokenResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RevokeTokenResponse. @@ -8446,9 +8588,9 @@ func (o SetStatusResponse_SdkV2) Type(ctx context.Context) attr.Type { type SlackConfig_SdkV2 struct { // [Input-Only] URL for Slack destination. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` // [Output-Only] Whether URL is set. - UrlSet types.Bool `tfsdk:"url_set" tf:"optional"` + UrlSet types.Bool `tfsdk:"url_set"` } func (newState *SlackConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SlackConfig_SdkV2) { @@ -8457,9 +8599,11 @@ func (newState *SlackConfig_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SlackConfig_SdkV2) SyncEffectiveFieldsDuringRead(existingState SlackConfig_SdkV2) { } -func (c SlackConfig_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SlackConfig_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["url"] = attrs["url"].SetOptional() + attrs["url_set"] = attrs["url_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SlackConfig. @@ -8497,7 +8641,7 @@ func (o SlackConfig_SdkV2) Type(ctx context.Context) attr.Type { type StringMessage_SdkV2 struct { // Represents a generic string value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *StringMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StringMessage_SdkV2) { @@ -8506,9 +8650,10 @@ func (newState *StringMessage_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *StringMessage_SdkV2) SyncEffectiveFieldsDuringRead(existingState StringMessage_SdkV2) { } -func (c StringMessage_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StringMessage_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StringMessage. @@ -8544,13 +8689,13 @@ func (o StringMessage_SdkV2) Type(ctx context.Context) attr.Type { type TokenAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *TokenAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenAccessControlRequest_SdkV2) { @@ -8559,9 +8704,13 @@ func (newState *TokenAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *TokenAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenAccessControlRequest_SdkV2) { } -func (c TokenAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenAccessControlRequest. @@ -8603,15 +8752,15 @@ func (o TokenAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type { type TokenAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *TokenAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenAccessControlResponse_SdkV2) { @@ -8620,10 +8769,14 @@ func (newState *TokenAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *TokenAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenAccessControlResponse_SdkV2) { } -func (c TokenAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c TokenAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenAccessControlResponse. @@ -8698,24 +8851,24 @@ func (o *TokenAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Context type TokenInfo_SdkV2 struct { // Comment that describes the purpose of the token, specified by the token // creator. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // User ID of the user that created the token. - CreatedById types.Int64 `tfsdk:"created_by_id" tf:"optional"` + CreatedById types.Int64 `tfsdk:"created_by_id"` // Username of the user that created the token. - CreatedByUsername types.String `tfsdk:"created_by_username" tf:"optional"` + CreatedByUsername types.String `tfsdk:"created_by_username"` // Timestamp when the token was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Timestamp when the token expires. - ExpiryTime types.Int64 `tfsdk:"expiry_time" tf:"optional"` + ExpiryTime types.Int64 `tfsdk:"expiry_time"` // Approximate timestamp for the day the token was last used. Accurate up to // 1 day. - LastUsedDay types.Int64 `tfsdk:"last_used_day" tf:"optional"` + LastUsedDay types.Int64 `tfsdk:"last_used_day"` // User ID of the user that owns the token. - OwnerId types.Int64 `tfsdk:"owner_id" tf:"optional"` + OwnerId types.Int64 `tfsdk:"owner_id"` // ID of the token. - TokenId types.String `tfsdk:"token_id" tf:"optional"` + TokenId types.String `tfsdk:"token_id"` // If applicable, the ID of the workspace that the token was created in. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *TokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenInfo_SdkV2) { @@ -8724,9 +8877,18 @@ func (newState *TokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan To func (newState *TokenInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenInfo_SdkV2) { } -func (c TokenInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_by_id"] = attrs["created_by_id"].SetOptional() + attrs["created_by_username"] = attrs["created_by_username"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["expiry_time"] = attrs["expiry_time"].SetOptional() + attrs["last_used_day"] = attrs["last_used_day"].SetOptional() + attrs["owner_id"] = attrs["owner_id"].SetOptional() + attrs["token_id"] = attrs["token_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenInfo. @@ -8777,11 +8939,11 @@ func (o TokenInfo_SdkV2) Type(ctx context.Context) attr.Type { } type TokenPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *TokenPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermission_SdkV2) { @@ -8790,9 +8952,12 @@ func (newState *TokenPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *TokenPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenPermission_SdkV2) { } -func (c TokenPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermission. @@ -8861,11 +9026,11 @@ func (o *TokenPermission_SdkV2) SetInheritedFromObject(ctx context.Context, v [] } type TokenPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *TokenPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermissions_SdkV2) { @@ -8874,10 +9039,12 @@ func (newState *TokenPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *TokenPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenPermissions_SdkV2) { } -func (c TokenPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c TokenPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermissions. @@ -8946,9 +9113,9 @@ func (o *TokenPermissions_SdkV2) SetAccessControlList(ctx context.Context, v []T } type TokenPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *TokenPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermissionsDescription_SdkV2) { @@ -8957,9 +9124,11 @@ func (newState *TokenPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *TokenPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenPermissionsDescription_SdkV2) { } -func (c TokenPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermissionsDescription. @@ -8996,7 +9165,7 @@ func (o TokenPermissionsDescription_SdkV2) Type(ctx context.Context) attr.Type { } type TokenPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` } func (newState *TokenPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermissionsRequest_SdkV2) { @@ -9005,10 +9174,10 @@ func (newState *TokenPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *TokenPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState TokenPermissionsRequest_SdkV2) { } -func (c TokenPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c TokenPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermissionsRequest. @@ -9076,14 +9245,14 @@ func (o *TokenPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Context type UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) { @@ -9092,13 +9261,13 @@ func (newState *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) Sy func (newState *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) { } -func (c UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - AibiDashboardEmbeddingAccessPolicySetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAibiDashboardEmbeddingAccessPolicySettingRequest. @@ -9170,14 +9339,14 @@ func (o *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest_SdkV2) SetSettin type UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) { @@ -9186,13 +9355,13 @@ func (newState *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) func (newState *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) { } -func (c UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - AibiDashboardEmbeddingApprovedDomainsSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest. @@ -9264,14 +9433,14 @@ func (o *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest_SdkV2) SetSet type UpdateAutomaticClusterUpdateSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateAutomaticClusterUpdateSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAutomaticClusterUpdateSettingRequest_SdkV2) { @@ -9280,13 +9449,13 @@ func (newState *UpdateAutomaticClusterUpdateSettingRequest_SdkV2) SyncEffectiveF func (newState *UpdateAutomaticClusterUpdateSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateAutomaticClusterUpdateSettingRequest_SdkV2) { } -func (c UpdateAutomaticClusterUpdateSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - AutomaticClusterUpdateSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateAutomaticClusterUpdateSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAutomaticClusterUpdateSettingRequest. @@ -9358,14 +9527,14 @@ func (o *UpdateAutomaticClusterUpdateSettingRequest_SdkV2) SetSetting(ctx contex type UpdateComplianceSecurityProfileSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateComplianceSecurityProfileSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateComplianceSecurityProfileSettingRequest_SdkV2) { @@ -9374,13 +9543,13 @@ func (newState *UpdateComplianceSecurityProfileSettingRequest_SdkV2) SyncEffecti func (newState *UpdateComplianceSecurityProfileSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateComplianceSecurityProfileSettingRequest_SdkV2) { } -func (c UpdateComplianceSecurityProfileSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - ComplianceSecurityProfileSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateComplianceSecurityProfileSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateComplianceSecurityProfileSettingRequest. @@ -9452,14 +9621,14 @@ func (o *UpdateComplianceSecurityProfileSettingRequest_SdkV2) SetSetting(ctx con type UpdateCspEnablementAccountSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateCspEnablementAccountSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCspEnablementAccountSettingRequest_SdkV2) { @@ -9468,13 +9637,13 @@ func (newState *UpdateCspEnablementAccountSettingRequest_SdkV2) SyncEffectiveFie func (newState *UpdateCspEnablementAccountSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCspEnablementAccountSettingRequest_SdkV2) { } -func (c UpdateCspEnablementAccountSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - CspEnablementAccountSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateCspEnablementAccountSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCspEnablementAccountSettingRequest. @@ -9546,12 +9715,12 @@ func (o *UpdateCspEnablementAccountSettingRequest_SdkV2) SetSetting(ctx context. type UpdateDefaultNamespaceSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` // This represents the setting configuration for the default namespace in // the Databricks workspace. Setting the default catalog for the workspace // determines the catalog that is used when queries do not reference a fully @@ -9561,7 +9730,7 @@ type UpdateDefaultNamespaceSettingRequest_SdkV2 struct { // assumed). This setting requires a restart of clusters and SQL warehouses // to take effect. Additionally, the default namespace only applies when // using Unity Catalog-enabled compute. - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateDefaultNamespaceSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDefaultNamespaceSettingRequest_SdkV2) { @@ -9570,13 +9739,13 @@ func (newState *UpdateDefaultNamespaceSettingRequest_SdkV2) SyncEffectiveFieldsD func (newState *UpdateDefaultNamespaceSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateDefaultNamespaceSettingRequest_SdkV2) { } -func (c UpdateDefaultNamespaceSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DefaultNamespaceSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDefaultNamespaceSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDefaultNamespaceSettingRequest. @@ -9648,14 +9817,14 @@ func (o *UpdateDefaultNamespaceSettingRequest_SdkV2) SetSetting(ctx context.Cont type UpdateDisableLegacyAccessRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateDisableLegacyAccessRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDisableLegacyAccessRequest_SdkV2) { @@ -9664,13 +9833,13 @@ func (newState *UpdateDisableLegacyAccessRequest_SdkV2) SyncEffectiveFieldsDurin func (newState *UpdateDisableLegacyAccessRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateDisableLegacyAccessRequest_SdkV2) { } -func (c UpdateDisableLegacyAccessRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DisableLegacyAccess_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDisableLegacyAccessRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDisableLegacyAccessRequest. @@ -9742,14 +9911,14 @@ func (o *UpdateDisableLegacyAccessRequest_SdkV2) SetSetting(ctx context.Context, type UpdateDisableLegacyDbfsRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateDisableLegacyDbfsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDisableLegacyDbfsRequest_SdkV2) { @@ -9758,13 +9927,13 @@ func (newState *UpdateDisableLegacyDbfsRequest_SdkV2) SyncEffectiveFieldsDuringC func (newState *UpdateDisableLegacyDbfsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateDisableLegacyDbfsRequest_SdkV2) { } -func (c UpdateDisableLegacyDbfsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DisableLegacyDbfs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDisableLegacyDbfsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDisableLegacyDbfsRequest. @@ -9836,14 +10005,14 @@ func (o *UpdateDisableLegacyDbfsRequest_SdkV2) SetSetting(ctx context.Context, v type UpdateDisableLegacyFeaturesRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateDisableLegacyFeaturesRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDisableLegacyFeaturesRequest_SdkV2) { @@ -9852,13 +10021,13 @@ func (newState *UpdateDisableLegacyFeaturesRequest_SdkV2) SyncEffectiveFieldsDur func (newState *UpdateDisableLegacyFeaturesRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateDisableLegacyFeaturesRequest_SdkV2) { } -func (c UpdateDisableLegacyFeaturesRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DisableLegacyFeatures_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDisableLegacyFeaturesRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDisableLegacyFeaturesRequest. @@ -9930,14 +10099,14 @@ func (o *UpdateDisableLegacyFeaturesRequest_SdkV2) SetSetting(ctx context.Contex type UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) { @@ -9946,13 +10115,13 @@ func (newState *UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) SyncEffect func (newState *UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) { } -func (c UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - EnhancedSecurityMonitoringSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateEnhancedSecurityMonitoringSettingRequest. @@ -10024,14 +10193,14 @@ func (o *UpdateEnhancedSecurityMonitoringSettingRequest_SdkV2) SetSetting(ctx co type UpdateEsmEnablementAccountSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateEsmEnablementAccountSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateEsmEnablementAccountSettingRequest_SdkV2) { @@ -10040,13 +10209,13 @@ func (newState *UpdateEsmEnablementAccountSettingRequest_SdkV2) SyncEffectiveFie func (newState *UpdateEsmEnablementAccountSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateEsmEnablementAccountSettingRequest_SdkV2) { } -func (c UpdateEsmEnablementAccountSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - EsmEnablementAccountSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateEsmEnablementAccountSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateEsmEnablementAccountSettingRequest. @@ -10117,20 +10286,20 @@ func (o *UpdateEsmEnablementAccountSettingRequest_SdkV2) SetSetting(ctx context. // Details required to update an IP access list. type UpdateIpAccessList_SdkV2 struct { // Specifies whether this IP access list is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The ID for the corresponding IP access list IpAccessListId types.String `tfsdk:"-"` - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:"optional"` + Label types.String `tfsdk:"label"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:"optional"` + ListType types.String `tfsdk:"list_type"` } func (newState *UpdateIpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateIpAccessList_SdkV2) { @@ -10139,10 +10308,14 @@ func (newState *UpdateIpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateIpAccessList_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateIpAccessList_SdkV2) { } -func (c UpdateIpAccessList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "ip_access_list_id")...) +func (c UpdateIpAccessList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["ip_access_list_id"] = attrs["ip_access_list_id"].SetRequired() + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetOptional() + attrs["list_type"] = attrs["list_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateIpAccessList. @@ -10217,9 +10390,9 @@ func (o *UpdateIpAccessList_SdkV2) SetIpAddresses(ctx context.Context, v []types type UpdateNotificationDestinationRequest_SdkV2 struct { // The configuration for the notification destination. Must wrap EXACTLY one // of the nested configs. - Config types.List `tfsdk:"config" tf:"optional,object"` + Config types.List `tfsdk:"config"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying notification destination. Id types.String `tfsdk:"-"` } @@ -10230,11 +10403,13 @@ func (newState *UpdateNotificationDestinationRequest_SdkV2) SyncEffectiveFieldsD func (newState *UpdateNotificationDestinationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateNotificationDestinationRequest_SdkV2) { } -func (c UpdateNotificationDestinationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Config_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateNotificationDestinationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config"] = attrs["config"].SetOptional() + attrs["config"] = attrs["config"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateNotificationDestinationRequest. @@ -10306,14 +10481,14 @@ func (o *UpdateNotificationDestinationRequest_SdkV2) SetConfig(ctx context.Conte type UpdatePersonalComputeSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdatePersonalComputeSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePersonalComputeSettingRequest_SdkV2) { @@ -10322,13 +10497,13 @@ func (newState *UpdatePersonalComputeSettingRequest_SdkV2) SyncEffectiveFieldsDu func (newState *UpdatePersonalComputeSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdatePersonalComputeSettingRequest_SdkV2) { } -func (c UpdatePersonalComputeSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - PersonalComputeSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdatePersonalComputeSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePersonalComputeSettingRequest. @@ -10430,14 +10605,14 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2 struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.List `tfsdk:"setting" tf:"object"` + Setting types.List `tfsdk:"setting"` } func (newState *UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) { @@ -10446,13 +10621,13 @@ func (newState *UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) SyncEffective func (newState *UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) { } -func (c UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - RestrictWorkspaceAdminsSetting_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateRestrictWorkspaceAdminsSettingRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() + attrs["setting"] = attrs["setting"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRestrictWorkspaceAdminsSettingRequest. diff --git a/internal/service/settings_tf/model.go b/internal/service/settings_tf/model.go index 98f5c2404..9674f4702 100755 --- a/internal/service/settings_tf/model.go +++ b/internal/service/settings_tf/model.go @@ -23,7 +23,7 @@ import ( ) type AibiDashboardEmbeddingAccessPolicy struct { - AccessPolicyType types.String `tfsdk:"access_policy_type" tf:""` + AccessPolicyType types.String `tfsdk:"access_policy_type"` } func (newState *AibiDashboardEmbeddingAccessPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingAccessPolicy) { @@ -32,10 +32,10 @@ func (newState *AibiDashboardEmbeddingAccessPolicy) SyncEffectiveFieldsDuringCre func (newState *AibiDashboardEmbeddingAccessPolicy) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingAccessPolicy) { } -func (c AibiDashboardEmbeddingAccessPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "access_policy_type")...) +func (c AibiDashboardEmbeddingAccessPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_policy_type"] = attrs["access_policy_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingAccessPolicy. @@ -70,7 +70,7 @@ func (o AibiDashboardEmbeddingAccessPolicy) Type(ctx context.Context) attr.Type } type AibiDashboardEmbeddingAccessPolicySetting struct { - AibiDashboardEmbeddingAccessPolicy types.Object `tfsdk:"aibi_dashboard_embedding_access_policy" tf:"object"` + AibiDashboardEmbeddingAccessPolicy types.Object `tfsdk:"aibi_dashboard_embedding_access_policy"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -78,13 +78,13 @@ type AibiDashboardEmbeddingAccessPolicySetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *AibiDashboardEmbeddingAccessPolicySetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingAccessPolicySetting) { @@ -93,11 +93,12 @@ func (newState *AibiDashboardEmbeddingAccessPolicySetting) SyncEffectiveFieldsDu func (newState *AibiDashboardEmbeddingAccessPolicySetting) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingAccessPolicySetting) { } -func (c AibiDashboardEmbeddingAccessPolicySetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aibi_dashboard_embedding_access_policy")...) - AibiDashboardEmbeddingAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "aibi_dashboard_embedding_access_policy")...) +func (c AibiDashboardEmbeddingAccessPolicySetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aibi_dashboard_embedding_access_policy"] = attrs["aibi_dashboard_embedding_access_policy"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingAccessPolicySetting. @@ -166,7 +167,7 @@ func (o *AibiDashboardEmbeddingAccessPolicySetting) SetAibiDashboardEmbeddingAcc } type AibiDashboardEmbeddingApprovedDomains struct { - ApprovedDomains types.List `tfsdk:"approved_domains" tf:"optional"` + ApprovedDomains types.List `tfsdk:"approved_domains"` } func (newState *AibiDashboardEmbeddingApprovedDomains) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingApprovedDomains) { @@ -175,9 +176,10 @@ func (newState *AibiDashboardEmbeddingApprovedDomains) SyncEffectiveFieldsDuring func (newState *AibiDashboardEmbeddingApprovedDomains) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingApprovedDomains) { } -func (c AibiDashboardEmbeddingApprovedDomains) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AibiDashboardEmbeddingApprovedDomains) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["approved_domains"] = attrs["approved_domains"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingApprovedDomains. @@ -242,7 +244,7 @@ func (o *AibiDashboardEmbeddingApprovedDomains) SetApprovedDomains(ctx context.C } type AibiDashboardEmbeddingApprovedDomainsSetting struct { - AibiDashboardEmbeddingApprovedDomains types.Object `tfsdk:"aibi_dashboard_embedding_approved_domains" tf:"object"` + AibiDashboardEmbeddingApprovedDomains types.Object `tfsdk:"aibi_dashboard_embedding_approved_domains"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -250,13 +252,13 @@ type AibiDashboardEmbeddingApprovedDomainsSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *AibiDashboardEmbeddingApprovedDomainsSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan AibiDashboardEmbeddingApprovedDomainsSetting) { @@ -265,11 +267,12 @@ func (newState *AibiDashboardEmbeddingApprovedDomainsSetting) SyncEffectiveField func (newState *AibiDashboardEmbeddingApprovedDomainsSetting) SyncEffectiveFieldsDuringRead(existingState AibiDashboardEmbeddingApprovedDomainsSetting) { } -func (c AibiDashboardEmbeddingApprovedDomainsSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "aibi_dashboard_embedding_approved_domains")...) - AibiDashboardEmbeddingApprovedDomains{}.ApplySchemaCustomizations(cs, append(path, "aibi_dashboard_embedding_approved_domains")...) +func (c AibiDashboardEmbeddingApprovedDomainsSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aibi_dashboard_embedding_approved_domains"] = attrs["aibi_dashboard_embedding_approved_domains"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AibiDashboardEmbeddingApprovedDomainsSetting. @@ -338,7 +341,7 @@ func (o *AibiDashboardEmbeddingApprovedDomainsSetting) SetAibiDashboardEmbedding } type AutomaticClusterUpdateSetting struct { - AutomaticClusterUpdateWorkspace types.Object `tfsdk:"automatic_cluster_update_workspace" tf:"object"` + AutomaticClusterUpdateWorkspace types.Object `tfsdk:"automatic_cluster_update_workspace"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -346,13 +349,13 @@ type AutomaticClusterUpdateSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *AutomaticClusterUpdateSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan AutomaticClusterUpdateSetting) { @@ -361,11 +364,12 @@ func (newState *AutomaticClusterUpdateSetting) SyncEffectiveFieldsDuringCreateOr func (newState *AutomaticClusterUpdateSetting) SyncEffectiveFieldsDuringRead(existingState AutomaticClusterUpdateSetting) { } -func (c AutomaticClusterUpdateSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "automatic_cluster_update_workspace")...) - ClusterAutoRestartMessage{}.ApplySchemaCustomizations(cs, append(path, "automatic_cluster_update_workspace")...) +func (c AutomaticClusterUpdateSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["automatic_cluster_update_workspace"] = attrs["automatic_cluster_update_workspace"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AutomaticClusterUpdateSetting. @@ -434,7 +438,7 @@ func (o *AutomaticClusterUpdateSetting) SetAutomaticClusterUpdateWorkspace(ctx c } type BooleanMessage struct { - Value types.Bool `tfsdk:"value" tf:"optional"` + Value types.Bool `tfsdk:"value"` } func (newState *BooleanMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan BooleanMessage) { @@ -443,9 +447,10 @@ func (newState *BooleanMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan Boo func (newState *BooleanMessage) SyncEffectiveFieldsDuringRead(existingState BooleanMessage) { } -func (c BooleanMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BooleanMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BooleanMessage. @@ -480,20 +485,20 @@ func (o BooleanMessage) Type(ctx context.Context) attr.Type { } type ClusterAutoRestartMessage struct { - CanToggle types.Bool `tfsdk:"can_toggle" tf:"optional"` + CanToggle types.Bool `tfsdk:"can_toggle"` - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // Contains an information about the enablement status judging (e.g. whether // the enterprise tier is enabled) This is only additional information that // MUST NOT be used to decide whether the setting is enabled or not. This is // intended to use only for purposes like showing an error message to the // customer with the additional details. For example, using these details we // can check why exactly the feature is disabled for this customer. - EnablementDetails types.Object `tfsdk:"enablement_details" tf:"optional,object"` + EnablementDetails types.Object `tfsdk:"enablement_details"` - MaintenanceWindow types.Object `tfsdk:"maintenance_window" tf:"optional,object"` + MaintenanceWindow types.Object `tfsdk:"maintenance_window"` - RestartEvenIfNoUpdatesAvailable types.Bool `tfsdk:"restart_even_if_no_updates_available" tf:"optional"` + RestartEvenIfNoUpdatesAvailable types.Bool `tfsdk:"restart_even_if_no_updates_available"` } func (newState *ClusterAutoRestartMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessage) { @@ -502,11 +507,14 @@ func (newState *ClusterAutoRestartMessage) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ClusterAutoRestartMessage) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessage) { } -func (c ClusterAutoRestartMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAutoRestartMessageEnablementDetails{}.ApplySchemaCustomizations(cs, append(path, "enablement_details")...) - ClusterAutoRestartMessageMaintenanceWindow{}.ApplySchemaCustomizations(cs, append(path, "maintenance_window")...) +func (c ClusterAutoRestartMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["can_toggle"] = attrs["can_toggle"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["enablement_details"] = attrs["enablement_details"].SetOptional() + attrs["maintenance_window"] = attrs["maintenance_window"].SetOptional() + attrs["restart_even_if_no_updates_available"] = attrs["restart_even_if_no_updates_available"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessage. @@ -615,12 +623,12 @@ func (o *ClusterAutoRestartMessage) SetMaintenanceWindow(ctx context.Context, v // the feature is disabled for this customer. type ClusterAutoRestartMessageEnablementDetails struct { // The feature is force enabled if compliance mode is active - ForcedForComplianceMode types.Bool `tfsdk:"forced_for_compliance_mode" tf:"optional"` + ForcedForComplianceMode types.Bool `tfsdk:"forced_for_compliance_mode"` // The feature is unavailable if the corresponding entitlement disabled (see // getShieldEntitlementEnable) - UnavailableForDisabledEntitlement types.Bool `tfsdk:"unavailable_for_disabled_entitlement" tf:"optional"` + UnavailableForDisabledEntitlement types.Bool `tfsdk:"unavailable_for_disabled_entitlement"` // The feature is unavailable if the customer doesn't have enterprise tier - UnavailableForNonEnterpriseTier types.Bool `tfsdk:"unavailable_for_non_enterprise_tier" tf:"optional"` + UnavailableForNonEnterpriseTier types.Bool `tfsdk:"unavailable_for_non_enterprise_tier"` } func (newState *ClusterAutoRestartMessageEnablementDetails) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageEnablementDetails) { @@ -629,9 +637,12 @@ func (newState *ClusterAutoRestartMessageEnablementDetails) SyncEffectiveFieldsD func (newState *ClusterAutoRestartMessageEnablementDetails) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageEnablementDetails) { } -func (c ClusterAutoRestartMessageEnablementDetails) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterAutoRestartMessageEnablementDetails) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["forced_for_compliance_mode"] = attrs["forced_for_compliance_mode"].SetOptional() + attrs["unavailable_for_disabled_entitlement"] = attrs["unavailable_for_disabled_entitlement"].SetOptional() + attrs["unavailable_for_non_enterprise_tier"] = attrs["unavailable_for_non_enterprise_tier"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageEnablementDetails. @@ -670,7 +681,7 @@ func (o ClusterAutoRestartMessageEnablementDetails) Type(ctx context.Context) at } type ClusterAutoRestartMessageMaintenanceWindow struct { - WeekDayBasedSchedule types.Object `tfsdk:"week_day_based_schedule" tf:"optional,object"` + WeekDayBasedSchedule types.Object `tfsdk:"week_day_based_schedule"` } func (newState *ClusterAutoRestartMessageMaintenanceWindow) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageMaintenanceWindow) { @@ -679,10 +690,10 @@ func (newState *ClusterAutoRestartMessageMaintenanceWindow) SyncEffectiveFieldsD func (newState *ClusterAutoRestartMessageMaintenanceWindow) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageMaintenanceWindow) { } -func (c ClusterAutoRestartMessageMaintenanceWindow) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule{}.ApplySchemaCustomizations(cs, append(path, "week_day_based_schedule")...) +func (c ClusterAutoRestartMessageMaintenanceWindow) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["week_day_based_schedule"] = attrs["week_day_based_schedule"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageMaintenanceWindow. @@ -747,11 +758,11 @@ func (o *ClusterAutoRestartMessageMaintenanceWindow) SetWeekDayBasedSchedule(ctx } type ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule struct { - DayOfWeek types.String `tfsdk:"day_of_week" tf:"optional"` + DayOfWeek types.String `tfsdk:"day_of_week"` - Frequency types.String `tfsdk:"frequency" tf:"optional"` + Frequency types.String `tfsdk:"frequency"` - WindowStartTime types.Object `tfsdk:"window_start_time" tf:"optional,object"` + WindowStartTime types.Object `tfsdk:"window_start_time"` } func (newState *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) { @@ -760,10 +771,12 @@ func (newState *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) func (newState *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) { } -func (c ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ClusterAutoRestartMessageMaintenanceWindowWindowStartTime{}.ApplySchemaCustomizations(cs, append(path, "window_start_time")...) +func (c ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["day_of_week"] = attrs["day_of_week"].SetOptional() + attrs["frequency"] = attrs["frequency"].SetOptional() + attrs["window_start_time"] = attrs["window_start_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule. @@ -832,9 +845,9 @@ func (o *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule) SetWind } type ClusterAutoRestartMessageMaintenanceWindowWindowStartTime struct { - Hours types.Int64 `tfsdk:"hours" tf:"optional"` + Hours types.Int64 `tfsdk:"hours"` - Minutes types.Int64 `tfsdk:"minutes" tf:"optional"` + Minutes types.Int64 `tfsdk:"minutes"` } func (newState *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) SyncEffectiveFieldsDuringCreateOrUpdate(plan ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) { @@ -843,9 +856,11 @@ func (newState *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) SyncE func (newState *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) SyncEffectiveFieldsDuringRead(existingState ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) { } -func (c ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["hours"] = attrs["hours"].SetOptional() + attrs["minutes"] = attrs["minutes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ClusterAutoRestartMessageMaintenanceWindowWindowStartTime. @@ -884,9 +899,9 @@ func (o ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) Type(ctx cont // SHIELD feature: CSP type ComplianceSecurityProfile struct { // Set by customers when they request Compliance Security Profile (CSP) - ComplianceStandards types.List `tfsdk:"compliance_standards" tf:"optional"` + ComplianceStandards types.List `tfsdk:"compliance_standards"` - IsEnabled types.Bool `tfsdk:"is_enabled" tf:"optional"` + IsEnabled types.Bool `tfsdk:"is_enabled"` } func (newState *ComplianceSecurityProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplianceSecurityProfile) { @@ -895,9 +910,11 @@ func (newState *ComplianceSecurityProfile) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ComplianceSecurityProfile) SyncEffectiveFieldsDuringRead(existingState ComplianceSecurityProfile) { } -func (c ComplianceSecurityProfile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ComplianceSecurityProfile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_standards"] = attrs["compliance_standards"].SetOptional() + attrs["is_enabled"] = attrs["is_enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplianceSecurityProfile. @@ -965,7 +982,7 @@ func (o *ComplianceSecurityProfile) SetComplianceStandards(ctx context.Context, type ComplianceSecurityProfileSetting struct { // SHIELD feature: CSP - ComplianceSecurityProfileWorkspace types.Object `tfsdk:"compliance_security_profile_workspace" tf:"object"` + ComplianceSecurityProfileWorkspace types.Object `tfsdk:"compliance_security_profile_workspace"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -973,13 +990,13 @@ type ComplianceSecurityProfileSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *ComplianceSecurityProfileSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComplianceSecurityProfileSetting) { @@ -988,11 +1005,12 @@ func (newState *ComplianceSecurityProfileSetting) SyncEffectiveFieldsDuringCreat func (newState *ComplianceSecurityProfileSetting) SyncEffectiveFieldsDuringRead(existingState ComplianceSecurityProfileSetting) { } -func (c ComplianceSecurityProfileSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "compliance_security_profile_workspace")...) - ComplianceSecurityProfile{}.ApplySchemaCustomizations(cs, append(path, "compliance_security_profile_workspace")...) +func (c ComplianceSecurityProfileSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_security_profile_workspace"] = attrs["compliance_security_profile_workspace"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ComplianceSecurityProfileSetting. @@ -1061,15 +1079,15 @@ func (o *ComplianceSecurityProfileSetting) SetComplianceSecurityProfileWorkspace } type Config struct { - Email types.Object `tfsdk:"email" tf:"optional,object"` + Email types.Object `tfsdk:"email"` - GenericWebhook types.Object `tfsdk:"generic_webhook" tf:"optional,object"` + GenericWebhook types.Object `tfsdk:"generic_webhook"` - MicrosoftTeams types.Object `tfsdk:"microsoft_teams" tf:"optional,object"` + MicrosoftTeams types.Object `tfsdk:"microsoft_teams"` - Pagerduty types.Object `tfsdk:"pagerduty" tf:"optional,object"` + Pagerduty types.Object `tfsdk:"pagerduty"` - Slack types.Object `tfsdk:"slack" tf:"optional,object"` + Slack types.Object `tfsdk:"slack"` } func (newState *Config) SyncEffectiveFieldsDuringCreateOrUpdate(plan Config) { @@ -1078,14 +1096,14 @@ func (newState *Config) SyncEffectiveFieldsDuringCreateOrUpdate(plan Config) { func (newState *Config) SyncEffectiveFieldsDuringRead(existingState Config) { } -func (c Config) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmailConfig{}.ApplySchemaCustomizations(cs, append(path, "email")...) - GenericWebhookConfig{}.ApplySchemaCustomizations(cs, append(path, "generic_webhook")...) - MicrosoftTeamsConfig{}.ApplySchemaCustomizations(cs, append(path, "microsoft_teams")...) - PagerdutyConfig{}.ApplySchemaCustomizations(cs, append(path, "pagerduty")...) - SlackConfig{}.ApplySchemaCustomizations(cs, append(path, "slack")...) +func (c Config) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["email"] = attrs["email"].SetOptional() + attrs["generic_webhook"] = attrs["generic_webhook"].SetOptional() + attrs["microsoft_teams"] = attrs["microsoft_teams"].SetOptional() + attrs["pagerduty"] = attrs["pagerduty"].SetOptional() + attrs["slack"] = attrs["slack"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Config. @@ -1275,16 +1293,16 @@ func (o *Config) SetSlack(ctx context.Context, v SlackConfig) { // Details required to configure a block list or allow list. type CreateIpAccessList struct { - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:""` + Label types.String `tfsdk:"label"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:""` + ListType types.String `tfsdk:"list_type"` } func (newState *CreateIpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateIpAccessList) { @@ -1293,11 +1311,12 @@ func (newState *CreateIpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateIpAccessList) SyncEffectiveFieldsDuringRead(existingState CreateIpAccessList) { } -func (c CreateIpAccessList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "label")...) - cs.SetRequired(append(path, "list_type")...) +func (c CreateIpAccessList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetRequired() + attrs["list_type"] = attrs["list_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateIpAccessList. @@ -1368,7 +1387,7 @@ func (o *CreateIpAccessList) SetIpAddresses(ctx context.Context, v []types.Strin // An IP access list was successfully created. type CreateIpAccessListResponse struct { // Definition of an IP Access list - IpAccessList types.Object `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.Object `tfsdk:"ip_access_list"` } func (newState *CreateIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateIpAccessListResponse) { @@ -1377,10 +1396,10 @@ func (newState *CreateIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateIpAccessListResponse) SyncEffectiveFieldsDuringRead(existingState CreateIpAccessListResponse) { } -func (c CreateIpAccessListResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) +func (c CreateIpAccessListResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateIpAccessListResponse. @@ -1449,11 +1468,11 @@ type CreateNetworkConnectivityConfigRequest struct { // alphanumeric characters, hyphens, and underscores. The length must be // between 3 and 30 characters. The name must match the regular expression // `^[0-9a-zA-Z-_]{3,30}$`. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The region for the network connectivity configuration. Only workspaces in // the same region can be attached to the network connectivity // configuration. - Region types.String `tfsdk:"region" tf:""` + Region types.String `tfsdk:"region"` } func (newState *CreateNetworkConnectivityConfigRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateNetworkConnectivityConfigRequest) { @@ -1462,11 +1481,11 @@ func (newState *CreateNetworkConnectivityConfigRequest) SyncEffectiveFieldsDurin func (newState *CreateNetworkConnectivityConfigRequest) SyncEffectiveFieldsDuringRead(existingState CreateNetworkConnectivityConfigRequest) { } -func (c CreateNetworkConnectivityConfigRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "region")...) +func (c CreateNetworkConnectivityConfigRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["region"] = attrs["region"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateNetworkConnectivityConfigRequest. @@ -1505,9 +1524,9 @@ func (o CreateNetworkConnectivityConfigRequest) Type(ctx context.Context) attr.T type CreateNotificationDestinationRequest struct { // The configuration for the notification destination. Must wrap EXACTLY one // of the nested configs. - Config types.Object `tfsdk:"config" tf:"optional,object"` + Config types.Object `tfsdk:"config"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` } func (newState *CreateNotificationDestinationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateNotificationDestinationRequest) { @@ -1516,10 +1535,11 @@ func (newState *CreateNotificationDestinationRequest) SyncEffectiveFieldsDuringC func (newState *CreateNotificationDestinationRequest) SyncEffectiveFieldsDuringRead(existingState CreateNotificationDestinationRequest) { } -func (c CreateNotificationDestinationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Config{}.ApplySchemaCustomizations(cs, append(path, "config")...) +func (c CreateNotificationDestinationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config"] = attrs["config"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateNotificationDestinationRequest. @@ -1588,11 +1608,11 @@ func (o *CreateNotificationDestinationRequest) SetConfig(ctx context.Context, v // Configuration details for creating on-behalf tokens. type CreateOboTokenRequest struct { // Application ID of the service principal. - ApplicationId types.String `tfsdk:"application_id" tf:""` + ApplicationId types.String `tfsdk:"application_id"` // Comment that describes the purpose of the token. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The number of seconds before the token expires. - LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds" tf:"optional"` + LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds"` } func (newState *CreateOboTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateOboTokenRequest) { @@ -1601,10 +1621,12 @@ func (newState *CreateOboTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateOboTokenRequest) SyncEffectiveFieldsDuringRead(existingState CreateOboTokenRequest) { } -func (c CreateOboTokenRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "application_id")...) +func (c CreateOboTokenRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["application_id"] = attrs["application_id"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["lifetime_seconds"] = attrs["lifetime_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateOboTokenRequest. @@ -1644,9 +1666,9 @@ func (o CreateOboTokenRequest) Type(ctx context.Context) attr.Type { // An on-behalf token was successfully created for the service principal. type CreateOboTokenResponse struct { - TokenInfo types.Object `tfsdk:"token_info" tf:"optional,object"` + TokenInfo types.Object `tfsdk:"token_info"` // Value of the token. - TokenValue types.String `tfsdk:"token_value" tf:"optional"` + TokenValue types.String `tfsdk:"token_value"` } func (newState *CreateOboTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateOboTokenResponse) { @@ -1655,10 +1677,11 @@ func (newState *CreateOboTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateOboTokenResponse) SyncEffectiveFieldsDuringRead(existingState CreateOboTokenResponse) { } -func (c CreateOboTokenResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenInfo{}.ApplySchemaCustomizations(cs, append(path, "token_info")...) +func (c CreateOboTokenResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_info"] = attrs["token_info"].SetOptional() + attrs["token_value"] = attrs["token_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateOboTokenResponse. @@ -1728,11 +1751,11 @@ type CreatePrivateEndpointRuleRequest struct { // The sub-resource type (group ID) of the target resource. Note that to // connect to workspace root storage (root DBFS), you need two endpoints, // one for `blob` and one for `dfs`. - GroupId types.String `tfsdk:"group_id" tf:""` + GroupId types.String `tfsdk:"group_id"` // Your Network Connectvity Configuration ID. NetworkConnectivityConfigId types.String `tfsdk:"-"` // The Azure resource ID of the target resource. - ResourceId types.String `tfsdk:"resource_id" tf:""` + ResourceId types.String `tfsdk:"resource_id"` } func (newState *CreatePrivateEndpointRuleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreatePrivateEndpointRuleRequest) { @@ -1741,12 +1764,12 @@ func (newState *CreatePrivateEndpointRuleRequest) SyncEffectiveFieldsDuringCreat func (newState *CreatePrivateEndpointRuleRequest) SyncEffectiveFieldsDuringRead(existingState CreatePrivateEndpointRuleRequest) { } -func (c CreatePrivateEndpointRuleRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "group_id")...) - cs.SetRequired(append(path, "network_connectivity_config_id")...) - cs.SetRequired(append(path, "resource_id")...) +func (c CreatePrivateEndpointRuleRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_id"] = attrs["group_id"].SetRequired() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetRequired() + attrs["resource_id"] = attrs["resource_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreatePrivateEndpointRuleRequest. @@ -1786,11 +1809,11 @@ func (o CreatePrivateEndpointRuleRequest) Type(ctx context.Context) attr.Type { type CreateTokenRequest struct { // Optional description to attach to the token. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The lifetime of the token, in seconds. // // If the lifetime is not specified, this token remains valid indefinitely. - LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds" tf:"optional"` + LifetimeSeconds types.Int64 `tfsdk:"lifetime_seconds"` } func (newState *CreateTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTokenRequest) { @@ -1799,9 +1822,11 @@ func (newState *CreateTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateTokenRequest) SyncEffectiveFieldsDuringRead(existingState CreateTokenRequest) { } -func (c CreateTokenRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateTokenRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["lifetime_seconds"] = attrs["lifetime_seconds"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTokenRequest. @@ -1839,9 +1864,9 @@ func (o CreateTokenRequest) Type(ctx context.Context) attr.Type { type CreateTokenResponse struct { // The information for the new token. - TokenInfo types.Object `tfsdk:"token_info" tf:"optional,object"` + TokenInfo types.Object `tfsdk:"token_info"` // The value of the new token. - TokenValue types.String `tfsdk:"token_value" tf:"optional"` + TokenValue types.String `tfsdk:"token_value"` } func (newState *CreateTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateTokenResponse) { @@ -1850,10 +1875,11 @@ func (newState *CreateTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *CreateTokenResponse) SyncEffectiveFieldsDuringRead(existingState CreateTokenResponse) { } -func (c CreateTokenResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PublicTokenInfo{}.ApplySchemaCustomizations(cs, append(path, "token_info")...) +func (c CreateTokenResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_info"] = attrs["token_info"].SetOptional() + attrs["token_value"] = attrs["token_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateTokenResponse. @@ -1923,9 +1949,9 @@ func (o *CreateTokenResponse) SetTokenInfo(ctx context.Context, v PublicTokenInf type CspEnablementAccount struct { // Set by customers when they request Compliance Security Profile (CSP) // Invariants are enforced in Settings policy. - ComplianceStandards types.List `tfsdk:"compliance_standards" tf:"optional"` + ComplianceStandards types.List `tfsdk:"compliance_standards"` // Enforced = it cannot be overriden at workspace level. - IsEnforced types.Bool `tfsdk:"is_enforced" tf:"optional"` + IsEnforced types.Bool `tfsdk:"is_enforced"` } func (newState *CspEnablementAccount) SyncEffectiveFieldsDuringCreateOrUpdate(plan CspEnablementAccount) { @@ -1934,9 +1960,11 @@ func (newState *CspEnablementAccount) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CspEnablementAccount) SyncEffectiveFieldsDuringRead(existingState CspEnablementAccount) { } -func (c CspEnablementAccount) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CspEnablementAccount) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compliance_standards"] = attrs["compliance_standards"].SetOptional() + attrs["is_enforced"] = attrs["is_enforced"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CspEnablementAccount. @@ -2004,7 +2032,7 @@ func (o *CspEnablementAccount) SetComplianceStandards(ctx context.Context, v []t type CspEnablementAccountSetting struct { // Account level policy for CSP - CspEnablementAccount types.Object `tfsdk:"csp_enablement_account" tf:"object"` + CspEnablementAccount types.Object `tfsdk:"csp_enablement_account"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -2012,13 +2040,13 @@ type CspEnablementAccountSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *CspEnablementAccountSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan CspEnablementAccountSetting) { @@ -2027,11 +2055,12 @@ func (newState *CspEnablementAccountSetting) SyncEffectiveFieldsDuringCreateOrUp func (newState *CspEnablementAccountSetting) SyncEffectiveFieldsDuringRead(existingState CspEnablementAccountSetting) { } -func (c CspEnablementAccountSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "csp_enablement_account")...) - CspEnablementAccount{}.ApplySchemaCustomizations(cs, append(path, "csp_enablement_account")...) +func (c CspEnablementAccountSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["csp_enablement_account"] = attrs["csp_enablement_account"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CspEnablementAccountSetting. @@ -2116,15 +2145,15 @@ type DefaultNamespaceSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - Namespace types.Object `tfsdk:"namespace" tf:"object"` + Namespace types.Object `tfsdk:"namespace"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DefaultNamespaceSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan DefaultNamespaceSetting) { @@ -2133,11 +2162,12 @@ func (newState *DefaultNamespaceSetting) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *DefaultNamespaceSetting) SyncEffectiveFieldsDuringRead(existingState DefaultNamespaceSetting) { } -func (c DefaultNamespaceSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "namespace")...) - StringMessage{}.ApplySchemaCustomizations(cs, append(path, "namespace")...) +func (c DefaultNamespaceSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["namespace"] = attrs["namespace"].SetRequired() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DefaultNamespaceSetting. @@ -2294,7 +2324,7 @@ type DeleteAibiDashboardEmbeddingAccessPolicySettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) { @@ -2303,10 +2333,10 @@ func (newState *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) SyncEff func (newState *DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) SyncEffectiveFieldsDuringRead(existingState DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) { } -func (c DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAibiDashboardEmbeddingAccessPolicySettingResponse. @@ -2392,7 +2422,7 @@ type DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) { @@ -2401,10 +2431,10 @@ func (newState *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) Sync func (newState *DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) SyncEffectiveFieldsDuringRead(existingState DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) { } -func (c DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse. @@ -2490,7 +2520,7 @@ type DeleteDefaultNamespaceSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDefaultNamespaceSettingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDefaultNamespaceSettingResponse) { @@ -2499,10 +2529,10 @@ func (newState *DeleteDefaultNamespaceSettingResponse) SyncEffectiveFieldsDuring func (newState *DeleteDefaultNamespaceSettingResponse) SyncEffectiveFieldsDuringRead(existingState DeleteDefaultNamespaceSettingResponse) { } -func (c DeleteDefaultNamespaceSettingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDefaultNamespaceSettingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDefaultNamespaceSettingResponse. @@ -2588,7 +2618,7 @@ type DeleteDisableLegacyAccessResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDisableLegacyAccessResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDisableLegacyAccessResponse) { @@ -2597,10 +2627,10 @@ func (newState *DeleteDisableLegacyAccessResponse) SyncEffectiveFieldsDuringCrea func (newState *DeleteDisableLegacyAccessResponse) SyncEffectiveFieldsDuringRead(existingState DeleteDisableLegacyAccessResponse) { } -func (c DeleteDisableLegacyAccessResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDisableLegacyAccessResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDisableLegacyAccessResponse. @@ -2686,7 +2716,7 @@ type DeleteDisableLegacyDbfsResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDisableLegacyDbfsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDisableLegacyDbfsResponse) { @@ -2695,10 +2725,10 @@ func (newState *DeleteDisableLegacyDbfsResponse) SyncEffectiveFieldsDuringCreate func (newState *DeleteDisableLegacyDbfsResponse) SyncEffectiveFieldsDuringRead(existingState DeleteDisableLegacyDbfsResponse) { } -func (c DeleteDisableLegacyDbfsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDisableLegacyDbfsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDisableLegacyDbfsResponse. @@ -2784,7 +2814,7 @@ type DeleteDisableLegacyFeaturesResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteDisableLegacyFeaturesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDisableLegacyFeaturesResponse) { @@ -2793,10 +2823,10 @@ func (newState *DeleteDisableLegacyFeaturesResponse) SyncEffectiveFieldsDuringCr func (newState *DeleteDisableLegacyFeaturesResponse) SyncEffectiveFieldsDuringRead(existingState DeleteDisableLegacyFeaturesResponse) { } -func (c DeleteDisableLegacyFeaturesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteDisableLegacyFeaturesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDisableLegacyFeaturesResponse. @@ -3022,7 +3052,7 @@ type DeletePersonalComputeSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeletePersonalComputeSettingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeletePersonalComputeSettingResponse) { @@ -3031,10 +3061,10 @@ func (newState *DeletePersonalComputeSettingResponse) SyncEffectiveFieldsDuringC func (newState *DeletePersonalComputeSettingResponse) SyncEffectiveFieldsDuringRead(existingState DeletePersonalComputeSettingResponse) { } -func (c DeletePersonalComputeSettingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeletePersonalComputeSettingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeletePersonalComputeSettingResponse. @@ -3191,7 +3221,7 @@ type DeleteRestrictWorkspaceAdminsSettingResponse struct { // delete pattern to perform setting deletions in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // DELETE request to identify the rule set version you are deleting. - Etag types.String `tfsdk:"etag" tf:""` + Etag types.String `tfsdk:"etag"` } func (newState *DeleteRestrictWorkspaceAdminsSettingResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteRestrictWorkspaceAdminsSettingResponse) { @@ -3200,10 +3230,10 @@ func (newState *DeleteRestrictWorkspaceAdminsSettingResponse) SyncEffectiveField func (newState *DeleteRestrictWorkspaceAdminsSettingResponse) SyncEffectiveFieldsDuringRead(existingState DeleteRestrictWorkspaceAdminsSettingResponse) { } -func (c DeleteRestrictWorkspaceAdminsSettingResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "etag")...) +func (c DeleteRestrictWorkspaceAdminsSettingResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRestrictWorkspaceAdminsSettingResponse. @@ -3275,7 +3305,7 @@ func (o DeleteTokenManagementRequest) Type(ctx context.Context) attr.Type { } type DisableLegacyAccess struct { - DisableLegacyAccess types.Object `tfsdk:"disable_legacy_access" tf:"object"` + DisableLegacyAccess types.Object `tfsdk:"disable_legacy_access"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -3283,13 +3313,13 @@ type DisableLegacyAccess struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DisableLegacyAccess) SyncEffectiveFieldsDuringCreateOrUpdate(plan DisableLegacyAccess) { @@ -3298,11 +3328,12 @@ func (newState *DisableLegacyAccess) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *DisableLegacyAccess) SyncEffectiveFieldsDuringRead(existingState DisableLegacyAccess) { } -func (c DisableLegacyAccess) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "disable_legacy_access")...) - BooleanMessage{}.ApplySchemaCustomizations(cs, append(path, "disable_legacy_access")...) +func (c DisableLegacyAccess) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disable_legacy_access"] = attrs["disable_legacy_access"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DisableLegacyAccess. @@ -3371,7 +3402,7 @@ func (o *DisableLegacyAccess) SetDisableLegacyAccess(ctx context.Context, v Bool } type DisableLegacyDbfs struct { - DisableLegacyDbfs types.Object `tfsdk:"disable_legacy_dbfs" tf:"object"` + DisableLegacyDbfs types.Object `tfsdk:"disable_legacy_dbfs"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -3379,13 +3410,13 @@ type DisableLegacyDbfs struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DisableLegacyDbfs) SyncEffectiveFieldsDuringCreateOrUpdate(plan DisableLegacyDbfs) { @@ -3394,11 +3425,12 @@ func (newState *DisableLegacyDbfs) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DisableLegacyDbfs) SyncEffectiveFieldsDuringRead(existingState DisableLegacyDbfs) { } -func (c DisableLegacyDbfs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "disable_legacy_dbfs")...) - BooleanMessage{}.ApplySchemaCustomizations(cs, append(path, "disable_legacy_dbfs")...) +func (c DisableLegacyDbfs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disable_legacy_dbfs"] = attrs["disable_legacy_dbfs"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DisableLegacyDbfs. @@ -3467,7 +3499,7 @@ func (o *DisableLegacyDbfs) SetDisableLegacyDbfs(ctx context.Context, v BooleanM } type DisableLegacyFeatures struct { - DisableLegacyFeatures types.Object `tfsdk:"disable_legacy_features" tf:"object"` + DisableLegacyFeatures types.Object `tfsdk:"disable_legacy_features"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -3475,13 +3507,13 @@ type DisableLegacyFeatures struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *DisableLegacyFeatures) SyncEffectiveFieldsDuringCreateOrUpdate(plan DisableLegacyFeatures) { @@ -3490,11 +3522,12 @@ func (newState *DisableLegacyFeatures) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *DisableLegacyFeatures) SyncEffectiveFieldsDuringRead(existingState DisableLegacyFeatures) { } -func (c DisableLegacyFeatures) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "disable_legacy_features")...) - BooleanMessage{}.ApplySchemaCustomizations(cs, append(path, "disable_legacy_features")...) +func (c DisableLegacyFeatures) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["disable_legacy_features"] = attrs["disable_legacy_features"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DisableLegacyFeatures. @@ -3568,7 +3601,7 @@ func (o *DisableLegacyFeatures) SetDisableLegacyFeatures(ctx context.Context, v // dataplane, see networkconfig.textproto). type EgressNetworkPolicy struct { // The access policy enforced for egress traffic to the internet. - InternetAccess types.Object `tfsdk:"internet_access" tf:"optional,object"` + InternetAccess types.Object `tfsdk:"internet_access"` } func (newState *EgressNetworkPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicy) { @@ -3577,10 +3610,10 @@ func (newState *EgressNetworkPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *EgressNetworkPolicy) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicy) { } -func (c EgressNetworkPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EgressNetworkPolicyInternetAccessPolicy{}.ApplySchemaCustomizations(cs, append(path, "internet_access")...) +func (c EgressNetworkPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["internet_access"] = attrs["internet_access"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicy. @@ -3645,19 +3678,19 @@ func (o *EgressNetworkPolicy) SetInternetAccess(ctx context.Context, v EgressNet } type EgressNetworkPolicyInternetAccessPolicy struct { - AllowedInternetDestinations types.List `tfsdk:"allowed_internet_destinations" tf:"optional"` + AllowedInternetDestinations types.List `tfsdk:"allowed_internet_destinations"` - AllowedStorageDestinations types.List `tfsdk:"allowed_storage_destinations" tf:"optional"` + AllowedStorageDestinations types.List `tfsdk:"allowed_storage_destinations"` // Optional. If not specified, assume the policy is enforced for all // workloads. - LogOnlyMode types.Object `tfsdk:"log_only_mode" tf:"optional,object"` + LogOnlyMode types.Object `tfsdk:"log_only_mode"` // At which level can Databricks and Databricks managed compute access // Internet. FULL_ACCESS: Databricks can access Internet. No blocking rules // will apply. RESTRICTED_ACCESS: Databricks can only access explicitly // allowed internet and storage destinations, as well as UC connections and // external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only // access destinations via private link. - RestrictionMode types.String `tfsdk:"restriction_mode" tf:"optional"` + RestrictionMode types.String `tfsdk:"restriction_mode"` } func (newState *EgressNetworkPolicyInternetAccessPolicy) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicy) { @@ -3666,12 +3699,13 @@ func (newState *EgressNetworkPolicyInternetAccessPolicy) SyncEffectiveFieldsDuri func (newState *EgressNetworkPolicyInternetAccessPolicy) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicy) { } -func (c EgressNetworkPolicyInternetAccessPolicy) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EgressNetworkPolicyInternetAccessPolicyInternetDestination{}.ApplySchemaCustomizations(cs, append(path, "allowed_internet_destinations")...) - EgressNetworkPolicyInternetAccessPolicyStorageDestination{}.ApplySchemaCustomizations(cs, append(path, "allowed_storage_destinations")...) - EgressNetworkPolicyInternetAccessPolicyLogOnlyMode{}.ApplySchemaCustomizations(cs, append(path, "log_only_mode")...) +func (c EgressNetworkPolicyInternetAccessPolicy) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_internet_destinations"] = attrs["allowed_internet_destinations"].SetOptional() + attrs["allowed_storage_destinations"] = attrs["allowed_storage_destinations"].SetOptional() + attrs["log_only_mode"] = attrs["log_only_mode"].SetOptional() + attrs["restriction_mode"] = attrs["restriction_mode"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicy. @@ -3803,15 +3837,15 @@ func (o *EgressNetworkPolicyInternetAccessPolicy) SetLogOnlyMode(ctx context.Con // restricted. We only support domain name (FQDN) destinations for the time // being, though going forwards we want to support host names and IP addresses. type EgressNetworkPolicyInternetAccessPolicyInternetDestination struct { - Destination types.String `tfsdk:"destination" tf:"optional"` + Destination types.String `tfsdk:"destination"` // The filtering protocol used by the DP. For private and public preview, // SEG will only support TCP filtering (i.e. DNS based filtering, filtering // by destination IP address), so protocol will be set to TCP by default and // hidden from the user. In the future, users may be able to select HTTP // filtering (i.e. SNI based filtering, filtering by FQDN). - Protocol types.String `tfsdk:"protocol" tf:"optional"` + Protocol types.String `tfsdk:"protocol"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *EgressNetworkPolicyInternetAccessPolicyInternetDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicyInternetDestination) { @@ -3820,9 +3854,12 @@ func (newState *EgressNetworkPolicyInternetAccessPolicyInternetDestination) Sync func (newState *EgressNetworkPolicyInternetAccessPolicyInternetDestination) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicyInternetDestination) { } -func (c EgressNetworkPolicyInternetAccessPolicyInternetDestination) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EgressNetworkPolicyInternetAccessPolicyInternetDestination) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination"] = attrs["destination"].SetOptional() + attrs["protocol"] = attrs["protocol"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicyInternetDestination. @@ -3861,9 +3898,9 @@ func (o EgressNetworkPolicyInternetAccessPolicyInternetDestination) Type(ctx con } type EgressNetworkPolicyInternetAccessPolicyLogOnlyMode struct { - LogOnlyModeType types.String `tfsdk:"log_only_mode_type" tf:"optional"` + LogOnlyModeType types.String `tfsdk:"log_only_mode_type"` - Workloads types.List `tfsdk:"workloads" tf:"optional"` + Workloads types.List `tfsdk:"workloads"` } func (newState *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) { @@ -3872,9 +3909,11 @@ func (newState *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) SyncEffectiv func (newState *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) { } -func (c EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["log_only_mode_type"] = attrs["log_only_mode_type"].SetOptional() + attrs["workloads"] = attrs["workloads"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicyLogOnlyMode. @@ -3942,21 +3981,21 @@ func (o *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode) SetWorkloads(ctx co // Users can specify accessible storage destinations. type EgressNetworkPolicyInternetAccessPolicyStorageDestination struct { - AllowedPaths types.List `tfsdk:"allowed_paths" tf:"optional"` + AllowedPaths types.List `tfsdk:"allowed_paths"` - AzureContainer types.String `tfsdk:"azure_container" tf:"optional"` + AzureContainer types.String `tfsdk:"azure_container"` - AzureDnsZone types.String `tfsdk:"azure_dns_zone" tf:"optional"` + AzureDnsZone types.String `tfsdk:"azure_dns_zone"` - AzureStorageAccount types.String `tfsdk:"azure_storage_account" tf:"optional"` + AzureStorageAccount types.String `tfsdk:"azure_storage_account"` - AzureStorageService types.String `tfsdk:"azure_storage_service" tf:"optional"` + AzureStorageService types.String `tfsdk:"azure_storage_service"` - BucketName types.String `tfsdk:"bucket_name" tf:"optional"` + BucketName types.String `tfsdk:"bucket_name"` - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *EgressNetworkPolicyInternetAccessPolicyStorageDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan EgressNetworkPolicyInternetAccessPolicyStorageDestination) { @@ -3965,9 +4004,17 @@ func (newState *EgressNetworkPolicyInternetAccessPolicyStorageDestination) SyncE func (newState *EgressNetworkPolicyInternetAccessPolicyStorageDestination) SyncEffectiveFieldsDuringRead(existingState EgressNetworkPolicyInternetAccessPolicyStorageDestination) { } -func (c EgressNetworkPolicyInternetAccessPolicyStorageDestination) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EgressNetworkPolicyInternetAccessPolicyStorageDestination) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_paths"] = attrs["allowed_paths"].SetOptional() + attrs["azure_container"] = attrs["azure_container"].SetOptional() + attrs["azure_dns_zone"] = attrs["azure_dns_zone"].SetOptional() + attrs["azure_storage_account"] = attrs["azure_storage_account"].SetOptional() + attrs["azure_storage_service"] = attrs["azure_storage_service"].SetOptional() + attrs["bucket_name"] = attrs["bucket_name"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EgressNetworkPolicyInternetAccessPolicyStorageDestination. @@ -4047,7 +4094,7 @@ func (o *EgressNetworkPolicyInternetAccessPolicyStorageDestination) SetAllowedPa type EmailConfig struct { // Email addresses to notify. - Addresses types.List `tfsdk:"addresses" tf:"optional"` + Addresses types.List `tfsdk:"addresses"` } func (newState *EmailConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmailConfig) { @@ -4056,9 +4103,10 @@ func (newState *EmailConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmailC func (newState *EmailConfig) SyncEffectiveFieldsDuringRead(existingState EmailConfig) { } -func (c EmailConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmailConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["addresses"] = attrs["addresses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmailConfig. @@ -4131,9 +4179,9 @@ func (newState *Empty) SyncEffectiveFieldsDuringCreateOrUpdate(plan Empty) { func (newState *Empty) SyncEffectiveFieldsDuringRead(existingState Empty) { } -func (c Empty) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Empty) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Empty. @@ -4165,7 +4213,7 @@ func (o Empty) Type(ctx context.Context) attr.Type { // SHIELD feature: ESM type EnhancedSecurityMonitoring struct { - IsEnabled types.Bool `tfsdk:"is_enabled" tf:"optional"` + IsEnabled types.Bool `tfsdk:"is_enabled"` } func (newState *EnhancedSecurityMonitoring) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnhancedSecurityMonitoring) { @@ -4174,9 +4222,10 @@ func (newState *EnhancedSecurityMonitoring) SyncEffectiveFieldsDuringCreateOrUpd func (newState *EnhancedSecurityMonitoring) SyncEffectiveFieldsDuringRead(existingState EnhancedSecurityMonitoring) { } -func (c EnhancedSecurityMonitoring) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EnhancedSecurityMonitoring) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_enabled"] = attrs["is_enabled"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnhancedSecurityMonitoring. @@ -4212,7 +4261,7 @@ func (o EnhancedSecurityMonitoring) Type(ctx context.Context) attr.Type { type EnhancedSecurityMonitoringSetting struct { // SHIELD feature: ESM - EnhancedSecurityMonitoringWorkspace types.Object `tfsdk:"enhanced_security_monitoring_workspace" tf:"object"` + EnhancedSecurityMonitoringWorkspace types.Object `tfsdk:"enhanced_security_monitoring_workspace"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -4220,13 +4269,13 @@ type EnhancedSecurityMonitoringSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *EnhancedSecurityMonitoringSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnhancedSecurityMonitoringSetting) { @@ -4235,11 +4284,12 @@ func (newState *EnhancedSecurityMonitoringSetting) SyncEffectiveFieldsDuringCrea func (newState *EnhancedSecurityMonitoringSetting) SyncEffectiveFieldsDuringRead(existingState EnhancedSecurityMonitoringSetting) { } -func (c EnhancedSecurityMonitoringSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "enhanced_security_monitoring_workspace")...) - EnhancedSecurityMonitoring{}.ApplySchemaCustomizations(cs, append(path, "enhanced_security_monitoring_workspace")...) +func (c EnhancedSecurityMonitoringSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enhanced_security_monitoring_workspace"] = attrs["enhanced_security_monitoring_workspace"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnhancedSecurityMonitoringSetting. @@ -4309,7 +4359,7 @@ func (o *EnhancedSecurityMonitoringSetting) SetEnhancedSecurityMonitoringWorkspa // Account level policy for ESM type EsmEnablementAccount struct { - IsEnforced types.Bool `tfsdk:"is_enforced" tf:"optional"` + IsEnforced types.Bool `tfsdk:"is_enforced"` } func (newState *EsmEnablementAccount) SyncEffectiveFieldsDuringCreateOrUpdate(plan EsmEnablementAccount) { @@ -4318,9 +4368,10 @@ func (newState *EsmEnablementAccount) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *EsmEnablementAccount) SyncEffectiveFieldsDuringRead(existingState EsmEnablementAccount) { } -func (c EsmEnablementAccount) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EsmEnablementAccount) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["is_enforced"] = attrs["is_enforced"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EsmEnablementAccount. @@ -4356,7 +4407,7 @@ func (o EsmEnablementAccount) Type(ctx context.Context) attr.Type { type EsmEnablementAccountSetting struct { // Account level policy for ESM - EsmEnablementAccount types.Object `tfsdk:"esm_enablement_account" tf:"object"` + EsmEnablementAccount types.Object `tfsdk:"esm_enablement_account"` // etag used for versioning. The response is at least as fresh as the eTag // provided. This is used for optimistic concurrency control as a way to // help prevent simultaneous writes of a setting overwriting each other. It @@ -4364,13 +4415,13 @@ type EsmEnablementAccountSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *EsmEnablementAccountSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan EsmEnablementAccountSetting) { @@ -4379,11 +4430,12 @@ func (newState *EsmEnablementAccountSetting) SyncEffectiveFieldsDuringCreateOrUp func (newState *EsmEnablementAccountSetting) SyncEffectiveFieldsDuringRead(existingState EsmEnablementAccountSetting) { } -func (c EsmEnablementAccountSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "esm_enablement_account")...) - EsmEnablementAccount{}.ApplySchemaCustomizations(cs, append(path, "esm_enablement_account")...) +func (c EsmEnablementAccountSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["esm_enablement_account"] = attrs["esm_enablement_account"].SetRequired() + attrs["etag"] = attrs["etag"].SetOptional() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EsmEnablementAccountSetting. @@ -4454,16 +4506,16 @@ func (o *EsmEnablementAccountSetting) SetEsmEnablementAccount(ctx context.Contex // The exchange token is the result of the token exchange with the IdP type ExchangeToken struct { // The requested token. - Credential types.String `tfsdk:"credential" tf:"optional"` + Credential types.String `tfsdk:"credential"` // The end-of-life timestamp of the token. The value is in milliseconds // since the Unix epoch. - CredentialEolTime types.Int64 `tfsdk:"credentialEolTime" tf:"optional"` + CredentialEolTime types.Int64 `tfsdk:"credentialEolTime"` // User ID of the user that owns this token. - OwnerId types.Int64 `tfsdk:"ownerId" tf:"optional"` + OwnerId types.Int64 `tfsdk:"ownerId"` // The scopes of access granted in the token. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` // The type of this exchange token - TokenType types.String `tfsdk:"tokenType" tf:"optional"` + TokenType types.String `tfsdk:"tokenType"` } func (newState *ExchangeToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeToken) { @@ -4472,9 +4524,14 @@ func (newState *ExchangeToken) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exch func (newState *ExchangeToken) SyncEffectiveFieldsDuringRead(existingState ExchangeToken) { } -func (c ExchangeToken) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExchangeToken) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential"] = attrs["credential"].SetOptional() + attrs["credentialEolTime"] = attrs["credentialEolTime"].SetOptional() + attrs["ownerId"] = attrs["ownerId"].SetOptional() + attrs["scopes"] = attrs["scopes"].SetOptional() + attrs["tokenType"] = attrs["tokenType"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeToken. @@ -4549,11 +4606,11 @@ func (o *ExchangeToken) SetScopes(ctx context.Context, v []types.String) { // Exchange a token with the IdP type ExchangeTokenRequest struct { // The partition of Credentials store - PartitionId types.Object `tfsdk:"partitionId" tf:"object"` + PartitionId types.Object `tfsdk:"partitionId"` // Array of scopes for the token request. - Scopes types.List `tfsdk:"scopes" tf:""` + Scopes types.List `tfsdk:"scopes"` // A list of token types being requested - TokenType types.List `tfsdk:"tokenType" tf:""` + TokenType types.List `tfsdk:"tokenType"` } func (newState *ExchangeTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeTokenRequest) { @@ -4562,13 +4619,12 @@ func (newState *ExchangeTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ExchangeTokenRequest) SyncEffectiveFieldsDuringRead(existingState ExchangeTokenRequest) { } -func (c ExchangeTokenRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "partitionId")...) - PartitionId{}.ApplySchemaCustomizations(cs, append(path, "partitionId")...) - cs.SetRequired(append(path, "scopes")...) - cs.SetRequired(append(path, "tokenType")...) +func (c ExchangeTokenRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["partitionId"] = attrs["partitionId"].SetRequired() + attrs["scopes"] = attrs["scopes"].SetRequired() + attrs["tokenType"] = attrs["tokenType"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeTokenRequest. @@ -4696,7 +4752,7 @@ func (o *ExchangeTokenRequest) SetTokenType(ctx context.Context, v []types.Strin // Exhanged tokens were successfully returned. type ExchangeTokenResponse struct { - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *ExchangeTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExchangeTokenResponse) { @@ -4705,10 +4761,10 @@ func (newState *ExchangeTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ExchangeTokenResponse) SyncEffectiveFieldsDuringRead(existingState ExchangeTokenResponse) { } -func (c ExchangeTokenResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExchangeToken{}.ApplySchemaCustomizations(cs, append(path, "values")...) +func (c ExchangeTokenResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExchangeTokenResponse. @@ -4775,7 +4831,7 @@ func (o *ExchangeTokenResponse) SetValues(ctx context.Context, v []ExchangeToken // An IP access list was successfully returned. type FetchIpAccessListResponse struct { // Definition of an IP Access list - IpAccessList types.Object `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.Object `tfsdk:"ip_access_list"` } func (newState *FetchIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan FetchIpAccessListResponse) { @@ -4784,10 +4840,10 @@ func (newState *FetchIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *FetchIpAccessListResponse) SyncEffectiveFieldsDuringRead(existingState FetchIpAccessListResponse) { } -func (c FetchIpAccessListResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) +func (c FetchIpAccessListResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in FetchIpAccessListResponse. @@ -4853,17 +4909,17 @@ func (o *FetchIpAccessListResponse) SetIpAccessList(ctx context.Context, v IpAcc type GenericWebhookConfig struct { // [Input-Only][Optional] Password for webhook. - Password types.String `tfsdk:"password" tf:"optional"` + Password types.String `tfsdk:"password"` // [Output-Only] Whether password is set. - PasswordSet types.Bool `tfsdk:"password_set" tf:"optional"` + PasswordSet types.Bool `tfsdk:"password_set"` // [Input-Only] URL for webhook. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` // [Output-Only] Whether URL is set. - UrlSet types.Bool `tfsdk:"url_set" tf:"optional"` + UrlSet types.Bool `tfsdk:"url_set"` // [Input-Only][Optional] Username for webhook. - Username types.String `tfsdk:"username" tf:"optional"` + Username types.String `tfsdk:"username"` // [Output-Only] Whether username is set. - UsernameSet types.Bool `tfsdk:"username_set" tf:"optional"` + UsernameSet types.Bool `tfsdk:"username_set"` } func (newState *GenericWebhookConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan GenericWebhookConfig) { @@ -4872,9 +4928,15 @@ func (newState *GenericWebhookConfig) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *GenericWebhookConfig) SyncEffectiveFieldsDuringRead(existingState GenericWebhookConfig) { } -func (c GenericWebhookConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GenericWebhookConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["password"] = attrs["password"].SetOptional() + attrs["password_set"] = attrs["password_set"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() + attrs["url_set"] = attrs["url_set"].SetOptional() + attrs["username"] = attrs["username"].SetOptional() + attrs["username_set"] = attrs["username_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GenericWebhookConfig. @@ -5467,7 +5529,7 @@ func (o GetIpAccessListRequest) Type(ctx context.Context) attr.Type { type GetIpAccessListResponse struct { // Definition of an IP Access list - IpAccessList types.Object `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.Object `tfsdk:"ip_access_list"` } func (newState *GetIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetIpAccessListResponse) { @@ -5476,10 +5538,10 @@ func (newState *GetIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GetIpAccessListResponse) SyncEffectiveFieldsDuringRead(existingState GetIpAccessListResponse) { } -func (c GetIpAccessListResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) +func (c GetIpAccessListResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetIpAccessListResponse. @@ -5545,7 +5607,7 @@ func (o *GetIpAccessListResponse) SetIpAccessList(ctx context.Context, v IpAcces // IP access lists were successfully returned. type GetIpAccessListsResponse struct { - IpAccessLists types.List `tfsdk:"ip_access_lists" tf:"optional"` + IpAccessLists types.List `tfsdk:"ip_access_lists"` } func (newState *GetIpAccessListsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetIpAccessListsResponse) { @@ -5554,10 +5616,10 @@ func (newState *GetIpAccessListsResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *GetIpAccessListsResponse) SyncEffectiveFieldsDuringRead(existingState GetIpAccessListsResponse) { } -func (c GetIpAccessListsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo{}.ApplySchemaCustomizations(cs, append(path, "ip_access_lists")...) +func (c GetIpAccessListsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_lists"] = attrs["ip_access_lists"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetIpAccessListsResponse. @@ -5896,7 +5958,7 @@ func (o GetTokenManagementRequest) Type(ctx context.Context) attr.Type { type GetTokenPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetTokenPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetTokenPermissionLevelsResponse) { @@ -5905,10 +5967,10 @@ func (newState *GetTokenPermissionLevelsResponse) SyncEffectiveFieldsDuringCreat func (newState *GetTokenPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetTokenPermissionLevelsResponse) { } -func (c GetTokenPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetTokenPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetTokenPermissionLevelsResponse. @@ -5974,7 +6036,7 @@ func (o *GetTokenPermissionLevelsResponse) SetPermissionLevels(ctx context.Conte // Token with specified Token ID was successfully returned. type GetTokenResponse struct { - TokenInfo types.Object `tfsdk:"token_info" tf:"optional,object"` + TokenInfo types.Object `tfsdk:"token_info"` } func (newState *GetTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetTokenResponse) { @@ -5983,10 +6045,10 @@ func (newState *GetTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan G func (newState *GetTokenResponse) SyncEffectiveFieldsDuringRead(existingState GetTokenResponse) { } -func (c GetTokenResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenInfo{}.ApplySchemaCustomizations(cs, append(path, "token_info")...) +func (c GetTokenResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_info"] = attrs["token_info"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetTokenResponse. @@ -6053,30 +6115,30 @@ func (o *GetTokenResponse) SetTokenInfo(ctx context.Context, v TokenInfo) { // Definition of an IP Access list type IpAccessListInfo struct { // Total number of IP or CIDR values. - AddressCount types.Int64 `tfsdk:"address_count" tf:"optional"` + AddressCount types.Int64 `tfsdk:"address_count"` // Creation timestamp in milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // User ID of the user who created this list. - CreatedBy types.Int64 `tfsdk:"created_by" tf:"optional"` + CreatedBy types.Int64 `tfsdk:"created_by"` // Specifies whether this IP access list is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:"optional"` + Label types.String `tfsdk:"label"` // Universally unique identifier (UUID) of the IP access list. - ListId types.String `tfsdk:"list_id" tf:"optional"` + ListId types.String `tfsdk:"list_id"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:"optional"` + ListType types.String `tfsdk:"list_type"` // Update timestamp in milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // User ID of the user who updated this list. - UpdatedBy types.Int64 `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.Int64 `tfsdk:"updated_by"` } func (newState *IpAccessListInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan IpAccessListInfo) { @@ -6085,9 +6147,19 @@ func (newState *IpAccessListInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan I func (newState *IpAccessListInfo) SyncEffectiveFieldsDuringRead(existingState IpAccessListInfo) { } -func (c IpAccessListInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c IpAccessListInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["address_count"] = attrs["address_count"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetOptional() + attrs["list_id"] = attrs["list_id"].SetOptional() + attrs["list_type"] = attrs["list_type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IpAccessListInfo. @@ -6171,7 +6243,7 @@ func (o *IpAccessListInfo) SetIpAddresses(ctx context.Context, v []types.String) // IP access lists were successfully returned. type ListIpAccessListResponse struct { - IpAccessLists types.List `tfsdk:"ip_access_lists" tf:"optional"` + IpAccessLists types.List `tfsdk:"ip_access_lists"` } func (newState *ListIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListIpAccessListResponse) { @@ -6180,10 +6252,10 @@ func (newState *ListIpAccessListResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListIpAccessListResponse) SyncEffectiveFieldsDuringRead(existingState ListIpAccessListResponse) { } -func (c ListIpAccessListResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessListInfo{}.ApplySchemaCustomizations(cs, append(path, "ip_access_lists")...) +func (c ListIpAccessListResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["ip_access_lists"] = attrs["ip_access_lists"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListIpAccessListResponse. @@ -6248,10 +6320,10 @@ func (o *ListIpAccessListResponse) SetIpAccessLists(ctx context.Context, v []IpA } type ListNccAzurePrivateEndpointRulesResponse struct { - Items types.List `tfsdk:"items" tf:"optional"` + Items types.List `tfsdk:"items"` // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListNccAzurePrivateEndpointRulesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNccAzurePrivateEndpointRulesResponse) { @@ -6260,10 +6332,11 @@ func (newState *ListNccAzurePrivateEndpointRulesResponse) SyncEffectiveFieldsDur func (newState *ListNccAzurePrivateEndpointRulesResponse) SyncEffectiveFieldsDuringRead(existingState ListNccAzurePrivateEndpointRulesResponse) { } -func (c ListNccAzurePrivateEndpointRulesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NccAzurePrivateEndpointRule{}.ApplySchemaCustomizations(cs, append(path, "items")...) +func (c ListNccAzurePrivateEndpointRulesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["items"] = attrs["items"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNccAzurePrivateEndpointRulesResponse. @@ -6367,10 +6440,10 @@ func (o ListNetworkConnectivityConfigurationsRequest) Type(ctx context.Context) } type ListNetworkConnectivityConfigurationsResponse struct { - Items types.List `tfsdk:"items" tf:"optional"` + Items types.List `tfsdk:"items"` // A token that can be used to get the next page of results. If null, there // are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListNetworkConnectivityConfigurationsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNetworkConnectivityConfigurationsResponse) { @@ -6379,10 +6452,11 @@ func (newState *ListNetworkConnectivityConfigurationsResponse) SyncEffectiveFiel func (newState *ListNetworkConnectivityConfigurationsResponse) SyncEffectiveFieldsDuringRead(existingState ListNetworkConnectivityConfigurationsResponse) { } -func (c ListNetworkConnectivityConfigurationsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NetworkConnectivityConfiguration{}.ApplySchemaCustomizations(cs, append(path, "items")...) +func (c ListNetworkConnectivityConfigurationsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["items"] = attrs["items"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNetworkConnectivityConfigurationsResponse. @@ -6490,9 +6564,9 @@ func (o ListNotificationDestinationsRequest) Type(ctx context.Context) attr.Type type ListNotificationDestinationsResponse struct { // Page token for next of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListNotificationDestinationsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNotificationDestinationsResponse) { @@ -6501,10 +6575,11 @@ func (newState *ListNotificationDestinationsResponse) SyncEffectiveFieldsDuringC func (newState *ListNotificationDestinationsResponse) SyncEffectiveFieldsDuringRead(existingState ListNotificationDestinationsResponse) { } -func (c ListNotificationDestinationsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListNotificationDestinationsResult{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListNotificationDestinationsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNotificationDestinationsResponse. @@ -6573,11 +6648,11 @@ func (o *ListNotificationDestinationsResponse) SetResults(ctx context.Context, v type ListNotificationDestinationsResult struct { // [Output-only] The type of the notification destination. The type can not // be changed once set. - DestinationType types.String `tfsdk:"destination_type" tf:"optional"` + DestinationType types.String `tfsdk:"destination_type"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying notification destination. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *ListNotificationDestinationsResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListNotificationDestinationsResult) { @@ -6586,9 +6661,12 @@ func (newState *ListNotificationDestinationsResult) SyncEffectiveFieldsDuringCre func (newState *ListNotificationDestinationsResult) SyncEffectiveFieldsDuringRead(existingState ListNotificationDestinationsResult) { } -func (c ListNotificationDestinationsResult) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ListNotificationDestinationsResult) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["destination_type"] = attrs["destination_type"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListNotificationDestinationsResult. @@ -6669,7 +6747,7 @@ func (o ListPrivateEndpointRulesRequest) Type(ctx context.Context) attr.Type { type ListPublicTokensResponse struct { // The information for each token. - TokenInfos types.List `tfsdk:"token_infos" tf:"optional"` + TokenInfos types.List `tfsdk:"token_infos"` } func (newState *ListPublicTokensResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListPublicTokensResponse) { @@ -6678,10 +6756,10 @@ func (newState *ListPublicTokensResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListPublicTokensResponse) SyncEffectiveFieldsDuringRead(existingState ListPublicTokensResponse) { } -func (c ListPublicTokensResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PublicTokenInfo{}.ApplySchemaCustomizations(cs, append(path, "token_infos")...) +func (c ListPublicTokensResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_infos"] = attrs["token_infos"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListPublicTokensResponse. @@ -6789,7 +6867,7 @@ func (o ListTokenManagementRequest) Type(ctx context.Context) attr.Type { // Tokens were successfully returned. type ListTokensResponse struct { // Token metadata of each user-created token in the workspace - TokenInfos types.List `tfsdk:"token_infos" tf:"optional"` + TokenInfos types.List `tfsdk:"token_infos"` } func (newState *ListTokensResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListTokensResponse) { @@ -6798,10 +6876,10 @@ func (newState *ListTokensResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListTokensResponse) SyncEffectiveFieldsDuringRead(existingState ListTokensResponse) { } -func (c ListTokensResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenInfo{}.ApplySchemaCustomizations(cs, append(path, "token_infos")...) +func (c ListTokensResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_infos"] = attrs["token_infos"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListTokensResponse. @@ -6867,9 +6945,9 @@ func (o *ListTokensResponse) SetTokenInfos(ctx context.Context, v []TokenInfo) { type MicrosoftTeamsConfig struct { // [Input-Only] URL for Microsoft Teams. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` // [Output-Only] Whether URL is set. - UrlSet types.Bool `tfsdk:"url_set" tf:"optional"` + UrlSet types.Bool `tfsdk:"url_set"` } func (newState *MicrosoftTeamsConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan MicrosoftTeamsConfig) { @@ -6878,9 +6956,11 @@ func (newState *MicrosoftTeamsConfig) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *MicrosoftTeamsConfig) SyncEffectiveFieldsDuringRead(existingState MicrosoftTeamsConfig) { } -func (c MicrosoftTeamsConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MicrosoftTeamsConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["url"] = attrs["url"].SetOptional() + attrs["url_set"] = attrs["url_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MicrosoftTeamsConfig. @@ -6921,7 +7001,7 @@ func (o MicrosoftTeamsConfig) Type(ctx context.Context) attr.Type { type NccAwsStableIpRule struct { // The list of stable IP CIDR blocks from which Databricks network traffic // originates when accessing your resources. - CidrBlocks types.List `tfsdk:"cidr_blocks" tf:"optional"` + CidrBlocks types.List `tfsdk:"cidr_blocks"` } func (newState *NccAwsStableIpRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAwsStableIpRule) { @@ -6930,9 +7010,10 @@ func (newState *NccAwsStableIpRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *NccAwsStableIpRule) SyncEffectiveFieldsDuringRead(existingState NccAwsStableIpRule) { } -func (c NccAwsStableIpRule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NccAwsStableIpRule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cidr_blocks"] = attrs["cidr_blocks"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccAwsStableIpRule. @@ -7010,28 +7091,28 @@ type NccAzurePrivateEndpointRule struct { // DISCONNECTED: Connection was removed by the private link resource owner, // the private endpoint becomes informative and should be deleted for // clean-up. - ConnectionState types.String `tfsdk:"connection_state" tf:"optional"` + ConnectionState types.String `tfsdk:"connection_state"` // Time in epoch milliseconds when this object was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Whether this private endpoint is deactivated. - Deactivated types.Bool `tfsdk:"deactivated" tf:"computed"` + Deactivated types.Bool `tfsdk:"deactivated"` // Time in epoch milliseconds when this object was deactivated. - DeactivatedAt types.Int64 `tfsdk:"deactivated_at" tf:"computed"` + DeactivatedAt types.Int64 `tfsdk:"deactivated_at"` // The name of the Azure private endpoint resource. - EndpointName types.String `tfsdk:"endpoint_name" tf:"computed"` + EndpointName types.String `tfsdk:"endpoint_name"` // The sub-resource type (group ID) of the target resource. Note that to // connect to workspace root storage (root DBFS), you need two endpoints, // one for `blob` and one for `dfs`. - GroupId types.String `tfsdk:"group_id" tf:"optional"` + GroupId types.String `tfsdk:"group_id"` // The ID of a network connectivity configuration, which is the parent // resource of this private endpoint rule object. - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"optional"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id"` // The Azure resource ID of the target resource. - ResourceId types.String `tfsdk:"resource_id" tf:"optional"` + ResourceId types.String `tfsdk:"resource_id"` // The ID of a private endpoint rule. - RuleId types.String `tfsdk:"rule_id" tf:"computed"` + RuleId types.String `tfsdk:"rule_id"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed"` + UpdatedTime types.Int64 `tfsdk:"updated_time"` } func (newState *NccAzurePrivateEndpointRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAzurePrivateEndpointRule) { @@ -7040,15 +7121,19 @@ func (newState *NccAzurePrivateEndpointRule) SyncEffectiveFieldsDuringCreateOrUp func (newState *NccAzurePrivateEndpointRule) SyncEffectiveFieldsDuringRead(existingState NccAzurePrivateEndpointRule) { } -func (c NccAzurePrivateEndpointRule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "creation_time")...) - cs.SetComputed(append(path, "deactivated")...) - cs.SetComputed(append(path, "deactivated_at")...) - cs.SetComputed(append(path, "endpoint_name")...) - cs.SetComputed(append(path, "rule_id")...) - cs.SetComputed(append(path, "updated_time")...) +func (c NccAzurePrivateEndpointRule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["connection_state"] = attrs["connection_state"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["deactivated"] = attrs["deactivated"].SetComputed() + attrs["deactivated_at"] = attrs["deactivated_at"].SetComputed() + attrs["endpoint_name"] = attrs["endpoint_name"].SetComputed() + attrs["group_id"] = attrs["group_id"].SetOptional() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetOptional() + attrs["resource_id"] = attrs["resource_id"].SetOptional() + attrs["rule_id"] = attrs["rule_id"].SetComputed() + attrs["updated_time"] = attrs["updated_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccAzurePrivateEndpointRule. @@ -7106,11 +7191,11 @@ func (o NccAzurePrivateEndpointRule) Type(ctx context.Context) attr.Type { type NccAzureServiceEndpointRule struct { // The list of subnets from which Databricks network traffic originates when // accessing your Azure resources. - Subnets types.List `tfsdk:"subnets" tf:"optional"` + Subnets types.List `tfsdk:"subnets"` // The Azure region in which this service endpoint rule applies. - TargetRegion types.String `tfsdk:"target_region" tf:"optional"` + TargetRegion types.String `tfsdk:"target_region"` // The Azure services to which this service endpoint rule applies to. - TargetServices types.List `tfsdk:"target_services" tf:"optional"` + TargetServices types.List `tfsdk:"target_services"` } func (newState *NccAzureServiceEndpointRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAzureServiceEndpointRule) { @@ -7119,9 +7204,12 @@ func (newState *NccAzureServiceEndpointRule) SyncEffectiveFieldsDuringCreateOrUp func (newState *NccAzureServiceEndpointRule) SyncEffectiveFieldsDuringRead(existingState NccAzureServiceEndpointRule) { } -func (c NccAzureServiceEndpointRule) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NccAzureServiceEndpointRule) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["subnets"] = attrs["subnets"].SetOptional() + attrs["target_region"] = attrs["target_region"].SetOptional() + attrs["target_services"] = attrs["target_services"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccAzureServiceEndpointRule. @@ -7224,10 +7312,10 @@ type NccEgressConfig struct { // The network connectivity rules that are applied by default without // resource specific configurations. You can find the stable network // information of your serverless compute resources here. - DefaultRules types.Object `tfsdk:"default_rules" tf:"computed,object"` + DefaultRules types.Object `tfsdk:"default_rules"` // The network connectivity rules that configured for each destinations. // These rules override default rules. - TargetRules types.Object `tfsdk:"target_rules" tf:"optional,object"` + TargetRules types.Object `tfsdk:"target_rules"` } func (newState *NccEgressConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccEgressConfig) { @@ -7236,12 +7324,11 @@ func (newState *NccEgressConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Nc func (newState *NccEgressConfig) SyncEffectiveFieldsDuringRead(existingState NccEgressConfig) { } -func (c NccEgressConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "default_rules")...) - NccEgressDefaultRules{}.ApplySchemaCustomizations(cs, append(path, "default_rules")...) - NccEgressTargetRules{}.ApplySchemaCustomizations(cs, append(path, "target_rules")...) +func (c NccEgressConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["default_rules"] = attrs["default_rules"].SetComputed() + attrs["target_rules"] = attrs["target_rules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccEgressConfig. @@ -7343,11 +7430,11 @@ type NccEgressDefaultRules struct { // The stable AWS IP CIDR blocks. You can use these to configure the // firewall of your resources to allow traffic from your Databricks // workspace. - AwsStableIpRule types.Object `tfsdk:"aws_stable_ip_rule" tf:"optional,object"` + AwsStableIpRule types.Object `tfsdk:"aws_stable_ip_rule"` // The stable Azure service endpoints. You can configure the firewall of // your Azure resources to allow traffic from your Databricks serverless // compute resources. - AzureServiceEndpointRule types.Object `tfsdk:"azure_service_endpoint_rule" tf:"optional,object"` + AzureServiceEndpointRule types.Object `tfsdk:"azure_service_endpoint_rule"` } func (newState *NccEgressDefaultRules) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccEgressDefaultRules) { @@ -7356,11 +7443,11 @@ func (newState *NccEgressDefaultRules) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *NccEgressDefaultRules) SyncEffectiveFieldsDuringRead(existingState NccEgressDefaultRules) { } -func (c NccEgressDefaultRules) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NccAwsStableIpRule{}.ApplySchemaCustomizations(cs, append(path, "aws_stable_ip_rule")...) - NccAzureServiceEndpointRule{}.ApplySchemaCustomizations(cs, append(path, "azure_service_endpoint_rule")...) +func (c NccEgressDefaultRules) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["aws_stable_ip_rule"] = attrs["aws_stable_ip_rule"].SetOptional() + attrs["azure_service_endpoint_rule"] = attrs["azure_service_endpoint_rule"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccEgressDefaultRules. @@ -7458,7 +7545,7 @@ func (o *NccEgressDefaultRules) SetAzureServiceEndpointRule(ctx context.Context, // The network connectivity rules that configured for each destinations. These // rules override default rules. type NccEgressTargetRules struct { - AzurePrivateEndpointRules types.List `tfsdk:"azure_private_endpoint_rules" tf:"optional"` + AzurePrivateEndpointRules types.List `tfsdk:"azure_private_endpoint_rules"` } func (newState *NccEgressTargetRules) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccEgressTargetRules) { @@ -7467,10 +7554,10 @@ func (newState *NccEgressTargetRules) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *NccEgressTargetRules) SyncEffectiveFieldsDuringRead(existingState NccEgressTargetRules) { } -func (c NccEgressTargetRules) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - NccAzurePrivateEndpointRule{}.ApplySchemaCustomizations(cs, append(path, "azure_private_endpoint_rules")...) +func (c NccEgressTargetRules) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["azure_private_endpoint_rules"] = attrs["azure_private_endpoint_rules"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NccEgressTargetRules. @@ -7536,25 +7623,25 @@ func (o *NccEgressTargetRules) SetAzurePrivateEndpointRules(ctx context.Context, type NetworkConnectivityConfiguration struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` + AccountId types.String `tfsdk:"account_id"` // Time in epoch milliseconds when this object was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` + CreationTime types.Int64 `tfsdk:"creation_time"` // The network connectivity rules that apply to network traffic from your // serverless compute resources. - EgressConfig types.Object `tfsdk:"egress_config" tf:"optional,object"` + EgressConfig types.Object `tfsdk:"egress_config"` // The name of the network connectivity configuration. The name can contain // alphanumeric characters, hyphens, and underscores. The length must be // between 3 and 30 characters. The name must match the regular expression // `^[0-9a-zA-Z-_]{3,30}$`. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Databricks network connectivity configuration ID. - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"computed"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id"` // The region for the network connectivity configuration. Only workspaces in // the same region can be attached to the network connectivity // configuration. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed"` + UpdatedTime types.Int64 `tfsdk:"updated_time"` } func (newState *NetworkConnectivityConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkConnectivityConfiguration) { @@ -7563,13 +7650,16 @@ func (newState *NetworkConnectivityConfiguration) SyncEffectiveFieldsDuringCreat func (newState *NetworkConnectivityConfiguration) SyncEffectiveFieldsDuringRead(existingState NetworkConnectivityConfiguration) { } -func (c NetworkConnectivityConfiguration) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "creation_time")...) - NccEgressConfig{}.ApplySchemaCustomizations(cs, append(path, "egress_config")...) - cs.SetComputed(append(path, "network_connectivity_config_id")...) - cs.SetComputed(append(path, "updated_time")...) +func (c NetworkConnectivityConfiguration) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["account_id"] = attrs["account_id"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetComputed() + attrs["egress_config"] = attrs["egress_config"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["network_connectivity_config_id"] = attrs["network_connectivity_config_id"].SetComputed() + attrs["region"] = attrs["region"].SetOptional() + attrs["updated_time"] = attrs["updated_time"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NetworkConnectivityConfiguration. @@ -7649,14 +7739,14 @@ type NotificationDestination struct { // The configuration for the notification destination. Will be exactly one // of the nested configs. Only returns for users with workspace admin // permissions. - Config types.Object `tfsdk:"config" tf:"optional,object"` + Config types.Object `tfsdk:"config"` // [Output-only] The type of the notification destination. The type can not // be changed once set. - DestinationType types.String `tfsdk:"destination_type" tf:"optional"` + DestinationType types.String `tfsdk:"destination_type"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying notification destination. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *NotificationDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan NotificationDestination) { @@ -7665,10 +7755,13 @@ func (newState *NotificationDestination) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *NotificationDestination) SyncEffectiveFieldsDuringRead(existingState NotificationDestination) { } -func (c NotificationDestination) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Config{}.ApplySchemaCustomizations(cs, append(path, "config")...) +func (c NotificationDestination) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config"] = attrs["config"].SetOptional() + attrs["destination_type"] = attrs["destination_type"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NotificationDestination. @@ -7740,9 +7833,9 @@ func (o *NotificationDestination) SetConfig(ctx context.Context, v Config) { type PagerdutyConfig struct { // [Input-Only] Integration key for PagerDuty. - IntegrationKey types.String `tfsdk:"integration_key" tf:"optional"` + IntegrationKey types.String `tfsdk:"integration_key"` // [Output-Only] Whether integration key is set. - IntegrationKeySet types.Bool `tfsdk:"integration_key_set" tf:"optional"` + IntegrationKeySet types.Bool `tfsdk:"integration_key_set"` } func (newState *PagerdutyConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan PagerdutyConfig) { @@ -7751,9 +7844,11 @@ func (newState *PagerdutyConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pa func (newState *PagerdutyConfig) SyncEffectiveFieldsDuringRead(existingState PagerdutyConfig) { } -func (c PagerdutyConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PagerdutyConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["integration_key"] = attrs["integration_key"].SetOptional() + attrs["integration_key_set"] = attrs["integration_key_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PagerdutyConfig. @@ -7792,7 +7887,7 @@ func (o PagerdutyConfig) Type(ctx context.Context) attr.Type { // Partition by workspace or account type PartitionId struct { // The ID of the workspace. - WorkspaceId types.Int64 `tfsdk:"workspaceId" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspaceId"` } func (newState *PartitionId) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartitionId) { @@ -7801,9 +7896,10 @@ func (newState *PartitionId) SyncEffectiveFieldsDuringCreateOrUpdate(plan Partit func (newState *PartitionId) SyncEffectiveFieldsDuringRead(existingState PartitionId) { } -func (c PartitionId) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PartitionId) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["workspaceId"] = attrs["workspaceId"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartitionId. @@ -7845,7 +7941,7 @@ type PersonalComputeMessage struct { // users or groups to be added to the ACLs of that workspace’s Personal // Compute default policy before they will be able to create compute // resources through that policy. - Value types.String `tfsdk:"value" tf:""` + Value types.String `tfsdk:"value"` } func (newState *PersonalComputeMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan PersonalComputeMessage) { @@ -7854,10 +7950,10 @@ func (newState *PersonalComputeMessage) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PersonalComputeMessage) SyncEffectiveFieldsDuringRead(existingState PersonalComputeMessage) { } -func (c PersonalComputeMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "value")...) +func (c PersonalComputeMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PersonalComputeMessage. @@ -7899,15 +7995,15 @@ type PersonalComputeSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - PersonalCompute types.Object `tfsdk:"personal_compute" tf:"object"` + PersonalCompute types.Object `tfsdk:"personal_compute"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *PersonalComputeSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan PersonalComputeSetting) { @@ -7916,11 +8012,12 @@ func (newState *PersonalComputeSetting) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *PersonalComputeSetting) SyncEffectiveFieldsDuringRead(existingState PersonalComputeSetting) { } -func (c PersonalComputeSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "personal_compute")...) - PersonalComputeMessage{}.ApplySchemaCustomizations(cs, append(path, "personal_compute")...) +func (c PersonalComputeSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["personal_compute"] = attrs["personal_compute"].SetRequired() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PersonalComputeSetting. @@ -7990,14 +8087,14 @@ func (o *PersonalComputeSetting) SetPersonalCompute(ctx context.Context, v Perso type PublicTokenInfo struct { // Comment the token was created with, if applicable. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Server time (in epoch milliseconds) when the token was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Server time (in epoch milliseconds) when the token will expire, or -1 if // not applicable. - ExpiryTime types.Int64 `tfsdk:"expiry_time" tf:"optional"` + ExpiryTime types.Int64 `tfsdk:"expiry_time"` // The ID of this token. - TokenId types.String `tfsdk:"token_id" tf:"optional"` + TokenId types.String `tfsdk:"token_id"` } func (newState *PublicTokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublicTokenInfo) { @@ -8006,9 +8103,13 @@ func (newState *PublicTokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pu func (newState *PublicTokenInfo) SyncEffectiveFieldsDuringRead(existingState PublicTokenInfo) { } -func (c PublicTokenInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PublicTokenInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["expiry_time"] = attrs["expiry_time"].SetOptional() + attrs["token_id"] = attrs["token_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PublicTokenInfo. @@ -8051,20 +8152,20 @@ func (o PublicTokenInfo) Type(ctx context.Context) attr.Type { // Details required to replace an IP access list. type ReplaceIpAccessList struct { // Specifies whether this IP access list is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:""` + Enabled types.Bool `tfsdk:"enabled"` // The ID for the corresponding IP access list IpAccessListId types.String `tfsdk:"-"` - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:""` + Label types.String `tfsdk:"label"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:""` + ListType types.String `tfsdk:"list_type"` } func (newState *ReplaceIpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan ReplaceIpAccessList) { @@ -8073,13 +8174,14 @@ func (newState *ReplaceIpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ReplaceIpAccessList) SyncEffectiveFieldsDuringRead(existingState ReplaceIpAccessList) { } -func (c ReplaceIpAccessList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "enabled")...) - cs.SetRequired(append(path, "ip_access_list_id")...) - cs.SetRequired(append(path, "label")...) - cs.SetRequired(append(path, "list_type")...) +func (c ReplaceIpAccessList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetRequired() + attrs["ip_access_list_id"] = attrs["ip_access_list_id"].SetRequired() + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetRequired() + attrs["list_type"] = attrs["list_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ReplaceIpAccessList. @@ -8182,7 +8284,7 @@ func (o ReplaceResponse) Type(ctx context.Context) attr.Type { } type RestrictWorkspaceAdminsMessage struct { - Status types.String `tfsdk:"status" tf:""` + Status types.String `tfsdk:"status"` } func (newState *RestrictWorkspaceAdminsMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestrictWorkspaceAdminsMessage) { @@ -8191,10 +8293,10 @@ func (newState *RestrictWorkspaceAdminsMessage) SyncEffectiveFieldsDuringCreateO func (newState *RestrictWorkspaceAdminsMessage) SyncEffectiveFieldsDuringRead(existingState RestrictWorkspaceAdminsMessage) { } -func (c RestrictWorkspaceAdminsMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "status")...) +func (c RestrictWorkspaceAdminsMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["status"] = attrs["status"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestrictWorkspaceAdminsMessage. @@ -8236,15 +8338,15 @@ type RestrictWorkspaceAdminsSetting struct { // update pattern to perform setting updates in order to avoid race // conditions. That is, get an etag from a GET request, and pass it with the // PATCH request to identify the setting version you are updating. - Etag types.String `tfsdk:"etag" tf:"optional"` + Etag types.String `tfsdk:"etag"` - RestrictWorkspaceAdmins types.Object `tfsdk:"restrict_workspace_admins" tf:"object"` + RestrictWorkspaceAdmins types.Object `tfsdk:"restrict_workspace_admins"` // Name of the corresponding setting. This field is populated in the // response, but it will not be respected even if it's set in the request // body. The setting name in the path parameter will be respected instead. // Setting name is required to be 'default' if the setting only has one // instance per workspace. - SettingName types.String `tfsdk:"setting_name" tf:"optional"` + SettingName types.String `tfsdk:"setting_name"` } func (newState *RestrictWorkspaceAdminsSetting) SyncEffectiveFieldsDuringCreateOrUpdate(plan RestrictWorkspaceAdminsSetting) { @@ -8253,11 +8355,12 @@ func (newState *RestrictWorkspaceAdminsSetting) SyncEffectiveFieldsDuringCreateO func (newState *RestrictWorkspaceAdminsSetting) SyncEffectiveFieldsDuringRead(existingState RestrictWorkspaceAdminsSetting) { } -func (c RestrictWorkspaceAdminsSetting) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "restrict_workspace_admins")...) - RestrictWorkspaceAdminsMessage{}.ApplySchemaCustomizations(cs, append(path, "restrict_workspace_admins")...) +func (c RestrictWorkspaceAdminsSetting) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["etag"] = attrs["etag"].SetOptional() + attrs["restrict_workspace_admins"] = attrs["restrict_workspace_admins"].SetRequired() + attrs["setting_name"] = attrs["setting_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RestrictWorkspaceAdminsSetting. @@ -8327,7 +8430,7 @@ func (o *RestrictWorkspaceAdminsSetting) SetRestrictWorkspaceAdmins(ctx context. type RevokeTokenRequest struct { // The ID of the token to be revoked. - TokenId types.String `tfsdk:"token_id" tf:""` + TokenId types.String `tfsdk:"token_id"` } func (newState *RevokeTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RevokeTokenRequest) { @@ -8336,10 +8439,10 @@ func (newState *RevokeTokenRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RevokeTokenRequest) SyncEffectiveFieldsDuringRead(existingState RevokeTokenRequest) { } -func (c RevokeTokenRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "token_id")...) +func (c RevokeTokenRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["token_id"] = attrs["token_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RevokeTokenRequest. @@ -8382,9 +8485,9 @@ func (newState *RevokeTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RevokeTokenResponse) SyncEffectiveFieldsDuringRead(existingState RevokeTokenResponse) { } -func (c RevokeTokenResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RevokeTokenResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RevokeTokenResponse. @@ -8446,9 +8549,9 @@ func (o SetStatusResponse) Type(ctx context.Context) attr.Type { type SlackConfig struct { // [Input-Only] URL for Slack destination. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` // [Output-Only] Whether URL is set. - UrlSet types.Bool `tfsdk:"url_set" tf:"optional"` + UrlSet types.Bool `tfsdk:"url_set"` } func (newState *SlackConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan SlackConfig) { @@ -8457,9 +8560,11 @@ func (newState *SlackConfig) SyncEffectiveFieldsDuringCreateOrUpdate(plan SlackC func (newState *SlackConfig) SyncEffectiveFieldsDuringRead(existingState SlackConfig) { } -func (c SlackConfig) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SlackConfig) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["url"] = attrs["url"].SetOptional() + attrs["url_set"] = attrs["url_set"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SlackConfig. @@ -8497,7 +8602,7 @@ func (o SlackConfig) Type(ctx context.Context) attr.Type { type StringMessage struct { // Represents a generic string value. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *StringMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan StringMessage) { @@ -8506,9 +8611,10 @@ func (newState *StringMessage) SyncEffectiveFieldsDuringCreateOrUpdate(plan Stri func (newState *StringMessage) SyncEffectiveFieldsDuringRead(existingState StringMessage) { } -func (c StringMessage) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StringMessage) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StringMessage. @@ -8544,13 +8650,13 @@ func (o StringMessage) Type(ctx context.Context) attr.Type { type TokenAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *TokenAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenAccessControlRequest) { @@ -8559,9 +8665,13 @@ func (newState *TokenAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpda func (newState *TokenAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState TokenAccessControlRequest) { } -func (c TokenAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenAccessControlRequest. @@ -8603,15 +8713,15 @@ func (o TokenAccessControlRequest) Type(ctx context.Context) attr.Type { type TokenAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *TokenAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenAccessControlResponse) { @@ -8620,10 +8730,14 @@ func (newState *TokenAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *TokenAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState TokenAccessControlResponse) { } -func (c TokenAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c TokenAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenAccessControlResponse. @@ -8698,24 +8812,24 @@ func (o *TokenAccessControlResponse) SetAllPermissions(ctx context.Context, v [] type TokenInfo struct { // Comment that describes the purpose of the token, specified by the token // creator. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // User ID of the user that created the token. - CreatedById types.Int64 `tfsdk:"created_by_id" tf:"optional"` + CreatedById types.Int64 `tfsdk:"created_by_id"` // Username of the user that created the token. - CreatedByUsername types.String `tfsdk:"created_by_username" tf:"optional"` + CreatedByUsername types.String `tfsdk:"created_by_username"` // Timestamp when the token was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` + CreationTime types.Int64 `tfsdk:"creation_time"` // Timestamp when the token expires. - ExpiryTime types.Int64 `tfsdk:"expiry_time" tf:"optional"` + ExpiryTime types.Int64 `tfsdk:"expiry_time"` // Approximate timestamp for the day the token was last used. Accurate up to // 1 day. - LastUsedDay types.Int64 `tfsdk:"last_used_day" tf:"optional"` + LastUsedDay types.Int64 `tfsdk:"last_used_day"` // User ID of the user that owns the token. - OwnerId types.Int64 `tfsdk:"owner_id" tf:"optional"` + OwnerId types.Int64 `tfsdk:"owner_id"` // ID of the token. - TokenId types.String `tfsdk:"token_id" tf:"optional"` + TokenId types.String `tfsdk:"token_id"` // If applicable, the ID of the workspace that the token was created in. - WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` + WorkspaceId types.Int64 `tfsdk:"workspace_id"` } func (newState *TokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenInfo) { @@ -8724,9 +8838,18 @@ func (newState *TokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenInf func (newState *TokenInfo) SyncEffectiveFieldsDuringRead(existingState TokenInfo) { } -func (c TokenInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_by_id"] = attrs["created_by_id"].SetOptional() + attrs["created_by_username"] = attrs["created_by_username"].SetOptional() + attrs["creation_time"] = attrs["creation_time"].SetOptional() + attrs["expiry_time"] = attrs["expiry_time"].SetOptional() + attrs["last_used_day"] = attrs["last_used_day"].SetOptional() + attrs["owner_id"] = attrs["owner_id"].SetOptional() + attrs["token_id"] = attrs["token_id"].SetOptional() + attrs["workspace_id"] = attrs["workspace_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenInfo. @@ -8777,11 +8900,11 @@ func (o TokenInfo) Type(ctx context.Context) attr.Type { } type TokenPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *TokenPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermission) { @@ -8790,9 +8913,12 @@ func (newState *TokenPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan To func (newState *TokenPermission) SyncEffectiveFieldsDuringRead(existingState TokenPermission) { } -func (c TokenPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermission. @@ -8861,11 +8987,11 @@ func (o *TokenPermission) SetInheritedFromObject(ctx context.Context, v []types. } type TokenPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *TokenPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermissions) { @@ -8874,10 +9000,12 @@ func (newState *TokenPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan T func (newState *TokenPermissions) SyncEffectiveFieldsDuringRead(existingState TokenPermissions) { } -func (c TokenPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c TokenPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermissions. @@ -8946,9 +9074,9 @@ func (o *TokenPermissions) SetAccessControlList(ctx context.Context, v []TokenAc } type TokenPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *TokenPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermissionsDescription) { @@ -8957,9 +9085,11 @@ func (newState *TokenPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUp func (newState *TokenPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState TokenPermissionsDescription) { } -func (c TokenPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TokenPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermissionsDescription. @@ -8996,7 +9126,7 @@ func (o TokenPermissionsDescription) Type(ctx context.Context) attr.Type { } type TokenPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` } func (newState *TokenPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan TokenPermissionsRequest) { @@ -9005,10 +9135,10 @@ func (newState *TokenPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *TokenPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState TokenPermissionsRequest) { } -func (c TokenPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TokenAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c TokenPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TokenPermissionsRequest. @@ -9076,14 +9206,14 @@ func (o *TokenPermissionsRequest) SetAccessControlList(ctx context.Context, v [] type UpdateAibiDashboardEmbeddingAccessPolicySettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) { @@ -9092,13 +9222,12 @@ func (newState *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) SyncEffe func (newState *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) { } -func (c UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - AibiDashboardEmbeddingAccessPolicySetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAibiDashboardEmbeddingAccessPolicySettingRequest. @@ -9170,14 +9299,14 @@ func (o *UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) SetSetting(ctx type UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) { @@ -9186,13 +9315,12 @@ func (newState *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) SyncE func (newState *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) { } -func (c UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - AibiDashboardEmbeddingApprovedDomainsSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest. @@ -9264,14 +9392,14 @@ func (o *UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) SetSetting(c type UpdateAutomaticClusterUpdateSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateAutomaticClusterUpdateSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAutomaticClusterUpdateSettingRequest) { @@ -9280,13 +9408,12 @@ func (newState *UpdateAutomaticClusterUpdateSettingRequest) SyncEffectiveFieldsD func (newState *UpdateAutomaticClusterUpdateSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateAutomaticClusterUpdateSettingRequest) { } -func (c UpdateAutomaticClusterUpdateSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - AutomaticClusterUpdateSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateAutomaticClusterUpdateSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAutomaticClusterUpdateSettingRequest. @@ -9358,14 +9485,14 @@ func (o *UpdateAutomaticClusterUpdateSettingRequest) SetSetting(ctx context.Cont type UpdateComplianceSecurityProfileSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateComplianceSecurityProfileSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateComplianceSecurityProfileSettingRequest) { @@ -9374,13 +9501,12 @@ func (newState *UpdateComplianceSecurityProfileSettingRequest) SyncEffectiveFiel func (newState *UpdateComplianceSecurityProfileSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateComplianceSecurityProfileSettingRequest) { } -func (c UpdateComplianceSecurityProfileSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - ComplianceSecurityProfileSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateComplianceSecurityProfileSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateComplianceSecurityProfileSettingRequest. @@ -9452,14 +9578,14 @@ func (o *UpdateComplianceSecurityProfileSettingRequest) SetSetting(ctx context.C type UpdateCspEnablementAccountSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateCspEnablementAccountSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCspEnablementAccountSettingRequest) { @@ -9468,13 +9594,12 @@ func (newState *UpdateCspEnablementAccountSettingRequest) SyncEffectiveFieldsDur func (newState *UpdateCspEnablementAccountSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateCspEnablementAccountSettingRequest) { } -func (c UpdateCspEnablementAccountSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - CspEnablementAccountSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateCspEnablementAccountSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCspEnablementAccountSettingRequest. @@ -9546,12 +9671,12 @@ func (o *UpdateCspEnablementAccountSettingRequest) SetSetting(ctx context.Contex type UpdateDefaultNamespaceSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` // This represents the setting configuration for the default namespace in // the Databricks workspace. Setting the default catalog for the workspace // determines the catalog that is used when queries do not reference a fully @@ -9561,7 +9686,7 @@ type UpdateDefaultNamespaceSettingRequest struct { // assumed). This setting requires a restart of clusters and SQL warehouses // to take effect. Additionally, the default namespace only applies when // using Unity Catalog-enabled compute. - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateDefaultNamespaceSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDefaultNamespaceSettingRequest) { @@ -9570,13 +9695,12 @@ func (newState *UpdateDefaultNamespaceSettingRequest) SyncEffectiveFieldsDuringC func (newState *UpdateDefaultNamespaceSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateDefaultNamespaceSettingRequest) { } -func (c UpdateDefaultNamespaceSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DefaultNamespaceSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDefaultNamespaceSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDefaultNamespaceSettingRequest. @@ -9648,14 +9772,14 @@ func (o *UpdateDefaultNamespaceSettingRequest) SetSetting(ctx context.Context, v type UpdateDisableLegacyAccessRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateDisableLegacyAccessRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDisableLegacyAccessRequest) { @@ -9664,13 +9788,12 @@ func (newState *UpdateDisableLegacyAccessRequest) SyncEffectiveFieldsDuringCreat func (newState *UpdateDisableLegacyAccessRequest) SyncEffectiveFieldsDuringRead(existingState UpdateDisableLegacyAccessRequest) { } -func (c UpdateDisableLegacyAccessRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DisableLegacyAccess{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDisableLegacyAccessRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDisableLegacyAccessRequest. @@ -9742,14 +9865,14 @@ func (o *UpdateDisableLegacyAccessRequest) SetSetting(ctx context.Context, v Dis type UpdateDisableLegacyDbfsRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateDisableLegacyDbfsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDisableLegacyDbfsRequest) { @@ -9758,13 +9881,12 @@ func (newState *UpdateDisableLegacyDbfsRequest) SyncEffectiveFieldsDuringCreateO func (newState *UpdateDisableLegacyDbfsRequest) SyncEffectiveFieldsDuringRead(existingState UpdateDisableLegacyDbfsRequest) { } -func (c UpdateDisableLegacyDbfsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DisableLegacyDbfs{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDisableLegacyDbfsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDisableLegacyDbfsRequest. @@ -9836,14 +9958,14 @@ func (o *UpdateDisableLegacyDbfsRequest) SetSetting(ctx context.Context, v Disab type UpdateDisableLegacyFeaturesRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateDisableLegacyFeaturesRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDisableLegacyFeaturesRequest) { @@ -9852,13 +9974,12 @@ func (newState *UpdateDisableLegacyFeaturesRequest) SyncEffectiveFieldsDuringCre func (newState *UpdateDisableLegacyFeaturesRequest) SyncEffectiveFieldsDuringRead(existingState UpdateDisableLegacyFeaturesRequest) { } -func (c UpdateDisableLegacyFeaturesRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - DisableLegacyFeatures{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateDisableLegacyFeaturesRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateDisableLegacyFeaturesRequest. @@ -9930,14 +10051,14 @@ func (o *UpdateDisableLegacyFeaturesRequest) SetSetting(ctx context.Context, v D type UpdateEnhancedSecurityMonitoringSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateEnhancedSecurityMonitoringSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateEnhancedSecurityMonitoringSettingRequest) { @@ -9946,13 +10067,12 @@ func (newState *UpdateEnhancedSecurityMonitoringSettingRequest) SyncEffectiveFie func (newState *UpdateEnhancedSecurityMonitoringSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateEnhancedSecurityMonitoringSettingRequest) { } -func (c UpdateEnhancedSecurityMonitoringSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - EnhancedSecurityMonitoringSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateEnhancedSecurityMonitoringSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateEnhancedSecurityMonitoringSettingRequest. @@ -10024,14 +10144,14 @@ func (o *UpdateEnhancedSecurityMonitoringSettingRequest) SetSetting(ctx context. type UpdateEsmEnablementAccountSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateEsmEnablementAccountSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateEsmEnablementAccountSettingRequest) { @@ -10040,13 +10160,12 @@ func (newState *UpdateEsmEnablementAccountSettingRequest) SyncEffectiveFieldsDur func (newState *UpdateEsmEnablementAccountSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateEsmEnablementAccountSettingRequest) { } -func (c UpdateEsmEnablementAccountSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - EsmEnablementAccountSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateEsmEnablementAccountSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateEsmEnablementAccountSettingRequest. @@ -10117,20 +10236,20 @@ func (o *UpdateEsmEnablementAccountSettingRequest) SetSetting(ctx context.Contex // Details required to update an IP access list. type UpdateIpAccessList struct { // Specifies whether this IP access list is enabled. - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // The ID for the corresponding IP access list IpAccessListId types.String `tfsdk:"-"` - IpAddresses types.List `tfsdk:"ip_addresses" tf:"optional"` + IpAddresses types.List `tfsdk:"ip_addresses"` // Label for the IP access list. This **cannot** be empty. - Label types.String `tfsdk:"label" tf:"optional"` + Label types.String `tfsdk:"label"` // Type of IP access list. Valid values are as follows and are // case-sensitive: // // * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block // list. Exclude this IP or range. IP addresses in the block list are // excluded even if they are included in an allow list. - ListType types.String `tfsdk:"list_type" tf:"optional"` + ListType types.String `tfsdk:"list_type"` } func (newState *UpdateIpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateIpAccessList) { @@ -10139,10 +10258,14 @@ func (newState *UpdateIpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateIpAccessList) SyncEffectiveFieldsDuringRead(existingState UpdateIpAccessList) { } -func (c UpdateIpAccessList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "ip_access_list_id")...) +func (c UpdateIpAccessList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["ip_access_list_id"] = attrs["ip_access_list_id"].SetRequired() + attrs["ip_addresses"] = attrs["ip_addresses"].SetOptional() + attrs["label"] = attrs["label"].SetOptional() + attrs["list_type"] = attrs["list_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateIpAccessList. @@ -10217,9 +10340,9 @@ func (o *UpdateIpAccessList) SetIpAddresses(ctx context.Context, v []types.Strin type UpdateNotificationDestinationRequest struct { // The configuration for the notification destination. Must wrap EXACTLY one // of the nested configs. - Config types.Object `tfsdk:"config" tf:"optional,object"` + Config types.Object `tfsdk:"config"` // The display name for the notification destination. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying notification destination. Id types.String `tfsdk:"-"` } @@ -10230,11 +10353,12 @@ func (newState *UpdateNotificationDestinationRequest) SyncEffectiveFieldsDuringC func (newState *UpdateNotificationDestinationRequest) SyncEffectiveFieldsDuringRead(existingState UpdateNotificationDestinationRequest) { } -func (c UpdateNotificationDestinationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Config{}.ApplySchemaCustomizations(cs, append(path, "config")...) - cs.SetRequired(append(path, "id")...) +func (c UpdateNotificationDestinationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config"] = attrs["config"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateNotificationDestinationRequest. @@ -10306,14 +10430,14 @@ func (o *UpdateNotificationDestinationRequest) SetConfig(ctx context.Context, v type UpdatePersonalComputeSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdatePersonalComputeSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdatePersonalComputeSettingRequest) { @@ -10322,13 +10446,12 @@ func (newState *UpdatePersonalComputeSettingRequest) SyncEffectiveFieldsDuringCr func (newState *UpdatePersonalComputeSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdatePersonalComputeSettingRequest) { } -func (c UpdatePersonalComputeSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - PersonalComputeSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdatePersonalComputeSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdatePersonalComputeSettingRequest. @@ -10430,14 +10553,14 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type UpdateRestrictWorkspaceAdminsSettingRequest struct { // This should always be set to true for Settings API. Added for AIP // compliance. - AllowMissing types.Bool `tfsdk:"allow_missing" tf:""` + AllowMissing types.Bool `tfsdk:"allow_missing"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - FieldMask types.String `tfsdk:"field_mask" tf:""` + FieldMask types.String `tfsdk:"field_mask"` - Setting types.Object `tfsdk:"setting" tf:"object"` + Setting types.Object `tfsdk:"setting"` } func (newState *UpdateRestrictWorkspaceAdminsSettingRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRestrictWorkspaceAdminsSettingRequest) { @@ -10446,13 +10569,12 @@ func (newState *UpdateRestrictWorkspaceAdminsSettingRequest) SyncEffectiveFields func (newState *UpdateRestrictWorkspaceAdminsSettingRequest) SyncEffectiveFieldsDuringRead(existingState UpdateRestrictWorkspaceAdminsSettingRequest) { } -func (c UpdateRestrictWorkspaceAdminsSettingRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "allow_missing")...) - cs.SetRequired(append(path, "field_mask")...) - cs.SetRequired(append(path, "setting")...) - RestrictWorkspaceAdminsSetting{}.ApplySchemaCustomizations(cs, append(path, "setting")...) +func (c UpdateRestrictWorkspaceAdminsSettingRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allow_missing"] = attrs["allow_missing"].SetRequired() + attrs["field_mask"] = attrs["field_mask"].SetRequired() + attrs["setting"] = attrs["setting"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRestrictWorkspaceAdminsSettingRequest. diff --git a/internal/service/sharing_tf/legacy_model.go b/internal/service/sharing_tf/legacy_model.go index fe90a39db..872c8417a 100755 --- a/internal/service/sharing_tf/legacy_model.go +++ b/internal/service/sharing_tf/legacy_model.go @@ -18,6 +18,7 @@ import ( "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" "github.com/databricks/terraform-provider-databricks/internal/service/catalog_tf" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -25,14 +26,14 @@ import ( type CreateProvider_SdkV2 struct { // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:""` + AuthenticationType types.String `tfsdk:"authentication_type"` // Description about the provider. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the Provider. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // This field is required when the __authentication_type__ is **TOKEN** or // not provided. - RecipientProfileStr types.String `tfsdk:"recipient_profile_str" tf:"optional"` + RecipientProfileStr types.String `tfsdk:"recipient_profile_str"` } func (newState *CreateProvider_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateProvider_SdkV2) { @@ -41,11 +42,13 @@ func (newState *CreateProvider_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateProvider_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateProvider_SdkV2) { } -func (c CreateProvider_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "authentication_type")...) - cs.SetRequired(append(path, "name")...) +func (c CreateProvider_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authentication_type"] = attrs["authentication_type"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["recipient_profile_str"] = attrs["recipient_profile_str"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateProvider. @@ -87,27 +90,27 @@ func (o CreateProvider_SdkV2) Type(ctx context.Context) attr.Type { type CreateRecipient_SdkV2 struct { // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:""` + AuthenticationType types.String `tfsdk:"authentication_type"` // Description about the recipient. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The global Unity Catalog metastore id provided by the data recipient. // This field is required when the __authentication_type__ is // **DATABRICKS**. The identifier is of format // __cloud__:__region__:__metastore-uuid__. - DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id" tf:"optional"` + DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id"` // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // IP Access List - IpAccessList types.List `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.List `tfsdk:"ip_access_list"` // Name of Recipient. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Username of the recipient owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Recipient properties as map of string key-value pairs. - PropertiesKvpairs types.List `tfsdk:"properties_kvpairs" tf:"optional,object"` + PropertiesKvpairs types.List `tfsdk:"properties_kvpairs"` // The one-time sharing code provided by the data recipient. This field is // required when the __authentication_type__ is **DATABRICKS**. - SharingCode types.String `tfsdk:"sharing_code" tf:"optional"` + SharingCode types.String `tfsdk:"sharing_code"` } func (newState *CreateRecipient_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRecipient_SdkV2) { @@ -116,13 +119,20 @@ func (newState *CreateRecipient_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *CreateRecipient_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRecipient_SdkV2) { } -func (c CreateRecipient_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "authentication_type")...) - IpAccessList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) - cs.SetRequired(append(path, "name")...) - SecurablePropertiesKvPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "properties_kvpairs")...) +func (c CreateRecipient_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authentication_type"] = attrs["authentication_type"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["data_recipient_global_metastore_id"] = attrs["data_recipient_global_metastore_id"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["sharing_code"] = attrs["sharing_code"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRecipient. @@ -233,11 +243,11 @@ func (o *CreateRecipient_SdkV2) SetPropertiesKvpairs(ctx context.Context, v Secu type CreateShare_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the share. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Storage root URL for the share. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateShare_SdkV2) { @@ -246,10 +256,12 @@ func (newState *CreateShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateShare_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateShare_SdkV2) { } -func (c CreateShare_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c CreateShare_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateShare. @@ -474,9 +486,9 @@ func (newState *GetActivationUrlInfoResponse_SdkV2) SyncEffectiveFieldsDuringCre func (newState *GetActivationUrlInfoResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetActivationUrlInfoResponse_SdkV2) { } -func (c GetActivationUrlInfoResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetActivationUrlInfoResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetActivationUrlInfoResponse. @@ -584,9 +596,9 @@ type GetRecipientSharePermissionsResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of data share permissions for a recipient. - PermissionsOut types.List `tfsdk:"permissions_out" tf:"optional"` + PermissionsOut types.List `tfsdk:"permissions_out"` } func (newState *GetRecipientSharePermissionsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRecipientSharePermissionsResponse_SdkV2) { @@ -595,10 +607,11 @@ func (newState *GetRecipientSharePermissionsResponse_SdkV2) SyncEffectiveFieldsD func (newState *GetRecipientSharePermissionsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetRecipientSharePermissionsResponse_SdkV2) { } -func (c GetRecipientSharePermissionsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ShareToPrivilegeAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permissions_out")...) +func (c GetRecipientSharePermissionsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["permissions_out"] = attrs["permissions_out"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRecipientSharePermissionsResponse. @@ -707,7 +720,7 @@ func (o GetShareRequest_SdkV2) Type(ctx context.Context) attr.Type { type IpAccessList_SdkV2 struct { // Allowed IP Addresses in CIDR notation. Limit of 100. - AllowedIpAddresses types.List `tfsdk:"allowed_ip_addresses" tf:"optional"` + AllowedIpAddresses types.List `tfsdk:"allowed_ip_addresses"` } func (newState *IpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan IpAccessList_SdkV2) { @@ -716,9 +729,10 @@ func (newState *IpAccessList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *IpAccessList_SdkV2) SyncEffectiveFieldsDuringRead(existingState IpAccessList_SdkV2) { } -func (c IpAccessList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c IpAccessList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_ip_addresses"] = attrs["allowed_ip_addresses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IpAccessList. @@ -786,9 +800,9 @@ type ListProviderSharesResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of provider shares. - Shares types.List `tfsdk:"shares" tf:"optional"` + Shares types.List `tfsdk:"shares"` } func (newState *ListProviderSharesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProviderSharesResponse_SdkV2) { @@ -797,10 +811,11 @@ func (newState *ListProviderSharesResponse_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ListProviderSharesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListProviderSharesResponse_SdkV2) { } -func (c ListProviderSharesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderShare_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "shares")...) +func (c ListProviderSharesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["shares"] = attrs["shares"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProviderSharesResponse. @@ -924,9 +939,9 @@ type ListProvidersResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of provider information objects. - Providers types.List `tfsdk:"providers" tf:"optional"` + Providers types.List `tfsdk:"providers"` } func (newState *ListProvidersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProvidersResponse_SdkV2) { @@ -935,10 +950,11 @@ func (newState *ListProvidersResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *ListProvidersResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListProvidersResponse_SdkV2) { } -func (c ListProvidersResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "providers")...) +func (c ListProvidersResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["providers"] = attrs["providers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProvidersResponse. @@ -1062,9 +1078,9 @@ type ListRecipientsResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of recipient information objects. - Recipients types.List `tfsdk:"recipients" tf:"optional"` + Recipients types.List `tfsdk:"recipients"` } func (newState *ListRecipientsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRecipientsResponse_SdkV2) { @@ -1073,10 +1089,11 @@ func (newState *ListRecipientsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ListRecipientsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListRecipientsResponse_SdkV2) { } -func (c ListRecipientsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RecipientInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "recipients")...) +func (c ListRecipientsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["recipients"] = attrs["recipients"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRecipientsResponse. @@ -1199,9 +1216,9 @@ type ListSharesResponse_SdkV2 struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of data share information objects. - Shares types.List `tfsdk:"shares" tf:"optional"` + Shares types.List `tfsdk:"shares"` } func (newState *ListSharesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSharesResponse_SdkV2) { @@ -1210,10 +1227,11 @@ func (newState *ListSharesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListSharesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListSharesResponse_SdkV2) { } -func (c ListSharesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ShareInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "shares")...) +func (c ListSharesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["shares"] = attrs["shares"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSharesResponse. @@ -1281,7 +1299,7 @@ func (o *ListSharesResponse_SdkV2) SetShares(ctx context.Context, v []ShareInfo_ type Partition_SdkV2 struct { // An array of partition values. - Values types.List `tfsdk:"value" tf:"optional"` + Values types.List `tfsdk:"value"` } func (newState *Partition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Partition_SdkV2) { @@ -1290,10 +1308,10 @@ func (newState *Partition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pa func (newState *Partition_SdkV2) SyncEffectiveFieldsDuringRead(existingState Partition_SdkV2) { } -func (c Partition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PartitionValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c Partition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Partition. @@ -1359,7 +1377,7 @@ func (o *Partition_SdkV2) SetValues(ctx context.Context, v []PartitionValue_SdkV type PartitionSpecificationPartition_SdkV2 struct { // An array of partition values. - Values types.List `tfsdk:"value" tf:"optional"` + Values types.List `tfsdk:"value"` } func (newState *PartitionSpecificationPartition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartitionSpecificationPartition_SdkV2) { @@ -1368,10 +1386,10 @@ func (newState *PartitionSpecificationPartition_SdkV2) SyncEffectiveFieldsDuring func (newState *PartitionSpecificationPartition_SdkV2) SyncEffectiveFieldsDuringRead(existingState PartitionSpecificationPartition_SdkV2) { } -func (c PartitionSpecificationPartition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PartitionValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c PartitionSpecificationPartition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartitionSpecificationPartition. @@ -1437,17 +1455,17 @@ func (o *PartitionSpecificationPartition_SdkV2) SetValues(ctx context.Context, v type PartitionValue_SdkV2 struct { // The name of the partition column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The operator to apply for the value. - Op types.String `tfsdk:"op" tf:"optional"` + Op types.String `tfsdk:"op"` // The key of a Delta Sharing recipient's property. For example // "databricks-account-id". When this field is set, field `value` can not be // set. - RecipientPropertyKey types.String `tfsdk:"recipient_property_key" tf:"optional"` + RecipientPropertyKey types.String `tfsdk:"recipient_property_key"` // The value of the partition column. When this value is not set, it means // `null` value. When this field is set, field `recipient_property_key` can // not be set. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *PartitionValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartitionValue_SdkV2) { @@ -1456,9 +1474,13 @@ func (newState *PartitionValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *PartitionValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState PartitionValue_SdkV2) { } -func (c PartitionValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PartitionValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["op"] = attrs["op"].SetOptional() + attrs["recipient_property_key"] = attrs["recipient_property_key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartitionValue. @@ -1500,9 +1522,9 @@ func (o PartitionValue_SdkV2) Type(ctx context.Context) attr.Type { type PrivilegeAssignment_SdkV2 struct { // The principal (user email address or group name). - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The privileges assigned to the principal. - Privileges types.List `tfsdk:"privileges" tf:"optional"` + Privileges types.List `tfsdk:"privileges"` } func (newState *PrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrivilegeAssignment_SdkV2) { @@ -1511,9 +1533,11 @@ func (newState *PrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *PrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState PrivilegeAssignment_SdkV2) { } -func (c PrivilegeAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrivilegeAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetOptional() + attrs["privileges"] = attrs["privileges"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrivilegeAssignment. @@ -1581,40 +1605,40 @@ func (o *PrivilegeAssignment_SdkV2) SetPrivileges(ctx context.Context, v []types type ProviderInfo_SdkV2 struct { // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:"optional"` + AuthenticationType types.String `tfsdk:"authentication_type"` // Cloud vendor of the provider's UC metastore. This field is only present // when the __authentication_type__ is **DATABRICKS**. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Description about the provider. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this Provider was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of Provider creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The global UC metastore id of the data provider. This field is only // present when the __authentication_type__ is **DATABRICKS**. The // identifier is of format ::. - DataProviderGlobalMetastoreId types.String `tfsdk:"data_provider_global_metastore_id" tf:"optional"` + DataProviderGlobalMetastoreId types.String `tfsdk:"data_provider_global_metastore_id"` // UUID of the provider's UC metastore. This field is only present when the // __authentication_type__ is **DATABRICKS**. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the Provider. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of Provider owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The recipient profile. This field is only present when the // authentication_type is `TOKEN`. - RecipientProfile types.List `tfsdk:"recipient_profile" tf:"optional,object"` + RecipientProfile types.List `tfsdk:"recipient_profile"` // This field is only present when the authentication_type is `TOKEN` or not // provided. - RecipientProfileStr types.String `tfsdk:"recipient_profile_str" tf:"optional"` + RecipientProfileStr types.String `tfsdk:"recipient_profile_str"` // Cloud region of the provider's UC metastore. This field is only present // when the __authentication_type__ is **DATABRICKS**. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // Time at which this Provider was created, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified Share. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *ProviderInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderInfo_SdkV2) { @@ -1623,10 +1647,24 @@ func (newState *ProviderInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ProviderInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ProviderInfo_SdkV2) { } -func (c ProviderInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RecipientProfile_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "recipient_profile")...) +func (c ProviderInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authentication_type"] = attrs["authentication_type"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_provider_global_metastore_id"] = attrs["data_provider_global_metastore_id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["recipient_profile"] = attrs["recipient_profile"].SetOptional() + attrs["recipient_profile"] = attrs["recipient_profile"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["recipient_profile_str"] = attrs["recipient_profile_str"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderInfo. @@ -1718,7 +1756,7 @@ func (o *ProviderInfo_SdkV2) SetRecipientProfile(ctx context.Context, v Recipien type ProviderShare_SdkV2 struct { // The name of the Provider Share. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ProviderShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderShare_SdkV2) { @@ -1727,9 +1765,10 @@ func (newState *ProviderShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ProviderShare_SdkV2) SyncEffectiveFieldsDuringRead(existingState ProviderShare_SdkV2) { } -func (c ProviderShare_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ProviderShare_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderShare. @@ -1766,49 +1805,49 @@ func (o ProviderShare_SdkV2) Type(ctx context.Context) attr.Type { type RecipientInfo_SdkV2 struct { // A boolean status field showing whether the Recipient's activation URL has // been exercised or not. - Activated types.Bool `tfsdk:"activated" tf:"optional"` + Activated types.Bool `tfsdk:"activated"` // Full activation url to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl types.String `tfsdk:"activation_url" tf:"optional"` + ActivationUrl types.String `tfsdk:"activation_url"` // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:"optional"` + AuthenticationType types.String `tfsdk:"authentication_type"` // Cloud vendor of the recipient's Unity Catalog Metstore. This field is // only present when the __authentication_type__ is **DATABRICKS**`. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Description about the recipient. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this recipient was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of recipient creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The global Unity Catalog metastore id provided by the data recipient. // This field is only present when the __authentication_type__ is // **DATABRICKS**. The identifier is of format // __cloud__:__region__:__metastore-uuid__. - DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id" tf:"optional"` + DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id"` // IP Access List - IpAccessList types.List `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.List `tfsdk:"ip_access_list"` // Unique identifier of recipient's Unity Catalog metastore. This field is // only present when the __authentication_type__ is **DATABRICKS** - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of Recipient. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of the recipient owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Recipient properties as map of string key-value pairs. - PropertiesKvpairs types.List `tfsdk:"properties_kvpairs" tf:"optional,object"` + PropertiesKvpairs types.List `tfsdk:"properties_kvpairs"` // Cloud region of the recipient's Unity Catalog Metstore. This field is // only present when the __authentication_type__ is **DATABRICKS**. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The one-time sharing code provided by the data recipient. This field is // only present when the __authentication_type__ is **DATABRICKS**. - SharingCode types.String `tfsdk:"sharing_code" tf:"optional"` + SharingCode types.String `tfsdk:"sharing_code"` // This field is only present when the __authentication_type__ is **TOKEN**. - Tokens types.List `tfsdk:"tokens" tf:"optional"` + Tokens types.List `tfsdk:"tokens"` // Time at which the recipient was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of recipient updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *RecipientInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RecipientInfo_SdkV2) { @@ -1817,12 +1856,29 @@ func (newState *RecipientInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *RecipientInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RecipientInfo_SdkV2) { } -func (c RecipientInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) - SecurablePropertiesKvPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "properties_kvpairs")...) - RecipientTokenInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tokens")...) - - return cs +func (c RecipientInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activated"] = attrs["activated"].SetOptional() + attrs["activation_url"] = attrs["activation_url"].SetOptional() + attrs["authentication_type"] = attrs["authentication_type"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_recipient_global_metastore_id"] = attrs["data_recipient_global_metastore_id"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["region"] = attrs["region"].SetOptional() + attrs["sharing_code"] = attrs["sharing_code"].SetOptional() + attrs["tokens"] = attrs["tokens"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RecipientInfo. @@ -1980,11 +2036,11 @@ func (o *RecipientInfo_SdkV2) SetTokens(ctx context.Context, v []RecipientTokenI type RecipientProfile_SdkV2 struct { // The token used to authorize the recipient. - BearerToken types.String `tfsdk:"bearer_token" tf:"optional"` + BearerToken types.String `tfsdk:"bearer_token"` // The endpoint for the share to be used by the recipient. - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` // The version number of the recipient's credentials on a share. - ShareCredentialsVersion types.Int64 `tfsdk:"share_credentials_version" tf:"optional"` + ShareCredentialsVersion types.Int64 `tfsdk:"share_credentials_version"` } func (newState *RecipientProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RecipientProfile_SdkV2) { @@ -1993,9 +2049,12 @@ func (newState *RecipientProfile_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *RecipientProfile_SdkV2) SyncEffectiveFieldsDuringRead(existingState RecipientProfile_SdkV2) { } -func (c RecipientProfile_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RecipientProfile_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bearer_token"] = attrs["bearer_token"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["share_credentials_version"] = attrs["share_credentials_version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RecipientProfile. @@ -2036,19 +2095,19 @@ func (o RecipientProfile_SdkV2) Type(ctx context.Context) attr.Type { type RecipientTokenInfo_SdkV2 struct { // Full activation URL to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl types.String `tfsdk:"activation_url" tf:"optional"` + ActivationUrl types.String `tfsdk:"activation_url"` // Time at which this recipient Token was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of recipient token creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // Unique ID of the recipient token. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time at which this recipient Token was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of recipient Token updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *RecipientTokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RecipientTokenInfo_SdkV2) { @@ -2057,9 +2116,16 @@ func (newState *RecipientTokenInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *RecipientTokenInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RecipientTokenInfo_SdkV2) { } -func (c RecipientTokenInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RecipientTokenInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activation_url"] = attrs["activation_url"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RecipientTokenInfo. @@ -2144,13 +2210,13 @@ func (o RetrieveTokenRequest_SdkV2) Type(ctx context.Context) attr.Type { type RetrieveTokenResponse_SdkV2 struct { // The token used to authorize the recipient. - BearerToken types.String `tfsdk:"bearerToken" tf:"optional"` + BearerToken types.String `tfsdk:"bearerToken"` // The endpoint for the share to be used by the recipient. - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime types.String `tfsdk:"expirationTime" tf:"optional"` + ExpirationTime types.String `tfsdk:"expirationTime"` // These field names must follow the delta sharing protocol. - ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion" tf:"optional"` + ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion"` } func (newState *RetrieveTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RetrieveTokenResponse_SdkV2) { @@ -2159,9 +2225,13 @@ func (newState *RetrieveTokenResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *RetrieveTokenResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RetrieveTokenResponse_SdkV2) { } -func (c RetrieveTokenResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RetrieveTokenResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bearerToken"] = attrs["bearerToken"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["expirationTime"] = attrs["expirationTime"].SetOptional() + attrs["shareCredentialsVersion"] = attrs["shareCredentialsVersion"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RetrieveTokenResponse. @@ -2206,7 +2276,7 @@ type RotateRecipientToken_SdkV2 struct { // the expiration_time of existing token only to a smaller timestamp, it // cannot extend the expiration_time. Use 0 to expire the existing token // immediately, negative number will return an error. - ExistingTokenExpireInSeconds types.Int64 `tfsdk:"existing_token_expire_in_seconds" tf:""` + ExistingTokenExpireInSeconds types.Int64 `tfsdk:"existing_token_expire_in_seconds"` // The name of the recipient. Name types.String `tfsdk:"-"` } @@ -2217,11 +2287,11 @@ func (newState *RotateRecipientToken_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *RotateRecipientToken_SdkV2) SyncEffectiveFieldsDuringRead(existingState RotateRecipientToken_SdkV2) { } -func (c RotateRecipientToken_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "existing_token_expire_in_seconds")...) - cs.SetRequired(append(path, "name")...) +func (c RotateRecipientToken_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["existing_token_expire_in_seconds"] = attrs["existing_token_expire_in_seconds"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RotateRecipientToken. @@ -2261,7 +2331,7 @@ func (o RotateRecipientToken_SdkV2) Type(ctx context.Context) attr.Type { // to the securable. type SecurablePropertiesKvPairs_SdkV2 struct { // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:""` + Properties types.Map `tfsdk:"properties"` } func (newState *SecurablePropertiesKvPairs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecurablePropertiesKvPairs_SdkV2) { @@ -2270,10 +2340,10 @@ func (newState *SecurablePropertiesKvPairs_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *SecurablePropertiesKvPairs_SdkV2) SyncEffectiveFieldsDuringRead(existingState SecurablePropertiesKvPairs_SdkV2) { } -func (c SecurablePropertiesKvPairs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "properties")...) +func (c SecurablePropertiesKvPairs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["properties"] = attrs["properties"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecurablePropertiesKvPairs. @@ -2339,25 +2409,25 @@ func (o *SecurablePropertiesKvPairs_SdkV2) SetProperties(ctx context.Context, v type ShareInfo_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this share was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of share creator. - CreatedBy types.String `tfsdk:"created_by" tf:"computed"` + CreatedBy types.String `tfsdk:"created_by"` // Name of the share. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // A list of shared data objects within the share. - Objects types.List `tfsdk:"object" tf:"optional"` + Objects types.List `tfsdk:"object"` // Username of current owner of share. - Owner types.String `tfsdk:"owner" tf:"computed"` + Owner types.String `tfsdk:"owner"` // Storage Location URL (full path) for the share. - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for the share. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Time at which this share was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of share updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"computed"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo_SdkV2) { @@ -2366,15 +2436,19 @@ func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sh func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ShareInfo_SdkV2) { } -func (c ShareInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "created_at")...) - cs.SetComputed(append(path, "created_by")...) - SharedDataObject_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "object")...) - cs.SetComputed(append(path, "owner")...) - cs.SetComputed(append(path, "updated_at")...) - cs.SetComputed(append(path, "updated_by")...) +func (c ShareInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetComputed() + attrs["created_by"] = attrs["created_by"].SetComputed() + attrs["name"] = attrs["name"].SetOptional() + attrs["object"] = attrs["object"].SetOptional() + attrs["owner"] = attrs["owner"].SetComputed() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetComputed() + attrs["updated_by"] = attrs["updated_by"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ShareInfo. @@ -2511,9 +2585,9 @@ func (o SharePermissionsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ShareToPrivilegeAssignment_SdkV2 struct { // The privileges assigned to the principal. - PrivilegeAssignments types.List `tfsdk:"privilege_assignments" tf:"optional"` + PrivilegeAssignments types.List `tfsdk:"privilege_assignments"` // The share name. - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` } func (newState *ShareToPrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareToPrivilegeAssignment_SdkV2) { @@ -2522,10 +2596,11 @@ func (newState *ShareToPrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *ShareToPrivilegeAssignment_SdkV2) SyncEffectiveFieldsDuringRead(existingState ShareToPrivilegeAssignment_SdkV2) { } -func (c ShareToPrivilegeAssignment_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PrivilegeAssignment_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "privilege_assignments")...) +func (c ShareToPrivilegeAssignment_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["privilege_assignments"] = attrs["privilege_assignments"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ShareToPrivilegeAssignment. @@ -2594,38 +2669,38 @@ func (o *ShareToPrivilegeAssignment_SdkV2) SetPrivilegeAssignments(ctx context.C type SharedDataObject_SdkV2 struct { // The time when this data object is added to the share, in epoch // milliseconds. - AddedAt types.Int64 `tfsdk:"added_at" tf:"computed"` + AddedAt types.Int64 `tfsdk:"added_at"` // Username of the sharer. - AddedBy types.String `tfsdk:"added_by" tf:"computed"` + AddedBy types.String `tfsdk:"added_by"` // Whether to enable cdf or indicate if cdf is enabled on the shared object. - CdfEnabled types.Bool `tfsdk:"cdf_enabled" tf:"optional"` - EffectiveCdfEnabled types.Bool `tfsdk:"effective_cdf_enabled" tf:"computed"` + CdfEnabled types.Bool `tfsdk:"cdf_enabled"` + EffectiveCdfEnabled types.Bool `tfsdk:"effective_cdf_enabled"` // A user-provided comment when adding the data object to the share. // [Update:OPT] - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The content of the notebook file when the data object type is // NOTEBOOK_FILE. This should be base64 encoded. Required for adding a // NOTEBOOK_FILE, optional for updating, ignored for other types. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // The type of the data object. - DataObjectType types.String `tfsdk:"data_object_type" tf:"optional"` + DataObjectType types.String `tfsdk:"data_object_type"` // Whether to enable or disable sharing of data history. If not specified, // the default is **DISABLED**. - HistoryDataSharingStatus types.String `tfsdk:"history_data_sharing_status" tf:"optional"` - EffectiveHistoryDataSharingStatus types.String `tfsdk:"effective_history_data_sharing_status" tf:"computed"` + HistoryDataSharingStatus types.String `tfsdk:"history_data_sharing_status"` + EffectiveHistoryDataSharingStatus types.String `tfsdk:"effective_history_data_sharing_status"` // A fully qualified name that uniquely identifies a data object. // // For example, a table's fully qualified name is in the format of // `..`. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Array of partitions for the shared data. - Partitions types.List `tfsdk:"partition" tf:"optional"` + Partitions types.List `tfsdk:"partition"` // A user-provided new name for the data object within the share. If this // new name is not provided, the object's original name will be used as the // `shared_as` name. The `shared_as` name must be unique within a share. For // tables, the new name must follow the format of `.
`. - SharedAs types.String `tfsdk:"shared_as" tf:"optional"` - EffectiveSharedAs types.String `tfsdk:"effective_shared_as" tf:"computed"` + SharedAs types.String `tfsdk:"shared_as"` + EffectiveSharedAs types.String `tfsdk:"effective_shared_as"` // The start version associated with the object. This allows data providers // to control the lowest object version that is accessible by clients. If // specified, clients can query snapshots or changes for versions >= @@ -2633,16 +2708,16 @@ type SharedDataObject_SdkV2 struct { // version of the object at the time it was added to the share. // // NOTE: The start_version should be <= the `current` version of the object. - StartVersion types.Int64 `tfsdk:"start_version" tf:"optional"` - EffectiveStartVersion types.Int64 `tfsdk:"effective_start_version" tf:"computed"` + StartVersion types.Int64 `tfsdk:"start_version"` + EffectiveStartVersion types.Int64 `tfsdk:"effective_start_version"` // One of: **ACTIVE**, **PERMISSION_DENIED**. - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` // A user-provided new name for the data object within the share. If this // new name is not provided, the object's original name will be used as the // `string_shared_as` name. The `string_shared_as` name must be unique // within a share. For notebooks, the new name should be the new notebook // file name. - StringSharedAs types.String `tfsdk:"string_shared_as" tf:"optional"` + StringSharedAs types.String `tfsdk:"string_shared_as"` } func (newState *SharedDataObject_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SharedDataObject_SdkV2) { @@ -2675,18 +2750,26 @@ func (newState *SharedDataObject_SdkV2) SyncEffectiveFieldsDuringRead(existingSt } } -func (c SharedDataObject_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "added_at")...) - cs.SetComputed(append(path, "added_by")...) - cs.SetComputed(append(path, "effective_cdf_enabled")...) - cs.SetComputed(append(path, "effective_history_data_sharing_status")...) - cs.SetRequired(append(path, "name")...) - Partition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "partition")...) - cs.SetComputed(append(path, "effective_shared_as")...) - cs.SetComputed(append(path, "effective_start_version")...) - cs.SetComputed(append(path, "status")...) +func (c SharedDataObject_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["added_at"] = attrs["added_at"].SetComputed() + attrs["added_by"] = attrs["added_by"].SetComputed() + attrs["effective_cdf_enabled"] = attrs["effective_cdf_enabled"].SetComputed() + attrs["cdf_enabled"] = attrs["cdf_enabled"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["content"] = attrs["content"].SetOptional() + attrs["data_object_type"] = attrs["data_object_type"].SetOptional() + attrs["effective_history_data_sharing_status"] = attrs["effective_history_data_sharing_status"].SetComputed() + attrs["history_data_sharing_status"] = attrs["history_data_sharing_status"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["partition"] = attrs["partition"].SetOptional() + attrs["effective_shared_as"] = attrs["effective_shared_as"].SetComputed() + attrs["shared_as"] = attrs["shared_as"].SetOptional() + attrs["effective_start_version"] = attrs["effective_start_version"].SetComputed() + attrs["start_version"] = attrs["start_version"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() + attrs["string_shared_as"] = attrs["string_shared_as"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SharedDataObject. @@ -2784,9 +2867,9 @@ func (o *SharedDataObject_SdkV2) SetPartitions(ctx context.Context, v []Partitio type SharedDataObjectUpdate_SdkV2 struct { // One of: **ADD**, **REMOVE**, **UPDATE**. - Action types.String `tfsdk:"action" tf:"optional"` + Action types.String `tfsdk:"action"` // The data object that is being added, removed, or updated. - DataObject types.List `tfsdk:"data_object" tf:"optional,object"` + DataObject types.List `tfsdk:"data_object"` } func (newState *SharedDataObjectUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SharedDataObjectUpdate_SdkV2) { @@ -2795,10 +2878,12 @@ func (newState *SharedDataObjectUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *SharedDataObjectUpdate_SdkV2) SyncEffectiveFieldsDuringRead(existingState SharedDataObjectUpdate_SdkV2) { } -func (c SharedDataObjectUpdate_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SharedDataObject_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_object")...) +func (c SharedDataObjectUpdate_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action"] = attrs["action"].SetOptional() + attrs["data_object"] = attrs["data_object"].SetOptional() + attrs["data_object"] = attrs["data_object"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SharedDataObjectUpdate. @@ -2896,16 +2981,16 @@ func (o UpdatePermissionsResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateProvider_SdkV2 struct { // Description about the provider. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the provider. Name types.String `tfsdk:"-"` // New name for the provider. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of Provider owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // This field is required when the __authentication_type__ is **TOKEN** or // not provided. - RecipientProfileStr types.String `tfsdk:"recipient_profile_str" tf:"optional"` + RecipientProfileStr types.String `tfsdk:"recipient_profile_str"` } func (newState *UpdateProvider_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProvider_SdkV2) { @@ -2914,10 +2999,14 @@ func (newState *UpdateProvider_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *UpdateProvider_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateProvider_SdkV2) { } -func (c UpdateProvider_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateProvider_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["recipient_profile_str"] = attrs["recipient_profile_str"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProvider. @@ -2961,22 +3050,22 @@ func (o UpdateProvider_SdkV2) Type(ctx context.Context) attr.Type { type UpdateRecipient_SdkV2 struct { // Description about the recipient. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // IP Access List - IpAccessList types.List `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.List `tfsdk:"ip_access_list"` // Name of the recipient. Name types.String `tfsdk:"-"` // New name for the recipient. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of the recipient owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Recipient properties as map of string key-value pairs. When provided in // update request, the specified properties will override the existing // properties. To add and remove properties, one would need to perform a // read-modify-write. - PropertiesKvpairs types.List `tfsdk:"properties_kvpairs" tf:"optional,object"` + PropertiesKvpairs types.List `tfsdk:"properties_kvpairs"` } func (newState *UpdateRecipient_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRecipient_SdkV2) { @@ -2985,12 +3074,18 @@ func (newState *UpdateRecipient_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *UpdateRecipient_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRecipient_SdkV2) { } -func (c UpdateRecipient_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessList_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) - cs.SetRequired(append(path, "name")...) - SecurablePropertiesKvPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "properties_kvpairs")...) +func (c UpdateRecipient_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRecipient. @@ -3127,17 +3222,17 @@ func (o UpdateResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateShare_SdkV2 struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the share. Name types.String `tfsdk:"-"` // New name for the share. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of share. - Owner types.String `tfsdk:"owner" tf:"computed"` + Owner types.String `tfsdk:"owner"` // Storage root URL for the share. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Array of shared data object updates. - Updates types.List `tfsdk:"updates" tf:"optional"` + Updates types.List `tfsdk:"updates"` } func (newState *UpdateShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateShare_SdkV2) { @@ -3146,12 +3241,15 @@ func (newState *UpdateShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateShare_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateShare_SdkV2) { } -func (c UpdateShare_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetComputed(append(path, "owner")...) - SharedDataObjectUpdate_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "updates")...) +func (c UpdateShare_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetComputed() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updates"] = attrs["updates"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateShare. @@ -3227,7 +3325,7 @@ func (o *UpdateShare_SdkV2) SetUpdates(ctx context.Context, v []SharedDataObject type UpdateSharePermissions_SdkV2 struct { // Array of permission changes. - Changes types.List `tfsdk:"changes" tf:"optional"` + Changes types.List `tfsdk:"changes"` // Maximum number of permissions to return. - when set to 0, the page length // is set to a server configured value (recommended); - when set to a value // greater than 0, the page length is the minimum of this value and a server @@ -3250,10 +3348,13 @@ func (newState *UpdateSharePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *UpdateSharePermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateSharePermissions_SdkV2) { } -func (c UpdateSharePermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateSharePermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["changes"] = attrs["changes"].SetOptional() + attrs["max_results"] = attrs["max_results"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["page_token"] = attrs["page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateSharePermissions. diff --git a/internal/service/sharing_tf/model.go b/internal/service/sharing_tf/model.go index da6d4d56f..a521ca68b 100755 --- a/internal/service/sharing_tf/model.go +++ b/internal/service/sharing_tf/model.go @@ -25,14 +25,14 @@ import ( type CreateProvider struct { // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:""` + AuthenticationType types.String `tfsdk:"authentication_type"` // Description about the provider. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the Provider. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // This field is required when the __authentication_type__ is **TOKEN** or // not provided. - RecipientProfileStr types.String `tfsdk:"recipient_profile_str" tf:"optional"` + RecipientProfileStr types.String `tfsdk:"recipient_profile_str"` } func (newState *CreateProvider) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateProvider) { @@ -41,11 +41,13 @@ func (newState *CreateProvider) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CreateProvider) SyncEffectiveFieldsDuringRead(existingState CreateProvider) { } -func (c CreateProvider) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "authentication_type")...) - cs.SetRequired(append(path, "name")...) +func (c CreateProvider) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authentication_type"] = attrs["authentication_type"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["recipient_profile_str"] = attrs["recipient_profile_str"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateProvider. @@ -87,27 +89,27 @@ func (o CreateProvider) Type(ctx context.Context) attr.Type { type CreateRecipient struct { // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:""` + AuthenticationType types.String `tfsdk:"authentication_type"` // Description about the recipient. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The global Unity Catalog metastore id provided by the data recipient. // This field is required when the __authentication_type__ is // **DATABRICKS**. The identifier is of format // __cloud__:__region__:__metastore-uuid__. - DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id" tf:"optional"` + DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id"` // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // IP Access List - IpAccessList types.Object `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.Object `tfsdk:"ip_access_list"` // Name of Recipient. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Username of the recipient owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Recipient properties as map of string key-value pairs. - PropertiesKvpairs types.Object `tfsdk:"properties_kvpairs" tf:"optional,object"` + PropertiesKvpairs types.Object `tfsdk:"properties_kvpairs"` // The one-time sharing code provided by the data recipient. This field is // required when the __authentication_type__ is **DATABRICKS**. - SharingCode types.String `tfsdk:"sharing_code" tf:"optional"` + SharingCode types.String `tfsdk:"sharing_code"` } func (newState *CreateRecipient) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRecipient) { @@ -116,13 +118,18 @@ func (newState *CreateRecipient) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cr func (newState *CreateRecipient) SyncEffectiveFieldsDuringRead(existingState CreateRecipient) { } -func (c CreateRecipient) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "authentication_type")...) - IpAccessList{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) - cs.SetRequired(append(path, "name")...) - SecurablePropertiesKvPairs{}.ApplySchemaCustomizations(cs, append(path, "properties_kvpairs")...) +func (c CreateRecipient) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authentication_type"] = attrs["authentication_type"].SetRequired() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["data_recipient_global_metastore_id"] = attrs["data_recipient_global_metastore_id"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].SetOptional() + attrs["sharing_code"] = attrs["sharing_code"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRecipient. @@ -233,11 +240,11 @@ func (o *CreateRecipient) SetPropertiesKvpairs(ctx context.Context, v SecurableP type CreateShare struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the share. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Storage root URL for the share. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` } func (newState *CreateShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateShare) { @@ -246,10 +253,12 @@ func (newState *CreateShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan Create func (newState *CreateShare) SyncEffectiveFieldsDuringRead(existingState CreateShare) { } -func (c CreateShare) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c CreateShare) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["storage_root"] = attrs["storage_root"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateShare. @@ -474,9 +483,9 @@ func (newState *GetActivationUrlInfoResponse) SyncEffectiveFieldsDuringCreateOrU func (newState *GetActivationUrlInfoResponse) SyncEffectiveFieldsDuringRead(existingState GetActivationUrlInfoResponse) { } -func (c GetActivationUrlInfoResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetActivationUrlInfoResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetActivationUrlInfoResponse. @@ -584,9 +593,9 @@ type GetRecipientSharePermissionsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of data share permissions for a recipient. - PermissionsOut types.List `tfsdk:"permissions_out" tf:"optional"` + PermissionsOut types.List `tfsdk:"permissions_out"` } func (newState *GetRecipientSharePermissionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRecipientSharePermissionsResponse) { @@ -595,10 +604,11 @@ func (newState *GetRecipientSharePermissionsResponse) SyncEffectiveFieldsDuringC func (newState *GetRecipientSharePermissionsResponse) SyncEffectiveFieldsDuringRead(existingState GetRecipientSharePermissionsResponse) { } -func (c GetRecipientSharePermissionsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ShareToPrivilegeAssignment{}.ApplySchemaCustomizations(cs, append(path, "permissions_out")...) +func (c GetRecipientSharePermissionsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["permissions_out"] = attrs["permissions_out"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRecipientSharePermissionsResponse. @@ -707,7 +717,7 @@ func (o GetShareRequest) Type(ctx context.Context) attr.Type { type IpAccessList struct { // Allowed IP Addresses in CIDR notation. Limit of 100. - AllowedIpAddresses types.List `tfsdk:"allowed_ip_addresses" tf:"optional"` + AllowedIpAddresses types.List `tfsdk:"allowed_ip_addresses"` } func (newState *IpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan IpAccessList) { @@ -716,9 +726,10 @@ func (newState *IpAccessList) SyncEffectiveFieldsDuringCreateOrUpdate(plan IpAcc func (newState *IpAccessList) SyncEffectiveFieldsDuringRead(existingState IpAccessList) { } -func (c IpAccessList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c IpAccessList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["allowed_ip_addresses"] = attrs["allowed_ip_addresses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in IpAccessList. @@ -786,9 +797,9 @@ type ListProviderSharesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of provider shares. - Shares types.List `tfsdk:"shares" tf:"optional"` + Shares types.List `tfsdk:"shares"` } func (newState *ListProviderSharesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProviderSharesResponse) { @@ -797,10 +808,11 @@ func (newState *ListProviderSharesResponse) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListProviderSharesResponse) SyncEffectiveFieldsDuringRead(existingState ListProviderSharesResponse) { } -func (c ListProviderSharesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderShare{}.ApplySchemaCustomizations(cs, append(path, "shares")...) +func (c ListProviderSharesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["shares"] = attrs["shares"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProviderSharesResponse. @@ -924,9 +936,9 @@ type ListProvidersResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of provider information objects. - Providers types.List `tfsdk:"providers" tf:"optional"` + Providers types.List `tfsdk:"providers"` } func (newState *ListProvidersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListProvidersResponse) { @@ -935,10 +947,11 @@ func (newState *ListProvidersResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *ListProvidersResponse) SyncEffectiveFieldsDuringRead(existingState ListProvidersResponse) { } -func (c ListProvidersResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ProviderInfo{}.ApplySchemaCustomizations(cs, append(path, "providers")...) +func (c ListProvidersResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["providers"] = attrs["providers"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListProvidersResponse. @@ -1062,9 +1075,9 @@ type ListRecipientsResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of recipient information objects. - Recipients types.List `tfsdk:"recipients" tf:"optional"` + Recipients types.List `tfsdk:"recipients"` } func (newState *ListRecipientsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListRecipientsResponse) { @@ -1073,10 +1086,11 @@ func (newState *ListRecipientsResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListRecipientsResponse) SyncEffectiveFieldsDuringRead(existingState ListRecipientsResponse) { } -func (c ListRecipientsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RecipientInfo{}.ApplySchemaCustomizations(cs, append(path, "recipients")...) +func (c ListRecipientsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["recipients"] = attrs["recipients"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListRecipientsResponse. @@ -1199,9 +1213,9 @@ type ListSharesResponse struct { // Opaque token to retrieve the next page of results. Absent if there are no // more pages. __page_token__ should be set to this value for the next // request (for the next page of results). - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // An array of data share information objects. - Shares types.List `tfsdk:"shares" tf:"optional"` + Shares types.List `tfsdk:"shares"` } func (newState *ListSharesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSharesResponse) { @@ -1210,10 +1224,11 @@ func (newState *ListSharesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListSharesResponse) SyncEffectiveFieldsDuringRead(existingState ListSharesResponse) { } -func (c ListSharesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ShareInfo{}.ApplySchemaCustomizations(cs, append(path, "shares")...) +func (c ListSharesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["shares"] = attrs["shares"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSharesResponse. @@ -1281,7 +1296,7 @@ func (o *ListSharesResponse) SetShares(ctx context.Context, v []ShareInfo) { type Partition struct { // An array of partition values. - Values types.List `tfsdk:"value" tf:"optional"` + Values types.List `tfsdk:"value"` } func (newState *Partition) SyncEffectiveFieldsDuringCreateOrUpdate(plan Partition) { @@ -1290,10 +1305,10 @@ func (newState *Partition) SyncEffectiveFieldsDuringCreateOrUpdate(plan Partitio func (newState *Partition) SyncEffectiveFieldsDuringRead(existingState Partition) { } -func (c Partition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PartitionValue{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c Partition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Partition. @@ -1359,7 +1374,7 @@ func (o *Partition) SetValues(ctx context.Context, v []PartitionValue) { type PartitionSpecificationPartition struct { // An array of partition values. - Values types.List `tfsdk:"value" tf:"optional"` + Values types.List `tfsdk:"value"` } func (newState *PartitionSpecificationPartition) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartitionSpecificationPartition) { @@ -1368,10 +1383,10 @@ func (newState *PartitionSpecificationPartition) SyncEffectiveFieldsDuringCreate func (newState *PartitionSpecificationPartition) SyncEffectiveFieldsDuringRead(existingState PartitionSpecificationPartition) { } -func (c PartitionSpecificationPartition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PartitionValue{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c PartitionSpecificationPartition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartitionSpecificationPartition. @@ -1437,17 +1452,17 @@ func (o *PartitionSpecificationPartition) SetValues(ctx context.Context, v []Par type PartitionValue struct { // The name of the partition column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The operator to apply for the value. - Op types.String `tfsdk:"op" tf:"optional"` + Op types.String `tfsdk:"op"` // The key of a Delta Sharing recipient's property. For example // "databricks-account-id". When this field is set, field `value` can not be // set. - RecipientPropertyKey types.String `tfsdk:"recipient_property_key" tf:"optional"` + RecipientPropertyKey types.String `tfsdk:"recipient_property_key"` // The value of the partition column. When this value is not set, it means // `null` value. When this field is set, field `recipient_property_key` can // not be set. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *PartitionValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan PartitionValue) { @@ -1456,9 +1471,13 @@ func (newState *PartitionValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan Par func (newState *PartitionValue) SyncEffectiveFieldsDuringRead(existingState PartitionValue) { } -func (c PartitionValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PartitionValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["op"] = attrs["op"].SetOptional() + attrs["recipient_property_key"] = attrs["recipient_property_key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PartitionValue. @@ -1500,9 +1519,9 @@ func (o PartitionValue) Type(ctx context.Context) attr.Type { type PrivilegeAssignment struct { // The principal (user email address or group name). - Principal types.String `tfsdk:"principal" tf:"optional"` + Principal types.String `tfsdk:"principal"` // The privileges assigned to the principal. - Privileges types.List `tfsdk:"privileges" tf:"optional"` + Privileges types.List `tfsdk:"privileges"` } func (newState *PrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan PrivilegeAssignment) { @@ -1511,9 +1530,11 @@ func (newState *PrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *PrivilegeAssignment) SyncEffectiveFieldsDuringRead(existingState PrivilegeAssignment) { } -func (c PrivilegeAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c PrivilegeAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetOptional() + attrs["privileges"] = attrs["privileges"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PrivilegeAssignment. @@ -1581,40 +1602,40 @@ func (o *PrivilegeAssignment) SetPrivileges(ctx context.Context, v []types.Strin type ProviderInfo struct { // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:"optional"` + AuthenticationType types.String `tfsdk:"authentication_type"` // Cloud vendor of the provider's UC metastore. This field is only present // when the __authentication_type__ is **DATABRICKS**. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Description about the provider. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this Provider was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of Provider creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The global UC metastore id of the data provider. This field is only // present when the __authentication_type__ is **DATABRICKS**. The // identifier is of format ::. - DataProviderGlobalMetastoreId types.String `tfsdk:"data_provider_global_metastore_id" tf:"optional"` + DataProviderGlobalMetastoreId types.String `tfsdk:"data_provider_global_metastore_id"` // UUID of the provider's UC metastore. This field is only present when the // __authentication_type__ is **DATABRICKS**. - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // The name of the Provider. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of Provider owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // The recipient profile. This field is only present when the // authentication_type is `TOKEN`. - RecipientProfile types.Object `tfsdk:"recipient_profile" tf:"optional,object"` + RecipientProfile types.Object `tfsdk:"recipient_profile"` // This field is only present when the authentication_type is `TOKEN` or not // provided. - RecipientProfileStr types.String `tfsdk:"recipient_profile_str" tf:"optional"` + RecipientProfileStr types.String `tfsdk:"recipient_profile_str"` // Cloud region of the provider's UC metastore. This field is only present // when the __authentication_type__ is **DATABRICKS**. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // Time at which this Provider was created, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of user who last modified Share. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *ProviderInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderInfo) { @@ -1623,10 +1644,23 @@ func (newState *ProviderInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Provi func (newState *ProviderInfo) SyncEffectiveFieldsDuringRead(existingState ProviderInfo) { } -func (c ProviderInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RecipientProfile{}.ApplySchemaCustomizations(cs, append(path, "recipient_profile")...) +func (c ProviderInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authentication_type"] = attrs["authentication_type"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_provider_global_metastore_id"] = attrs["data_provider_global_metastore_id"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["recipient_profile"] = attrs["recipient_profile"].SetOptional() + attrs["recipient_profile_str"] = attrs["recipient_profile_str"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderInfo. @@ -1718,7 +1752,7 @@ func (o *ProviderInfo) SetRecipientProfile(ctx context.Context, v RecipientProfi type ProviderShare struct { // The name of the Provider Share. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ProviderShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan ProviderShare) { @@ -1727,9 +1761,10 @@ func (newState *ProviderShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan Prov func (newState *ProviderShare) SyncEffectiveFieldsDuringRead(existingState ProviderShare) { } -func (c ProviderShare) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ProviderShare) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ProviderShare. @@ -1766,49 +1801,49 @@ func (o ProviderShare) Type(ctx context.Context) attr.Type { type RecipientInfo struct { // A boolean status field showing whether the Recipient's activation URL has // been exercised or not. - Activated types.Bool `tfsdk:"activated" tf:"optional"` + Activated types.Bool `tfsdk:"activated"` // Full activation url to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl types.String `tfsdk:"activation_url" tf:"optional"` + ActivationUrl types.String `tfsdk:"activation_url"` // The delta sharing authentication type. - AuthenticationType types.String `tfsdk:"authentication_type" tf:"optional"` + AuthenticationType types.String `tfsdk:"authentication_type"` // Cloud vendor of the recipient's Unity Catalog Metstore. This field is // only present when the __authentication_type__ is **DATABRICKS**`. - Cloud types.String `tfsdk:"cloud" tf:"optional"` + Cloud types.String `tfsdk:"cloud"` // Description about the recipient. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this recipient was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of recipient creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // The global Unity Catalog metastore id provided by the data recipient. // This field is only present when the __authentication_type__ is // **DATABRICKS**. The identifier is of format // __cloud__:__region__:__metastore-uuid__. - DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id" tf:"optional"` + DataRecipientGlobalMetastoreId types.String `tfsdk:"data_recipient_global_metastore_id"` // IP Access List - IpAccessList types.Object `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.Object `tfsdk:"ip_access_list"` // Unique identifier of recipient's Unity Catalog metastore. This field is // only present when the __authentication_type__ is **DATABRICKS** - MetastoreId types.String `tfsdk:"metastore_id" tf:"optional"` + MetastoreId types.String `tfsdk:"metastore_id"` // Name of Recipient. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Username of the recipient owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Recipient properties as map of string key-value pairs. - PropertiesKvpairs types.Object `tfsdk:"properties_kvpairs" tf:"optional,object"` + PropertiesKvpairs types.Object `tfsdk:"properties_kvpairs"` // Cloud region of the recipient's Unity Catalog Metstore. This field is // only present when the __authentication_type__ is **DATABRICKS**. - Region types.String `tfsdk:"region" tf:"optional"` + Region types.String `tfsdk:"region"` // The one-time sharing code provided by the data recipient. This field is // only present when the __authentication_type__ is **DATABRICKS**. - SharingCode types.String `tfsdk:"sharing_code" tf:"optional"` + SharingCode types.String `tfsdk:"sharing_code"` // This field is only present when the __authentication_type__ is **TOKEN**. - Tokens types.List `tfsdk:"tokens" tf:"optional"` + Tokens types.List `tfsdk:"tokens"` // Time at which the recipient was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of recipient updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *RecipientInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RecipientInfo) { @@ -1817,12 +1852,27 @@ func (newState *RecipientInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Reci func (newState *RecipientInfo) SyncEffectiveFieldsDuringRead(existingState RecipientInfo) { } -func (c RecipientInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessList{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) - SecurablePropertiesKvPairs{}.ApplySchemaCustomizations(cs, append(path, "properties_kvpairs")...) - RecipientTokenInfo{}.ApplySchemaCustomizations(cs, append(path, "tokens")...) - - return cs +func (c RecipientInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activated"] = attrs["activated"].SetOptional() + attrs["activation_url"] = attrs["activation_url"].SetOptional() + attrs["authentication_type"] = attrs["authentication_type"].SetOptional() + attrs["cloud"] = attrs["cloud"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["data_recipient_global_metastore_id"] = attrs["data_recipient_global_metastore_id"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["metastore_id"] = attrs["metastore_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].SetOptional() + attrs["region"] = attrs["region"].SetOptional() + attrs["sharing_code"] = attrs["sharing_code"].SetOptional() + attrs["tokens"] = attrs["tokens"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RecipientInfo. @@ -1980,11 +2030,11 @@ func (o *RecipientInfo) SetTokens(ctx context.Context, v []RecipientTokenInfo) { type RecipientProfile struct { // The token used to authorize the recipient. - BearerToken types.String `tfsdk:"bearer_token" tf:"optional"` + BearerToken types.String `tfsdk:"bearer_token"` // The endpoint for the share to be used by the recipient. - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` // The version number of the recipient's credentials on a share. - ShareCredentialsVersion types.Int64 `tfsdk:"share_credentials_version" tf:"optional"` + ShareCredentialsVersion types.Int64 `tfsdk:"share_credentials_version"` } func (newState *RecipientProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan RecipientProfile) { @@ -1993,9 +2043,12 @@ func (newState *RecipientProfile) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *RecipientProfile) SyncEffectiveFieldsDuringRead(existingState RecipientProfile) { } -func (c RecipientProfile) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RecipientProfile) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bearer_token"] = attrs["bearer_token"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["share_credentials_version"] = attrs["share_credentials_version"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RecipientProfile. @@ -2036,19 +2089,19 @@ func (o RecipientProfile) Type(ctx context.Context) attr.Type { type RecipientTokenInfo struct { // Full activation URL to retrieve the access token. It will be empty if the // token is already retrieved. - ActivationUrl types.String `tfsdk:"activation_url" tf:"optional"` + ActivationUrl types.String `tfsdk:"activation_url"` // Time at which this recipient Token was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of recipient token creator. - CreatedBy types.String `tfsdk:"created_by" tf:"optional"` + CreatedBy types.String `tfsdk:"created_by"` // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // Unique ID of the recipient token. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Time at which this recipient Token was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of recipient Token updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"optional"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *RecipientTokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RecipientTokenInfo) { @@ -2057,9 +2110,16 @@ func (newState *RecipientTokenInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *RecipientTokenInfo) SyncEffectiveFieldsDuringRead(existingState RecipientTokenInfo) { } -func (c RecipientTokenInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RecipientTokenInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["activation_url"] = attrs["activation_url"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["created_by"] = attrs["created_by"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["updated_by"] = attrs["updated_by"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RecipientTokenInfo. @@ -2144,13 +2204,13 @@ func (o RetrieveTokenRequest) Type(ctx context.Context) attr.Type { type RetrieveTokenResponse struct { // The token used to authorize the recipient. - BearerToken types.String `tfsdk:"bearerToken" tf:"optional"` + BearerToken types.String `tfsdk:"bearerToken"` // The endpoint for the share to be used by the recipient. - Endpoint types.String `tfsdk:"endpoint" tf:"optional"` + Endpoint types.String `tfsdk:"endpoint"` // Expiration timestamp of the token in epoch milliseconds. - ExpirationTime types.String `tfsdk:"expirationTime" tf:"optional"` + ExpirationTime types.String `tfsdk:"expirationTime"` // These field names must follow the delta sharing protocol. - ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion" tf:"optional"` + ShareCredentialsVersion types.Int64 `tfsdk:"shareCredentialsVersion"` } func (newState *RetrieveTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RetrieveTokenResponse) { @@ -2159,9 +2219,13 @@ func (newState *RetrieveTokenResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *RetrieveTokenResponse) SyncEffectiveFieldsDuringRead(existingState RetrieveTokenResponse) { } -func (c RetrieveTokenResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RetrieveTokenResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bearerToken"] = attrs["bearerToken"].SetOptional() + attrs["endpoint"] = attrs["endpoint"].SetOptional() + attrs["expirationTime"] = attrs["expirationTime"].SetOptional() + attrs["shareCredentialsVersion"] = attrs["shareCredentialsVersion"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RetrieveTokenResponse. @@ -2206,7 +2270,7 @@ type RotateRecipientToken struct { // the expiration_time of existing token only to a smaller timestamp, it // cannot extend the expiration_time. Use 0 to expire the existing token // immediately, negative number will return an error. - ExistingTokenExpireInSeconds types.Int64 `tfsdk:"existing_token_expire_in_seconds" tf:""` + ExistingTokenExpireInSeconds types.Int64 `tfsdk:"existing_token_expire_in_seconds"` // The name of the recipient. Name types.String `tfsdk:"-"` } @@ -2217,11 +2281,11 @@ func (newState *RotateRecipientToken) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RotateRecipientToken) SyncEffectiveFieldsDuringRead(existingState RotateRecipientToken) { } -func (c RotateRecipientToken) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "existing_token_expire_in_seconds")...) - cs.SetRequired(append(path, "name")...) +func (c RotateRecipientToken) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["existing_token_expire_in_seconds"] = attrs["existing_token_expire_in_seconds"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RotateRecipientToken. @@ -2261,7 +2325,7 @@ func (o RotateRecipientToken) Type(ctx context.Context) attr.Type { // to the securable. type SecurablePropertiesKvPairs struct { // A map of key-value properties attached to the securable. - Properties types.Map `tfsdk:"properties" tf:""` + Properties types.Map `tfsdk:"properties"` } func (newState *SecurablePropertiesKvPairs) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecurablePropertiesKvPairs) { @@ -2270,10 +2334,10 @@ func (newState *SecurablePropertiesKvPairs) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SecurablePropertiesKvPairs) SyncEffectiveFieldsDuringRead(existingState SecurablePropertiesKvPairs) { } -func (c SecurablePropertiesKvPairs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "properties")...) +func (c SecurablePropertiesKvPairs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["properties"] = attrs["properties"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecurablePropertiesKvPairs. @@ -2339,25 +2403,25 @@ func (o *SecurablePropertiesKvPairs) SetProperties(ctx context.Context, v map[st type ShareInfo struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Time at which this share was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed"` + CreatedAt types.Int64 `tfsdk:"created_at"` // Username of share creator. - CreatedBy types.String `tfsdk:"created_by" tf:"computed"` + CreatedBy types.String `tfsdk:"created_by"` // Name of the share. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // A list of shared data objects within the share. - Objects types.List `tfsdk:"object" tf:"optional"` + Objects types.List `tfsdk:"object"` // Username of current owner of share. - Owner types.String `tfsdk:"owner" tf:"computed"` + Owner types.String `tfsdk:"owner"` // Storage Location URL (full path) for the share. - StorageLocation types.String `tfsdk:"storage_location" tf:"optional"` + StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for the share. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Time at which this share was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed"` + UpdatedAt types.Int64 `tfsdk:"updated_at"` // Username of share updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"computed"` + UpdatedBy types.String `tfsdk:"updated_by"` } func (newState *ShareInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo) { @@ -2366,15 +2430,19 @@ func (newState *ShareInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInf func (newState *ShareInfo) SyncEffectiveFieldsDuringRead(existingState ShareInfo) { } -func (c ShareInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "created_at")...) - cs.SetComputed(append(path, "created_by")...) - SharedDataObject{}.ApplySchemaCustomizations(cs, append(path, "object")...) - cs.SetComputed(append(path, "owner")...) - cs.SetComputed(append(path, "updated_at")...) - cs.SetComputed(append(path, "updated_by")...) +func (c ShareInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetComputed() + attrs["created_by"] = attrs["created_by"].SetComputed() + attrs["name"] = attrs["name"].SetOptional() + attrs["object"] = attrs["object"].SetOptional() + attrs["owner"] = attrs["owner"].SetComputed() + attrs["storage_location"] = attrs["storage_location"].SetOptional() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetComputed() + attrs["updated_by"] = attrs["updated_by"].SetComputed() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ShareInfo. @@ -2511,9 +2579,9 @@ func (o SharePermissionsRequest) Type(ctx context.Context) attr.Type { type ShareToPrivilegeAssignment struct { // The privileges assigned to the principal. - PrivilegeAssignments types.List `tfsdk:"privilege_assignments" tf:"optional"` + PrivilegeAssignments types.List `tfsdk:"privilege_assignments"` // The share name. - ShareName types.String `tfsdk:"share_name" tf:"optional"` + ShareName types.String `tfsdk:"share_name"` } func (newState *ShareToPrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareToPrivilegeAssignment) { @@ -2522,10 +2590,11 @@ func (newState *ShareToPrivilegeAssignment) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ShareToPrivilegeAssignment) SyncEffectiveFieldsDuringRead(existingState ShareToPrivilegeAssignment) { } -func (c ShareToPrivilegeAssignment) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - PrivilegeAssignment{}.ApplySchemaCustomizations(cs, append(path, "privilege_assignments")...) +func (c ShareToPrivilegeAssignment) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["privilege_assignments"] = attrs["privilege_assignments"].SetOptional() + attrs["share_name"] = attrs["share_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ShareToPrivilegeAssignment. @@ -2594,38 +2663,38 @@ func (o *ShareToPrivilegeAssignment) SetPrivilegeAssignments(ctx context.Context type SharedDataObject struct { // The time when this data object is added to the share, in epoch // milliseconds. - AddedAt types.Int64 `tfsdk:"added_at" tf:"computed"` + AddedAt types.Int64 `tfsdk:"added_at"` // Username of the sharer. - AddedBy types.String `tfsdk:"added_by" tf:"computed"` + AddedBy types.String `tfsdk:"added_by"` // Whether to enable cdf or indicate if cdf is enabled on the shared object. - CdfEnabled types.Bool `tfsdk:"cdf_enabled" tf:"optional"` - EffectiveCdfEnabled types.Bool `tfsdk:"effective_cdf_enabled" tf:"computed"` + CdfEnabled types.Bool `tfsdk:"cdf_enabled"` + EffectiveCdfEnabled types.Bool `tfsdk:"effective_cdf_enabled"` // A user-provided comment when adding the data object to the share. // [Update:OPT] - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The content of the notebook file when the data object type is // NOTEBOOK_FILE. This should be base64 encoded. Required for adding a // NOTEBOOK_FILE, optional for updating, ignored for other types. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // The type of the data object. - DataObjectType types.String `tfsdk:"data_object_type" tf:"optional"` + DataObjectType types.String `tfsdk:"data_object_type"` // Whether to enable or disable sharing of data history. If not specified, // the default is **DISABLED**. - HistoryDataSharingStatus types.String `tfsdk:"history_data_sharing_status" tf:"optional"` - EffectiveHistoryDataSharingStatus types.String `tfsdk:"effective_history_data_sharing_status" tf:"computed"` + HistoryDataSharingStatus types.String `tfsdk:"history_data_sharing_status"` + EffectiveHistoryDataSharingStatus types.String `tfsdk:"effective_history_data_sharing_status"` // A fully qualified name that uniquely identifies a data object. // // For example, a table's fully qualified name is in the format of // `..
`. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Array of partitions for the shared data. - Partitions types.List `tfsdk:"partition" tf:"optional"` + Partitions types.List `tfsdk:"partition"` // A user-provided new name for the data object within the share. If this // new name is not provided, the object's original name will be used as the // `shared_as` name. The `shared_as` name must be unique within a share. For // tables, the new name must follow the format of `.
`. - SharedAs types.String `tfsdk:"shared_as" tf:"optional"` - EffectiveSharedAs types.String `tfsdk:"effective_shared_as" tf:"computed"` + SharedAs types.String `tfsdk:"shared_as"` + EffectiveSharedAs types.String `tfsdk:"effective_shared_as"` // The start version associated with the object. This allows data providers // to control the lowest object version that is accessible by clients. If // specified, clients can query snapshots or changes for versions >= @@ -2633,16 +2702,16 @@ type SharedDataObject struct { // version of the object at the time it was added to the share. // // NOTE: The start_version should be <= the `current` version of the object. - StartVersion types.Int64 `tfsdk:"start_version" tf:"optional"` - EffectiveStartVersion types.Int64 `tfsdk:"effective_start_version" tf:"computed"` + StartVersion types.Int64 `tfsdk:"start_version"` + EffectiveStartVersion types.Int64 `tfsdk:"effective_start_version"` // One of: **ACTIVE**, **PERMISSION_DENIED**. - Status types.String `tfsdk:"status" tf:"computed"` + Status types.String `tfsdk:"status"` // A user-provided new name for the data object within the share. If this // new name is not provided, the object's original name will be used as the // `string_shared_as` name. The `string_shared_as` name must be unique // within a share. For notebooks, the new name should be the new notebook // file name. - StringSharedAs types.String `tfsdk:"string_shared_as" tf:"optional"` + StringSharedAs types.String `tfsdk:"string_shared_as"` } func (newState *SharedDataObject) SyncEffectiveFieldsDuringCreateOrUpdate(plan SharedDataObject) { @@ -2675,18 +2744,26 @@ func (newState *SharedDataObject) SyncEffectiveFieldsDuringRead(existingState Sh } } -func (c SharedDataObject) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetComputed(append(path, "added_at")...) - cs.SetComputed(append(path, "added_by")...) - cs.SetComputed(append(path, "effective_cdf_enabled")...) - cs.SetComputed(append(path, "effective_history_data_sharing_status")...) - cs.SetRequired(append(path, "name")...) - Partition{}.ApplySchemaCustomizations(cs, append(path, "partition")...) - cs.SetComputed(append(path, "effective_shared_as")...) - cs.SetComputed(append(path, "effective_start_version")...) - cs.SetComputed(append(path, "status")...) +func (c SharedDataObject) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["added_at"] = attrs["added_at"].SetComputed() + attrs["added_by"] = attrs["added_by"].SetComputed() + attrs["effective_cdf_enabled"] = attrs["effective_cdf_enabled"].SetComputed() + attrs["cdf_enabled"] = attrs["cdf_enabled"].SetOptional() + attrs["comment"] = attrs["comment"].SetOptional() + attrs["content"] = attrs["content"].SetOptional() + attrs["data_object_type"] = attrs["data_object_type"].SetOptional() + attrs["effective_history_data_sharing_status"] = attrs["effective_history_data_sharing_status"].SetComputed() + attrs["history_data_sharing_status"] = attrs["history_data_sharing_status"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["partition"] = attrs["partition"].SetOptional() + attrs["effective_shared_as"] = attrs["effective_shared_as"].SetComputed() + attrs["shared_as"] = attrs["shared_as"].SetOptional() + attrs["effective_start_version"] = attrs["effective_start_version"].SetComputed() + attrs["start_version"] = attrs["start_version"].SetOptional() + attrs["status"] = attrs["status"].SetComputed() + attrs["string_shared_as"] = attrs["string_shared_as"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SharedDataObject. @@ -2784,9 +2861,9 @@ func (o *SharedDataObject) SetPartitions(ctx context.Context, v []Partition) { type SharedDataObjectUpdate struct { // One of: **ADD**, **REMOVE**, **UPDATE**. - Action types.String `tfsdk:"action" tf:"optional"` + Action types.String `tfsdk:"action"` // The data object that is being added, removed, or updated. - DataObject types.Object `tfsdk:"data_object" tf:"optional,object"` + DataObject types.Object `tfsdk:"data_object"` } func (newState *SharedDataObjectUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(plan SharedDataObjectUpdate) { @@ -2795,10 +2872,11 @@ func (newState *SharedDataObjectUpdate) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *SharedDataObjectUpdate) SyncEffectiveFieldsDuringRead(existingState SharedDataObjectUpdate) { } -func (c SharedDataObjectUpdate) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SharedDataObject{}.ApplySchemaCustomizations(cs, append(path, "data_object")...) +func (c SharedDataObjectUpdate) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["action"] = attrs["action"].SetOptional() + attrs["data_object"] = attrs["data_object"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SharedDataObjectUpdate. @@ -2896,16 +2974,16 @@ func (o UpdatePermissionsResponse) Type(ctx context.Context) attr.Type { type UpdateProvider struct { // Description about the provider. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Name of the provider. Name types.String `tfsdk:"-"` // New name for the provider. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of Provider owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // This field is required when the __authentication_type__ is **TOKEN** or // not provided. - RecipientProfileStr types.String `tfsdk:"recipient_profile_str" tf:"optional"` + RecipientProfileStr types.String `tfsdk:"recipient_profile_str"` } func (newState *UpdateProvider) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateProvider) { @@ -2914,10 +2992,14 @@ func (newState *UpdateProvider) SyncEffectiveFieldsDuringCreateOrUpdate(plan Upd func (newState *UpdateProvider) SyncEffectiveFieldsDuringRead(existingState UpdateProvider) { } -func (c UpdateProvider) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateProvider) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["recipient_profile_str"] = attrs["recipient_profile_str"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateProvider. @@ -2961,22 +3043,22 @@ func (o UpdateProvider) Type(ctx context.Context) attr.Type { type UpdateRecipient struct { // Description about the recipient. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // Expiration timestamp of the token, in epoch milliseconds. - ExpirationTime types.Int64 `tfsdk:"expiration_time" tf:"optional"` + ExpirationTime types.Int64 `tfsdk:"expiration_time"` // IP Access List - IpAccessList types.Object `tfsdk:"ip_access_list" tf:"optional,object"` + IpAccessList types.Object `tfsdk:"ip_access_list"` // Name of the recipient. Name types.String `tfsdk:"-"` // New name for the recipient. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of the recipient owner. - Owner types.String `tfsdk:"owner" tf:"optional"` + Owner types.String `tfsdk:"owner"` // Recipient properties as map of string key-value pairs. When provided in // update request, the specified properties will override the existing // properties. To add and remove properties, one would need to perform a // read-modify-write. - PropertiesKvpairs types.Object `tfsdk:"properties_kvpairs" tf:"optional,object"` + PropertiesKvpairs types.Object `tfsdk:"properties_kvpairs"` } func (newState *UpdateRecipient) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRecipient) { @@ -2985,12 +3067,16 @@ func (newState *UpdateRecipient) SyncEffectiveFieldsDuringCreateOrUpdate(plan Up func (newState *UpdateRecipient) SyncEffectiveFieldsDuringRead(existingState UpdateRecipient) { } -func (c UpdateRecipient) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - IpAccessList{}.ApplySchemaCustomizations(cs, append(path, "ip_access_list")...) - cs.SetRequired(append(path, "name")...) - SecurablePropertiesKvPairs{}.ApplySchemaCustomizations(cs, append(path, "properties_kvpairs")...) +func (c UpdateRecipient) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["expiration_time"] = attrs["expiration_time"].SetOptional() + attrs["ip_access_list"] = attrs["ip_access_list"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetOptional() + attrs["properties_kvpairs"] = attrs["properties_kvpairs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRecipient. @@ -3127,17 +3213,17 @@ func (o UpdateResponse) Type(ctx context.Context) attr.Type { type UpdateShare struct { // User-provided free-form text description. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment"` // The name of the share. Name types.String `tfsdk:"-"` // New name for the share. - NewName types.String `tfsdk:"new_name" tf:"optional"` + NewName types.String `tfsdk:"new_name"` // Username of current owner of share. - Owner types.String `tfsdk:"owner" tf:"computed"` + Owner types.String `tfsdk:"owner"` // Storage root URL for the share. - StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` + StorageRoot types.String `tfsdk:"storage_root"` // Array of shared data object updates. - Updates types.List `tfsdk:"updates" tf:"optional"` + Updates types.List `tfsdk:"updates"` } func (newState *UpdateShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateShare) { @@ -3146,12 +3232,15 @@ func (newState *UpdateShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan Update func (newState *UpdateShare) SyncEffectiveFieldsDuringRead(existingState UpdateShare) { } -func (c UpdateShare) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetComputed(append(path, "owner")...) - SharedDataObjectUpdate{}.ApplySchemaCustomizations(cs, append(path, "updates")...) +func (c UpdateShare) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["comment"] = attrs["comment"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["new_name"] = attrs["new_name"].SetOptional() + attrs["owner"] = attrs["owner"].SetComputed() + attrs["storage_root"] = attrs["storage_root"].SetOptional() + attrs["updates"] = attrs["updates"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateShare. @@ -3227,7 +3316,7 @@ func (o *UpdateShare) SetUpdates(ctx context.Context, v []SharedDataObjectUpdate type UpdateSharePermissions struct { // Array of permission changes. - Changes types.List `tfsdk:"changes" tf:"optional"` + Changes types.List `tfsdk:"changes"` // Maximum number of permissions to return. - when set to 0, the page length // is set to a server configured value (recommended); - when set to a value // greater than 0, the page length is the minimum of this value and a server @@ -3250,10 +3339,13 @@ func (newState *UpdateSharePermissions) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpdateSharePermissions) SyncEffectiveFieldsDuringRead(existingState UpdateSharePermissions) { } -func (c UpdateSharePermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c UpdateSharePermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["changes"] = attrs["changes"].SetOptional() + attrs["max_results"] = attrs["max_results"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["page_token"] = attrs["page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateSharePermissions. diff --git a/internal/service/sql_tf/legacy_model.go b/internal/service/sql_tf/legacy_model.go index 92d1a357d..7432cd736 100755 --- a/internal/service/sql_tf/legacy_model.go +++ b/internal/service/sql_tf/legacy_model.go @@ -17,18 +17,19 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) type AccessControl_SdkV2 struct { - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AccessControl_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccessControl_SdkV2) { @@ -37,9 +38,12 @@ func (newState *AccessControl_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *AccessControl_SdkV2) SyncEffectiveFieldsDuringRead(existingState AccessControl_SdkV2) { } -func (c AccessControl_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AccessControl_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccessControl. @@ -79,48 +83,48 @@ func (o AccessControl_SdkV2) Type(ctx context.Context) attr.Type { type Alert_SdkV2 struct { // Trigger conditions of the alert. - Condition types.List `tfsdk:"condition" tf:"optional,object"` + Condition types.List `tfsdk:"condition"` // The timestamp indicating when the alert was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the alert. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The workspace state of the alert. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // The workspace path of the folder containing the alert. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` // Current state of the alert's trigger status. This field is set to UNKNOWN // if the alert has not yet been evaluated or ran into an error during the // last evaluation. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Timestamp when the alert was last triggered, if the alert has been // triggered before. - TriggerTime types.String `tfsdk:"trigger_time" tf:"optional"` + TriggerTime types.String `tfsdk:"trigger_time"` // The timestamp indicating when the alert was updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *Alert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Alert_SdkV2) { @@ -129,10 +133,25 @@ func (newState *Alert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Alert_ func (newState *Alert_SdkV2) SyncEffectiveFieldsDuringRead(existingState Alert_SdkV2) { } -func (c Alert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c Alert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["condition"] = attrs["condition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["trigger_time"] = attrs["trigger_time"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Alert. @@ -226,14 +245,14 @@ func (o *Alert_SdkV2) SetCondition(ctx context.Context, v AlertCondition_SdkV2) type AlertCondition_SdkV2 struct { // Alert state if result is empty. - EmptyResultState types.String `tfsdk:"empty_result_state" tf:"optional"` + EmptyResultState types.String `tfsdk:"empty_result_state"` // Operator used for comparison in alert evaluation. - Op types.String `tfsdk:"op" tf:"optional"` + Op types.String `tfsdk:"op"` // Name of the column from the query result to use for comparison in alert // evaluation. - Operand types.List `tfsdk:"operand" tf:"optional,object"` + Operand types.List `tfsdk:"operand"` // Threshold value used for comparison in alert evaluation. - Threshold types.List `tfsdk:"threshold" tf:"optional,object"` + Threshold types.List `tfsdk:"threshold"` } func (newState *AlertCondition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertCondition_SdkV2) { @@ -242,11 +261,15 @@ func (newState *AlertCondition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *AlertCondition_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertCondition_SdkV2) { } -func (c AlertCondition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertConditionOperand_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "operand")...) - AlertConditionThreshold_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "threshold")...) +func (c AlertCondition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["empty_result_state"] = attrs["empty_result_state"].SetOptional() + attrs["op"] = attrs["op"].SetOptional() + attrs["operand"] = attrs["operand"].SetOptional() + attrs["operand"] = attrs["operand"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["threshold"] = attrs["threshold"].SetOptional() + attrs["threshold"] = attrs["threshold"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertCondition. @@ -346,7 +369,7 @@ func (o *AlertCondition_SdkV2) SetThreshold(ctx context.Context, v AlertConditio } type AlertConditionOperand_SdkV2 struct { - Column types.List `tfsdk:"column" tf:"optional,object"` + Column types.List `tfsdk:"column"` } func (newState *AlertConditionOperand_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertConditionOperand_SdkV2) { @@ -355,10 +378,11 @@ func (newState *AlertConditionOperand_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *AlertConditionOperand_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertConditionOperand_SdkV2) { } -func (c AlertConditionOperand_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertOperandColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "column")...) +func (c AlertConditionOperand_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column"] = attrs["column"].SetOptional() + attrs["column"] = attrs["column"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertConditionOperand. @@ -423,7 +447,7 @@ func (o *AlertConditionOperand_SdkV2) SetColumn(ctx context.Context, v AlertOper } type AlertConditionThreshold_SdkV2 struct { - Value types.List `tfsdk:"value" tf:"optional,object"` + Value types.List `tfsdk:"value"` } func (newState *AlertConditionThreshold_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertConditionThreshold_SdkV2) { @@ -432,10 +456,11 @@ func (newState *AlertConditionThreshold_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *AlertConditionThreshold_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertConditionThreshold_SdkV2) { } -func (c AlertConditionThreshold_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertOperandValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c AlertConditionThreshold_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() + attrs["value"] = attrs["value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertConditionThreshold. @@ -500,7 +525,7 @@ func (o *AlertConditionThreshold_SdkV2) SetValue(ctx context.Context, v AlertOpe } type AlertOperandColumn_SdkV2 struct { - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *AlertOperandColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertOperandColumn_SdkV2) { @@ -509,9 +534,10 @@ func (newState *AlertOperandColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *AlertOperandColumn_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertOperandColumn_SdkV2) { } -func (c AlertOperandColumn_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AlertOperandColumn_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertOperandColumn. @@ -546,11 +572,11 @@ func (o AlertOperandColumn_SdkV2) Type(ctx context.Context) attr.Type { } type AlertOperandValue_SdkV2 struct { - BoolValue types.Bool `tfsdk:"bool_value" tf:"optional"` + BoolValue types.Bool `tfsdk:"bool_value"` - DoubleValue types.Float64 `tfsdk:"double_value" tf:"optional"` + DoubleValue types.Float64 `tfsdk:"double_value"` - StringValue types.String `tfsdk:"string_value" tf:"optional"` + StringValue types.String `tfsdk:"string_value"` } func (newState *AlertOperandValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertOperandValue_SdkV2) { @@ -559,9 +585,12 @@ func (newState *AlertOperandValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AlertOperandValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertOperandValue_SdkV2) { } -func (c AlertOperandValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AlertOperandValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bool_value"] = attrs["bool_value"].SetOptional() + attrs["double_value"] = attrs["double_value"].SetOptional() + attrs["string_value"] = attrs["string_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertOperandValue. @@ -602,29 +631,29 @@ func (o AlertOperandValue_SdkV2) Type(ctx context.Context) attr.Type { // Alert configuration options. type AlertOptions_SdkV2 struct { // Name of column in the query result to compare in alert evaluation. - Column types.String `tfsdk:"column" tf:""` + Column types.String `tfsdk:"column"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This includes email // subject, Slack notification header, etc. See [here] for custom templating // instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // State that alert evaluates to when query result is empty. - EmptyResultState types.String `tfsdk:"empty_result_state" tf:"optional"` + EmptyResultState types.String `tfsdk:"empty_result_state"` // Whether or not the alert is muted. If an alert is muted, it will not // notify users and notification destinations when triggered. - Muted types.Bool `tfsdk:"muted" tf:"optional"` + Muted types.Bool `tfsdk:"muted"` // Operator used to compare in alert evaluation: `>`, `>=`, `<`, `<=`, `==`, // `!=` - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // Value used to compare in alert evaluation. Supported types include // strings (eg. 'foobar'), floats (eg. 123.4), and booleans (true). - Value types.Object `tfsdk:"value" tf:""` + Value types.Object `tfsdk:"value"` } func (newState *AlertOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertOptions_SdkV2) { @@ -633,12 +662,16 @@ func (newState *AlertOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AlertOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertOptions_SdkV2) { } -func (c AlertOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "column")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "value")...) +func (c AlertOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column"] = attrs["column"].SetRequired() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["empty_result_state"] = attrs["empty_result_state"].SetOptional() + attrs["muted"] = attrs["muted"].SetOptional() + attrs["op"] = attrs["op"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertOptions. @@ -686,44 +719,44 @@ func (o AlertOptions_SdkV2) Type(ctx context.Context) attr.Type { type AlertQuery_SdkV2 struct { // The timestamp when this query was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Data source ID maps to the ID of the data source used by the resource and // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Query ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Indicates whether the query is trashed. Trashed queries can't be used in // dashboards, or appear in search results. If this boolean is `true`, the // `options` property for this query includes a `moved_to_trash_at` // timestamp. Trashed queries are permanently deleted after 30 days. - IsArchived types.Bool `tfsdk:"is_archived" tf:"optional"` + IsArchived types.Bool `tfsdk:"is_archived"` // Whether the query is a draft. Draft queries only appear in list views for // their owners. Visualizations from draft queries cannot appear on // dashboards. - IsDraft types.Bool `tfsdk:"is_draft" tf:"optional"` + IsDraft types.Bool `tfsdk:"is_draft"` // Text parameter types are not safe from SQL injection for all types of // data source. Set this Boolean parameter to `true` if a query either does // not use any text type parameters or uses a data source type where text // type parameters are handled safely. - IsSafe types.Bool `tfsdk:"is_safe" tf:"optional"` + IsSafe types.Bool `tfsdk:"is_safe"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - Options types.List `tfsdk:"options" tf:"optional,object"` + Options types.List `tfsdk:"options"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The timestamp at which this query was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` // The ID of the user who owns the query. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *AlertQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertQuery_SdkV2) { @@ -732,10 +765,23 @@ func (newState *AlertQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan A func (newState *AlertQuery_SdkV2) SyncEffectiveFieldsDuringRead(existingState AlertQuery_SdkV2) { } -func (c AlertQuery_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) +func (c AlertQuery_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_archived"] = attrs["is_archived"].SetOptional() + attrs["is_draft"] = attrs["is_draft"].SetOptional() + attrs["is_safe"] = attrs["is_safe"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["query"] = attrs["query"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertQuery. @@ -858,13 +904,13 @@ func (o *AlertQuery_SdkV2) SetTags(ctx context.Context, v []types.String) { type BaseChunkInfo_SdkV2 struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount types.Int64 `tfsdk:"byte_count" tf:"optional"` + ByteCount types.Int64 `tfsdk:"byte_count"` // The position within the sequence of result set chunks. - ChunkIndex types.Int64 `tfsdk:"chunk_index" tf:"optional"` + ChunkIndex types.Int64 `tfsdk:"chunk_index"` // The number of rows within the result chunk. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // The starting row offset within the result set. - RowOffset types.Int64 `tfsdk:"row_offset" tf:"optional"` + RowOffset types.Int64 `tfsdk:"row_offset"` } func (newState *BaseChunkInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseChunkInfo_SdkV2) { @@ -873,9 +919,13 @@ func (newState *BaseChunkInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *BaseChunkInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState BaseChunkInfo_SdkV2) { } -func (c BaseChunkInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BaseChunkInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_count"] = attrs["byte_count"].SetOptional() + attrs["chunk_index"] = attrs["chunk_index"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["row_offset"] = attrs["row_offset"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BaseChunkInfo. @@ -986,9 +1036,9 @@ func (o CancelExecutionResponse_SdkV2) Type(ctx context.Context) attr.Type { // Configures the channel name and DBSQL version of the warehouse. // CHANNEL_NAME_CUSTOM should be chosen only when `dbsql_version` is specified. type Channel_SdkV2 struct { - DbsqlVersion types.String `tfsdk:"dbsql_version" tf:"optional"` + DbsqlVersion types.String `tfsdk:"dbsql_version"` - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *Channel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Channel_SdkV2) { @@ -997,9 +1047,11 @@ func (newState *Channel_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Chan func (newState *Channel_SdkV2) SyncEffectiveFieldsDuringRead(existingState Channel_SdkV2) { } -func (c Channel_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Channel_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbsql_version"] = attrs["dbsql_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Channel. @@ -1038,9 +1090,9 @@ func (o Channel_SdkV2) Type(ctx context.Context) attr.Type { // Details about a Channel. type ChannelInfo_SdkV2 struct { // DB SQL Version the Channel is mapped to. - DbsqlVersion types.String `tfsdk:"dbsql_version" tf:"optional"` + DbsqlVersion types.String `tfsdk:"dbsql_version"` // Name of the channel - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ChannelInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChannelInfo_SdkV2) { @@ -1049,9 +1101,11 @@ func (newState *ChannelInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ChannelInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ChannelInfo_SdkV2) { } -func (c ChannelInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ChannelInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbsql_version"] = attrs["dbsql_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChannelInfo. @@ -1089,22 +1143,22 @@ func (o ChannelInfo_SdkV2) Type(ctx context.Context) attr.Type { type ColumnInfo_SdkV2 struct { // The name of the column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The ordinal position of the column (starting at position 0). - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The format of the interval type. - TypeIntervalType types.String `tfsdk:"type_interval_type" tf:"optional"` + TypeIntervalType types.String `tfsdk:"type_interval_type"` // The name of the base data type. This doesn't include details for complex // types such as STRUCT, MAP or ARRAY. - TypeName types.String `tfsdk:"type_name" tf:"optional"` + TypeName types.String `tfsdk:"type_name"` // Specifies the number of digits in a number. This applies to the DECIMAL // type. - TypePrecision types.Int64 `tfsdk:"type_precision" tf:"optional"` + TypePrecision types.Int64 `tfsdk:"type_precision"` // Specifies the number of digits to the right of the decimal point in a // number. This applies to the DECIMAL type. - TypeScale types.Int64 `tfsdk:"type_scale" tf:"optional"` + TypeScale types.Int64 `tfsdk:"type_scale"` // The full SQL type specification. - TypeText types.String `tfsdk:"type_text" tf:"optional"` + TypeText types.String `tfsdk:"type_text"` } func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnInfo_SdkV2) { @@ -1113,9 +1167,16 @@ func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ColumnInfo_SdkV2) { } -func (c ColumnInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ColumnInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["type_interval_type"] = attrs["type_interval_type"].SetOptional() + attrs["type_name"] = attrs["type_name"].SetOptional() + attrs["type_precision"] = attrs["type_precision"].SetOptional() + attrs["type_scale"] = attrs["type_scale"].SetOptional() + attrs["type_text"] = attrs["type_text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnInfo. @@ -1163,17 +1224,17 @@ func (o ColumnInfo_SdkV2) Type(ctx context.Context) attr.Type { type CreateAlert_SdkV2 struct { // Name of the alert. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Alert configuration options. - Options types.List `tfsdk:"options" tf:"object"` + Options types.List `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // Query ID. - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm types.Int64 `tfsdk:"rearm" tf:"optional"` + Rearm types.Int64 `tfsdk:"rearm"` } func (newState *CreateAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAlert_SdkV2) { @@ -1182,13 +1243,15 @@ func (newState *CreateAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateAlert_SdkV2) { } -func (c CreateAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) - AlertOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - cs.SetRequired(append(path, "query_id")...) +func (c CreateAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parent"] = attrs["parent"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetRequired() + attrs["rearm"] = attrs["rearm"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAlert. @@ -1261,7 +1324,7 @@ func (o *CreateAlert_SdkV2) SetOptions(ctx context.Context, v AlertOptions_SdkV2 } type CreateAlertRequest_SdkV2 struct { - Alert types.List `tfsdk:"alert" tf:"optional,object"` + Alert types.List `tfsdk:"alert"` } func (newState *CreateAlertRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAlertRequest_SdkV2) { @@ -1270,10 +1333,11 @@ func (newState *CreateAlertRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateAlertRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateAlertRequest_SdkV2) { } -func (c CreateAlertRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateAlertRequestAlert_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert")...) +func (c CreateAlertRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert"] = attrs["alert"].SetOptional() + attrs["alert"] = attrs["alert"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAlertRequest. @@ -1339,30 +1403,30 @@ func (o *CreateAlertRequest_SdkV2) SetAlert(ctx context.Context, v CreateAlertRe type CreateAlertRequestAlert_SdkV2 struct { // Trigger conditions of the alert. - Condition types.List `tfsdk:"condition" tf:"optional,object"` + Condition types.List `tfsdk:"condition"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The workspace path of the folder containing the alert. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` } func (newState *CreateAlertRequestAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAlertRequestAlert_SdkV2) { @@ -1371,10 +1435,18 @@ func (newState *CreateAlertRequestAlert_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateAlertRequestAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateAlertRequestAlert_SdkV2) { } -func (c CreateAlertRequestAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c CreateAlertRequestAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["condition"] = attrs["condition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAlertRequestAlert. @@ -1453,7 +1525,7 @@ func (o *CreateAlertRequestAlert_SdkV2) SetCondition(ctx context.Context, v Aler } type CreateQueryRequest_SdkV2 struct { - Query types.List `tfsdk:"query" tf:"optional,object"` + Query types.List `tfsdk:"query"` } func (newState *CreateQueryRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateQueryRequest_SdkV2) { @@ -1462,10 +1534,11 @@ func (newState *CreateQueryRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateQueryRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateQueryRequest_SdkV2) { } -func (c CreateQueryRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateQueryRequestQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query")...) +func (c CreateQueryRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query"] = attrs["query"].SetOptional() + attrs["query"] = attrs["query"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateQueryRequest. @@ -1531,29 +1604,29 @@ func (o *CreateQueryRequest_SdkV2) SetQuery(ctx context.Context, v CreateQueryRe type CreateQueryRequestQuery_SdkV2 struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Workspace path of the workspace folder containing the object. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *CreateQueryRequestQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateQueryRequestQuery_SdkV2) { @@ -1562,10 +1635,20 @@ func (newState *CreateQueryRequestQuery_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateQueryRequestQuery_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateQueryRequestQuery_SdkV2) { } -func (c CreateQueryRequestQuery_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c CreateQueryRequestQuery_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateQueryRequestQuery. @@ -1682,18 +1765,18 @@ func (o *CreateQueryRequestQuery_SdkV2) SetTags(ctx context.Context, v []types.S type CreateQueryVisualizationsLegacyRequest_SdkV2 struct { // A short description of this visualization. This is not displayed in the // UI. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The name of the visualization that appears on dashboards and the query // screen. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The options object varies widely from one visualization type to the next // and is unsupported. Databricks does not recommend modifying visualization // settings in JSON. - Options types.Object `tfsdk:"options" tf:""` + Options types.Object `tfsdk:"options"` // The identifier returned by :method:queries/create - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` // The type of visualization: chart, table, pivot table, and so on. - Type_ types.String `tfsdk:"type" tf:""` + Type_ types.String `tfsdk:"type"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateQueryVisualizationsLegacyRequest. @@ -1736,7 +1819,7 @@ func (o CreateQueryVisualizationsLegacyRequest_SdkV2) Type(ctx context.Context) } type CreateVisualizationRequest_SdkV2 struct { - Visualization types.List `tfsdk:"visualization" tf:"optional,object"` + Visualization types.List `tfsdk:"visualization"` } func (newState *CreateVisualizationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVisualizationRequest_SdkV2) { @@ -1745,10 +1828,11 @@ func (newState *CreateVisualizationRequest_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *CreateVisualizationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateVisualizationRequest_SdkV2) { } -func (c CreateVisualizationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateVisualizationRequestVisualization_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "visualization")...) +func (c CreateVisualizationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["visualization"] = attrs["visualization"].SetOptional() + attrs["visualization"] = attrs["visualization"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVisualizationRequest. @@ -1814,19 +1898,19 @@ func (o *CreateVisualizationRequest_SdkV2) SetVisualization(ctx context.Context, type CreateVisualizationRequestVisualization_SdkV2 struct { // The display name of the visualization. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID of the query that the visualization is attached to. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions types.String `tfsdk:"serialized_options" tf:"optional"` + SerializedOptions types.String `tfsdk:"serialized_options"` // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan types.String `tfsdk:"serialized_query_plan" tf:"optional"` + SerializedQueryPlan types.String `tfsdk:"serialized_query_plan"` // The type of visualization: counter, table, funnel, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *CreateVisualizationRequestVisualization_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVisualizationRequestVisualization_SdkV2) { @@ -1835,9 +1919,14 @@ func (newState *CreateVisualizationRequestVisualization_SdkV2) SyncEffectiveFiel func (newState *CreateVisualizationRequestVisualization_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateVisualizationRequestVisualization_SdkV2) { } -func (c CreateVisualizationRequestVisualization_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateVisualizationRequestVisualization_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["serialized_options"] = attrs["serialized_options"].SetOptional() + attrs["serialized_query_plan"] = attrs["serialized_query_plan"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVisualizationRequestVisualization. @@ -1888,33 +1977,33 @@ type CreateWarehouseRequest_SdkV2 struct { // autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.List `tfsdk:"channel" tf:"optional,object"` + Channel types.List `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -1924,23 +2013,23 @@ type CreateWarehouseRequest_SdkV2 struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.List `tfsdk:"tags" tf:"optional,object"` + Tags types.List `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *CreateWarehouseRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWarehouseRequest_SdkV2) { @@ -1949,11 +2038,24 @@ func (newState *CreateWarehouseRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *CreateWarehouseRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateWarehouseRequest_SdkV2) { } -func (c CreateWarehouseRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - EndpointTags_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateWarehouseRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["channel"] = attrs["channel"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["tags"] = attrs["tags"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWarehouseRequest. @@ -2072,7 +2174,7 @@ func (o *CreateWarehouseRequest_SdkV2) SetTags(ctx context.Context, v EndpointTa type CreateWarehouseResponse_SdkV2 struct { // Id for the SQL warehouse. This value is unique across all SQL warehouses. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *CreateWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWarehouseResponse_SdkV2) { @@ -2081,9 +2183,10 @@ func (newState *CreateWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *CreateWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateWarehouseResponse_SdkV2) { } -func (c CreateWarehouseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateWarehouseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWarehouseResponse. @@ -2119,19 +2222,19 @@ func (o CreateWarehouseResponse_SdkV2) Type(ctx context.Context) attr.Type { type CreateWidget_SdkV2 struct { // Dashboard ID returned by :method:dashboards/create. - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` // Widget ID returned by :method:dashboardwidgets/create Id types.String `tfsdk:"-"` - Options types.List `tfsdk:"options" tf:"object"` + Options types.List `tfsdk:"options"` // If this is a textbox widget, the application displays this text. This // field is ignored if the widget contains a visualization in the // `visualization` field. - Text types.String `tfsdk:"text" tf:"optional"` + Text types.String `tfsdk:"text"` // Query Vizualization ID returned by :method:queryvisualizations/create. - VisualizationId types.String `tfsdk:"visualization_id" tf:"optional"` + VisualizationId types.String `tfsdk:"visualization_id"` // Width of a widget - Width types.Int64 `tfsdk:"width" tf:""` + Width types.Int64 `tfsdk:"width"` } func (newState *CreateWidget_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWidget_SdkV2) { @@ -2140,14 +2243,16 @@ func (newState *CreateWidget_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateWidget_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateWidget_SdkV2) { } -func (c CreateWidget_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "options")...) - WidgetOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - cs.SetRequired(append(path, "width")...) +func (c CreateWidget_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["text"] = attrs["text"].SetOptional() + attrs["visualization_id"] = attrs["visualization_id"].SetOptional() + attrs["width"] = attrs["width"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWidget. @@ -2225,49 +2330,49 @@ func (o *CreateWidget_SdkV2) SetOptions(ctx context.Context, v WidgetOptions_Sdk // boxes. type Dashboard_SdkV2 struct { // Whether the authenticated user can edit the query definition. - CanEdit types.Bool `tfsdk:"can_edit" tf:"optional"` + CanEdit types.Bool `tfsdk:"can_edit"` // Timestamp when this dashboard was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // In the web application, query filters that share a name are coupled to a // single selection box if this value is `true`. - DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled" tf:"optional"` + DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled"` // The ID for this dashboard. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Indicates whether a dashboard is trashed. Trashed dashboards won't appear // in list views. If this boolean is `true`, the `options` property for this // dashboard includes a `moved_to_trash_at` timestamp. Items in trash are // permanently deleted after 30 days. - IsArchived types.Bool `tfsdk:"is_archived" tf:"optional"` + IsArchived types.Bool `tfsdk:"is_archived"` // Whether a dashboard is a draft. Draft dashboards only appear in list // views for their owners. - IsDraft types.Bool `tfsdk:"is_draft" tf:"optional"` + IsDraft types.Bool `tfsdk:"is_draft"` // Indicates whether this query object appears in the current user's // favorites list. This flag determines whether the star icon for favorites // is selected. - IsFavorite types.Bool `tfsdk:"is_favorite" tf:"optional"` + IsFavorite types.Bool `tfsdk:"is_favorite"` // The title of the dashboard that appears in list views and at the top of // the dashboard page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - Options types.List `tfsdk:"options" tf:"optional,object"` + Options types.List `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionTier types.String `tfsdk:"permission_tier" tf:"optional"` + PermissionTier types.String `tfsdk:"permission_tier"` // URL slug. Usually mirrors the query name with dashes (`-`) instead of // spaces. Appears in the URL for this query. - Slug types.String `tfsdk:"slug" tf:"optional"` + Slug types.String `tfsdk:"slug"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // Timestamp when this dashboard was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` - User types.List `tfsdk:"user" tf:"optional,object"` + User types.List `tfsdk:"user"` // The ID of the user who owns the dashboard. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` - Widgets types.List `tfsdk:"widgets" tf:"optional"` + Widgets types.List `tfsdk:"widgets"` } func (newState *Dashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboard_SdkV2) { @@ -2276,12 +2381,28 @@ func (newState *Dashboard_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Da func (newState *Dashboard_SdkV2) SyncEffectiveFieldsDuringRead(existingState Dashboard_SdkV2) { } -func (c Dashboard_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DashboardOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - User_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "user")...) - Widget_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "widgets")...) - - return cs +func (c Dashboard_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["can_edit"] = attrs["can_edit"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["dashboard_filters_enabled"] = attrs["dashboard_filters_enabled"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_archived"] = attrs["is_archived"].SetOptional() + attrs["is_draft"] = attrs["is_draft"].SetOptional() + attrs["is_favorite"] = attrs["is_favorite"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parent"] = attrs["parent"].SetOptional() + attrs["permission_tier"] = attrs["permission_tier"].SetOptional() + attrs["slug"] = attrs["slug"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + attrs["user"] = attrs["user"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["widgets"] = attrs["widgets"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dashboard. @@ -2468,13 +2589,13 @@ type DashboardEditContent_SdkV2 struct { DashboardId types.String `tfsdk:"-"` // The title of this dashboard that appears in list views and at the top of // the dashboard page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *DashboardEditContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DashboardEditContent_SdkV2) { @@ -2483,10 +2604,13 @@ func (newState *DashboardEditContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *DashboardEditContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState DashboardEditContent_SdkV2) { } -func (c DashboardEditContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) +func (c DashboardEditContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["name"] = attrs["name"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DashboardEditContent. @@ -2560,7 +2684,7 @@ type DashboardOptions_SdkV2 struct { // The timestamp when this dashboard was moved to trash. Only present when // the `is_archived` property is `true`. Trashed items are deleted after // thirty days. - MovedToTrashAt types.String `tfsdk:"moved_to_trash_at" tf:"optional"` + MovedToTrashAt types.String `tfsdk:"moved_to_trash_at"` } func (newState *DashboardOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DashboardOptions_SdkV2) { @@ -2569,9 +2693,10 @@ func (newState *DashboardOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *DashboardOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState DashboardOptions_SdkV2) { } -func (c DashboardOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DashboardOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["moved_to_trash_at"] = attrs["moved_to_trash_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DashboardOptions. @@ -2607,21 +2732,21 @@ func (o DashboardOptions_SdkV2) Type(ctx context.Context) attr.Type { type DashboardPostContent_SdkV2 struct { // Indicates whether the dashboard filters are enabled - DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled" tf:"optional"` + DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled"` // Indicates whether this dashboard object should appear in the current // user's favorites list. - IsFavorite types.Bool `tfsdk:"is_favorite" tf:"optional"` + IsFavorite types.Bool `tfsdk:"is_favorite"` // The title of this dashboard that appears in list views and at the top of // the dashboard page. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *DashboardPostContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DashboardPostContent_SdkV2) { @@ -2630,10 +2755,15 @@ func (newState *DashboardPostContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *DashboardPostContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState DashboardPostContent_SdkV2) { } -func (c DashboardPostContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c DashboardPostContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_filters_enabled"] = attrs["dashboard_filters_enabled"].SetOptional() + attrs["is_favorite"] = attrs["is_favorite"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DashboardPostContent. @@ -2713,26 +2843,26 @@ type DataSource_SdkV2 struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The string name of this data source / SQL warehouse as it appears in the // Databricks SQL web application. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Reserved for internal use. - PauseReason types.String `tfsdk:"pause_reason" tf:"optional"` + PauseReason types.String `tfsdk:"pause_reason"` // Reserved for internal use. - Paused types.Int64 `tfsdk:"paused" tf:"optional"` + Paused types.Int64 `tfsdk:"paused"` // Reserved for internal use. - SupportsAutoLimit types.Bool `tfsdk:"supports_auto_limit" tf:"optional"` + SupportsAutoLimit types.Bool `tfsdk:"supports_auto_limit"` // Reserved for internal use. - Syntax types.String `tfsdk:"syntax" tf:"optional"` + Syntax types.String `tfsdk:"syntax"` // The type of data source. For SQL warehouses, this will be // `databricks_internal`. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // Reserved for internal use. - ViewOnly types.Bool `tfsdk:"view_only" tf:"optional"` + ViewOnly types.Bool `tfsdk:"view_only"` // The ID of the associated SQL warehouse, if this data source is backed by // a SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *DataSource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataSource_SdkV2) { @@ -2741,9 +2871,18 @@ func (newState *DataSource_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan D func (newState *DataSource_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataSource_SdkV2) { } -func (c DataSource_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataSource_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pause_reason"] = attrs["pause_reason"].SetOptional() + attrs["paused"] = attrs["paused"].SetOptional() + attrs["supports_auto_limit"] = attrs["supports_auto_limit"].SetOptional() + attrs["syntax"] = attrs["syntax"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["view_only"] = attrs["view_only"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataSource. @@ -2794,9 +2933,9 @@ func (o DataSource_SdkV2) Type(ctx context.Context) attr.Type { } type DateRange_SdkV2 struct { - End types.String `tfsdk:"end" tf:""` + End types.String `tfsdk:"end"` - Start types.String `tfsdk:"start" tf:""` + Start types.String `tfsdk:"start"` } func (newState *DateRange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateRange_SdkV2) { @@ -2805,11 +2944,11 @@ func (newState *DateRange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Da func (newState *DateRange_SdkV2) SyncEffectiveFieldsDuringRead(existingState DateRange_SdkV2) { } -func (c DateRange_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "end")...) - cs.SetRequired(append(path, "start")...) +func (c DateRange_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end"] = attrs["end"].SetRequired() + attrs["start"] = attrs["start"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DateRange. @@ -2847,14 +2986,14 @@ func (o DateRange_SdkV2) Type(ctx context.Context) attr.Type { type DateRangeValue_SdkV2 struct { // Manually specified date-time range value. - DateRangeValue types.List `tfsdk:"date_range_value" tf:"optional,object"` + DateRangeValue types.List `tfsdk:"date_range_value"` // Dynamic date-time range value based on current date-time. - DynamicDateRangeValue types.String `tfsdk:"dynamic_date_range_value" tf:"optional"` + DynamicDateRangeValue types.String `tfsdk:"dynamic_date_range_value"` // Date-time precision to format the value into when the query is run. // Defaults to DAY_PRECISION (YYYY-MM-DD). - Precision types.String `tfsdk:"precision" tf:"optional"` + Precision types.String `tfsdk:"precision"` - StartDayOfWeek types.Int64 `tfsdk:"start_day_of_week" tf:"optional"` + StartDayOfWeek types.Int64 `tfsdk:"start_day_of_week"` } func (newState *DateRangeValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateRangeValue_SdkV2) { @@ -2863,10 +3002,14 @@ func (newState *DateRangeValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DateRangeValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState DateRangeValue_SdkV2) { } -func (c DateRangeValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DateRange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "date_range_value")...) +func (c DateRangeValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["date_range_value"] = attrs["date_range_value"].SetOptional() + attrs["date_range_value"] = attrs["date_range_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["dynamic_date_range_value"] = attrs["dynamic_date_range_value"].SetOptional() + attrs["precision"] = attrs["precision"].SetOptional() + attrs["start_day_of_week"] = attrs["start_day_of_week"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DateRangeValue. @@ -2938,12 +3081,12 @@ func (o *DateRangeValue_SdkV2) SetDateRangeValue(ctx context.Context, v DateRang type DateValue_SdkV2 struct { // Manually specified date-time value. - DateValue types.String `tfsdk:"date_value" tf:"optional"` + DateValue types.String `tfsdk:"date_value"` // Dynamic date-time value based on current date-time. - DynamicDateValue types.String `tfsdk:"dynamic_date_value" tf:"optional"` + DynamicDateValue types.String `tfsdk:"dynamic_date_value"` // Date-time precision to format the value into when the query is run. // Defaults to DAY_PRECISION (YYYY-MM-DD). - Precision types.String `tfsdk:"precision" tf:"optional"` + Precision types.String `tfsdk:"precision"` } func (newState *DateValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateValue_SdkV2) { @@ -2952,9 +3095,12 @@ func (newState *DateValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Da func (newState *DateValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState DateValue_SdkV2) { } -func (c DateValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DateValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["date_value"] = attrs["date_value"].SetOptional() + attrs["dynamic_date_value"] = attrs["dynamic_date_value"].SetOptional() + attrs["precision"] = attrs["precision"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DateValue. @@ -3286,9 +3432,9 @@ func (newState *DeleteWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *DeleteWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteWarehouseResponse_SdkV2) { } -func (c DeleteWarehouseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteWarehouseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteWarehouseResponse. @@ -3321,15 +3467,15 @@ func (o DeleteWarehouseResponse_SdkV2) Type(ctx context.Context) attr.Type { type EditAlert_SdkV2 struct { AlertId types.String `tfsdk:"-"` // Name of the alert. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Alert configuration options. - Options types.List `tfsdk:"options" tf:"object"` + Options types.List `tfsdk:"options"` // Query ID. - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm types.Int64 `tfsdk:"rearm" tf:"optional"` + Rearm types.Int64 `tfsdk:"rearm"` } func (newState *EditAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditAlert_SdkV2) { @@ -3338,14 +3484,15 @@ func (newState *EditAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ed func (newState *EditAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditAlert_SdkV2) { } -func (c EditAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "alert_id")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) - AlertOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - cs.SetRequired(append(path, "query_id")...) +func (c EditAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_id"] = attrs["alert_id"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["query_id"] = attrs["query_id"].SetRequired() + attrs["rearm"] = attrs["rearm"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditAlert. @@ -3424,35 +3571,35 @@ type EditWarehouseRequest_SdkV2 struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.List `tfsdk:"channel" tf:"optional,object"` + Channel types.List `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute. - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Required. Id of the warehouse to configure. Id types.String `tfsdk:"-"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -3462,23 +3609,23 @@ type EditWarehouseRequest_SdkV2 struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.List `tfsdk:"tags" tf:"optional,object"` + Tags types.List `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *EditWarehouseRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditWarehouseRequest_SdkV2) { @@ -3487,12 +3634,25 @@ func (newState *EditWarehouseRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *EditWarehouseRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditWarehouseRequest_SdkV2) { } -func (c EditWarehouseRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - cs.SetRequired(append(path, "id")...) - EndpointTags_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c EditWarehouseRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["channel"] = attrs["channel"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["tags"] = attrs["tags"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditWarehouseRequest. @@ -3620,9 +3780,9 @@ func (newState *EditWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *EditWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState EditWarehouseResponse_SdkV2) { } -func (c EditWarehouseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditWarehouseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditWarehouseResponse. @@ -3663,9 +3823,9 @@ func (newState *Empty_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Empty_ func (newState *Empty_SdkV2) SyncEffectiveFieldsDuringRead(existingState Empty_SdkV2) { } -func (c Empty_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Empty_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Empty. @@ -3696,9 +3856,9 @@ func (o Empty_SdkV2) Type(ctx context.Context) attr.Type { } type EndpointConfPair_SdkV2 struct { - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *EndpointConfPair_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointConfPair_SdkV2) { @@ -3707,9 +3867,11 @@ func (newState *EndpointConfPair_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *EndpointConfPair_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointConfPair_SdkV2) { } -func (c EndpointConfPair_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointConfPair_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointConfPair. @@ -3747,17 +3909,17 @@ func (o EndpointConfPair_SdkV2) Type(ctx context.Context) attr.Type { type EndpointHealth_SdkV2 struct { // Details about errors that are causing current degraded/failed status. - Details types.String `tfsdk:"details" tf:"optional"` + Details types.String `tfsdk:"details"` // The reason for failure to bring up clusters for this warehouse. This is // available when status is 'FAILED' and sometimes when it is DEGRADED. - FailureReason types.List `tfsdk:"failure_reason" tf:"optional,object"` + FailureReason types.List `tfsdk:"failure_reason"` // Deprecated. split into summary and details for security - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Health status of the warehouse. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // A short summary of the health status in case of degraded/failed // warehouses. - Summary types.String `tfsdk:"summary" tf:"optional"` + Summary types.String `tfsdk:"summary"` } func (newState *EndpointHealth_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointHealth_SdkV2) { @@ -3766,10 +3928,15 @@ func (newState *EndpointHealth_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *EndpointHealth_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointHealth_SdkV2) { } -func (c EndpointHealth_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TerminationReason_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "failure_reason")...) +func (c EndpointHealth_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["details"] = attrs["details"].SetOptional() + attrs["failure_reason"] = attrs["failure_reason"].SetOptional() + attrs["failure_reason"] = attrs["failure_reason"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["message"] = attrs["message"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["summary"] = attrs["summary"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointHealth. @@ -3848,40 +4015,40 @@ type EndpointInfo_SdkV2 struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.List `tfsdk:"channel" tf:"optional,object"` + Channel types.List `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Optional health status. Assume the warehouse is healthy if this field is // not set. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // unique identifier for warehouse - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // the jdbc connection string for this warehouse - JdbcUrl types.String `tfsdk:"jdbc_url" tf:"optional"` + JdbcUrl types.String `tfsdk:"jdbc_url"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -3891,31 +4058,31 @@ type EndpointInfo_SdkV2 struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // current number of active sessions for the warehouse - NumActiveSessions types.Int64 `tfsdk:"num_active_sessions" tf:"optional"` + NumActiveSessions types.Int64 `tfsdk:"num_active_sessions"` // current number of clusters running for the service - NumClusters types.Int64 `tfsdk:"num_clusters" tf:"optional"` + NumClusters types.Int64 `tfsdk:"num_clusters"` // ODBC parameters for the SQL warehouse - OdbcParams types.List `tfsdk:"odbc_params" tf:"optional,object"` + OdbcParams types.List `tfsdk:"odbc_params"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // State of the warehouse - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.List `tfsdk:"tags" tf:"optional,object"` + Tags types.List `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *EndpointInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointInfo_SdkV2) { @@ -3924,13 +4091,33 @@ func (newState *EndpointInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EndpointInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointInfo_SdkV2) { } -func (c EndpointInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - EndpointHealth_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - OdbcParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "odbc_params")...) - EndpointTags_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - - return cs +func (c EndpointInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["channel"] = attrs["channel"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["jdbc_url"] = attrs["jdbc_url"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["num_active_sessions"] = attrs["num_active_sessions"].SetOptional() + attrs["num_clusters"] = attrs["num_clusters"].SetOptional() + attrs["odbc_params"] = attrs["odbc_params"].SetOptional() + attrs["odbc_params"] = attrs["odbc_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["tags"] = attrs["tags"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointInfo. @@ -4120,9 +4307,9 @@ func (o *EndpointInfo_SdkV2) SetTags(ctx context.Context, v EndpointTags_SdkV2) } type EndpointTagPair_SdkV2 struct { - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *EndpointTagPair_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointTagPair_SdkV2) { @@ -4131,9 +4318,11 @@ func (newState *EndpointTagPair_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *EndpointTagPair_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointTagPair_SdkV2) { } -func (c EndpointTagPair_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointTagPair_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointTagPair. @@ -4170,7 +4359,7 @@ func (o EndpointTagPair_SdkV2) Type(ctx context.Context) attr.Type { } type EndpointTags_SdkV2 struct { - CustomTags types.List `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.List `tfsdk:"custom_tags"` } func (newState *EndpointTags_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointTags_SdkV2) { @@ -4179,10 +4368,10 @@ func (newState *EndpointTags_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EndpointTags_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointTags_SdkV2) { } -func (c EndpointTags_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointTagPair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "custom_tags")...) +func (c EndpointTags_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointTags. @@ -4248,11 +4437,11 @@ func (o *EndpointTags_SdkV2) SetCustomTags(ctx context.Context, v []EndpointTagP type EnumValue_SdkV2 struct { // List of valid query parameter values, newline delimited. - EnumOptions types.String `tfsdk:"enum_options" tf:"optional"` + EnumOptions types.String `tfsdk:"enum_options"` // If specified, allows multiple values to be selected for this parameter. - MultiValuesOptions types.List `tfsdk:"multi_values_options" tf:"optional,object"` + MultiValuesOptions types.List `tfsdk:"multi_values_options"` // List of selected query parameter values. - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *EnumValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnumValue_SdkV2) { @@ -4261,10 +4450,13 @@ func (newState *EnumValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan En func (newState *EnumValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState EnumValue_SdkV2) { } -func (c EnumValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MultiValuesOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "multi_values_options")...) +func (c EnumValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enum_options"] = attrs["enum_options"].SetOptional() + attrs["multi_values_options"] = attrs["multi_values_options"].SetOptional() + attrs["multi_values_options"] = attrs["multi_values_options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnumValue. @@ -4368,14 +4560,14 @@ type ExecuteStatementRequest_SdkV2 struct { // byte limit, then `truncated` in the response is set to `true`. When using // `EXTERNAL_LINKS` disposition, a default `byte_limit` of 100 GiB is // applied if `byte_limit` is not explcitly set. - ByteLimit types.Int64 `tfsdk:"byte_limit" tf:"optional"` + ByteLimit types.Int64 `tfsdk:"byte_limit"` // Sets default catalog for statement execution, similar to [`USE CATALOG`] // in SQL. // // [`USE CATALOG`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-catalog.html - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` - Disposition types.String `tfsdk:"disposition" tf:"optional"` + Disposition types.String `tfsdk:"disposition"` // Statement execution supports three result formats: `JSON_ARRAY` // (default), `ARROW_STREAM`, and `CSV`. // @@ -4412,7 +4604,7 @@ type ExecuteStatementRequest_SdkV2 struct { // // [Apache Arrow streaming format]: https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format // [RFC 4180]: https://www.rfc-editor.org/rfc/rfc4180 - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // When `wait_timeout > 0s`, the call will block up to the specified time. // If the statement execution doesn't finish within this time, // `on_wait_timeout` determines whether the execution should continue or be @@ -4421,7 +4613,7 @@ type ExecuteStatementRequest_SdkV2 struct { // polling with :method:statementexecution/getStatement. When set to // `CANCEL`, the statement execution is canceled and the call returns with a // `CANCELED` state. - OnWaitTimeout types.String `tfsdk:"on_wait_timeout" tf:"optional"` + OnWaitTimeout types.String `tfsdk:"on_wait_timeout"` // A list of parameters to pass into a SQL statement containing parameter // markers. A parameter consists of a name, a value, and optionally a type. // To represent a NULL value, the `value` field may be omitted or set to @@ -4452,19 +4644,19 @@ type ExecuteStatementRequest_SdkV2 struct { // // [Parameter markers]: https://docs.databricks.com/sql/language-manual/sql-ref-parameter-marker.html // [`cast` function]: https://docs.databricks.com/sql/language-manual/functions/cast.html - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Applies the given row limit to the statement's result set, but unlike the // `LIMIT` clause in SQL, it also sets the `truncated` field in the response // to indicate whether the result was trimmed due to the limit or not. - RowLimit types.Int64 `tfsdk:"row_limit" tf:"optional"` + RowLimit types.Int64 `tfsdk:"row_limit"` // Sets default schema for statement execution, similar to [`USE SCHEMA`] in // SQL. // // [`USE SCHEMA`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-schema.html - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // The SQL statement to execute. The statement can optionally be // parameterized, see `parameters`. - Statement types.String `tfsdk:"statement" tf:""` + Statement types.String `tfsdk:"statement"` // The time in seconds the call will wait for the statement's result set as // `Ns`, where `N` can be set to 0 or to a value between 5 and 50. // @@ -4479,12 +4671,12 @@ type ExecuteStatementRequest_SdkV2 struct { // manifest and result data (or a `FAILED` state in case of an execution // error). If the statement takes longer to execute, `on_wait_timeout` // determines what should happen after the timeout is reached. - WaitTimeout types.String `tfsdk:"wait_timeout" tf:"optional"` + WaitTimeout types.String `tfsdk:"wait_timeout"` // Warehouse upon which to execute a statement. See also [What are SQL // warehouses?] // // [What are SQL warehouses?]: https://docs.databricks.com/sql/admin/warehouse-type.html - WarehouseId types.String `tfsdk:"warehouse_id" tf:""` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *ExecuteStatementRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExecuteStatementRequest_SdkV2) { @@ -4493,12 +4685,20 @@ func (newState *ExecuteStatementRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ExecuteStatementRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExecuteStatementRequest_SdkV2) { } -func (c ExecuteStatementRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StatementParameterListItem_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) - cs.SetRequired(append(path, "statement")...) - cs.SetRequired(append(path, "warehouse_id")...) +func (c ExecuteStatementRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_limit"] = attrs["byte_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["disposition"] = attrs["disposition"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["on_wait_timeout"] = attrs["on_wait_timeout"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["row_limit"] = attrs["row_limit"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["statement"] = attrs["statement"].SetRequired() + attrs["wait_timeout"] = attrs["wait_timeout"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExecuteStatementRequest. @@ -4585,34 +4785,34 @@ func (o *ExecuteStatementRequest_SdkV2) SetParameters(ctx context.Context, v []S type ExternalLink_SdkV2 struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount types.Int64 `tfsdk:"byte_count" tf:"optional"` + ByteCount types.Int64 `tfsdk:"byte_count"` // The position within the sequence of result set chunks. - ChunkIndex types.Int64 `tfsdk:"chunk_index" tf:"optional"` + ChunkIndex types.Int64 `tfsdk:"chunk_index"` // Indicates the date-time that the given external link will expire and // becomes invalid, after which point a new `external_link` must be // requested. - Expiration types.String `tfsdk:"expiration" tf:"optional"` + Expiration types.String `tfsdk:"expiration"` - ExternalLink types.String `tfsdk:"external_link" tf:"optional"` + ExternalLink types.String `tfsdk:"external_link"` // HTTP headers that must be included with a GET request to the // `external_link`. Each header is provided as a key-value pair. Headers are // typically used to pass a decryption key to the external service. The // values of these headers should be considered sensitive and the client // should not expose these values in a log. - HttpHeaders types.Map `tfsdk:"http_headers" tf:"optional"` + HttpHeaders types.Map `tfsdk:"http_headers"` // When fetching, provides the `chunk_index` for the _next_ chunk. If // absent, indicates there are no more chunks. The next chunk can be fetched // with a :method:statementexecution/getStatementResultChunkN request. - NextChunkIndex types.Int64 `tfsdk:"next_chunk_index" tf:"optional"` + NextChunkIndex types.Int64 `tfsdk:"next_chunk_index"` // When fetching, provides a link to fetch the _next_ chunk. If absent, // indicates there are no more chunks. This link is an absolute `path` to be // joined with your `$DATABRICKS_HOST`, and should be treated as an opaque // link. This is an alternative to using `next_chunk_index`. - NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link" tf:"optional"` + NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link"` // The number of rows within the result chunk. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // The starting row offset within the result set. - RowOffset types.Int64 `tfsdk:"row_offset" tf:"optional"` + RowOffset types.Int64 `tfsdk:"row_offset"` } func (newState *ExternalLink_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalLink_SdkV2) { @@ -4621,9 +4821,18 @@ func (newState *ExternalLink_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ExternalLink_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExternalLink_SdkV2) { } -func (c ExternalLink_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExternalLink_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_count"] = attrs["byte_count"].SetOptional() + attrs["chunk_index"] = attrs["chunk_index"].SetOptional() + attrs["expiration"] = attrs["expiration"].SetOptional() + attrs["external_link"] = attrs["external_link"].SetOptional() + attrs["http_headers"] = attrs["http_headers"].SetOptional() + attrs["next_chunk_index"] = attrs["next_chunk_index"].SetOptional() + attrs["next_chunk_internal_link"] = attrs["next_chunk_internal_link"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["row_offset"] = attrs["row_offset"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalLink. @@ -4925,11 +5134,11 @@ func (o GetQueryRequest_SdkV2) Type(ctx context.Context) attr.Type { } type GetResponse_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // An object's type and UUID, separated by a forward slash (/) character. - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` // A singular noun object type. - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetResponse. @@ -5115,7 +5324,7 @@ func (o GetWarehousePermissionLevelsRequest_SdkV2) Type(ctx context.Context) att type GetWarehousePermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetWarehousePermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWarehousePermissionLevelsResponse_SdkV2) { @@ -5124,10 +5333,10 @@ func (newState *GetWarehousePermissionLevelsResponse_SdkV2) SyncEffectiveFieldsD func (newState *GetWarehousePermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetWarehousePermissionLevelsResponse_SdkV2) { } -func (c GetWarehousePermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehousePermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetWarehousePermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWarehousePermissionLevelsResponse. @@ -5272,40 +5481,40 @@ type GetWarehouseResponse_SdkV2 struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.List `tfsdk:"channel" tf:"optional,object"` + Channel types.List `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Optional health status. Assume the warehouse is healthy if this field is // not set. - Health types.List `tfsdk:"health" tf:"optional,object"` + Health types.List `tfsdk:"health"` // unique identifier for warehouse - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // the jdbc connection string for this warehouse - JdbcUrl types.String `tfsdk:"jdbc_url" tf:"optional"` + JdbcUrl types.String `tfsdk:"jdbc_url"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -5315,31 +5524,31 @@ type GetWarehouseResponse_SdkV2 struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // current number of active sessions for the warehouse - NumActiveSessions types.Int64 `tfsdk:"num_active_sessions" tf:"optional"` + NumActiveSessions types.Int64 `tfsdk:"num_active_sessions"` // current number of clusters running for the service - NumClusters types.Int64 `tfsdk:"num_clusters" tf:"optional"` + NumClusters types.Int64 `tfsdk:"num_clusters"` // ODBC parameters for the SQL warehouse - OdbcParams types.List `tfsdk:"odbc_params" tf:"optional,object"` + OdbcParams types.List `tfsdk:"odbc_params"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // State of the warehouse - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.List `tfsdk:"tags" tf:"optional,object"` + Tags types.List `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *GetWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWarehouseResponse_SdkV2) { @@ -5348,13 +5557,33 @@ func (newState *GetWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *GetWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetWarehouseResponse_SdkV2) { } -func (c GetWarehouseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - EndpointHealth_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "health")...) - OdbcParams_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "odbc_params")...) - EndpointTags_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - - return cs +func (c GetWarehouseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["channel"] = attrs["channel"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["health"] = attrs["health"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["jdbc_url"] = attrs["jdbc_url"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["num_active_sessions"] = attrs["num_active_sessions"].SetOptional() + attrs["num_clusters"] = attrs["num_clusters"].SetOptional() + attrs["odbc_params"] = attrs["odbc_params"].SetOptional() + attrs["odbc_params"] = attrs["odbc_params"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["tags"] = attrs["tags"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWarehouseResponse. @@ -5545,30 +5774,30 @@ func (o *GetWarehouseResponse_SdkV2) SetTags(ctx context.Context, v EndpointTags type GetWorkspaceWarehouseConfigResponse_SdkV2 struct { // Optional: Channel selection details - Channel types.List `tfsdk:"channel" tf:"optional,object"` + Channel types.List `tfsdk:"channel"` // Deprecated: Use sql_configuration_parameters - ConfigParam types.List `tfsdk:"config_param" tf:"optional,object"` + ConfigParam types.List `tfsdk:"config_param"` // Spark confs for external hive metastore configuration JSON serialized // size must be less than <= 512K - DataAccessConfig types.List `tfsdk:"data_access_config" tf:"optional"` + DataAccessConfig types.List `tfsdk:"data_access_config"` // List of Warehouse Types allowed in this workspace (limits allowed value // of the type field in CreateWarehouse and EditWarehouse). Note: Some types // cannot be disabled, they don't need to be specified in // SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing // warehouses to be converted to another type. Used by frontend to save // specific type availability in the warehouse create and edit form UI. - EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types" tf:"optional"` + EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types"` // Deprecated: Use sql_configuration_parameters - GlobalParam types.List `tfsdk:"global_param" tf:"optional,object"` + GlobalParam types.List `tfsdk:"global_param"` // GCP only: Google Service Account used to pass to cluster to access Google // Cloud Storage - GoogleServiceAccount types.String `tfsdk:"google_service_account" tf:"optional"` + GoogleServiceAccount types.String `tfsdk:"google_service_account"` // AWS Only: Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Security policy for warehouses - SecurityPolicy types.String `tfsdk:"security_policy" tf:"optional"` + SecurityPolicy types.String `tfsdk:"security_policy"` // SQL configuration parameters - SqlConfigurationParameters types.List `tfsdk:"sql_configuration_parameters" tf:"optional,object"` + SqlConfigurationParameters types.List `tfsdk:"sql_configuration_parameters"` } func (newState *GetWorkspaceWarehouseConfigResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWorkspaceWarehouseConfigResponse_SdkV2) { @@ -5577,15 +5806,22 @@ func (newState *GetWorkspaceWarehouseConfigResponse_SdkV2) SyncEffectiveFieldsDu func (newState *GetWorkspaceWarehouseConfigResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetWorkspaceWarehouseConfigResponse_SdkV2) { } -func (c GetWorkspaceWarehouseConfigResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - RepeatedEndpointConfPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config_param")...) - EndpointConfPair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_access_config")...) - WarehouseTypePair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "enabled_warehouse_types")...) - RepeatedEndpointConfPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "global_param")...) - RepeatedEndpointConfPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_configuration_parameters")...) +func (c GetWorkspaceWarehouseConfigResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["channel"] = attrs["channel"].SetOptional() + attrs["channel"] = attrs["channel"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config_param"] = attrs["config_param"].SetOptional() + attrs["config_param"] = attrs["config_param"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["data_access_config"] = attrs["data_access_config"].SetOptional() + attrs["enabled_warehouse_types"] = attrs["enabled_warehouse_types"].SetOptional() + attrs["global_param"] = attrs["global_param"].SetOptional() + attrs["global_param"] = attrs["global_param"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["google_service_account"] = attrs["google_service_account"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["security_policy"] = attrs["security_policy"].SetOptional() + attrs["sql_configuration_parameters"] = attrs["sql_configuration_parameters"].SetOptional() + attrs["sql_configuration_parameters"] = attrs["sql_configuration_parameters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWorkspaceWarehouseConfigResponse. @@ -5812,31 +6048,31 @@ func (o *GetWorkspaceWarehouseConfigResponse_SdkV2) SetSqlConfigurationParameter type LegacyAlert_SdkV2 struct { // Timestamp when the alert was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Alert ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Timestamp when the alert was last triggered. - LastTriggeredAt types.String `tfsdk:"last_triggered_at" tf:"optional"` + LastTriggeredAt types.String `tfsdk:"last_triggered_at"` // Name of the alert. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Alert configuration options. - Options types.List `tfsdk:"options" tf:"optional,object"` + Options types.List `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` - Query types.List `tfsdk:"query" tf:"optional,object"` + Query types.List `tfsdk:"query"` // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm types.Int64 `tfsdk:"rearm" tf:"optional"` + Rearm types.Int64 `tfsdk:"rearm"` // State of the alert. Possible values are: `unknown` (yet to be evaluated), // `triggered` (evaluated and fulfilled trigger conditions), or `ok` // (evaluated and did not fulfill trigger conditions). - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Timestamp when the alert was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` - User types.List `tfsdk:"user" tf:"optional,object"` + User types.List `tfsdk:"user"` } func (newState *LegacyAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LegacyAlert_SdkV2) { @@ -5845,12 +6081,23 @@ func (newState *LegacyAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *LegacyAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState LegacyAlert_SdkV2) { } -func (c LegacyAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - AlertQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query")...) - User_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "user")...) +func (c LegacyAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_triggered_at"] = attrs["last_triggered_at"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parent"] = attrs["parent"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query"] = attrs["query"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["rearm"] = attrs["rearm"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + attrs["user"] = attrs["user"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LegacyAlert. @@ -5995,72 +6242,72 @@ func (o *LegacyAlert_SdkV2) SetUser(ctx context.Context, v User_SdkV2) { type LegacyQuery_SdkV2 struct { // Describes whether the authenticated user is allowed to edit the // definition of this query. - CanEdit types.Bool `tfsdk:"can_edit" tf:"optional"` + CanEdit types.Bool `tfsdk:"can_edit"` // The timestamp when this query was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Data source ID maps to the ID of the data source used by the resource and // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Query ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Indicates whether the query is trashed. Trashed queries can't be used in // dashboards, or appear in search results. If this boolean is `true`, the // `options` property for this query includes a `moved_to_trash_at` // timestamp. Trashed queries are permanently deleted after 30 days. - IsArchived types.Bool `tfsdk:"is_archived" tf:"optional"` + IsArchived types.Bool `tfsdk:"is_archived"` // Whether the query is a draft. Draft queries only appear in list views for // their owners. Visualizations from draft queries cannot appear on // dashboards. - IsDraft types.Bool `tfsdk:"is_draft" tf:"optional"` + IsDraft types.Bool `tfsdk:"is_draft"` // Whether this query object appears in the current user's favorites list. // This flag determines whether the star icon for favorites is selected. - IsFavorite types.Bool `tfsdk:"is_favorite" tf:"optional"` + IsFavorite types.Bool `tfsdk:"is_favorite"` // Text parameter types are not safe from SQL injection for all types of // data source. Set this Boolean parameter to `true` if a query either does // not use any text type parameters or uses a data source type where text // type parameters are handled safely. - IsSafe types.Bool `tfsdk:"is_safe" tf:"optional"` + IsSafe types.Bool `tfsdk:"is_safe"` - LastModifiedBy types.List `tfsdk:"last_modified_by" tf:"optional,object"` + LastModifiedBy types.List `tfsdk:"last_modified_by"` // The ID of the user who last saved changes to this query. - LastModifiedById types.Int64 `tfsdk:"last_modified_by_id" tf:"optional"` + LastModifiedById types.Int64 `tfsdk:"last_modified_by_id"` // If there is a cached result for this query and user, this field includes // the query result ID. If this query uses parameters, this field is always // null. - LatestQueryDataId types.String `tfsdk:"latest_query_data_id" tf:"optional"` + LatestQueryDataId types.String `tfsdk:"latest_query_data_id"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - Options types.List `tfsdk:"options" tf:"optional,object"` + Options types.List `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionTier types.String `tfsdk:"permission_tier" tf:"optional"` + PermissionTier types.String `tfsdk:"permission_tier"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` // A SHA-256 hash of the query text along with the authenticated user ID. - QueryHash types.String `tfsdk:"query_hash" tf:"optional"` + QueryHash types.String `tfsdk:"query_hash"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The timestamp at which this query was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` - User types.List `tfsdk:"user" tf:"optional,object"` + User types.List `tfsdk:"user"` // The ID of the user who owns the query. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` - Visualizations types.List `tfsdk:"visualizations" tf:"optional"` + Visualizations types.List `tfsdk:"visualizations"` } func (newState *LegacyQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LegacyQuery_SdkV2) { @@ -6069,13 +6316,36 @@ func (newState *LegacyQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *LegacyQuery_SdkV2) SyncEffectiveFieldsDuringRead(existingState LegacyQuery_SdkV2) { } -func (c LegacyQuery_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - User_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "last_modified_by")...) - QueryOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - User_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "user")...) - LegacyVisualization_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "visualizations")...) - - return cs +func (c LegacyQuery_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["can_edit"] = attrs["can_edit"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_archived"] = attrs["is_archived"].SetOptional() + attrs["is_draft"] = attrs["is_draft"].SetOptional() + attrs["is_favorite"] = attrs["is_favorite"].SetOptional() + attrs["is_safe"] = attrs["is_safe"].SetOptional() + attrs["last_modified_by"] = attrs["last_modified_by"].SetOptional() + attrs["last_modified_by"] = attrs["last_modified_by"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["last_modified_by_id"] = attrs["last_modified_by_id"].SetOptional() + attrs["latest_query_data_id"] = attrs["latest_query_data_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["parent"] = attrs["parent"].SetOptional() + attrs["permission_tier"] = attrs["permission_tier"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query_hash"] = attrs["query_hash"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + attrs["user"] = attrs["user"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["visualizations"] = attrs["visualizations"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LegacyQuery. @@ -6307,25 +6577,25 @@ func (o *LegacyQuery_SdkV2) SetVisualizations(ctx context.Context, v []LegacyVis // same endpoint. Databricks does not recommend constructing ad-hoc // visualizations entirely in JSON. type LegacyVisualization_SdkV2 struct { - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // A short description of this visualization. This is not displayed in the // UI. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The UUID for this visualization. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The name of the visualization that appears on dashboards and the query // screen. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The options object varies widely from one visualization type to the next // and is unsupported. Databricks does not recommend modifying visualization // settings in JSON. - Options types.Object `tfsdk:"options" tf:"optional"` + Options types.Object `tfsdk:"options"` - Query types.List `tfsdk:"query" tf:"optional,object"` + Query types.List `tfsdk:"query"` // The type of visualization: chart, table, pivot table, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` } func (newState *LegacyVisualization_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan LegacyVisualization_SdkV2) { @@ -6334,10 +6604,18 @@ func (newState *LegacyVisualization_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *LegacyVisualization_SdkV2) SyncEffectiveFieldsDuringRead(existingState LegacyVisualization_SdkV2) { } -func (c LegacyVisualization_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LegacyQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query")...) +func (c LegacyVisualization_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query"] = attrs["query"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["type"] = attrs["type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LegacyVisualization. @@ -6456,9 +6734,9 @@ func (o ListAlertsRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListAlertsResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListAlertsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAlertsResponse_SdkV2) { @@ -6467,10 +6745,11 @@ func (newState *ListAlertsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListAlertsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAlertsResponse_SdkV2) { } -func (c ListAlertsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListAlertsResponseAlert_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListAlertsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAlertsResponse. @@ -6538,46 +6817,46 @@ func (o *ListAlertsResponse_SdkV2) SetResults(ctx context.Context, v []ListAlert type ListAlertsResponseAlert_SdkV2 struct { // Trigger conditions of the alert. - Condition types.List `tfsdk:"condition" tf:"optional,object"` + Condition types.List `tfsdk:"condition"` // The timestamp indicating when the alert was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the alert. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The workspace state of the alert. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` // Current state of the alert's trigger status. This field is set to UNKNOWN // if the alert has not yet been evaluated or ran into an error during the // last evaluation. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Timestamp when the alert was last triggered, if the alert has been // triggered before. - TriggerTime types.String `tfsdk:"trigger_time" tf:"optional"` + TriggerTime types.String `tfsdk:"trigger_time"` // The timestamp indicating when the alert was updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *ListAlertsResponseAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAlertsResponseAlert_SdkV2) { @@ -6586,10 +6865,24 @@ func (newState *ListAlertsResponseAlert_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ListAlertsResponseAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAlertsResponseAlert_SdkV2) { } -func (c ListAlertsResponseAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c ListAlertsResponseAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["condition"] = attrs["condition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["trigger_time"] = attrs["trigger_time"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAlertsResponseAlert. @@ -6832,11 +7125,11 @@ func (o ListQueriesRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListQueriesResponse_SdkV2 struct { // Whether there is another page of results. - HasNextPage types.Bool `tfsdk:"has_next_page" tf:"optional"` + HasNextPage types.Bool `tfsdk:"has_next_page"` // A token that can be used to get the next page of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Res types.List `tfsdk:"res" tf:"optional"` + Res types.List `tfsdk:"res"` } func (newState *ListQueriesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQueriesResponse_SdkV2) { @@ -6845,10 +7138,12 @@ func (newState *ListQueriesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListQueriesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListQueriesResponse_SdkV2) { } -func (c ListQueriesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "res")...) +func (c ListQueriesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_next_page"] = attrs["has_next_page"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["res"] = attrs["res"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQueriesResponse. @@ -7001,9 +7296,9 @@ func (o *ListQueryHistoryRequest_SdkV2) SetFilterBy(ctx context.Context, v Query } type ListQueryObjectsResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListQueryObjectsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQueryObjectsResponse_SdkV2) { @@ -7012,10 +7307,11 @@ func (newState *ListQueryObjectsResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *ListQueryObjectsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListQueryObjectsResponse_SdkV2) { } -func (c ListQueryObjectsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListQueryObjectsResponseQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListQueryObjectsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQueryObjectsResponse. @@ -7083,39 +7379,39 @@ func (o *ListQueryObjectsResponse_SdkV2) SetResults(ctx context.Context, v []Lis type ListQueryObjectsResponseQuery_SdkV2 struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // Timestamp when this query was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the query. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Username of the user who last saved changes to this query. - LastModifierUserName types.String `tfsdk:"last_modifier_user_name" tf:"optional"` + LastModifierUserName types.String `tfsdk:"last_modifier_user_name"` // Indicates whether the query is trashed. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Username of the user that owns the query. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // Timestamp when this query was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *ListQueryObjectsResponseQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQueryObjectsResponseQuery_SdkV2) { @@ -7124,10 +7420,25 @@ func (newState *ListQueryObjectsResponseQuery_SdkV2) SyncEffectiveFieldsDuringCr func (newState *ListQueryObjectsResponseQuery_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListQueryObjectsResponseQuery_SdkV2) { } -func (c ListQueryObjectsResponseQuery_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c ListQueryObjectsResponseQuery_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_modifier_user_name"] = attrs["last_modifier_user_name"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQueryObjectsResponseQuery. @@ -7252,13 +7563,13 @@ func (o *ListQueryObjectsResponseQuery_SdkV2) SetTags(ctx context.Context, v []t type ListResponse_SdkV2 struct { // The total number of dashboards. - Count types.Int64 `tfsdk:"count" tf:"optional"` + Count types.Int64 `tfsdk:"count"` // The current page being displayed. - Page types.Int64 `tfsdk:"page" tf:"optional"` + Page types.Int64 `tfsdk:"page"` // The number of dashboards per page. - PageSize types.Int64 `tfsdk:"page_size" tf:"optional"` + PageSize types.Int64 `tfsdk:"page_size"` // List of dashboards returned. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListResponse. @@ -7373,9 +7684,9 @@ func (o ListVisualizationsForQueryRequest_SdkV2) Type(ctx context.Context) attr. } type ListVisualizationsForQueryResponse_SdkV2 struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListVisualizationsForQueryResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListVisualizationsForQueryResponse_SdkV2) { @@ -7384,10 +7695,11 @@ func (newState *ListVisualizationsForQueryResponse_SdkV2) SyncEffectiveFieldsDur func (newState *ListVisualizationsForQueryResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListVisualizationsForQueryResponse_SdkV2) { } -func (c ListVisualizationsForQueryResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Visualization_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListVisualizationsForQueryResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListVisualizationsForQueryResponse. @@ -7493,7 +7805,7 @@ func (o ListWarehousesRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListWarehousesResponse_SdkV2 struct { // A list of warehouses and their configurations. - Warehouses types.List `tfsdk:"warehouses" tf:"optional"` + Warehouses types.List `tfsdk:"warehouses"` } func (newState *ListWarehousesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListWarehousesResponse_SdkV2) { @@ -7502,10 +7814,10 @@ func (newState *ListWarehousesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ListWarehousesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListWarehousesResponse_SdkV2) { } -func (c ListWarehousesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "warehouses")...) +func (c ListWarehousesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["warehouses"] = attrs["warehouses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListWarehousesResponse. @@ -7571,12 +7883,12 @@ func (o *ListWarehousesResponse_SdkV2) SetWarehouses(ctx context.Context, v []En type MultiValuesOptions_SdkV2 struct { // Character that prefixes each selected parameter value. - Prefix types.String `tfsdk:"prefix" tf:"optional"` + Prefix types.String `tfsdk:"prefix"` // Character that separates each selected parameter value. Defaults to a // comma. - Separator types.String `tfsdk:"separator" tf:"optional"` + Separator types.String `tfsdk:"separator"` // Character that suffixes each selected parameter value. - Suffix types.String `tfsdk:"suffix" tf:"optional"` + Suffix types.String `tfsdk:"suffix"` } func (newState *MultiValuesOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MultiValuesOptions_SdkV2) { @@ -7585,9 +7897,12 @@ func (newState *MultiValuesOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *MultiValuesOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState MultiValuesOptions_SdkV2) { } -func (c MultiValuesOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MultiValuesOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["prefix"] = attrs["prefix"].SetOptional() + attrs["separator"] = attrs["separator"].SetOptional() + attrs["suffix"] = attrs["suffix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MultiValuesOptions. @@ -7626,7 +7941,7 @@ func (o MultiValuesOptions_SdkV2) Type(ctx context.Context) attr.Type { } type NumericValue_SdkV2 struct { - Value types.Float64 `tfsdk:"value" tf:"optional"` + Value types.Float64 `tfsdk:"value"` } func (newState *NumericValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan NumericValue_SdkV2) { @@ -7635,9 +7950,10 @@ func (newState *NumericValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *NumericValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState NumericValue_SdkV2) { } -func (c NumericValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NumericValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NumericValue. @@ -7672,13 +7988,13 @@ func (o NumericValue_SdkV2) Type(ctx context.Context) attr.Type { } type OdbcParams_SdkV2 struct { - Hostname types.String `tfsdk:"hostname" tf:"optional"` + Hostname types.String `tfsdk:"hostname"` - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` - Port types.Int64 `tfsdk:"port" tf:"optional"` + Port types.Int64 `tfsdk:"port"` - Protocol types.String `tfsdk:"protocol" tf:"optional"` + Protocol types.String `tfsdk:"protocol"` } func (newState *OdbcParams_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OdbcParams_SdkV2) { @@ -7687,9 +8003,13 @@ func (newState *OdbcParams_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan O func (newState *OdbcParams_SdkV2) SyncEffectiveFieldsDuringRead(existingState OdbcParams_SdkV2) { } -func (c OdbcParams_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OdbcParams_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["hostname"] = attrs["hostname"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["port"] = attrs["port"].SetOptional() + attrs["protocol"] = attrs["protocol"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OdbcParams. @@ -7732,22 +8052,22 @@ func (o OdbcParams_SdkV2) Type(ctx context.Context) attr.Type { type Parameter_SdkV2 struct { // List of valid parameter values, newline delimited. Only applies for // dropdown list parameters. - EnumOptions types.String `tfsdk:"enumOptions" tf:"optional"` + EnumOptions types.String `tfsdk:"enumOptions"` // If specified, allows multiple values to be selected for this parameter. // Only applies to dropdown list and query-based dropdown list parameters. - MultiValuesOptions types.List `tfsdk:"multiValuesOptions" tf:"optional,object"` + MultiValuesOptions types.List `tfsdk:"multiValuesOptions"` // The literal parameter marker that appears between double curly braces in // the query text. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The UUID of the query that provides the parameter values. Only applies // for query-based dropdown list parameters. - QueryId types.String `tfsdk:"queryId" tf:"optional"` + QueryId types.String `tfsdk:"queryId"` // The text displayed in a parameter picking widget. - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` // Parameters can have several different types. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // The default value for this parameter. - Value types.Object `tfsdk:"value" tf:"optional"` + Value types.Object `tfsdk:"value"` } func (newState *Parameter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Parameter_SdkV2) { @@ -7756,10 +8076,17 @@ func (newState *Parameter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pa func (newState *Parameter_SdkV2) SyncEffectiveFieldsDuringRead(existingState Parameter_SdkV2) { } -func (c Parameter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MultiValuesOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "multiValuesOptions")...) +func (c Parameter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enumOptions"] = attrs["enumOptions"].SetOptional() + attrs["multiValuesOptions"] = attrs["multiValuesOptions"].SetOptional() + attrs["multiValuesOptions"] = attrs["multiValuesOptions"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() + attrs["queryId"] = attrs["queryId"].SetOptional() + attrs["title"] = attrs["title"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Parameter. @@ -7837,41 +8164,41 @@ func (o *Parameter_SdkV2) SetMultiValuesOptions(ctx context.Context, v MultiValu type Query_SdkV2 struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // Timestamp when this query was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the query. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Username of the user who last saved changes to this query. - LastModifierUserName types.String `tfsdk:"last_modifier_user_name" tf:"optional"` + LastModifierUserName types.String `tfsdk:"last_modifier_user_name"` // Indicates whether the query is trashed. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Username of the user that owns the query. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Workspace path of the workspace folder containing the object. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // Timestamp when this query was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *Query_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Query_SdkV2) { @@ -7880,10 +8207,26 @@ func (newState *Query_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Query_ func (newState *Query_SdkV2) SyncEffectiveFieldsDuringRead(existingState Query_SdkV2) { } -func (c Query_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) - - return cs +func (c Query_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_modifier_user_name"] = attrs["last_modifier_user_name"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Query. @@ -8010,11 +8353,11 @@ func (o *Query_SdkV2) SetTags(ctx context.Context, v []types.String) { type QueryBackedValue_SdkV2 struct { // If specified, allows multiple values to be selected for this parameter. - MultiValuesOptions types.List `tfsdk:"multi_values_options" tf:"optional,object"` + MultiValuesOptions types.List `tfsdk:"multi_values_options"` // UUID of the query that provides the parameter values. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // List of selected query parameter values. - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *QueryBackedValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryBackedValue_SdkV2) { @@ -8023,10 +8366,13 @@ func (newState *QueryBackedValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *QueryBackedValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryBackedValue_SdkV2) { } -func (c QueryBackedValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MultiValuesOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "multi_values_options")...) +func (c QueryBackedValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["multi_values_options"] = attrs["multi_values_options"].SetOptional() + attrs["multi_values_options"] = attrs["multi_values_options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryBackedValue. @@ -8128,27 +8474,27 @@ type QueryEditContent_SdkV2 struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Exclusively used for storing a list parameter definitions. A parameter is // an object with `title`, `name`, `type`, and `value` properties. The // `value` field here is the default value. It can be overridden at runtime. - Options types.Object `tfsdk:"options" tf:"optional"` + Options types.Object `tfsdk:"options"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` QueryId types.String `tfsdk:"-"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *QueryEditContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryEditContent_SdkV2) { @@ -8157,10 +8503,17 @@ func (newState *QueryEditContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *QueryEditContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryEditContent_SdkV2) { } -func (c QueryEditContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "query_id")...) +func (c QueryEditContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetRequired() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryEditContent. @@ -8241,15 +8594,15 @@ func (o *QueryEditContent_SdkV2) SetTags(ctx context.Context, v []types.String) type QueryFilter_SdkV2 struct { // A range filter for query submitted time. The time range must be <= 30 // days. - QueryStartTimeRange types.List `tfsdk:"query_start_time_range" tf:"optional,object"` + QueryStartTimeRange types.List `tfsdk:"query_start_time_range"` // A list of statement IDs. - StatementIds types.List `tfsdk:"statement_ids" tf:"optional"` + StatementIds types.List `tfsdk:"statement_ids"` - Statuses types.List `tfsdk:"statuses" tf:"optional"` + Statuses types.List `tfsdk:"statuses"` // A list of user IDs who ran the queries. - UserIds types.List `tfsdk:"user_ids" tf:"optional"` + UserIds types.List `tfsdk:"user_ids"` // A list of warehouse IDs. - WarehouseIds types.List `tfsdk:"warehouse_ids" tf:"optional"` + WarehouseIds types.List `tfsdk:"warehouse_ids"` } func (newState *QueryFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryFilter_SdkV2) { @@ -8258,10 +8611,15 @@ func (newState *QueryFilter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QueryFilter_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryFilter_SdkV2) { } -func (c QueryFilter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TimeRange_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query_start_time_range")...) +func (c QueryFilter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query_start_time_range"] = attrs["query_start_time_range"].SetOptional() + attrs["query_start_time_range"] = attrs["query_start_time_range"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["statement_ids"] = attrs["statement_ids"].SetOptional() + attrs["statuses"] = attrs["statuses"].SetOptional() + attrs["user_ids"] = attrs["user_ids"].SetOptional() + attrs["warehouse_ids"] = attrs["warehouse_ids"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryFilter. @@ -8451,54 +8809,54 @@ func (o *QueryFilter_SdkV2) SetWarehouseIds(ctx context.Context, v []types.Strin type QueryInfo_SdkV2 struct { // SQL Warehouse channel information at the time of query execution - ChannelUsed types.List `tfsdk:"channel_used" tf:"optional,object"` + ChannelUsed types.List `tfsdk:"channel_used"` // Total execution time of the statement ( excluding result fetch time ). - Duration types.Int64 `tfsdk:"duration" tf:"optional"` + Duration types.Int64 `tfsdk:"duration"` // Alias for `warehouse_id`. - EndpointId types.String `tfsdk:"endpoint_id" tf:"optional"` + EndpointId types.String `tfsdk:"endpoint_id"` // Message describing why the query could not complete. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // The ID of the user whose credentials were used to run the query. - ExecutedAsUserId types.Int64 `tfsdk:"executed_as_user_id" tf:"optional"` + ExecutedAsUserId types.Int64 `tfsdk:"executed_as_user_id"` // The email address or username of the user whose credentials were used to // run the query. - ExecutedAsUserName types.String `tfsdk:"executed_as_user_name" tf:"optional"` + ExecutedAsUserName types.String `tfsdk:"executed_as_user_name"` // The time execution of the query ended. - ExecutionEndTimeMs types.Int64 `tfsdk:"execution_end_time_ms" tf:"optional"` + ExecutionEndTimeMs types.Int64 `tfsdk:"execution_end_time_ms"` // Whether more updates for the query are expected. - IsFinal types.Bool `tfsdk:"is_final" tf:"optional"` + IsFinal types.Bool `tfsdk:"is_final"` // A key that can be used to look up query details. - LookupKey types.String `tfsdk:"lookup_key" tf:"optional"` + LookupKey types.String `tfsdk:"lookup_key"` // Metrics about query execution. - Metrics types.List `tfsdk:"metrics" tf:"optional,object"` + Metrics types.List `tfsdk:"metrics"` // Whether plans exist for the execution, or the reason why they are missing - PlansState types.String `tfsdk:"plans_state" tf:"optional"` + PlansState types.String `tfsdk:"plans_state"` // The time the query ended. - QueryEndTimeMs types.Int64 `tfsdk:"query_end_time_ms" tf:"optional"` + QueryEndTimeMs types.Int64 `tfsdk:"query_end_time_ms"` // The query ID. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // The time the query started. - QueryStartTimeMs types.Int64 `tfsdk:"query_start_time_ms" tf:"optional"` + QueryStartTimeMs types.Int64 `tfsdk:"query_start_time_ms"` // The text of the query. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // The number of results returned by the query. - RowsProduced types.Int64 `tfsdk:"rows_produced" tf:"optional"` + RowsProduced types.Int64 `tfsdk:"rows_produced"` // URL to the Spark UI query plan. - SparkUiUrl types.String `tfsdk:"spark_ui_url" tf:"optional"` + SparkUiUrl types.String `tfsdk:"spark_ui_url"` // Type of statement for this query - StatementType types.String `tfsdk:"statement_type" tf:"optional"` + StatementType types.String `tfsdk:"statement_type"` // Query status with one the following values: // // - `QUEUED`: Query has been received and queued. - `RUNNING`: Query has // started. - `CANCELED`: Query has been cancelled by the user. - `FAILED`: // Query has failed. - `FINISHED`: Query has completed. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The ID of the user who ran the query. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` // The email address or username of the user who ran the query. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` // Warehouse ID. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *QueryInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryInfo_SdkV2) { @@ -8507,11 +8865,33 @@ func (newState *QueryInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Qu func (newState *QueryInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryInfo_SdkV2) { } -func (c QueryInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ChannelInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel_used")...) - QueryMetrics_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) - - return cs +func (c QueryInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["channel_used"] = attrs["channel_used"].SetOptional() + attrs["channel_used"] = attrs["channel_used"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["duration"] = attrs["duration"].SetOptional() + attrs["endpoint_id"] = attrs["endpoint_id"].SetOptional() + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["executed_as_user_id"] = attrs["executed_as_user_id"].SetOptional() + attrs["executed_as_user_name"] = attrs["executed_as_user_name"].SetOptional() + attrs["execution_end_time_ms"] = attrs["execution_end_time_ms"].SetOptional() + attrs["is_final"] = attrs["is_final"].SetOptional() + attrs["lookup_key"] = attrs["lookup_key"].SetOptional() + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["metrics"] = attrs["metrics"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["plans_state"] = attrs["plans_state"].SetOptional() + attrs["query_end_time_ms"] = attrs["query_end_time_ms"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["query_start_time_ms"] = attrs["query_start_time_ms"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["rows_produced"] = attrs["rows_produced"].SetOptional() + attrs["spark_ui_url"] = attrs["spark_ui_url"].SetOptional() + attrs["statement_type"] = attrs["statement_type"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryInfo. @@ -8648,13 +9028,13 @@ func (o *QueryInfo_SdkV2) SetMetrics(ctx context.Context, v QueryMetrics_SdkV2) type QueryList_SdkV2 struct { // The total number of queries. - Count types.Int64 `tfsdk:"count" tf:"optional"` + Count types.Int64 `tfsdk:"count"` // The page number that is currently displayed. - Page types.Int64 `tfsdk:"page" tf:"optional"` + Page types.Int64 `tfsdk:"page"` // The number of queries per page. - PageSize types.Int64 `tfsdk:"page_size" tf:"optional"` + PageSize types.Int64 `tfsdk:"page_size"` // List of queries returned. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *QueryList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryList_SdkV2) { @@ -8663,10 +9043,13 @@ func (newState *QueryList_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Qu func (newState *QueryList_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryList_SdkV2) { } -func (c QueryList_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LegacyQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c QueryList_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["count"] = attrs["count"].SetOptional() + attrs["page"] = attrs["page"].SetOptional() + attrs["page_size"] = attrs["page_size"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryList. @@ -8740,61 +9123,61 @@ func (o *QueryList_SdkV2) SetResults(ctx context.Context, v []LegacyQuery_SdkV2) // Metrics come from the driver and are stored in the history service database. type QueryMetrics_SdkV2 struct { // Time spent loading metadata and optimizing the query, in milliseconds. - CompilationTimeMs types.Int64 `tfsdk:"compilation_time_ms" tf:"optional"` + CompilationTimeMs types.Int64 `tfsdk:"compilation_time_ms"` // Time spent executing the query, in milliseconds. - ExecutionTimeMs types.Int64 `tfsdk:"execution_time_ms" tf:"optional"` + ExecutionTimeMs types.Int64 `tfsdk:"execution_time_ms"` // Total amount of data sent over the network between executor nodes during // shuffle, in bytes. - NetworkSentBytes types.Int64 `tfsdk:"network_sent_bytes" tf:"optional"` + NetworkSentBytes types.Int64 `tfsdk:"network_sent_bytes"` // Timestamp of when the query was enqueued waiting while the warehouse was // at max load. This field is optional and will not appear if the query // skipped the overloading queue. - OverloadingQueueStartTimestamp types.Int64 `tfsdk:"overloading_queue_start_timestamp" tf:"optional"` + OverloadingQueueStartTimestamp types.Int64 `tfsdk:"overloading_queue_start_timestamp"` // Total execution time for all individual Photon query engine tasks in the // query, in milliseconds. - PhotonTotalTimeMs types.Int64 `tfsdk:"photon_total_time_ms" tf:"optional"` + PhotonTotalTimeMs types.Int64 `tfsdk:"photon_total_time_ms"` // Timestamp of when the query was enqueued waiting for a cluster to be // provisioned for the warehouse. This field is optional and will not appear // if the query skipped the provisioning queue. - ProvisioningQueueStartTimestamp types.Int64 `tfsdk:"provisioning_queue_start_timestamp" tf:"optional"` + ProvisioningQueueStartTimestamp types.Int64 `tfsdk:"provisioning_queue_start_timestamp"` // Total number of bytes in all tables not read due to pruning - PrunedBytes types.Int64 `tfsdk:"pruned_bytes" tf:"optional"` + PrunedBytes types.Int64 `tfsdk:"pruned_bytes"` // Total number of files from all tables not read due to pruning - PrunedFilesCount types.Int64 `tfsdk:"pruned_files_count" tf:"optional"` + PrunedFilesCount types.Int64 `tfsdk:"pruned_files_count"` // Timestamp of when the underlying compute started compilation of the // query. - QueryCompilationStartTimestamp types.Int64 `tfsdk:"query_compilation_start_timestamp" tf:"optional"` + QueryCompilationStartTimestamp types.Int64 `tfsdk:"query_compilation_start_timestamp"` // Total size of data read by the query, in bytes. - ReadBytes types.Int64 `tfsdk:"read_bytes" tf:"optional"` + ReadBytes types.Int64 `tfsdk:"read_bytes"` // Size of persistent data read from the cache, in bytes. - ReadCacheBytes types.Int64 `tfsdk:"read_cache_bytes" tf:"optional"` + ReadCacheBytes types.Int64 `tfsdk:"read_cache_bytes"` // Number of files read after pruning - ReadFilesCount types.Int64 `tfsdk:"read_files_count" tf:"optional"` + ReadFilesCount types.Int64 `tfsdk:"read_files_count"` // Number of partitions read after pruning. - ReadPartitionsCount types.Int64 `tfsdk:"read_partitions_count" tf:"optional"` + ReadPartitionsCount types.Int64 `tfsdk:"read_partitions_count"` // Size of persistent data read from cloud object storage on your cloud // tenant, in bytes. - ReadRemoteBytes types.Int64 `tfsdk:"read_remote_bytes" tf:"optional"` + ReadRemoteBytes types.Int64 `tfsdk:"read_remote_bytes"` // Time spent fetching the query results after the execution finished, in // milliseconds. - ResultFetchTimeMs types.Int64 `tfsdk:"result_fetch_time_ms" tf:"optional"` + ResultFetchTimeMs types.Int64 `tfsdk:"result_fetch_time_ms"` // `true` if the query result was fetched from cache, `false` otherwise. - ResultFromCache types.Bool `tfsdk:"result_from_cache" tf:"optional"` + ResultFromCache types.Bool `tfsdk:"result_from_cache"` // Total number of rows returned by the query. - RowsProducedCount types.Int64 `tfsdk:"rows_produced_count" tf:"optional"` + RowsProducedCount types.Int64 `tfsdk:"rows_produced_count"` // Total number of rows read by the query. - RowsReadCount types.Int64 `tfsdk:"rows_read_count" tf:"optional"` + RowsReadCount types.Int64 `tfsdk:"rows_read_count"` // Size of data temporarily written to disk while executing the query, in // bytes. - SpillToDiskBytes types.Int64 `tfsdk:"spill_to_disk_bytes" tf:"optional"` + SpillToDiskBytes types.Int64 `tfsdk:"spill_to_disk_bytes"` // Sum of execution time for all of the query’s tasks, in milliseconds. - TaskTotalTimeMs types.Int64 `tfsdk:"task_total_time_ms" tf:"optional"` + TaskTotalTimeMs types.Int64 `tfsdk:"task_total_time_ms"` // Total execution time of the query from the client’s point of view, in // milliseconds. - TotalTimeMs types.Int64 `tfsdk:"total_time_ms" tf:"optional"` + TotalTimeMs types.Int64 `tfsdk:"total_time_ms"` // Size pf persistent data written to cloud object storage in your cloud // tenant, in bytes. - WriteRemoteBytes types.Int64 `tfsdk:"write_remote_bytes" tf:"optional"` + WriteRemoteBytes types.Int64 `tfsdk:"write_remote_bytes"` } func (newState *QueryMetrics_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryMetrics_SdkV2) { @@ -8803,9 +9186,31 @@ func (newState *QueryMetrics_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QueryMetrics_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryMetrics_SdkV2) { } -func (c QueryMetrics_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c QueryMetrics_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compilation_time_ms"] = attrs["compilation_time_ms"].SetOptional() + attrs["execution_time_ms"] = attrs["execution_time_ms"].SetOptional() + attrs["network_sent_bytes"] = attrs["network_sent_bytes"].SetOptional() + attrs["overloading_queue_start_timestamp"] = attrs["overloading_queue_start_timestamp"].SetOptional() + attrs["photon_total_time_ms"] = attrs["photon_total_time_ms"].SetOptional() + attrs["provisioning_queue_start_timestamp"] = attrs["provisioning_queue_start_timestamp"].SetOptional() + attrs["pruned_bytes"] = attrs["pruned_bytes"].SetOptional() + attrs["pruned_files_count"] = attrs["pruned_files_count"].SetOptional() + attrs["query_compilation_start_timestamp"] = attrs["query_compilation_start_timestamp"].SetOptional() + attrs["read_bytes"] = attrs["read_bytes"].SetOptional() + attrs["read_cache_bytes"] = attrs["read_cache_bytes"].SetOptional() + attrs["read_files_count"] = attrs["read_files_count"].SetOptional() + attrs["read_partitions_count"] = attrs["read_partitions_count"].SetOptional() + attrs["read_remote_bytes"] = attrs["read_remote_bytes"].SetOptional() + attrs["result_fetch_time_ms"] = attrs["result_fetch_time_ms"].SetOptional() + attrs["result_from_cache"] = attrs["result_from_cache"].SetOptional() + attrs["rows_produced_count"] = attrs["rows_produced_count"].SetOptional() + attrs["rows_read_count"] = attrs["rows_read_count"].SetOptional() + attrs["spill_to_disk_bytes"] = attrs["spill_to_disk_bytes"].SetOptional() + attrs["task_total_time_ms"] = attrs["task_total_time_ms"].SetOptional() + attrs["total_time_ms"] = attrs["total_time_ms"].SetOptional() + attrs["write_remote_bytes"] = attrs["write_remote_bytes"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryMetrics. @@ -8883,15 +9288,15 @@ func (o QueryMetrics_SdkV2) Type(ctx context.Context) attr.Type { type QueryOptions_SdkV2 struct { // The name of the catalog to execute this query in. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // The timestamp when this query was moved to trash. Only present when the // `is_archived` property is `true`. Trashed items are deleted after thirty // days. - MovedToTrashAt types.String `tfsdk:"moved_to_trash_at" tf:"optional"` + MovedToTrashAt types.String `tfsdk:"moved_to_trash_at"` - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // The name of the schema to execute this query in. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` } func (newState *QueryOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryOptions_SdkV2) { @@ -8900,10 +9305,13 @@ func (newState *QueryOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *QueryOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryOptions_SdkV2) { } -func (c QueryOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Parameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c QueryOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["moved_to_trash_at"] = attrs["moved_to_trash_at"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryOptions. @@ -8976,23 +9384,23 @@ func (o *QueryOptions_SdkV2) SetParameters(ctx context.Context, v []Parameter_Sd type QueryParameter_SdkV2 struct { // Date-range query parameter value. Can only specify one of // `dynamic_date_range_value` or `date_range_value`. - DateRangeValue types.List `tfsdk:"date_range_value" tf:"optional,object"` + DateRangeValue types.List `tfsdk:"date_range_value"` // Date query parameter value. Can only specify one of `dynamic_date_value` // or `date_value`. - DateValue types.List `tfsdk:"date_value" tf:"optional,object"` + DateValue types.List `tfsdk:"date_value"` // Dropdown query parameter value. - EnumValue types.List `tfsdk:"enum_value" tf:"optional,object"` + EnumValue types.List `tfsdk:"enum_value"` // Literal parameter marker that appears between double curly braces in the // query text. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Numeric query parameter value. - NumericValue types.List `tfsdk:"numeric_value" tf:"optional,object"` + NumericValue types.List `tfsdk:"numeric_value"` // Query-based dropdown query parameter value. - QueryBackedValue types.List `tfsdk:"query_backed_value" tf:"optional,object"` + QueryBackedValue types.List `tfsdk:"query_backed_value"` // Text query parameter value. - TextValue types.List `tfsdk:"text_value" tf:"optional,object"` + TextValue types.List `tfsdk:"text_value"` // Text displayed in the user-facing parameter widget in the UI. - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` } func (newState *QueryParameter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryParameter_SdkV2) { @@ -9001,15 +9409,23 @@ func (newState *QueryParameter_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *QueryParameter_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryParameter_SdkV2) { } -func (c QueryParameter_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DateRangeValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "date_range_value")...) - DateValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "date_value")...) - EnumValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "enum_value")...) - NumericValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "numeric_value")...) - QueryBackedValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query_backed_value")...) - TextValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "text_value")...) +func (c QueryParameter_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["date_range_value"] = attrs["date_range_value"].SetOptional() + attrs["date_range_value"] = attrs["date_range_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["date_value"] = attrs["date_value"].SetOptional() + attrs["date_value"] = attrs["date_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["enum_value"] = attrs["enum_value"].SetOptional() + attrs["enum_value"] = attrs["enum_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() + attrs["numeric_value"] = attrs["numeric_value"].SetOptional() + attrs["numeric_value"] = attrs["numeric_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["query_backed_value"] = attrs["query_backed_value"].SetOptional() + attrs["query_backed_value"] = attrs["query_backed_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["text_value"] = attrs["text_value"].SetOptional() + attrs["text_value"] = attrs["text_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["title"] = attrs["title"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryParameter. @@ -9237,27 +9653,27 @@ type QueryPostContent_SdkV2 struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Exclusively used for storing a list parameter definitions. A parameter is // an object with `title`, `name`, `type`, and `value` properties. The // `value` field here is the default value. It can be overridden at runtime. - Options types.Object `tfsdk:"options" tf:"optional"` + Options types.Object `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *QueryPostContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryPostContent_SdkV2) { @@ -9266,9 +9682,17 @@ func (newState *QueryPostContent_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *QueryPostContent_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryPostContent_SdkV2) { } -func (c QueryPostContent_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c QueryPostContent_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryPostContent. @@ -9348,9 +9772,9 @@ func (o *QueryPostContent_SdkV2) SetTags(ctx context.Context, v []types.String) type RepeatedEndpointConfPairs_SdkV2 struct { // Deprecated: Use configuration_pairs - ConfigPair types.List `tfsdk:"config_pair" tf:"optional"` + ConfigPair types.List `tfsdk:"config_pair"` - ConfigurationPairs types.List `tfsdk:"configuration_pairs" tf:"optional"` + ConfigurationPairs types.List `tfsdk:"configuration_pairs"` } func (newState *RepeatedEndpointConfPairs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepeatedEndpointConfPairs_SdkV2) { @@ -9359,11 +9783,11 @@ func (newState *RepeatedEndpointConfPairs_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *RepeatedEndpointConfPairs_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepeatedEndpointConfPairs_SdkV2) { } -func (c RepeatedEndpointConfPairs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointConfPair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config_pair")...) - EndpointConfPair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "configuration_pairs")...) +func (c RepeatedEndpointConfPairs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config_pair"] = attrs["config_pair"].SetOptional() + attrs["configuration_pairs"] = attrs["configuration_pairs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepeatedEndpointConfPairs. @@ -9563,28 +9987,28 @@ func (o RestoreResponse_SdkV2) Type(ctx context.Context) attr.Type { type ResultData_SdkV2 struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount types.Int64 `tfsdk:"byte_count" tf:"optional"` + ByteCount types.Int64 `tfsdk:"byte_count"` // The position within the sequence of result set chunks. - ChunkIndex types.Int64 `tfsdk:"chunk_index" tf:"optional"` + ChunkIndex types.Int64 `tfsdk:"chunk_index"` // The `JSON_ARRAY` format is an array of arrays of values, where each // non-null value is formatted as a string. Null values are encoded as JSON // `null`. - DataArray types.List `tfsdk:"data_array" tf:"optional"` + DataArray types.List `tfsdk:"data_array"` - ExternalLinks types.List `tfsdk:"external_links" tf:"optional"` + ExternalLinks types.List `tfsdk:"external_links"` // When fetching, provides the `chunk_index` for the _next_ chunk. If // absent, indicates there are no more chunks. The next chunk can be fetched // with a :method:statementexecution/getStatementResultChunkN request. - NextChunkIndex types.Int64 `tfsdk:"next_chunk_index" tf:"optional"` + NextChunkIndex types.Int64 `tfsdk:"next_chunk_index"` // When fetching, provides a link to fetch the _next_ chunk. If absent, // indicates there are no more chunks. This link is an absolute `path` to be // joined with your `$DATABRICKS_HOST`, and should be treated as an opaque // link. This is an alternative to using `next_chunk_index`. - NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link" tf:"optional"` + NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link"` // The number of rows within the result chunk. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // The starting row offset within the result set. - RowOffset types.Int64 `tfsdk:"row_offset" tf:"optional"` + RowOffset types.Int64 `tfsdk:"row_offset"` } func (newState *ResultData_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultData_SdkV2) { @@ -9593,10 +10017,17 @@ func (newState *ResultData_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *ResultData_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResultData_SdkV2) { } -func (c ResultData_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalLink_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "external_links")...) +func (c ResultData_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_count"] = attrs["byte_count"].SetOptional() + attrs["chunk_index"] = attrs["chunk_index"].SetOptional() + attrs["data_array"] = attrs["data_array"].SetOptional() + attrs["external_links"] = attrs["external_links"].SetOptional() + attrs["next_chunk_index"] = attrs["next_chunk_index"].SetOptional() + attrs["next_chunk_internal_link"] = attrs["next_chunk_internal_link"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["row_offset"] = attrs["row_offset"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultData. @@ -9708,21 +10139,21 @@ func (o *ResultData_SdkV2) SetExternalLinks(ctx context.Context, v []ExternalLin // The result manifest provides schema and metadata for the result set. type ResultManifest_SdkV2 struct { // Array of result set chunk metadata. - Chunks types.List `tfsdk:"chunks" tf:"optional"` + Chunks types.List `tfsdk:"chunks"` - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // The schema is an ordered list of column descriptions. - Schema types.List `tfsdk:"schema" tf:"optional,object"` + Schema types.List `tfsdk:"schema"` // The total number of bytes in the result set. This field is not available // when using `INLINE` disposition. - TotalByteCount types.Int64 `tfsdk:"total_byte_count" tf:"optional"` + TotalByteCount types.Int64 `tfsdk:"total_byte_count"` // The total number of chunks that the result set has been divided into. - TotalChunkCount types.Int64 `tfsdk:"total_chunk_count" tf:"optional"` + TotalChunkCount types.Int64 `tfsdk:"total_chunk_count"` // The total number of rows in the result set. - TotalRowCount types.Int64 `tfsdk:"total_row_count" tf:"optional"` + TotalRowCount types.Int64 `tfsdk:"total_row_count"` // Indicates whether the result is truncated due to `row_limit` or // `byte_limit`. - Truncated types.Bool `tfsdk:"truncated" tf:"optional"` + Truncated types.Bool `tfsdk:"truncated"` } func (newState *ResultManifest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultManifest_SdkV2) { @@ -9731,11 +10162,17 @@ func (newState *ResultManifest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ResultManifest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResultManifest_SdkV2) { } -func (c ResultManifest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BaseChunkInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "chunks")...) - ResultSchema_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "schema")...) +func (c ResultManifest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["chunks"] = attrs["chunks"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["schema"] = attrs["schema"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["total_byte_count"] = attrs["total_byte_count"].SetOptional() + attrs["total_chunk_count"] = attrs["total_chunk_count"].SetOptional() + attrs["total_row_count"] = attrs["total_row_count"].SetOptional() + attrs["truncated"] = attrs["truncated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultManifest. @@ -9842,9 +10279,9 @@ func (o *ResultManifest_SdkV2) SetSchema(ctx context.Context, v ResultSchema_Sdk // The schema is an ordered list of column descriptions. type ResultSchema_SdkV2 struct { - ColumnCount types.Int64 `tfsdk:"column_count" tf:"optional"` + ColumnCount types.Int64 `tfsdk:"column_count"` - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` } func (newState *ResultSchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultSchema_SdkV2) { @@ -9853,10 +10290,11 @@ func (newState *ResultSchema_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ResultSchema_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResultSchema_SdkV2) { } -func (c ResultSchema_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "columns")...) +func (c ResultSchema_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column_count"] = attrs["column_count"].SetOptional() + attrs["columns"] = attrs["columns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultSchema. @@ -9923,9 +10361,9 @@ func (o *ResultSchema_SdkV2) SetColumns(ctx context.Context, v []ColumnInfo_SdkV } type ServiceError_SdkV2 struct { - ErrorCode types.String `tfsdk:"error_code" tf:"optional"` + ErrorCode types.String `tfsdk:"error_code"` // A brief summary of the error condition. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *ServiceError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServiceError_SdkV2) { @@ -9934,9 +10372,11 @@ func (newState *ServiceError_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ServiceError_SdkV2) SyncEffectiveFieldsDuringRead(existingState ServiceError_SdkV2) { } -func (c ServiceError_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServiceError_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_code"] = attrs["error_code"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServiceError. @@ -9974,7 +10414,7 @@ func (o ServiceError_SdkV2) Type(ctx context.Context) attr.Type { // Set object ACL type SetRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // Object ID. The ACL for the object with this UUID is overwritten by this // request's POST content. ObjectId types.String `tfsdk:"-"` @@ -10048,11 +10488,11 @@ func (o *SetRequest_SdkV2) SetAccessControlList(ctx context.Context, v []AccessC } type SetResponse_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // An object's type and UUID, separated by a forward slash (/) character. - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` // A singular noun object type. - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetResponse. @@ -10122,30 +10562,30 @@ func (o *SetResponse_SdkV2) SetAccessControlList(ctx context.Context, v []Access type SetWorkspaceWarehouseConfigRequest_SdkV2 struct { // Optional: Channel selection details - Channel types.List `tfsdk:"channel" tf:"optional,object"` + Channel types.List `tfsdk:"channel"` // Deprecated: Use sql_configuration_parameters - ConfigParam types.List `tfsdk:"config_param" tf:"optional,object"` + ConfigParam types.List `tfsdk:"config_param"` // Spark confs for external hive metastore configuration JSON serialized // size must be less than <= 512K - DataAccessConfig types.List `tfsdk:"data_access_config" tf:"optional"` + DataAccessConfig types.List `tfsdk:"data_access_config"` // List of Warehouse Types allowed in this workspace (limits allowed value // of the type field in CreateWarehouse and EditWarehouse). Note: Some types // cannot be disabled, they don't need to be specified in // SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing // warehouses to be converted to another type. Used by frontend to save // specific type availability in the warehouse create and edit form UI. - EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types" tf:"optional"` + EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types"` // Deprecated: Use sql_configuration_parameters - GlobalParam types.List `tfsdk:"global_param" tf:"optional,object"` + GlobalParam types.List `tfsdk:"global_param"` // GCP only: Google Service Account used to pass to cluster to access Google // Cloud Storage - GoogleServiceAccount types.String `tfsdk:"google_service_account" tf:"optional"` + GoogleServiceAccount types.String `tfsdk:"google_service_account"` // AWS Only: Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Security policy for warehouses - SecurityPolicy types.String `tfsdk:"security_policy" tf:"optional"` + SecurityPolicy types.String `tfsdk:"security_policy"` // SQL configuration parameters - SqlConfigurationParameters types.List `tfsdk:"sql_configuration_parameters" tf:"optional,object"` + SqlConfigurationParameters types.List `tfsdk:"sql_configuration_parameters"` } func (newState *SetWorkspaceWarehouseConfigRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetWorkspaceWarehouseConfigRequest_SdkV2) { @@ -10154,15 +10594,22 @@ func (newState *SetWorkspaceWarehouseConfigRequest_SdkV2) SyncEffectiveFieldsDur func (newState *SetWorkspaceWarehouseConfigRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetWorkspaceWarehouseConfigRequest_SdkV2) { } -func (c SetWorkspaceWarehouseConfigRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - RepeatedEndpointConfPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "config_param")...) - EndpointConfPair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data_access_config")...) - WarehouseTypePair_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "enabled_warehouse_types")...) - RepeatedEndpointConfPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "global_param")...) - RepeatedEndpointConfPairs_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sql_configuration_parameters")...) +func (c SetWorkspaceWarehouseConfigRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["channel"] = attrs["channel"].SetOptional() + attrs["channel"] = attrs["channel"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["config_param"] = attrs["config_param"].SetOptional() + attrs["config_param"] = attrs["config_param"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["data_access_config"] = attrs["data_access_config"].SetOptional() + attrs["enabled_warehouse_types"] = attrs["enabled_warehouse_types"].SetOptional() + attrs["global_param"] = attrs["global_param"].SetOptional() + attrs["global_param"] = attrs["global_param"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["google_service_account"] = attrs["google_service_account"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["security_policy"] = attrs["security_policy"].SetOptional() + attrs["sql_configuration_parameters"] = attrs["sql_configuration_parameters"].SetOptional() + attrs["sql_configuration_parameters"] = attrs["sql_configuration_parameters"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetWorkspaceWarehouseConfigRequest. @@ -10396,9 +10843,9 @@ func (newState *SetWorkspaceWarehouseConfigResponse_SdkV2) SyncEffectiveFieldsDu func (newState *SetWorkspaceWarehouseConfigResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState SetWorkspaceWarehouseConfigResponse_SdkV2) { } -func (c SetWorkspaceWarehouseConfigResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetWorkspaceWarehouseConfigResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetWorkspaceWarehouseConfigResponse. @@ -10474,9 +10921,9 @@ func (newState *StartWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *StartWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState StartWarehouseResponse_SdkV2) { } -func (c StartWarehouseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StartWarehouseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartWarehouseResponse. @@ -10508,7 +10955,7 @@ func (o StartWarehouseResponse_SdkV2) Type(ctx context.Context) attr.Type { type StatementParameterListItem_SdkV2 struct { // The name of a parameter marker to be substituted in the statement. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The data type, given as a string. For example: `INT`, `STRING`, // `DECIMAL(10,2)`. If no type is given the type is assumed to be `STRING`. // Complex types, such as `ARRAY`, `MAP`, and `STRUCT` are not supported. @@ -10516,10 +10963,10 @@ type StatementParameterListItem_SdkV2 struct { // reference. // // [Data types]: https://docs.databricks.com/sql/language-manual/functions/cast.html - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // The value to substitute, represented as a string. If omitted, the value // is interpreted as NULL. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *StatementParameterListItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StatementParameterListItem_SdkV2) { @@ -10528,10 +10975,12 @@ func (newState *StatementParameterListItem_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *StatementParameterListItem_SdkV2) SyncEffectiveFieldsDuringRead(existingState StatementParameterListItem_SdkV2) { } -func (c StatementParameterListItem_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c StatementParameterListItem_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["type"] = attrs["type"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StatementParameterListItem. @@ -10571,15 +11020,15 @@ func (o StatementParameterListItem_SdkV2) Type(ctx context.Context) attr.Type { type StatementResponse_SdkV2 struct { // The result manifest provides schema and metadata for the result set. - Manifest types.List `tfsdk:"manifest" tf:"optional,object"` + Manifest types.List `tfsdk:"manifest"` - Result types.List `tfsdk:"result" tf:"optional,object"` + Result types.List `tfsdk:"result"` // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. - StatementId types.String `tfsdk:"statement_id" tf:"optional"` + StatementId types.String `tfsdk:"statement_id"` // The status response includes execution state and if relevant, error // information. - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` } func (newState *StatementResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StatementResponse_SdkV2) { @@ -10588,12 +11037,16 @@ func (newState *StatementResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *StatementResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState StatementResponse_SdkV2) { } -func (c StatementResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ResultManifest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "manifest")...) - ResultData_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "result")...) - StatementStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) +func (c StatementResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["manifest"] = attrs["manifest"].SetOptional() + attrs["manifest"] = attrs["manifest"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["result"] = attrs["result"].SetOptional() + attrs["result"] = attrs["result"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["statement_id"] = attrs["statement_id"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StatementResponse. @@ -10724,7 +11177,7 @@ func (o *StatementResponse_SdkV2) SetStatus(ctx context.Context, v StatementStat // The status response includes execution state and if relevant, error // information. type StatementStatus_SdkV2 struct { - Error types.List `tfsdk:"error" tf:"optional,object"` + Error types.List `tfsdk:"error"` // Statement execution state: - `PENDING`: waiting for warehouse - // `RUNNING`: running - `SUCCEEDED`: execution was successful, result data // available for fetch - `FAILED`: execution failed; reason for failure @@ -10732,7 +11185,7 @@ type StatementStatus_SdkV2 struct { // come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` // - `CLOSED`: execution successful, and statement closed; result no longer // available for fetch - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *StatementStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan StatementStatus_SdkV2) { @@ -10741,10 +11194,12 @@ func (newState *StatementStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *StatementStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState StatementStatus_SdkV2) { } -func (c StatementStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServiceError_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "error")...) +func (c StatementStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["error"] = attrs["error"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StatementStatus. @@ -10856,9 +11311,9 @@ func (newState *StopWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *StopWarehouseResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState StopWarehouseResponse_SdkV2) { } -func (c StopWarehouseResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StopWarehouseResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StopWarehouseResponse. @@ -10889,7 +11344,7 @@ func (o StopWarehouseResponse_SdkV2) Type(ctx context.Context) attr.Type { } type Success_SdkV2 struct { - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *Success_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Success_SdkV2) { @@ -10898,9 +11353,10 @@ func (newState *Success_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Succ func (newState *Success_SdkV2) SyncEffectiveFieldsDuringRead(existingState Success_SdkV2) { } -func (c Success_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Success_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Success. @@ -10936,12 +11392,12 @@ func (o Success_SdkV2) Type(ctx context.Context) attr.Type { type TerminationReason_SdkV2 struct { // status code indicating why the cluster was terminated - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // list of parameters that provide additional information about why the // cluster was terminated - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` // type of the termination - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *TerminationReason_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TerminationReason_SdkV2) { @@ -10950,9 +11406,12 @@ func (newState *TerminationReason_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *TerminationReason_SdkV2) SyncEffectiveFieldsDuringRead(existingState TerminationReason_SdkV2) { } -func (c TerminationReason_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TerminationReason_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TerminationReason. @@ -11021,7 +11480,7 @@ func (o *TerminationReason_SdkV2) SetParameters(ctx context.Context, v map[strin } type TextValue_SdkV2 struct { - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *TextValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TextValue_SdkV2) { @@ -11030,9 +11489,10 @@ func (newState *TextValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Te func (newState *TextValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState TextValue_SdkV2) { } -func (c TextValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TextValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TextValue. @@ -11068,9 +11528,9 @@ func (o TextValue_SdkV2) Type(ctx context.Context) attr.Type { type TimeRange_SdkV2 struct { // The end time in milliseconds. - EndTimeMs types.Int64 `tfsdk:"end_time_ms" tf:"optional"` + EndTimeMs types.Int64 `tfsdk:"end_time_ms"` // The start time in milliseconds. - StartTimeMs types.Int64 `tfsdk:"start_time_ms" tf:"optional"` + StartTimeMs types.Int64 `tfsdk:"start_time_ms"` } func (newState *TimeRange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TimeRange_SdkV2) { @@ -11079,9 +11539,11 @@ func (newState *TimeRange_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ti func (newState *TimeRange_SdkV2) SyncEffectiveFieldsDuringRead(existingState TimeRange_SdkV2) { } -func (c TimeRange_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TimeRange_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time_ms"] = attrs["end_time_ms"].SetOptional() + attrs["start_time_ms"] = attrs["start_time_ms"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TimeRange. @@ -11119,7 +11581,7 @@ func (o TimeRange_SdkV2) Type(ctx context.Context) attr.Type { type TransferOwnershipObjectId_SdkV2 struct { // Email address for the new owner, who must exist in the workspace. - NewOwner types.String `tfsdk:"new_owner" tf:"optional"` + NewOwner types.String `tfsdk:"new_owner"` } func (newState *TransferOwnershipObjectId_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan TransferOwnershipObjectId_SdkV2) { @@ -11128,9 +11590,10 @@ func (newState *TransferOwnershipObjectId_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *TransferOwnershipObjectId_SdkV2) SyncEffectiveFieldsDuringRead(existingState TransferOwnershipObjectId_SdkV2) { } -func (c TransferOwnershipObjectId_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TransferOwnershipObjectId_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["new_owner"] = attrs["new_owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransferOwnershipObjectId. @@ -11167,7 +11630,7 @@ func (o TransferOwnershipObjectId_SdkV2) Type(ctx context.Context) attr.Type { // Transfer object ownership type TransferOwnershipRequest_SdkV2 struct { // Email address for the new owner, who must exist in the workspace. - NewOwner types.String `tfsdk:"new_owner" tf:"optional"` + NewOwner types.String `tfsdk:"new_owner"` // The ID of the object on which to change ownership. ObjectId types.List `tfsdk:"-"` // The type of object on which to change ownership. @@ -11312,14 +11775,14 @@ func (o TrashQueryRequest_SdkV2) Type(ctx context.Context) attr.Type { } type UpdateAlertRequest_SdkV2 struct { - Alert types.List `tfsdk:"alert" tf:"optional,object"` + Alert types.List `tfsdk:"alert"` Id types.String `tfsdk:"-"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` } func (newState *UpdateAlertRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAlertRequest_SdkV2) { @@ -11328,12 +11791,13 @@ func (newState *UpdateAlertRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateAlertRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateAlertRequest_SdkV2) { } -func (c UpdateAlertRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateAlertRequestAlert_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "alert")...) - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "update_mask")...) +func (c UpdateAlertRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert"] = attrs["alert"].SetOptional() + attrs["alert"] = attrs["alert"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["id"] = attrs["id"].SetRequired() + attrs["update_mask"] = attrs["update_mask"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAlertRequest. @@ -11403,31 +11867,31 @@ func (o *UpdateAlertRequest_SdkV2) SetAlert(ctx context.Context, v UpdateAlertRe type UpdateAlertRequestAlert_SdkV2 struct { // Trigger conditions of the alert. - Condition types.List `tfsdk:"condition" tf:"optional,object"` + Condition types.List `tfsdk:"condition"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` } func (newState *UpdateAlertRequestAlert_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAlertRequestAlert_SdkV2) { @@ -11436,10 +11900,18 @@ func (newState *UpdateAlertRequestAlert_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *UpdateAlertRequestAlert_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateAlertRequestAlert_SdkV2) { } -func (c UpdateAlertRequestAlert_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c UpdateAlertRequestAlert_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["condition"] = attrs["condition"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAlertRequestAlert. @@ -11520,12 +11992,12 @@ func (o *UpdateAlertRequestAlert_SdkV2) SetCondition(ctx context.Context, v Aler type UpdateQueryRequest_SdkV2 struct { Id types.String `tfsdk:"-"` - Query types.List `tfsdk:"query" tf:"optional,object"` + Query types.List `tfsdk:"query"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` } func (newState *UpdateQueryRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateQueryRequest_SdkV2) { @@ -11534,12 +12006,13 @@ func (newState *UpdateQueryRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateQueryRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateQueryRequest_SdkV2) { } -func (c UpdateQueryRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - UpdateQueryRequestQuery_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "query")...) - cs.SetRequired(append(path, "update_mask")...) +func (c UpdateQueryRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["query"] = attrs["query"].SetOptional() + attrs["query"] = attrs["query"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["update_mask"] = attrs["update_mask"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateQueryRequest. @@ -11609,29 +12082,29 @@ func (o *UpdateQueryRequest_SdkV2) SetQuery(ctx context.Context, v UpdateQueryRe type UpdateQueryRequestQuery_SdkV2 struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Username of the user that owns the query. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *UpdateQueryRequestQuery_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateQueryRequestQuery_SdkV2) { @@ -11640,10 +12113,20 @@ func (newState *UpdateQueryRequestQuery_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *UpdateQueryRequestQuery_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateQueryRequestQuery_SdkV2) { } -func (c UpdateQueryRequestQuery_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c UpdateQueryRequestQuery_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateQueryRequestQuery. @@ -11792,9 +12275,9 @@ type UpdateVisualizationRequest_SdkV2 struct { // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` - Visualization types.List `tfsdk:"visualization" tf:"optional,object"` + Visualization types.List `tfsdk:"visualization"` } func (newState *UpdateVisualizationRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateVisualizationRequest_SdkV2) { @@ -11803,12 +12286,13 @@ func (newState *UpdateVisualizationRequest_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *UpdateVisualizationRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateVisualizationRequest_SdkV2) { } -func (c UpdateVisualizationRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "update_mask")...) - UpdateVisualizationRequestVisualization_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "visualization")...) +func (c UpdateVisualizationRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["update_mask"] = attrs["update_mask"].SetRequired() + attrs["visualization"] = attrs["visualization"].SetOptional() + attrs["visualization"] = attrs["visualization"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateVisualizationRequest. @@ -11878,17 +12362,17 @@ func (o *UpdateVisualizationRequest_SdkV2) SetVisualization(ctx context.Context, type UpdateVisualizationRequestVisualization_SdkV2 struct { // The display name of the visualization. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions types.String `tfsdk:"serialized_options" tf:"optional"` + SerializedOptions types.String `tfsdk:"serialized_options"` // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan types.String `tfsdk:"serialized_query_plan" tf:"optional"` + SerializedQueryPlan types.String `tfsdk:"serialized_query_plan"` // The type of visualization: counter, table, funnel, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *UpdateVisualizationRequestVisualization_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateVisualizationRequestVisualization_SdkV2) { @@ -11897,9 +12381,13 @@ func (newState *UpdateVisualizationRequestVisualization_SdkV2) SyncEffectiveFiel func (newState *UpdateVisualizationRequestVisualization_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateVisualizationRequestVisualization_SdkV2) { } -func (c UpdateVisualizationRequestVisualization_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateVisualizationRequestVisualization_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["serialized_options"] = attrs["serialized_options"].SetOptional() + attrs["serialized_query_plan"] = attrs["serialized_query_plan"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateVisualizationRequestVisualization. @@ -11940,11 +12428,11 @@ func (o UpdateVisualizationRequestVisualization_SdkV2) Type(ctx context.Context) } type User_SdkV2 struct { - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *User_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan User_SdkV2) { @@ -11953,9 +12441,12 @@ func (newState *User_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan User_Sd func (newState *User_SdkV2) SyncEffectiveFieldsDuringRead(existingState User_SdkV2) { } -func (c User_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c User_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["email"] = attrs["email"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in User. @@ -11995,25 +12486,25 @@ func (o User_SdkV2) Type(ctx context.Context) attr.Type { type Visualization_SdkV2 struct { // The timestamp indicating when the visualization was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // The display name of the visualization. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the visualization. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // UUID of the query that the visualization is attached to. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions types.String `tfsdk:"serialized_options" tf:"optional"` + SerializedOptions types.String `tfsdk:"serialized_options"` // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan types.String `tfsdk:"serialized_query_plan" tf:"optional"` + SerializedQueryPlan types.String `tfsdk:"serialized_query_plan"` // The type of visualization: counter, table, funnel, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // The timestamp indicating when the visualization was updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *Visualization_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Visualization_SdkV2) { @@ -12022,9 +12513,17 @@ func (newState *Visualization_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *Visualization_SdkV2) SyncEffectiveFieldsDuringRead(existingState Visualization_SdkV2) { } -func (c Visualization_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Visualization_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["serialized_options"] = attrs["serialized_options"].SetOptional() + attrs["serialized_query_plan"] = attrs["serialized_query_plan"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Visualization. @@ -12074,13 +12573,13 @@ func (o Visualization_SdkV2) Type(ctx context.Context) attr.Type { type WarehouseAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WarehouseAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehouseAccessControlRequest_SdkV2) { @@ -12089,9 +12588,13 @@ func (newState *WarehouseAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCr func (newState *WarehouseAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehouseAccessControlRequest_SdkV2) { } -func (c WarehouseAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehouseAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehouseAccessControlRequest. @@ -12133,15 +12636,15 @@ func (o WarehouseAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type type WarehouseAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WarehouseAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehouseAccessControlResponse_SdkV2) { @@ -12150,10 +12653,14 @@ func (newState *WarehouseAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringC func (newState *WarehouseAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehouseAccessControlResponse_SdkV2) { } -func (c WarehouseAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehousePermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c WarehouseAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehouseAccessControlResponse. @@ -12226,11 +12733,11 @@ func (o *WarehouseAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Con } type WarehousePermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WarehousePermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehousePermission_SdkV2) { @@ -12239,9 +12746,12 @@ func (newState *WarehousePermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *WarehousePermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehousePermission_SdkV2) { } -func (c WarehousePermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehousePermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermission. @@ -12310,11 +12820,11 @@ func (o *WarehousePermission_SdkV2) SetInheritedFromObject(ctx context.Context, } type WarehousePermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *WarehousePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehousePermissions_SdkV2) { @@ -12323,10 +12833,12 @@ func (newState *WarehousePermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *WarehousePermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehousePermissions_SdkV2) { } -func (c WarehousePermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehouseAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c WarehousePermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermissions. @@ -12395,9 +12907,9 @@ func (o *WarehousePermissions_SdkV2) SetAccessControlList(ctx context.Context, v } type WarehousePermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WarehousePermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehousePermissionsDescription_SdkV2) { @@ -12406,9 +12918,11 @@ func (newState *WarehousePermissionsDescription_SdkV2) SyncEffectiveFieldsDuring func (newState *WarehousePermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehousePermissionsDescription_SdkV2) { } -func (c WarehousePermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehousePermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermissionsDescription. @@ -12445,7 +12959,7 @@ func (o WarehousePermissionsDescription_SdkV2) Type(ctx context.Context) attr.Ty } type WarehousePermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The SQL warehouse for which to get or manage permissions. WarehouseId types.String `tfsdk:"-"` } @@ -12456,11 +12970,11 @@ func (newState *WarehousePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *WarehousePermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehousePermissionsRequest_SdkV2) { } -func (c WarehousePermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehouseAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "warehouse_id")...) +func (c WarehousePermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermissionsRequest. @@ -12529,9 +13043,9 @@ func (o *WarehousePermissionsRequest_SdkV2) SetAccessControlList(ctx context.Con type WarehouseTypePair_SdkV2 struct { // If set to false the specific warehouse type will not be be allowed as a // value for warehouse_type in CreateWarehouse and EditWarehouse - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // Warehouse type: `PRO` or `CLASSIC`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *WarehouseTypePair_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehouseTypePair_SdkV2) { @@ -12540,9 +13054,11 @@ func (newState *WarehouseTypePair_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *WarehouseTypePair_SdkV2) SyncEffectiveFieldsDuringRead(existingState WarehouseTypePair_SdkV2) { } -func (c WarehouseTypePair_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehouseTypePair_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehouseTypePair. @@ -12580,17 +13096,17 @@ func (o WarehouseTypePair_SdkV2) Type(ctx context.Context) attr.Type { type Widget_SdkV2 struct { // The unique ID for this widget. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Options types.List `tfsdk:"options" tf:"optional,object"` + Options types.List `tfsdk:"options"` // The visualization description API changes frequently and is unsupported. // You can duplicate a visualization by copying description objects received // _from the API_ and then using them to create a new one with a POST // request to the same endpoint. Databricks does not recommend constructing // ad-hoc visualizations entirely in JSON. - Visualization types.List `tfsdk:"visualization" tf:"optional,object"` + Visualization types.List `tfsdk:"visualization"` // Unused field. - Width types.Int64 `tfsdk:"width" tf:"optional"` + Width types.Int64 `tfsdk:"width"` } func (newState *Widget_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Widget_SdkV2) { @@ -12599,11 +13115,15 @@ func (newState *Widget_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Widge func (newState *Widget_SdkV2) SyncEffectiveFieldsDuringRead(existingState Widget_SdkV2) { } -func (c Widget_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WidgetOptions_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "options")...) - LegacyVisualization_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "visualization")...) +func (c Widget_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["options"] = attrs["options"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["visualization"] = attrs["visualization"].SetOptional() + attrs["visualization"] = attrs["visualization"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["width"] = attrs["width"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Widget. @@ -12704,22 +13224,22 @@ func (o *Widget_SdkV2) SetVisualization(ctx context.Context, v LegacyVisualizati type WidgetOptions_SdkV2 struct { // Timestamp when this object was created - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Custom description of the widget - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Whether this widget is hidden on the dashboard. - IsHidden types.Bool `tfsdk:"isHidden" tf:"optional"` + IsHidden types.Bool `tfsdk:"isHidden"` // How parameters used by the visualization in this widget relate to other // widgets on the dashboard. Databricks does not recommend modifying this // definition in JSON. - ParameterMappings types.Object `tfsdk:"parameterMappings" tf:"optional"` + ParameterMappings types.Object `tfsdk:"parameterMappings"` // Coordinates of this widget on a dashboard. This portion of the API // changes frequently and is unsupported. - Position types.List `tfsdk:"position" tf:"optional,object"` + Position types.List `tfsdk:"position"` // Custom title of the widget - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` // Timestamp of the last time this object was updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` } func (newState *WidgetOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WidgetOptions_SdkV2) { @@ -12728,10 +13248,17 @@ func (newState *WidgetOptions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *WidgetOptions_SdkV2) SyncEffectiveFieldsDuringRead(existingState WidgetOptions_SdkV2) { } -func (c WidgetOptions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WidgetPosition_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "position")...) +func (c WidgetOptions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["isHidden"] = attrs["isHidden"].SetOptional() + attrs["parameterMappings"] = attrs["parameterMappings"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["position"] = attrs["position"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["title"] = attrs["title"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WidgetOptions. @@ -12811,15 +13338,15 @@ func (o *WidgetOptions_SdkV2) SetPosition(ctx context.Context, v WidgetPosition_ // frequently and is unsupported. type WidgetPosition_SdkV2 struct { // reserved for internal use - AutoHeight types.Bool `tfsdk:"autoHeight" tf:"optional"` + AutoHeight types.Bool `tfsdk:"autoHeight"` // column in the dashboard grid. Values start with 0 - Col types.Int64 `tfsdk:"col" tf:"optional"` + Col types.Int64 `tfsdk:"col"` // row in the dashboard grid. Values start with 0 - Row types.Int64 `tfsdk:"row" tf:"optional"` + Row types.Int64 `tfsdk:"row"` // width of the widget measured in dashboard grid cells - SizeX types.Int64 `tfsdk:"sizeX" tf:"optional"` + SizeX types.Int64 `tfsdk:"sizeX"` // height of the widget measured in dashboard grid cells - SizeY types.Int64 `tfsdk:"sizeY" tf:"optional"` + SizeY types.Int64 `tfsdk:"sizeY"` } func (newState *WidgetPosition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WidgetPosition_SdkV2) { @@ -12828,9 +13355,14 @@ func (newState *WidgetPosition_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *WidgetPosition_SdkV2) SyncEffectiveFieldsDuringRead(existingState WidgetPosition_SdkV2) { } -func (c WidgetPosition_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WidgetPosition_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoHeight"] = attrs["autoHeight"].SetOptional() + attrs["col"] = attrs["col"].SetOptional() + attrs["row"] = attrs["row"].SetOptional() + attrs["sizeX"] = attrs["sizeX"].SetOptional() + attrs["sizeY"] = attrs["sizeY"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WidgetPosition. diff --git a/internal/service/sql_tf/model.go b/internal/service/sql_tf/model.go index 34b9598d9..fd7d82ca9 100755 --- a/internal/service/sql_tf/model.go +++ b/internal/service/sql_tf/model.go @@ -23,12 +23,12 @@ import ( ) type AccessControl struct { - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *AccessControl) SyncEffectiveFieldsDuringCreateOrUpdate(plan AccessControl) { @@ -37,9 +37,12 @@ func (newState *AccessControl) SyncEffectiveFieldsDuringCreateOrUpdate(plan Acce func (newState *AccessControl) SyncEffectiveFieldsDuringRead(existingState AccessControl) { } -func (c AccessControl) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AccessControl) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AccessControl. @@ -79,48 +82,48 @@ func (o AccessControl) Type(ctx context.Context) attr.Type { type Alert struct { // Trigger conditions of the alert. - Condition types.Object `tfsdk:"condition" tf:"optional,object"` + Condition types.Object `tfsdk:"condition"` // The timestamp indicating when the alert was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the alert. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The workspace state of the alert. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // The workspace path of the folder containing the alert. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` // Current state of the alert's trigger status. This field is set to UNKNOWN // if the alert has not yet been evaluated or ran into an error during the // last evaluation. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Timestamp when the alert was last triggered, if the alert has been // triggered before. - TriggerTime types.String `tfsdk:"trigger_time" tf:"optional"` + TriggerTime types.String `tfsdk:"trigger_time"` // The timestamp indicating when the alert was updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *Alert) SyncEffectiveFieldsDuringCreateOrUpdate(plan Alert) { @@ -129,10 +132,24 @@ func (newState *Alert) SyncEffectiveFieldsDuringCreateOrUpdate(plan Alert) { func (newState *Alert) SyncEffectiveFieldsDuringRead(existingState Alert) { } -func (c Alert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c Alert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["trigger_time"] = attrs["trigger_time"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Alert. @@ -226,14 +243,14 @@ func (o *Alert) SetCondition(ctx context.Context, v AlertCondition) { type AlertCondition struct { // Alert state if result is empty. - EmptyResultState types.String `tfsdk:"empty_result_state" tf:"optional"` + EmptyResultState types.String `tfsdk:"empty_result_state"` // Operator used for comparison in alert evaluation. - Op types.String `tfsdk:"op" tf:"optional"` + Op types.String `tfsdk:"op"` // Name of the column from the query result to use for comparison in alert // evaluation. - Operand types.Object `tfsdk:"operand" tf:"optional,object"` + Operand types.Object `tfsdk:"operand"` // Threshold value used for comparison in alert evaluation. - Threshold types.Object `tfsdk:"threshold" tf:"optional,object"` + Threshold types.Object `tfsdk:"threshold"` } func (newState *AlertCondition) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertCondition) { @@ -242,11 +259,13 @@ func (newState *AlertCondition) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ale func (newState *AlertCondition) SyncEffectiveFieldsDuringRead(existingState AlertCondition) { } -func (c AlertCondition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertConditionOperand{}.ApplySchemaCustomizations(cs, append(path, "operand")...) - AlertConditionThreshold{}.ApplySchemaCustomizations(cs, append(path, "threshold")...) +func (c AlertCondition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["empty_result_state"] = attrs["empty_result_state"].SetOptional() + attrs["op"] = attrs["op"].SetOptional() + attrs["operand"] = attrs["operand"].SetOptional() + attrs["threshold"] = attrs["threshold"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertCondition. @@ -346,7 +365,7 @@ func (o *AlertCondition) SetThreshold(ctx context.Context, v AlertConditionThres } type AlertConditionOperand struct { - Column types.Object `tfsdk:"column" tf:"optional,object"` + Column types.Object `tfsdk:"column"` } func (newState *AlertConditionOperand) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertConditionOperand) { @@ -355,10 +374,10 @@ func (newState *AlertConditionOperand) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *AlertConditionOperand) SyncEffectiveFieldsDuringRead(existingState AlertConditionOperand) { } -func (c AlertConditionOperand) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertOperandColumn{}.ApplySchemaCustomizations(cs, append(path, "column")...) +func (c AlertConditionOperand) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column"] = attrs["column"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertConditionOperand. @@ -423,7 +442,7 @@ func (o *AlertConditionOperand) SetColumn(ctx context.Context, v AlertOperandCol } type AlertConditionThreshold struct { - Value types.Object `tfsdk:"value" tf:"optional,object"` + Value types.Object `tfsdk:"value"` } func (newState *AlertConditionThreshold) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertConditionThreshold) { @@ -432,10 +451,10 @@ func (newState *AlertConditionThreshold) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *AlertConditionThreshold) SyncEffectiveFieldsDuringRead(existingState AlertConditionThreshold) { } -func (c AlertConditionThreshold) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertOperandValue{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c AlertConditionThreshold) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertConditionThreshold. @@ -500,7 +519,7 @@ func (o *AlertConditionThreshold) SetValue(ctx context.Context, v AlertOperandVa } type AlertOperandColumn struct { - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *AlertOperandColumn) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertOperandColumn) { @@ -509,9 +528,10 @@ func (newState *AlertOperandColumn) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AlertOperandColumn) SyncEffectiveFieldsDuringRead(existingState AlertOperandColumn) { } -func (c AlertOperandColumn) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AlertOperandColumn) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertOperandColumn. @@ -546,11 +566,11 @@ func (o AlertOperandColumn) Type(ctx context.Context) attr.Type { } type AlertOperandValue struct { - BoolValue types.Bool `tfsdk:"bool_value" tf:"optional"` + BoolValue types.Bool `tfsdk:"bool_value"` - DoubleValue types.Float64 `tfsdk:"double_value" tf:"optional"` + DoubleValue types.Float64 `tfsdk:"double_value"` - StringValue types.String `tfsdk:"string_value" tf:"optional"` + StringValue types.String `tfsdk:"string_value"` } func (newState *AlertOperandValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertOperandValue) { @@ -559,9 +579,12 @@ func (newState *AlertOperandValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *AlertOperandValue) SyncEffectiveFieldsDuringRead(existingState AlertOperandValue) { } -func (c AlertOperandValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c AlertOperandValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bool_value"] = attrs["bool_value"].SetOptional() + attrs["double_value"] = attrs["double_value"].SetOptional() + attrs["string_value"] = attrs["string_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertOperandValue. @@ -602,29 +625,29 @@ func (o AlertOperandValue) Type(ctx context.Context) attr.Type { // Alert configuration options. type AlertOptions struct { // Name of column in the query result to compare in alert evaluation. - Column types.String `tfsdk:"column" tf:""` + Column types.String `tfsdk:"column"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This includes email // subject, Slack notification header, etc. See [here] for custom templating // instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // State that alert evaluates to when query result is empty. - EmptyResultState types.String `tfsdk:"empty_result_state" tf:"optional"` + EmptyResultState types.String `tfsdk:"empty_result_state"` // Whether or not the alert is muted. If an alert is muted, it will not // notify users and notification destinations when triggered. - Muted types.Bool `tfsdk:"muted" tf:"optional"` + Muted types.Bool `tfsdk:"muted"` // Operator used to compare in alert evaluation: `>`, `>=`, `<`, `<=`, `==`, // `!=` - Op types.String `tfsdk:"op" tf:""` + Op types.String `tfsdk:"op"` // Value used to compare in alert evaluation. Supported types include // strings (eg. 'foobar'), floats (eg. 123.4), and booleans (true). - Value types.Object `tfsdk:"value" tf:""` + Value types.Object `tfsdk:"value"` } func (newState *AlertOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertOptions) { @@ -633,12 +656,16 @@ func (newState *AlertOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan Alert func (newState *AlertOptions) SyncEffectiveFieldsDuringRead(existingState AlertOptions) { } -func (c AlertOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "column")...) - cs.SetRequired(append(path, "op")...) - cs.SetRequired(append(path, "value")...) +func (c AlertOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column"] = attrs["column"].SetRequired() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["empty_result_state"] = attrs["empty_result_state"].SetOptional() + attrs["muted"] = attrs["muted"].SetOptional() + attrs["op"] = attrs["op"].SetRequired() + attrs["value"] = attrs["value"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertOptions. @@ -686,44 +713,44 @@ func (o AlertOptions) Type(ctx context.Context) attr.Type { type AlertQuery struct { // The timestamp when this query was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Data source ID maps to the ID of the data source used by the resource and // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Query ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Indicates whether the query is trashed. Trashed queries can't be used in // dashboards, or appear in search results. If this boolean is `true`, the // `options` property for this query includes a `moved_to_trash_at` // timestamp. Trashed queries are permanently deleted after 30 days. - IsArchived types.Bool `tfsdk:"is_archived" tf:"optional"` + IsArchived types.Bool `tfsdk:"is_archived"` // Whether the query is a draft. Draft queries only appear in list views for // their owners. Visualizations from draft queries cannot appear on // dashboards. - IsDraft types.Bool `tfsdk:"is_draft" tf:"optional"` + IsDraft types.Bool `tfsdk:"is_draft"` // Text parameter types are not safe from SQL injection for all types of // data source. Set this Boolean parameter to `true` if a query either does // not use any text type parameters or uses a data source type where text // type parameters are handled safely. - IsSafe types.Bool `tfsdk:"is_safe" tf:"optional"` + IsSafe types.Bool `tfsdk:"is_safe"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - Options types.Object `tfsdk:"options" tf:"optional,object"` + Options types.Object `tfsdk:"options"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The timestamp at which this query was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` // The ID of the user who owns the query. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` } func (newState *AlertQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertQuery) { @@ -732,10 +759,22 @@ func (newState *AlertQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan AlertQu func (newState *AlertQuery) SyncEffectiveFieldsDuringRead(existingState AlertQuery) { } -func (c AlertQuery) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) +func (c AlertQuery) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_archived"] = attrs["is_archived"].SetOptional() + attrs["is_draft"] = attrs["is_draft"].SetOptional() + attrs["is_safe"] = attrs["is_safe"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AlertQuery. @@ -858,13 +897,13 @@ func (o *AlertQuery) SetTags(ctx context.Context, v []types.String) { type BaseChunkInfo struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount types.Int64 `tfsdk:"byte_count" tf:"optional"` + ByteCount types.Int64 `tfsdk:"byte_count"` // The position within the sequence of result set chunks. - ChunkIndex types.Int64 `tfsdk:"chunk_index" tf:"optional"` + ChunkIndex types.Int64 `tfsdk:"chunk_index"` // The number of rows within the result chunk. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // The starting row offset within the result set. - RowOffset types.Int64 `tfsdk:"row_offset" tf:"optional"` + RowOffset types.Int64 `tfsdk:"row_offset"` } func (newState *BaseChunkInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseChunkInfo) { @@ -873,9 +912,13 @@ func (newState *BaseChunkInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Base func (newState *BaseChunkInfo) SyncEffectiveFieldsDuringRead(existingState BaseChunkInfo) { } -func (c BaseChunkInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c BaseChunkInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_count"] = attrs["byte_count"].SetOptional() + attrs["chunk_index"] = attrs["chunk_index"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["row_offset"] = attrs["row_offset"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in BaseChunkInfo. @@ -986,9 +1029,9 @@ func (o CancelExecutionResponse) Type(ctx context.Context) attr.Type { // Configures the channel name and DBSQL version of the warehouse. // CHANNEL_NAME_CUSTOM should be chosen only when `dbsql_version` is specified. type Channel struct { - DbsqlVersion types.String `tfsdk:"dbsql_version" tf:"optional"` + DbsqlVersion types.String `tfsdk:"dbsql_version"` - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *Channel) SyncEffectiveFieldsDuringCreateOrUpdate(plan Channel) { @@ -997,9 +1040,11 @@ func (newState *Channel) SyncEffectiveFieldsDuringCreateOrUpdate(plan Channel) { func (newState *Channel) SyncEffectiveFieldsDuringRead(existingState Channel) { } -func (c Channel) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Channel) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbsql_version"] = attrs["dbsql_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Channel. @@ -1038,9 +1083,9 @@ func (o Channel) Type(ctx context.Context) attr.Type { // Details about a Channel. type ChannelInfo struct { // DB SQL Version the Channel is mapped to. - DbsqlVersion types.String `tfsdk:"dbsql_version" tf:"optional"` + DbsqlVersion types.String `tfsdk:"dbsql_version"` // Name of the channel - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ChannelInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ChannelInfo) { @@ -1049,9 +1094,11 @@ func (newState *ChannelInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Channe func (newState *ChannelInfo) SyncEffectiveFieldsDuringRead(existingState ChannelInfo) { } -func (c ChannelInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ChannelInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dbsql_version"] = attrs["dbsql_version"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ChannelInfo. @@ -1089,22 +1136,22 @@ func (o ChannelInfo) Type(ctx context.Context) attr.Type { type ColumnInfo struct { // The name of the column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The ordinal position of the column (starting at position 0). - Position types.Int64 `tfsdk:"position" tf:"optional"` + Position types.Int64 `tfsdk:"position"` // The format of the interval type. - TypeIntervalType types.String `tfsdk:"type_interval_type" tf:"optional"` + TypeIntervalType types.String `tfsdk:"type_interval_type"` // The name of the base data type. This doesn't include details for complex // types such as STRUCT, MAP or ARRAY. - TypeName types.String `tfsdk:"type_name" tf:"optional"` + TypeName types.String `tfsdk:"type_name"` // Specifies the number of digits in a number. This applies to the DECIMAL // type. - TypePrecision types.Int64 `tfsdk:"type_precision" tf:"optional"` + TypePrecision types.Int64 `tfsdk:"type_precision"` // Specifies the number of digits to the right of the decimal point in a // number. This applies to the DECIMAL type. - TypeScale types.Int64 `tfsdk:"type_scale" tf:"optional"` + TypeScale types.Int64 `tfsdk:"type_scale"` // The full SQL type specification. - TypeText types.String `tfsdk:"type_text" tf:"optional"` + TypeText types.String `tfsdk:"type_text"` } func (newState *ColumnInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnInfo) { @@ -1113,9 +1160,16 @@ func (newState *ColumnInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnI func (newState *ColumnInfo) SyncEffectiveFieldsDuringRead(existingState ColumnInfo) { } -func (c ColumnInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ColumnInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["type_interval_type"] = attrs["type_interval_type"].SetOptional() + attrs["type_name"] = attrs["type_name"].SetOptional() + attrs["type_precision"] = attrs["type_precision"].SetOptional() + attrs["type_scale"] = attrs["type_scale"].SetOptional() + attrs["type_text"] = attrs["type_text"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnInfo. @@ -1163,17 +1217,17 @@ func (o ColumnInfo) Type(ctx context.Context) attr.Type { type CreateAlert struct { // Name of the alert. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Alert configuration options. - Options types.Object `tfsdk:"options" tf:"object"` + Options types.Object `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // Query ID. - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm types.Int64 `tfsdk:"rearm" tf:"optional"` + Rearm types.Int64 `tfsdk:"rearm"` } func (newState *CreateAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAlert) { @@ -1182,13 +1236,14 @@ func (newState *CreateAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan Create func (newState *CreateAlert) SyncEffectiveFieldsDuringRead(existingState CreateAlert) { } -func (c CreateAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) - AlertOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - cs.SetRequired(append(path, "query_id")...) +func (c CreateAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetRequired() + attrs["rearm"] = attrs["rearm"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAlert. @@ -1261,7 +1316,7 @@ func (o *CreateAlert) SetOptions(ctx context.Context, v AlertOptions) { } type CreateAlertRequest struct { - Alert types.Object `tfsdk:"alert" tf:"optional,object"` + Alert types.Object `tfsdk:"alert"` } func (newState *CreateAlertRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAlertRequest) { @@ -1270,10 +1325,10 @@ func (newState *CreateAlertRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateAlertRequest) SyncEffectiveFieldsDuringRead(existingState CreateAlertRequest) { } -func (c CreateAlertRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateAlertRequestAlert{}.ApplySchemaCustomizations(cs, append(path, "alert")...) +func (c CreateAlertRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert"] = attrs["alert"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAlertRequest. @@ -1339,30 +1394,30 @@ func (o *CreateAlertRequest) SetAlert(ctx context.Context, v CreateAlertRequestA type CreateAlertRequestAlert struct { // Trigger conditions of the alert. - Condition types.Object `tfsdk:"condition" tf:"optional,object"` + Condition types.Object `tfsdk:"condition"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The workspace path of the folder containing the alert. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` } func (newState *CreateAlertRequestAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAlertRequestAlert) { @@ -1371,10 +1426,17 @@ func (newState *CreateAlertRequestAlert) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateAlertRequestAlert) SyncEffectiveFieldsDuringRead(existingState CreateAlertRequestAlert) { } -func (c CreateAlertRequestAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c CreateAlertRequestAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAlertRequestAlert. @@ -1453,7 +1515,7 @@ func (o *CreateAlertRequestAlert) SetCondition(ctx context.Context, v AlertCondi } type CreateQueryRequest struct { - Query types.Object `tfsdk:"query" tf:"optional,object"` + Query types.Object `tfsdk:"query"` } func (newState *CreateQueryRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateQueryRequest) { @@ -1462,10 +1524,10 @@ func (newState *CreateQueryRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateQueryRequest) SyncEffectiveFieldsDuringRead(existingState CreateQueryRequest) { } -func (c CreateQueryRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateQueryRequestQuery{}.ApplySchemaCustomizations(cs, append(path, "query")...) +func (c CreateQueryRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query"] = attrs["query"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateQueryRequest. @@ -1531,29 +1593,29 @@ func (o *CreateQueryRequest) SetQuery(ctx context.Context, v CreateQueryRequestQ type CreateQueryRequestQuery struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Workspace path of the workspace folder containing the object. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *CreateQueryRequestQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateQueryRequestQuery) { @@ -1562,10 +1624,20 @@ func (newState *CreateQueryRequestQuery) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateQueryRequestQuery) SyncEffectiveFieldsDuringRead(existingState CreateQueryRequestQuery) { } -func (c CreateQueryRequestQuery) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c CreateQueryRequestQuery) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateQueryRequestQuery. @@ -1682,18 +1754,18 @@ func (o *CreateQueryRequestQuery) SetTags(ctx context.Context, v []types.String) type CreateQueryVisualizationsLegacyRequest struct { // A short description of this visualization. This is not displayed in the // UI. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The name of the visualization that appears on dashboards and the query // screen. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The options object varies widely from one visualization type to the next // and is unsupported. Databricks does not recommend modifying visualization // settings in JSON. - Options types.Object `tfsdk:"options" tf:""` + Options types.Object `tfsdk:"options"` // The identifier returned by :method:queries/create - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` // The type of visualization: chart, table, pivot table, and so on. - Type_ types.String `tfsdk:"type" tf:""` + Type_ types.String `tfsdk:"type"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateQueryVisualizationsLegacyRequest. @@ -1736,7 +1808,7 @@ func (o CreateQueryVisualizationsLegacyRequest) Type(ctx context.Context) attr.T } type CreateVisualizationRequest struct { - Visualization types.Object `tfsdk:"visualization" tf:"optional,object"` + Visualization types.Object `tfsdk:"visualization"` } func (newState *CreateVisualizationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVisualizationRequest) { @@ -1745,10 +1817,10 @@ func (newState *CreateVisualizationRequest) SyncEffectiveFieldsDuringCreateOrUpd func (newState *CreateVisualizationRequest) SyncEffectiveFieldsDuringRead(existingState CreateVisualizationRequest) { } -func (c CreateVisualizationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CreateVisualizationRequestVisualization{}.ApplySchemaCustomizations(cs, append(path, "visualization")...) +func (c CreateVisualizationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["visualization"] = attrs["visualization"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVisualizationRequest. @@ -1814,19 +1886,19 @@ func (o *CreateVisualizationRequest) SetVisualization(ctx context.Context, v Cre type CreateVisualizationRequestVisualization struct { // The display name of the visualization. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID of the query that the visualization is attached to. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions types.String `tfsdk:"serialized_options" tf:"optional"` + SerializedOptions types.String `tfsdk:"serialized_options"` // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan types.String `tfsdk:"serialized_query_plan" tf:"optional"` + SerializedQueryPlan types.String `tfsdk:"serialized_query_plan"` // The type of visualization: counter, table, funnel, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *CreateVisualizationRequestVisualization) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVisualizationRequestVisualization) { @@ -1835,9 +1907,14 @@ func (newState *CreateVisualizationRequestVisualization) SyncEffectiveFieldsDuri func (newState *CreateVisualizationRequestVisualization) SyncEffectiveFieldsDuringRead(existingState CreateVisualizationRequestVisualization) { } -func (c CreateVisualizationRequestVisualization) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateVisualizationRequestVisualization) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["serialized_options"] = attrs["serialized_options"].SetOptional() + attrs["serialized_query_plan"] = attrs["serialized_query_plan"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVisualizationRequestVisualization. @@ -1888,33 +1965,33 @@ type CreateWarehouseRequest struct { // autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.Object `tfsdk:"channel" tf:"optional,object"` + Channel types.Object `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -1924,23 +2001,23 @@ type CreateWarehouseRequest struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.Object `tfsdk:"tags" tf:"optional,object"` + Tags types.Object `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *CreateWarehouseRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWarehouseRequest) { @@ -1949,11 +2026,22 @@ func (newState *CreateWarehouseRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *CreateWarehouseRequest) SyncEffectiveFieldsDuringRead(existingState CreateWarehouseRequest) { } -func (c CreateWarehouseRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - EndpointTags{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c CreateWarehouseRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWarehouseRequest. @@ -2072,7 +2160,7 @@ func (o *CreateWarehouseRequest) SetTags(ctx context.Context, v EndpointTags) { type CreateWarehouseResponse struct { // Id for the SQL warehouse. This value is unique across all SQL warehouses. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` } func (newState *CreateWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWarehouseResponse) { @@ -2081,9 +2169,10 @@ func (newState *CreateWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateWarehouseResponse) SyncEffectiveFieldsDuringRead(existingState CreateWarehouseResponse) { } -func (c CreateWarehouseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c CreateWarehouseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWarehouseResponse. @@ -2119,19 +2208,19 @@ func (o CreateWarehouseResponse) Type(ctx context.Context) attr.Type { type CreateWidget struct { // Dashboard ID returned by :method:dashboards/create. - DashboardId types.String `tfsdk:"dashboard_id" tf:""` + DashboardId types.String `tfsdk:"dashboard_id"` // Widget ID returned by :method:dashboardwidgets/create Id types.String `tfsdk:"-"` - Options types.Object `tfsdk:"options" tf:"object"` + Options types.Object `tfsdk:"options"` // If this is a textbox widget, the application displays this text. This // field is ignored if the widget contains a visualization in the // `visualization` field. - Text types.String `tfsdk:"text" tf:"optional"` + Text types.String `tfsdk:"text"` // Query Vizualization ID returned by :method:queryvisualizations/create. - VisualizationId types.String `tfsdk:"visualization_id" tf:"optional"` + VisualizationId types.String `tfsdk:"visualization_id"` // Width of a widget - Width types.Int64 `tfsdk:"width" tf:""` + Width types.Int64 `tfsdk:"width"` } func (newState *CreateWidget) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateWidget) { @@ -2140,14 +2229,15 @@ func (newState *CreateWidget) SyncEffectiveFieldsDuringCreateOrUpdate(plan Creat func (newState *CreateWidget) SyncEffectiveFieldsDuringRead(existingState CreateWidget) { } -func (c CreateWidget) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "options")...) - WidgetOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - cs.SetRequired(append(path, "width")...) +func (c CreateWidget) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["id"] = attrs["id"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["text"] = attrs["text"].SetOptional() + attrs["visualization_id"] = attrs["visualization_id"].SetOptional() + attrs["width"] = attrs["width"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateWidget. @@ -2225,49 +2315,49 @@ func (o *CreateWidget) SetOptions(ctx context.Context, v WidgetOptions) { // boxes. type Dashboard struct { // Whether the authenticated user can edit the query definition. - CanEdit types.Bool `tfsdk:"can_edit" tf:"optional"` + CanEdit types.Bool `tfsdk:"can_edit"` // Timestamp when this dashboard was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // In the web application, query filters that share a name are coupled to a // single selection box if this value is `true`. - DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled" tf:"optional"` + DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled"` // The ID for this dashboard. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Indicates whether a dashboard is trashed. Trashed dashboards won't appear // in list views. If this boolean is `true`, the `options` property for this // dashboard includes a `moved_to_trash_at` timestamp. Items in trash are // permanently deleted after 30 days. - IsArchived types.Bool `tfsdk:"is_archived" tf:"optional"` + IsArchived types.Bool `tfsdk:"is_archived"` // Whether a dashboard is a draft. Draft dashboards only appear in list // views for their owners. - IsDraft types.Bool `tfsdk:"is_draft" tf:"optional"` + IsDraft types.Bool `tfsdk:"is_draft"` // Indicates whether this query object appears in the current user's // favorites list. This flag determines whether the star icon for favorites // is selected. - IsFavorite types.Bool `tfsdk:"is_favorite" tf:"optional"` + IsFavorite types.Bool `tfsdk:"is_favorite"` // The title of the dashboard that appears in list views and at the top of // the dashboard page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - Options types.Object `tfsdk:"options" tf:"optional,object"` + Options types.Object `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionTier types.String `tfsdk:"permission_tier" tf:"optional"` + PermissionTier types.String `tfsdk:"permission_tier"` // URL slug. Usually mirrors the query name with dashes (`-`) instead of // spaces. Appears in the URL for this query. - Slug types.String `tfsdk:"slug" tf:"optional"` + Slug types.String `tfsdk:"slug"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // Timestamp when this dashboard was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` - User types.Object `tfsdk:"user" tf:"optional,object"` + User types.Object `tfsdk:"user"` // The ID of the user who owns the dashboard. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` - Widgets types.List `tfsdk:"widgets" tf:"optional"` + Widgets types.List `tfsdk:"widgets"` } func (newState *Dashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboard) { @@ -2276,12 +2366,26 @@ func (newState *Dashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboar func (newState *Dashboard) SyncEffectiveFieldsDuringRead(existingState Dashboard) { } -func (c Dashboard) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DashboardOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - User{}.ApplySchemaCustomizations(cs, append(path, "user")...) - Widget{}.ApplySchemaCustomizations(cs, append(path, "widgets")...) - - return cs +func (c Dashboard) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["can_edit"] = attrs["can_edit"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["dashboard_filters_enabled"] = attrs["dashboard_filters_enabled"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_archived"] = attrs["is_archived"].SetOptional() + attrs["is_draft"] = attrs["is_draft"].SetOptional() + attrs["is_favorite"] = attrs["is_favorite"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["permission_tier"] = attrs["permission_tier"].SetOptional() + attrs["slug"] = attrs["slug"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["widgets"] = attrs["widgets"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Dashboard. @@ -2468,13 +2572,13 @@ type DashboardEditContent struct { DashboardId types.String `tfsdk:"-"` // The title of this dashboard that appears in list views and at the top of // the dashboard page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *DashboardEditContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan DashboardEditContent) { @@ -2483,10 +2587,13 @@ func (newState *DashboardEditContent) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DashboardEditContent) SyncEffectiveFieldsDuringRead(existingState DashboardEditContent) { } -func (c DashboardEditContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dashboard_id")...) +func (c DashboardEditContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_id"] = attrs["dashboard_id"].SetRequired() + attrs["name"] = attrs["name"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DashboardEditContent. @@ -2560,7 +2667,7 @@ type DashboardOptions struct { // The timestamp when this dashboard was moved to trash. Only present when // the `is_archived` property is `true`. Trashed items are deleted after // thirty days. - MovedToTrashAt types.String `tfsdk:"moved_to_trash_at" tf:"optional"` + MovedToTrashAt types.String `tfsdk:"moved_to_trash_at"` } func (newState *DashboardOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan DashboardOptions) { @@ -2569,9 +2676,10 @@ func (newState *DashboardOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan D func (newState *DashboardOptions) SyncEffectiveFieldsDuringRead(existingState DashboardOptions) { } -func (c DashboardOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DashboardOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["moved_to_trash_at"] = attrs["moved_to_trash_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DashboardOptions. @@ -2607,21 +2715,21 @@ func (o DashboardOptions) Type(ctx context.Context) attr.Type { type DashboardPostContent struct { // Indicates whether the dashboard filters are enabled - DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled" tf:"optional"` + DashboardFiltersEnabled types.Bool `tfsdk:"dashboard_filters_enabled"` // Indicates whether this dashboard object should appear in the current // user's favorites list. - IsFavorite types.Bool `tfsdk:"is_favorite" tf:"optional"` + IsFavorite types.Bool `tfsdk:"is_favorite"` // The title of this dashboard that appears in list views and at the top of // the dashboard page. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *DashboardPostContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan DashboardPostContent) { @@ -2630,10 +2738,15 @@ func (newState *DashboardPostContent) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DashboardPostContent) SyncEffectiveFieldsDuringRead(existingState DashboardPostContent) { } -func (c DashboardPostContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c DashboardPostContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dashboard_filters_enabled"] = attrs["dashboard_filters_enabled"].SetOptional() + attrs["is_favorite"] = attrs["is_favorite"].SetOptional() + attrs["name"] = attrs["name"].SetRequired() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DashboardPostContent. @@ -2713,26 +2826,26 @@ type DataSource struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The string name of this data source / SQL warehouse as it appears in the // Databricks SQL web application. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Reserved for internal use. - PauseReason types.String `tfsdk:"pause_reason" tf:"optional"` + PauseReason types.String `tfsdk:"pause_reason"` // Reserved for internal use. - Paused types.Int64 `tfsdk:"paused" tf:"optional"` + Paused types.Int64 `tfsdk:"paused"` // Reserved for internal use. - SupportsAutoLimit types.Bool `tfsdk:"supports_auto_limit" tf:"optional"` + SupportsAutoLimit types.Bool `tfsdk:"supports_auto_limit"` // Reserved for internal use. - Syntax types.String `tfsdk:"syntax" tf:"optional"` + Syntax types.String `tfsdk:"syntax"` // The type of data source. For SQL warehouses, this will be // `databricks_internal`. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // Reserved for internal use. - ViewOnly types.Bool `tfsdk:"view_only" tf:"optional"` + ViewOnly types.Bool `tfsdk:"view_only"` // The ID of the associated SQL warehouse, if this data source is backed by // a SQL warehouse. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *DataSource) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataSource) { @@ -2741,9 +2854,18 @@ func (newState *DataSource) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataSou func (newState *DataSource) SyncEffectiveFieldsDuringRead(existingState DataSource) { } -func (c DataSource) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DataSource) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["pause_reason"] = attrs["pause_reason"].SetOptional() + attrs["paused"] = attrs["paused"].SetOptional() + attrs["supports_auto_limit"] = attrs["supports_auto_limit"].SetOptional() + attrs["syntax"] = attrs["syntax"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["view_only"] = attrs["view_only"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DataSource. @@ -2794,9 +2916,9 @@ func (o DataSource) Type(ctx context.Context) attr.Type { } type DateRange struct { - End types.String `tfsdk:"end" tf:""` + End types.String `tfsdk:"end"` - Start types.String `tfsdk:"start" tf:""` + Start types.String `tfsdk:"start"` } func (newState *DateRange) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateRange) { @@ -2805,11 +2927,11 @@ func (newState *DateRange) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateRang func (newState *DateRange) SyncEffectiveFieldsDuringRead(existingState DateRange) { } -func (c DateRange) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "end")...) - cs.SetRequired(append(path, "start")...) +func (c DateRange) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end"] = attrs["end"].SetRequired() + attrs["start"] = attrs["start"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DateRange. @@ -2847,14 +2969,14 @@ func (o DateRange) Type(ctx context.Context) attr.Type { type DateRangeValue struct { // Manually specified date-time range value. - DateRangeValue types.Object `tfsdk:"date_range_value" tf:"optional,object"` + DateRangeValue types.Object `tfsdk:"date_range_value"` // Dynamic date-time range value based on current date-time. - DynamicDateRangeValue types.String `tfsdk:"dynamic_date_range_value" tf:"optional"` + DynamicDateRangeValue types.String `tfsdk:"dynamic_date_range_value"` // Date-time precision to format the value into when the query is run. // Defaults to DAY_PRECISION (YYYY-MM-DD). - Precision types.String `tfsdk:"precision" tf:"optional"` + Precision types.String `tfsdk:"precision"` - StartDayOfWeek types.Int64 `tfsdk:"start_day_of_week" tf:"optional"` + StartDayOfWeek types.Int64 `tfsdk:"start_day_of_week"` } func (newState *DateRangeValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateRangeValue) { @@ -2863,10 +2985,13 @@ func (newState *DateRangeValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dat func (newState *DateRangeValue) SyncEffectiveFieldsDuringRead(existingState DateRangeValue) { } -func (c DateRangeValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DateRange{}.ApplySchemaCustomizations(cs, append(path, "date_range_value")...) +func (c DateRangeValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["date_range_value"] = attrs["date_range_value"].SetOptional() + attrs["dynamic_date_range_value"] = attrs["dynamic_date_range_value"].SetOptional() + attrs["precision"] = attrs["precision"].SetOptional() + attrs["start_day_of_week"] = attrs["start_day_of_week"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DateRangeValue. @@ -2938,12 +3063,12 @@ func (o *DateRangeValue) SetDateRangeValue(ctx context.Context, v DateRange) { type DateValue struct { // Manually specified date-time value. - DateValue types.String `tfsdk:"date_value" tf:"optional"` + DateValue types.String `tfsdk:"date_value"` // Dynamic date-time value based on current date-time. - DynamicDateValue types.String `tfsdk:"dynamic_date_value" tf:"optional"` + DynamicDateValue types.String `tfsdk:"dynamic_date_value"` // Date-time precision to format the value into when the query is run. // Defaults to DAY_PRECISION (YYYY-MM-DD). - Precision types.String `tfsdk:"precision" tf:"optional"` + Precision types.String `tfsdk:"precision"` } func (newState *DateValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateValue) { @@ -2952,9 +3077,12 @@ func (newState *DateValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan DateValu func (newState *DateValue) SyncEffectiveFieldsDuringRead(existingState DateValue) { } -func (c DateValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DateValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["date_value"] = attrs["date_value"].SetOptional() + attrs["dynamic_date_value"] = attrs["dynamic_date_value"].SetOptional() + attrs["precision"] = attrs["precision"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DateValue. @@ -3286,9 +3414,9 @@ func (newState *DeleteWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *DeleteWarehouseResponse) SyncEffectiveFieldsDuringRead(existingState DeleteWarehouseResponse) { } -func (c DeleteWarehouseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteWarehouseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteWarehouseResponse. @@ -3321,15 +3449,15 @@ func (o DeleteWarehouseResponse) Type(ctx context.Context) attr.Type { type EditAlert struct { AlertId types.String `tfsdk:"-"` // Name of the alert. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Alert configuration options. - Options types.Object `tfsdk:"options" tf:"object"` + Options types.Object `tfsdk:"options"` // Query ID. - QueryId types.String `tfsdk:"query_id" tf:""` + QueryId types.String `tfsdk:"query_id"` // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm types.Int64 `tfsdk:"rearm" tf:"optional"` + Rearm types.Int64 `tfsdk:"rearm"` } func (newState *EditAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditAlert) { @@ -3338,14 +3466,14 @@ func (newState *EditAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditAler func (newState *EditAlert) SyncEffectiveFieldsDuringRead(existingState EditAlert) { } -func (c EditAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "alert_id")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "options")...) - AlertOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - cs.SetRequired(append(path, "query_id")...) +func (c EditAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert_id"] = attrs["alert_id"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["options"] = attrs["options"].SetRequired() + attrs["query_id"] = attrs["query_id"].SetRequired() + attrs["rearm"] = attrs["rearm"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditAlert. @@ -3424,35 +3552,35 @@ type EditWarehouseRequest struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.Object `tfsdk:"channel" tf:"optional,object"` + Channel types.Object `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute. - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Required. Id of the warehouse to configure. Id types.String `tfsdk:"-"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -3462,23 +3590,23 @@ type EditWarehouseRequest struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.Object `tfsdk:"tags" tf:"optional,object"` + Tags types.Object `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *EditWarehouseRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan EditWarehouseRequest) { @@ -3487,12 +3615,23 @@ func (newState *EditWarehouseRequest) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *EditWarehouseRequest) SyncEffectiveFieldsDuringRead(existingState EditWarehouseRequest) { } -func (c EditWarehouseRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - cs.SetRequired(append(path, "id")...) - EndpointTags{}.ApplySchemaCustomizations(cs, append(path, "tags")...) +func (c EditWarehouseRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditWarehouseRequest. @@ -3620,9 +3759,9 @@ func (newState *EditWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *EditWarehouseResponse) SyncEffectiveFieldsDuringRead(existingState EditWarehouseResponse) { } -func (c EditWarehouseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EditWarehouseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EditWarehouseResponse. @@ -3663,9 +3802,9 @@ func (newState *Empty) SyncEffectiveFieldsDuringCreateOrUpdate(plan Empty) { func (newState *Empty) SyncEffectiveFieldsDuringRead(existingState Empty) { } -func (c Empty) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Empty) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Empty. @@ -3696,9 +3835,9 @@ func (o Empty) Type(ctx context.Context) attr.Type { } type EndpointConfPair struct { - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *EndpointConfPair) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointConfPair) { @@ -3707,9 +3846,11 @@ func (newState *EndpointConfPair) SyncEffectiveFieldsDuringCreateOrUpdate(plan E func (newState *EndpointConfPair) SyncEffectiveFieldsDuringRead(existingState EndpointConfPair) { } -func (c EndpointConfPair) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointConfPair) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointConfPair. @@ -3747,17 +3888,17 @@ func (o EndpointConfPair) Type(ctx context.Context) attr.Type { type EndpointHealth struct { // Details about errors that are causing current degraded/failed status. - Details types.String `tfsdk:"details" tf:"optional"` + Details types.String `tfsdk:"details"` // The reason for failure to bring up clusters for this warehouse. This is // available when status is 'FAILED' and sometimes when it is DEGRADED. - FailureReason types.Object `tfsdk:"failure_reason" tf:"optional,object"` + FailureReason types.Object `tfsdk:"failure_reason"` // Deprecated. split into summary and details for security - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Health status of the warehouse. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // A short summary of the health status in case of degraded/failed // warehouses. - Summary types.String `tfsdk:"summary" tf:"optional"` + Summary types.String `tfsdk:"summary"` } func (newState *EndpointHealth) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointHealth) { @@ -3766,10 +3907,14 @@ func (newState *EndpointHealth) SyncEffectiveFieldsDuringCreateOrUpdate(plan End func (newState *EndpointHealth) SyncEffectiveFieldsDuringRead(existingState EndpointHealth) { } -func (c EndpointHealth) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TerminationReason{}.ApplySchemaCustomizations(cs, append(path, "failure_reason")...) +func (c EndpointHealth) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["details"] = attrs["details"].SetOptional() + attrs["failure_reason"] = attrs["failure_reason"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["summary"] = attrs["summary"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointHealth. @@ -3848,40 +3993,40 @@ type EndpointInfo struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.Object `tfsdk:"channel" tf:"optional,object"` + Channel types.Object `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Optional health status. Assume the warehouse is healthy if this field is // not set. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // unique identifier for warehouse - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // the jdbc connection string for this warehouse - JdbcUrl types.String `tfsdk:"jdbc_url" tf:"optional"` + JdbcUrl types.String `tfsdk:"jdbc_url"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -3891,31 +4036,31 @@ type EndpointInfo struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // current number of active sessions for the warehouse - NumActiveSessions types.Int64 `tfsdk:"num_active_sessions" tf:"optional"` + NumActiveSessions types.Int64 `tfsdk:"num_active_sessions"` // current number of clusters running for the service - NumClusters types.Int64 `tfsdk:"num_clusters" tf:"optional"` + NumClusters types.Int64 `tfsdk:"num_clusters"` // ODBC parameters for the SQL warehouse - OdbcParams types.Object `tfsdk:"odbc_params" tf:"optional,object"` + OdbcParams types.Object `tfsdk:"odbc_params"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // State of the warehouse - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.Object `tfsdk:"tags" tf:"optional,object"` + Tags types.Object `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *EndpointInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointInfo) { @@ -3924,13 +4069,29 @@ func (newState *EndpointInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Endpo func (newState *EndpointInfo) SyncEffectiveFieldsDuringRead(existingState EndpointInfo) { } -func (c EndpointInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - EndpointHealth{}.ApplySchemaCustomizations(cs, append(path, "health")...) - OdbcParams{}.ApplySchemaCustomizations(cs, append(path, "odbc_params")...) - EndpointTags{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - - return cs +func (c EndpointInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["jdbc_url"] = attrs["jdbc_url"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["num_active_sessions"] = attrs["num_active_sessions"].SetOptional() + attrs["num_clusters"] = attrs["num_clusters"].SetOptional() + attrs["odbc_params"] = attrs["odbc_params"].SetOptional() + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointInfo. @@ -4120,9 +4281,9 @@ func (o *EndpointInfo) SetTags(ctx context.Context, v EndpointTags) { } type EndpointTagPair struct { - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *EndpointTagPair) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointTagPair) { @@ -4131,9 +4292,11 @@ func (newState *EndpointTagPair) SyncEffectiveFieldsDuringCreateOrUpdate(plan En func (newState *EndpointTagPair) SyncEffectiveFieldsDuringRead(existingState EndpointTagPair) { } -func (c EndpointTagPair) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointTagPair) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointTagPair. @@ -4170,7 +4333,7 @@ func (o EndpointTagPair) Type(ctx context.Context) attr.Type { } type EndpointTags struct { - CustomTags types.List `tfsdk:"custom_tags" tf:"optional"` + CustomTags types.List `tfsdk:"custom_tags"` } func (newState *EndpointTags) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointTags) { @@ -4179,10 +4342,10 @@ func (newState *EndpointTags) SyncEffectiveFieldsDuringCreateOrUpdate(plan Endpo func (newState *EndpointTags) SyncEffectiveFieldsDuringRead(existingState EndpointTags) { } -func (c EndpointTags) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointTagPair{}.ApplySchemaCustomizations(cs, append(path, "custom_tags")...) +func (c EndpointTags) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["custom_tags"] = attrs["custom_tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointTags. @@ -4248,11 +4411,11 @@ func (o *EndpointTags) SetCustomTags(ctx context.Context, v []EndpointTagPair) { type EnumValue struct { // List of valid query parameter values, newline delimited. - EnumOptions types.String `tfsdk:"enum_options" tf:"optional"` + EnumOptions types.String `tfsdk:"enum_options"` // If specified, allows multiple values to be selected for this parameter. - MultiValuesOptions types.Object `tfsdk:"multi_values_options" tf:"optional,object"` + MultiValuesOptions types.Object `tfsdk:"multi_values_options"` // List of selected query parameter values. - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *EnumValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnumValue) { @@ -4261,10 +4424,12 @@ func (newState *EnumValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan EnumValu func (newState *EnumValue) SyncEffectiveFieldsDuringRead(existingState EnumValue) { } -func (c EnumValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MultiValuesOptions{}.ApplySchemaCustomizations(cs, append(path, "multi_values_options")...) +func (c EnumValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enum_options"] = attrs["enum_options"].SetOptional() + attrs["multi_values_options"] = attrs["multi_values_options"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EnumValue. @@ -4368,14 +4533,14 @@ type ExecuteStatementRequest struct { // byte limit, then `truncated` in the response is set to `true`. When using // `EXTERNAL_LINKS` disposition, a default `byte_limit` of 100 GiB is // applied if `byte_limit` is not explcitly set. - ByteLimit types.Int64 `tfsdk:"byte_limit" tf:"optional"` + ByteLimit types.Int64 `tfsdk:"byte_limit"` // Sets default catalog for statement execution, similar to [`USE CATALOG`] // in SQL. // // [`USE CATALOG`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-catalog.html - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` - Disposition types.String `tfsdk:"disposition" tf:"optional"` + Disposition types.String `tfsdk:"disposition"` // Statement execution supports three result formats: `JSON_ARRAY` // (default), `ARROW_STREAM`, and `CSV`. // @@ -4412,7 +4577,7 @@ type ExecuteStatementRequest struct { // // [Apache Arrow streaming format]: https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format // [RFC 4180]: https://www.rfc-editor.org/rfc/rfc4180 - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // When `wait_timeout > 0s`, the call will block up to the specified time. // If the statement execution doesn't finish within this time, // `on_wait_timeout` determines whether the execution should continue or be @@ -4421,7 +4586,7 @@ type ExecuteStatementRequest struct { // polling with :method:statementexecution/getStatement. When set to // `CANCEL`, the statement execution is canceled and the call returns with a // `CANCELED` state. - OnWaitTimeout types.String `tfsdk:"on_wait_timeout" tf:"optional"` + OnWaitTimeout types.String `tfsdk:"on_wait_timeout"` // A list of parameters to pass into a SQL statement containing parameter // markers. A parameter consists of a name, a value, and optionally a type. // To represent a NULL value, the `value` field may be omitted or set to @@ -4452,19 +4617,19 @@ type ExecuteStatementRequest struct { // // [Parameter markers]: https://docs.databricks.com/sql/language-manual/sql-ref-parameter-marker.html // [`cast` function]: https://docs.databricks.com/sql/language-manual/functions/cast.html - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Applies the given row limit to the statement's result set, but unlike the // `LIMIT` clause in SQL, it also sets the `truncated` field in the response // to indicate whether the result was trimmed due to the limit or not. - RowLimit types.Int64 `tfsdk:"row_limit" tf:"optional"` + RowLimit types.Int64 `tfsdk:"row_limit"` // Sets default schema for statement execution, similar to [`USE SCHEMA`] in // SQL. // // [`USE SCHEMA`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-schema.html - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` // The SQL statement to execute. The statement can optionally be // parameterized, see `parameters`. - Statement types.String `tfsdk:"statement" tf:""` + Statement types.String `tfsdk:"statement"` // The time in seconds the call will wait for the statement's result set as // `Ns`, where `N` can be set to 0 or to a value between 5 and 50. // @@ -4479,12 +4644,12 @@ type ExecuteStatementRequest struct { // manifest and result data (or a `FAILED` state in case of an execution // error). If the statement takes longer to execute, `on_wait_timeout` // determines what should happen after the timeout is reached. - WaitTimeout types.String `tfsdk:"wait_timeout" tf:"optional"` + WaitTimeout types.String `tfsdk:"wait_timeout"` // Warehouse upon which to execute a statement. See also [What are SQL // warehouses?] // // [What are SQL warehouses?]: https://docs.databricks.com/sql/admin/warehouse-type.html - WarehouseId types.String `tfsdk:"warehouse_id" tf:""` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *ExecuteStatementRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExecuteStatementRequest) { @@ -4493,12 +4658,20 @@ func (newState *ExecuteStatementRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ExecuteStatementRequest) SyncEffectiveFieldsDuringRead(existingState ExecuteStatementRequest) { } -func (c ExecuteStatementRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - StatementParameterListItem{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) - cs.SetRequired(append(path, "statement")...) - cs.SetRequired(append(path, "warehouse_id")...) +func (c ExecuteStatementRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_limit"] = attrs["byte_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["disposition"] = attrs["disposition"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["on_wait_timeout"] = attrs["on_wait_timeout"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["row_limit"] = attrs["row_limit"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["statement"] = attrs["statement"].SetRequired() + attrs["wait_timeout"] = attrs["wait_timeout"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExecuteStatementRequest. @@ -4585,34 +4758,34 @@ func (o *ExecuteStatementRequest) SetParameters(ctx context.Context, v []Stateme type ExternalLink struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount types.Int64 `tfsdk:"byte_count" tf:"optional"` + ByteCount types.Int64 `tfsdk:"byte_count"` // The position within the sequence of result set chunks. - ChunkIndex types.Int64 `tfsdk:"chunk_index" tf:"optional"` + ChunkIndex types.Int64 `tfsdk:"chunk_index"` // Indicates the date-time that the given external link will expire and // becomes invalid, after which point a new `external_link` must be // requested. - Expiration types.String `tfsdk:"expiration" tf:"optional"` + Expiration types.String `tfsdk:"expiration"` - ExternalLink types.String `tfsdk:"external_link" tf:"optional"` + ExternalLink types.String `tfsdk:"external_link"` // HTTP headers that must be included with a GET request to the // `external_link`. Each header is provided as a key-value pair. Headers are // typically used to pass a decryption key to the external service. The // values of these headers should be considered sensitive and the client // should not expose these values in a log. - HttpHeaders types.Map `tfsdk:"http_headers" tf:"optional"` + HttpHeaders types.Map `tfsdk:"http_headers"` // When fetching, provides the `chunk_index` for the _next_ chunk. If // absent, indicates there are no more chunks. The next chunk can be fetched // with a :method:statementexecution/getStatementResultChunkN request. - NextChunkIndex types.Int64 `tfsdk:"next_chunk_index" tf:"optional"` + NextChunkIndex types.Int64 `tfsdk:"next_chunk_index"` // When fetching, provides a link to fetch the _next_ chunk. If absent, // indicates there are no more chunks. This link is an absolute `path` to be // joined with your `$DATABRICKS_HOST`, and should be treated as an opaque // link. This is an alternative to using `next_chunk_index`. - NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link" tf:"optional"` + NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link"` // The number of rows within the result chunk. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // The starting row offset within the result set. - RowOffset types.Int64 `tfsdk:"row_offset" tf:"optional"` + RowOffset types.Int64 `tfsdk:"row_offset"` } func (newState *ExternalLink) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExternalLink) { @@ -4621,9 +4794,18 @@ func (newState *ExternalLink) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exter func (newState *ExternalLink) SyncEffectiveFieldsDuringRead(existingState ExternalLink) { } -func (c ExternalLink) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExternalLink) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_count"] = attrs["byte_count"].SetOptional() + attrs["chunk_index"] = attrs["chunk_index"].SetOptional() + attrs["expiration"] = attrs["expiration"].SetOptional() + attrs["external_link"] = attrs["external_link"].SetOptional() + attrs["http_headers"] = attrs["http_headers"].SetOptional() + attrs["next_chunk_index"] = attrs["next_chunk_index"].SetOptional() + attrs["next_chunk_internal_link"] = attrs["next_chunk_internal_link"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["row_offset"] = attrs["row_offset"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExternalLink. @@ -4925,11 +5107,11 @@ func (o GetQueryRequest) Type(ctx context.Context) attr.Type { } type GetResponse struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // An object's type and UUID, separated by a forward slash (/) character. - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` // A singular noun object type. - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetResponse. @@ -5115,7 +5297,7 @@ func (o GetWarehousePermissionLevelsRequest) Type(ctx context.Context) attr.Type type GetWarehousePermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetWarehousePermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWarehousePermissionLevelsResponse) { @@ -5124,10 +5306,10 @@ func (newState *GetWarehousePermissionLevelsResponse) SyncEffectiveFieldsDuringC func (newState *GetWarehousePermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetWarehousePermissionLevelsResponse) { } -func (c GetWarehousePermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehousePermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetWarehousePermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWarehousePermissionLevelsResponse. @@ -5272,40 +5454,40 @@ type GetWarehouseResponse struct { // Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop. // // Defaults to 120 mins - AutoStopMins types.Int64 `tfsdk:"auto_stop_mins" tf:"optional"` + AutoStopMins types.Int64 `tfsdk:"auto_stop_mins"` // Channel Details - Channel types.Object `tfsdk:"channel" tf:"optional,object"` + Channel types.Object `tfsdk:"channel"` // Size of the clusters allocated for this warehouse. Increasing the size of // a spark cluster allows you to run larger queries on it. If you want to // increase the number of concurrent queries, please tune max_num_clusters. // // Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large // - 2X-Large - 3X-Large - 4X-Large - ClusterSize types.String `tfsdk:"cluster_size" tf:"optional"` + ClusterSize types.String `tfsdk:"cluster_size"` // warehouse creator name - CreatorName types.String `tfsdk:"creator_name" tf:"optional"` + CreatorName types.String `tfsdk:"creator_name"` // Configures whether the warehouse should use Photon optimized clusters. // // Defaults to false. - EnablePhoton types.Bool `tfsdk:"enable_photon" tf:"optional"` + EnablePhoton types.Bool `tfsdk:"enable_photon"` // Configures whether the warehouse should use serverless compute - EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute" tf:"optional"` + EnableServerlessCompute types.Bool `tfsdk:"enable_serverless_compute"` // Optional health status. Assume the warehouse is healthy if this field is // not set. - Health types.Object `tfsdk:"health" tf:"optional,object"` + Health types.Object `tfsdk:"health"` // unique identifier for warehouse - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Deprecated. Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // the jdbc connection string for this warehouse - JdbcUrl types.String `tfsdk:"jdbc_url" tf:"optional"` + JdbcUrl types.String `tfsdk:"jdbc_url"` // Maximum number of clusters that the autoscaler will create to handle // concurrent queries. // // Supported values: - Must be >= min_num_clusters - Must be <= 30. // // Defaults to min_clusters if unset. - MaxNumClusters types.Int64 `tfsdk:"max_num_clusters" tf:"optional"` + MaxNumClusters types.Int64 `tfsdk:"max_num_clusters"` // Minimum number of available clusters that will be maintained for this SQL // warehouse. Increasing this will ensure that a larger number of clusters // are always running and therefore may reduce the cold start time for new @@ -5315,31 +5497,31 @@ type GetWarehouseResponse struct { // Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30) // // Defaults to 1 - MinNumClusters types.Int64 `tfsdk:"min_num_clusters" tf:"optional"` + MinNumClusters types.Int64 `tfsdk:"min_num_clusters"` // Logical name for the cluster. // // Supported values: - Must be unique within an org. - Must be less than 100 // characters. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // current number of active sessions for the warehouse - NumActiveSessions types.Int64 `tfsdk:"num_active_sessions" tf:"optional"` + NumActiveSessions types.Int64 `tfsdk:"num_active_sessions"` // current number of clusters running for the service - NumClusters types.Int64 `tfsdk:"num_clusters" tf:"optional"` + NumClusters types.Int64 `tfsdk:"num_clusters"` // ODBC parameters for the SQL warehouse - OdbcParams types.Object `tfsdk:"odbc_params" tf:"optional,object"` + OdbcParams types.Object `tfsdk:"odbc_params"` // Configurations whether the warehouse should use spot instances. - SpotInstancePolicy types.String `tfsdk:"spot_instance_policy" tf:"optional"` + SpotInstancePolicy types.String `tfsdk:"spot_instance_policy"` // State of the warehouse - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // A set of key-value pairs that will be tagged on all resources (e.g., AWS // instances and EBS volumes) associated with this SQL warehouse. // // Supported values: - Number of tags < 45. - Tags types.Object `tfsdk:"tags" tf:"optional,object"` + Tags types.Object `tfsdk:"tags"` // Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless // compute, you must set to `PRO` and also set the field // `enable_serverless_compute` to `true`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *GetWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWarehouseResponse) { @@ -5348,13 +5530,29 @@ func (newState *GetWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *GetWarehouseResponse) SyncEffectiveFieldsDuringRead(existingState GetWarehouseResponse) { } -func (c GetWarehouseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - EndpointHealth{}.ApplySchemaCustomizations(cs, append(path, "health")...) - OdbcParams{}.ApplySchemaCustomizations(cs, append(path, "odbc_params")...) - EndpointTags{}.ApplySchemaCustomizations(cs, append(path, "tags")...) - - return cs +func (c GetWarehouseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["auto_stop_mins"] = attrs["auto_stop_mins"].SetOptional() + attrs["channel"] = attrs["channel"].SetOptional() + attrs["cluster_size"] = attrs["cluster_size"].SetOptional() + attrs["creator_name"] = attrs["creator_name"].SetOptional() + attrs["enable_photon"] = attrs["enable_photon"].SetOptional() + attrs["enable_serverless_compute"] = attrs["enable_serverless_compute"].SetOptional() + attrs["health"] = attrs["health"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["jdbc_url"] = attrs["jdbc_url"].SetOptional() + attrs["max_num_clusters"] = attrs["max_num_clusters"].SetOptional() + attrs["min_num_clusters"] = attrs["min_num_clusters"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["num_active_sessions"] = attrs["num_active_sessions"].SetOptional() + attrs["num_clusters"] = attrs["num_clusters"].SetOptional() + attrs["odbc_params"] = attrs["odbc_params"].SetOptional() + attrs["spot_instance_policy"] = attrs["spot_instance_policy"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWarehouseResponse. @@ -5545,30 +5743,30 @@ func (o *GetWarehouseResponse) SetTags(ctx context.Context, v EndpointTags) { type GetWorkspaceWarehouseConfigResponse struct { // Optional: Channel selection details - Channel types.Object `tfsdk:"channel" tf:"optional,object"` + Channel types.Object `tfsdk:"channel"` // Deprecated: Use sql_configuration_parameters - ConfigParam types.Object `tfsdk:"config_param" tf:"optional,object"` + ConfigParam types.Object `tfsdk:"config_param"` // Spark confs for external hive metastore configuration JSON serialized // size must be less than <= 512K - DataAccessConfig types.List `tfsdk:"data_access_config" tf:"optional"` + DataAccessConfig types.List `tfsdk:"data_access_config"` // List of Warehouse Types allowed in this workspace (limits allowed value // of the type field in CreateWarehouse and EditWarehouse). Note: Some types // cannot be disabled, they don't need to be specified in // SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing // warehouses to be converted to another type. Used by frontend to save // specific type availability in the warehouse create and edit form UI. - EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types" tf:"optional"` + EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types"` // Deprecated: Use sql_configuration_parameters - GlobalParam types.Object `tfsdk:"global_param" tf:"optional,object"` + GlobalParam types.Object `tfsdk:"global_param"` // GCP only: Google Service Account used to pass to cluster to access Google // Cloud Storage - GoogleServiceAccount types.String `tfsdk:"google_service_account" tf:"optional"` + GoogleServiceAccount types.String `tfsdk:"google_service_account"` // AWS Only: Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Security policy for warehouses - SecurityPolicy types.String `tfsdk:"security_policy" tf:"optional"` + SecurityPolicy types.String `tfsdk:"security_policy"` // SQL configuration parameters - SqlConfigurationParameters types.Object `tfsdk:"sql_configuration_parameters" tf:"optional,object"` + SqlConfigurationParameters types.Object `tfsdk:"sql_configuration_parameters"` } func (newState *GetWorkspaceWarehouseConfigResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWorkspaceWarehouseConfigResponse) { @@ -5577,15 +5775,18 @@ func (newState *GetWorkspaceWarehouseConfigResponse) SyncEffectiveFieldsDuringCr func (newState *GetWorkspaceWarehouseConfigResponse) SyncEffectiveFieldsDuringRead(existingState GetWorkspaceWarehouseConfigResponse) { } -func (c GetWorkspaceWarehouseConfigResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - RepeatedEndpointConfPairs{}.ApplySchemaCustomizations(cs, append(path, "config_param")...) - EndpointConfPair{}.ApplySchemaCustomizations(cs, append(path, "data_access_config")...) - WarehouseTypePair{}.ApplySchemaCustomizations(cs, append(path, "enabled_warehouse_types")...) - RepeatedEndpointConfPairs{}.ApplySchemaCustomizations(cs, append(path, "global_param")...) - RepeatedEndpointConfPairs{}.ApplySchemaCustomizations(cs, append(path, "sql_configuration_parameters")...) +func (c GetWorkspaceWarehouseConfigResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["channel"] = attrs["channel"].SetOptional() + attrs["config_param"] = attrs["config_param"].SetOptional() + attrs["data_access_config"] = attrs["data_access_config"].SetOptional() + attrs["enabled_warehouse_types"] = attrs["enabled_warehouse_types"].SetOptional() + attrs["global_param"] = attrs["global_param"].SetOptional() + attrs["google_service_account"] = attrs["google_service_account"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["security_policy"] = attrs["security_policy"].SetOptional() + attrs["sql_configuration_parameters"] = attrs["sql_configuration_parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWorkspaceWarehouseConfigResponse. @@ -5812,31 +6013,31 @@ func (o *GetWorkspaceWarehouseConfigResponse) SetSqlConfigurationParameters(ctx type LegacyAlert struct { // Timestamp when the alert was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Alert ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Timestamp when the alert was last triggered. - LastTriggeredAt types.String `tfsdk:"last_triggered_at" tf:"optional"` + LastTriggeredAt types.String `tfsdk:"last_triggered_at"` // Name of the alert. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Alert configuration options. - Options types.Object `tfsdk:"options" tf:"optional,object"` + Options types.Object `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` - Query types.Object `tfsdk:"query" tf:"optional,object"` + Query types.Object `tfsdk:"query"` // Number of seconds after being triggered before the alert rearms itself // and can be triggered again. If `null`, alert will never be triggered // again. - Rearm types.Int64 `tfsdk:"rearm" tf:"optional"` + Rearm types.Int64 `tfsdk:"rearm"` // State of the alert. Possible values are: `unknown` (yet to be evaluated), // `triggered` (evaluated and fulfilled trigger conditions), or `ok` // (evaluated and did not fulfill trigger conditions). - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Timestamp when the alert was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` - User types.Object `tfsdk:"user" tf:"optional,object"` + User types.Object `tfsdk:"user"` } func (newState *LegacyAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan LegacyAlert) { @@ -5845,12 +6046,20 @@ func (newState *LegacyAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan Legacy func (newState *LegacyAlert) SyncEffectiveFieldsDuringRead(existingState LegacyAlert) { } -func (c LegacyAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - AlertQuery{}.ApplySchemaCustomizations(cs, append(path, "query")...) - User{}.ApplySchemaCustomizations(cs, append(path, "user")...) +func (c LegacyAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_triggered_at"] = attrs["last_triggered_at"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["rearm"] = attrs["rearm"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LegacyAlert. @@ -5995,72 +6204,72 @@ func (o *LegacyAlert) SetUser(ctx context.Context, v User) { type LegacyQuery struct { // Describes whether the authenticated user is allowed to edit the // definition of this query. - CanEdit types.Bool `tfsdk:"can_edit" tf:"optional"` + CanEdit types.Bool `tfsdk:"can_edit"` // The timestamp when this query was created. - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Data source ID maps to the ID of the data source used by the resource and // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Query ID. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Indicates whether the query is trashed. Trashed queries can't be used in // dashboards, or appear in search results. If this boolean is `true`, the // `options` property for this query includes a `moved_to_trash_at` // timestamp. Trashed queries are permanently deleted after 30 days. - IsArchived types.Bool `tfsdk:"is_archived" tf:"optional"` + IsArchived types.Bool `tfsdk:"is_archived"` // Whether the query is a draft. Draft queries only appear in list views for // their owners. Visualizations from draft queries cannot appear on // dashboards. - IsDraft types.Bool `tfsdk:"is_draft" tf:"optional"` + IsDraft types.Bool `tfsdk:"is_draft"` // Whether this query object appears in the current user's favorites list. // This flag determines whether the star icon for favorites is selected. - IsFavorite types.Bool `tfsdk:"is_favorite" tf:"optional"` + IsFavorite types.Bool `tfsdk:"is_favorite"` // Text parameter types are not safe from SQL injection for all types of // data source. Set this Boolean parameter to `true` if a query either does // not use any text type parameters or uses a data source type where text // type parameters are handled safely. - IsSafe types.Bool `tfsdk:"is_safe" tf:"optional"` + IsSafe types.Bool `tfsdk:"is_safe"` - LastModifiedBy types.Object `tfsdk:"last_modified_by" tf:"optional,object"` + LastModifiedBy types.Object `tfsdk:"last_modified_by"` // The ID of the user who last saved changes to this query. - LastModifiedById types.Int64 `tfsdk:"last_modified_by_id" tf:"optional"` + LastModifiedById types.Int64 `tfsdk:"last_modified_by_id"` // If there is a cached result for this query and user, this field includes // the query result ID. If this query uses parameters, this field is always // null. - LatestQueryDataId types.String `tfsdk:"latest_query_data_id" tf:"optional"` + LatestQueryDataId types.String `tfsdk:"latest_query_data_id"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` - Options types.Object `tfsdk:"options" tf:"optional,object"` + Options types.Object `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // * `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * // `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query - PermissionTier types.String `tfsdk:"permission_tier" tf:"optional"` + PermissionTier types.String `tfsdk:"permission_tier"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` // A SHA-256 hash of the query text along with the authenticated user ID. - QueryHash types.String `tfsdk:"query_hash" tf:"optional"` + QueryHash types.String `tfsdk:"query_hash"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // The timestamp at which this query was last updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` - User types.Object `tfsdk:"user" tf:"optional,object"` + User types.Object `tfsdk:"user"` // The ID of the user who owns the query. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` - Visualizations types.List `tfsdk:"visualizations" tf:"optional"` + Visualizations types.List `tfsdk:"visualizations"` } func (newState *LegacyQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan LegacyQuery) { @@ -6069,13 +6278,33 @@ func (newState *LegacyQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan Legacy func (newState *LegacyQuery) SyncEffectiveFieldsDuringRead(existingState LegacyQuery) { } -func (c LegacyQuery) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - User{}.ApplySchemaCustomizations(cs, append(path, "last_modified_by")...) - QueryOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - User{}.ApplySchemaCustomizations(cs, append(path, "user")...) - LegacyVisualization{}.ApplySchemaCustomizations(cs, append(path, "visualizations")...) - - return cs +func (c LegacyQuery) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["can_edit"] = attrs["can_edit"].SetOptional() + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["is_archived"] = attrs["is_archived"].SetOptional() + attrs["is_draft"] = attrs["is_draft"].SetOptional() + attrs["is_favorite"] = attrs["is_favorite"].SetOptional() + attrs["is_safe"] = attrs["is_safe"].SetOptional() + attrs["last_modified_by"] = attrs["last_modified_by"].SetOptional() + attrs["last_modified_by_id"] = attrs["last_modified_by_id"].SetOptional() + attrs["latest_query_data_id"] = attrs["latest_query_data_id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["permission_tier"] = attrs["permission_tier"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query_hash"] = attrs["query_hash"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() + attrs["user"] = attrs["user"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["visualizations"] = attrs["visualizations"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LegacyQuery. @@ -6307,25 +6536,25 @@ func (o *LegacyQuery) SetVisualizations(ctx context.Context, v []LegacyVisualiza // same endpoint. Databricks does not recommend constructing ad-hoc // visualizations entirely in JSON. type LegacyVisualization struct { - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // A short description of this visualization. This is not displayed in the // UI. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The UUID for this visualization. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The name of the visualization that appears on dashboards and the query // screen. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The options object varies widely from one visualization type to the next // and is unsupported. Databricks does not recommend modifying visualization // settings in JSON. - Options types.Object `tfsdk:"options" tf:"optional"` + Options types.Object `tfsdk:"options"` - Query types.Object `tfsdk:"query" tf:"optional,object"` + Query types.Object `tfsdk:"query"` // The type of visualization: chart, table, pivot table, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` } func (newState *LegacyVisualization) SyncEffectiveFieldsDuringCreateOrUpdate(plan LegacyVisualization) { @@ -6334,10 +6563,17 @@ func (newState *LegacyVisualization) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *LegacyVisualization) SyncEffectiveFieldsDuringRead(existingState LegacyVisualization) { } -func (c LegacyVisualization) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LegacyQuery{}.ApplySchemaCustomizations(cs, append(path, "query")...) +func (c LegacyVisualization) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in LegacyVisualization. @@ -6456,9 +6692,9 @@ func (o ListAlertsRequest) Type(ctx context.Context) attr.Type { } type ListAlertsResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListAlertsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAlertsResponse) { @@ -6467,10 +6703,11 @@ func (newState *ListAlertsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListAlertsResponse) SyncEffectiveFieldsDuringRead(existingState ListAlertsResponse) { } -func (c ListAlertsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListAlertsResponseAlert{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListAlertsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAlertsResponse. @@ -6538,46 +6775,46 @@ func (o *ListAlertsResponse) SetResults(ctx context.Context, v []ListAlertsRespo type ListAlertsResponseAlert struct { // Trigger conditions of the alert. - Condition types.Object `tfsdk:"condition" tf:"optional,object"` + Condition types.Object `tfsdk:"condition"` // The timestamp indicating when the alert was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the alert. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // The workspace state of the alert. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` // Current state of the alert's trigger status. This field is set to UNKNOWN // if the alert has not yet been evaluated or ran into an error during the // last evaluation. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` // Timestamp when the alert was last triggered, if the alert has been // triggered before. - TriggerTime types.String `tfsdk:"trigger_time" tf:"optional"` + TriggerTime types.String `tfsdk:"trigger_time"` // The timestamp indicating when the alert was updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *ListAlertsResponseAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAlertsResponseAlert) { @@ -6586,10 +6823,23 @@ func (newState *ListAlertsResponseAlert) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListAlertsResponseAlert) SyncEffectiveFieldsDuringRead(existingState ListAlertsResponseAlert) { } -func (c ListAlertsResponseAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c ListAlertsResponseAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() + attrs["trigger_time"] = attrs["trigger_time"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAlertsResponseAlert. @@ -6832,11 +7082,11 @@ func (o ListQueriesRequest) Type(ctx context.Context) attr.Type { type ListQueriesResponse struct { // Whether there is another page of results. - HasNextPage types.Bool `tfsdk:"has_next_page" tf:"optional"` + HasNextPage types.Bool `tfsdk:"has_next_page"` // A token that can be used to get the next page of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Res types.List `tfsdk:"res" tf:"optional"` + Res types.List `tfsdk:"res"` } func (newState *ListQueriesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQueriesResponse) { @@ -6845,10 +7095,12 @@ func (newState *ListQueriesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ListQueriesResponse) SyncEffectiveFieldsDuringRead(existingState ListQueriesResponse) { } -func (c ListQueriesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryInfo{}.ApplySchemaCustomizations(cs, append(path, "res")...) +func (c ListQueriesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["has_next_page"] = attrs["has_next_page"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["res"] = attrs["res"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQueriesResponse. @@ -7001,9 +7253,9 @@ func (o *ListQueryHistoryRequest) SetFilterBy(ctx context.Context, v QueryFilter } type ListQueryObjectsResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListQueryObjectsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQueryObjectsResponse) { @@ -7012,10 +7264,11 @@ func (newState *ListQueryObjectsResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListQueryObjectsResponse) SyncEffectiveFieldsDuringRead(existingState ListQueryObjectsResponse) { } -func (c ListQueryObjectsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListQueryObjectsResponseQuery{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListQueryObjectsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQueryObjectsResponse. @@ -7083,39 +7336,39 @@ func (o *ListQueryObjectsResponse) SetResults(ctx context.Context, v []ListQuery type ListQueryObjectsResponseQuery struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // Timestamp when this query was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the query. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Username of the user who last saved changes to this query. - LastModifierUserName types.String `tfsdk:"last_modifier_user_name" tf:"optional"` + LastModifierUserName types.String `tfsdk:"last_modifier_user_name"` // Indicates whether the query is trashed. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Username of the user that owns the query. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // Timestamp when this query was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *ListQueryObjectsResponseQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListQueryObjectsResponseQuery) { @@ -7124,10 +7377,25 @@ func (newState *ListQueryObjectsResponseQuery) SyncEffectiveFieldsDuringCreateOr func (newState *ListQueryObjectsResponseQuery) SyncEffectiveFieldsDuringRead(existingState ListQueryObjectsResponseQuery) { } -func (c ListQueryObjectsResponseQuery) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c ListQueryObjectsResponseQuery) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_modifier_user_name"] = attrs["last_modifier_user_name"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListQueryObjectsResponseQuery. @@ -7252,13 +7520,13 @@ func (o *ListQueryObjectsResponseQuery) SetTags(ctx context.Context, v []types.S type ListResponse struct { // The total number of dashboards. - Count types.Int64 `tfsdk:"count" tf:"optional"` + Count types.Int64 `tfsdk:"count"` // The current page being displayed. - Page types.Int64 `tfsdk:"page" tf:"optional"` + Page types.Int64 `tfsdk:"page"` // The number of dashboards per page. - PageSize types.Int64 `tfsdk:"page_size" tf:"optional"` + PageSize types.Int64 `tfsdk:"page_size"` // List of dashboards returned. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListResponse. @@ -7373,9 +7641,9 @@ func (o ListVisualizationsForQueryRequest) Type(ctx context.Context) attr.Type { } type ListVisualizationsForQueryResponse struct { - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *ListVisualizationsForQueryResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListVisualizationsForQueryResponse) { @@ -7384,10 +7652,11 @@ func (newState *ListVisualizationsForQueryResponse) SyncEffectiveFieldsDuringCre func (newState *ListVisualizationsForQueryResponse) SyncEffectiveFieldsDuringRead(existingState ListVisualizationsForQueryResponse) { } -func (c ListVisualizationsForQueryResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Visualization{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c ListVisualizationsForQueryResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListVisualizationsForQueryResponse. @@ -7493,7 +7762,7 @@ func (o ListWarehousesRequest) Type(ctx context.Context) attr.Type { type ListWarehousesResponse struct { // A list of warehouses and their configurations. - Warehouses types.List `tfsdk:"warehouses" tf:"optional"` + Warehouses types.List `tfsdk:"warehouses"` } func (newState *ListWarehousesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListWarehousesResponse) { @@ -7502,10 +7771,10 @@ func (newState *ListWarehousesResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListWarehousesResponse) SyncEffectiveFieldsDuringRead(existingState ListWarehousesResponse) { } -func (c ListWarehousesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointInfo{}.ApplySchemaCustomizations(cs, append(path, "warehouses")...) +func (c ListWarehousesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["warehouses"] = attrs["warehouses"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListWarehousesResponse. @@ -7571,12 +7840,12 @@ func (o *ListWarehousesResponse) SetWarehouses(ctx context.Context, v []Endpoint type MultiValuesOptions struct { // Character that prefixes each selected parameter value. - Prefix types.String `tfsdk:"prefix" tf:"optional"` + Prefix types.String `tfsdk:"prefix"` // Character that separates each selected parameter value. Defaults to a // comma. - Separator types.String `tfsdk:"separator" tf:"optional"` + Separator types.String `tfsdk:"separator"` // Character that suffixes each selected parameter value. - Suffix types.String `tfsdk:"suffix" tf:"optional"` + Suffix types.String `tfsdk:"suffix"` } func (newState *MultiValuesOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan MultiValuesOptions) { @@ -7585,9 +7854,12 @@ func (newState *MultiValuesOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *MultiValuesOptions) SyncEffectiveFieldsDuringRead(existingState MultiValuesOptions) { } -func (c MultiValuesOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MultiValuesOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["prefix"] = attrs["prefix"].SetOptional() + attrs["separator"] = attrs["separator"].SetOptional() + attrs["suffix"] = attrs["suffix"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MultiValuesOptions. @@ -7626,7 +7898,7 @@ func (o MultiValuesOptions) Type(ctx context.Context) attr.Type { } type NumericValue struct { - Value types.Float64 `tfsdk:"value" tf:"optional"` + Value types.Float64 `tfsdk:"value"` } func (newState *NumericValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan NumericValue) { @@ -7635,9 +7907,10 @@ func (newState *NumericValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan Numer func (newState *NumericValue) SyncEffectiveFieldsDuringRead(existingState NumericValue) { } -func (c NumericValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c NumericValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in NumericValue. @@ -7672,13 +7945,13 @@ func (o NumericValue) Type(ctx context.Context) attr.Type { } type OdbcParams struct { - Hostname types.String `tfsdk:"hostname" tf:"optional"` + Hostname types.String `tfsdk:"hostname"` - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` - Port types.Int64 `tfsdk:"port" tf:"optional"` + Port types.Int64 `tfsdk:"port"` - Protocol types.String `tfsdk:"protocol" tf:"optional"` + Protocol types.String `tfsdk:"protocol"` } func (newState *OdbcParams) SyncEffectiveFieldsDuringCreateOrUpdate(plan OdbcParams) { @@ -7687,9 +7960,13 @@ func (newState *OdbcParams) SyncEffectiveFieldsDuringCreateOrUpdate(plan OdbcPar func (newState *OdbcParams) SyncEffectiveFieldsDuringRead(existingState OdbcParams) { } -func (c OdbcParams) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c OdbcParams) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["hostname"] = attrs["hostname"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["port"] = attrs["port"].SetOptional() + attrs["protocol"] = attrs["protocol"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in OdbcParams. @@ -7732,22 +8009,22 @@ func (o OdbcParams) Type(ctx context.Context) attr.Type { type Parameter struct { // List of valid parameter values, newline delimited. Only applies for // dropdown list parameters. - EnumOptions types.String `tfsdk:"enumOptions" tf:"optional"` + EnumOptions types.String `tfsdk:"enumOptions"` // If specified, allows multiple values to be selected for this parameter. // Only applies to dropdown list and query-based dropdown list parameters. - MultiValuesOptions types.Object `tfsdk:"multiValuesOptions" tf:"optional,object"` + MultiValuesOptions types.Object `tfsdk:"multiValuesOptions"` // The literal parameter marker that appears between double curly braces in // the query text. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // The UUID of the query that provides the parameter values. Only applies // for query-based dropdown list parameters. - QueryId types.String `tfsdk:"queryId" tf:"optional"` + QueryId types.String `tfsdk:"queryId"` // The text displayed in a parameter picking widget. - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` // Parameters can have several different types. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // The default value for this parameter. - Value types.Object `tfsdk:"value" tf:"optional"` + Value types.Object `tfsdk:"value"` } func (newState *Parameter) SyncEffectiveFieldsDuringCreateOrUpdate(plan Parameter) { @@ -7756,10 +8033,16 @@ func (newState *Parameter) SyncEffectiveFieldsDuringCreateOrUpdate(plan Paramete func (newState *Parameter) SyncEffectiveFieldsDuringRead(existingState Parameter) { } -func (c Parameter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MultiValuesOptions{}.ApplySchemaCustomizations(cs, append(path, "multiValuesOptions")...) +func (c Parameter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enumOptions"] = attrs["enumOptions"].SetOptional() + attrs["multiValuesOptions"] = attrs["multiValuesOptions"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["queryId"] = attrs["queryId"].SetOptional() + attrs["title"] = attrs["title"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Parameter. @@ -7837,41 +8120,41 @@ func (o *Parameter) SetMultiValuesOptions(ctx context.Context, v MultiValuesOpti type Query struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // Timestamp when this query was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the query. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Username of the user who last saved changes to this query. - LastModifierUserName types.String `tfsdk:"last_modifier_user_name" tf:"optional"` + LastModifierUserName types.String `tfsdk:"last_modifier_user_name"` // Indicates whether the query is trashed. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state"` // Username of the user that owns the query. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Workspace path of the workspace folder containing the object. - ParentPath types.String `tfsdk:"parent_path" tf:"optional"` + ParentPath types.String `tfsdk:"parent_path"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // Timestamp when this query was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *Query) SyncEffectiveFieldsDuringCreateOrUpdate(plan Query) { @@ -7880,10 +8163,26 @@ func (newState *Query) SyncEffectiveFieldsDuringCreateOrUpdate(plan Query) { func (newState *Query) SyncEffectiveFieldsDuringRead(existingState Query) { } -func (c Query) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) - - return cs +func (c Query) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_modifier_user_name"] = attrs["last_modifier_user_name"].SetOptional() + attrs["lifecycle_state"] = attrs["lifecycle_state"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["parent_path"] = attrs["parent_path"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Query. @@ -8010,11 +8309,11 @@ func (o *Query) SetTags(ctx context.Context, v []types.String) { type QueryBackedValue struct { // If specified, allows multiple values to be selected for this parameter. - MultiValuesOptions types.Object `tfsdk:"multi_values_options" tf:"optional,object"` + MultiValuesOptions types.Object `tfsdk:"multi_values_options"` // UUID of the query that provides the parameter values. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // List of selected query parameter values. - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *QueryBackedValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryBackedValue) { @@ -8023,10 +8322,12 @@ func (newState *QueryBackedValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan Q func (newState *QueryBackedValue) SyncEffectiveFieldsDuringRead(existingState QueryBackedValue) { } -func (c QueryBackedValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MultiValuesOptions{}.ApplySchemaCustomizations(cs, append(path, "multi_values_options")...) +func (c QueryBackedValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["multi_values_options"] = attrs["multi_values_options"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryBackedValue. @@ -8128,27 +8429,27 @@ type QueryEditContent struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Exclusively used for storing a list parameter definitions. A parameter is // an object with `title`, `name`, `type`, and `value` properties. The // `value` field here is the default value. It can be overridden at runtime. - Options types.Object `tfsdk:"options" tf:"optional"` + Options types.Object `tfsdk:"options"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` QueryId types.String `tfsdk:"-"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *QueryEditContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryEditContent) { @@ -8157,10 +8458,17 @@ func (newState *QueryEditContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan Q func (newState *QueryEditContent) SyncEffectiveFieldsDuringRead(existingState QueryEditContent) { } -func (c QueryEditContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "query_id")...) +func (c QueryEditContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetRequired() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryEditContent. @@ -8241,15 +8549,15 @@ func (o *QueryEditContent) SetTags(ctx context.Context, v []types.String) { type QueryFilter struct { // A range filter for query submitted time. The time range must be <= 30 // days. - QueryStartTimeRange types.Object `tfsdk:"query_start_time_range" tf:"optional,object"` + QueryStartTimeRange types.Object `tfsdk:"query_start_time_range"` // A list of statement IDs. - StatementIds types.List `tfsdk:"statement_ids" tf:"optional"` + StatementIds types.List `tfsdk:"statement_ids"` - Statuses types.List `tfsdk:"statuses" tf:"optional"` + Statuses types.List `tfsdk:"statuses"` // A list of user IDs who ran the queries. - UserIds types.List `tfsdk:"user_ids" tf:"optional"` + UserIds types.List `tfsdk:"user_ids"` // A list of warehouse IDs. - WarehouseIds types.List `tfsdk:"warehouse_ids" tf:"optional"` + WarehouseIds types.List `tfsdk:"warehouse_ids"` } func (newState *QueryFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryFilter) { @@ -8258,10 +8566,14 @@ func (newState *QueryFilter) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryF func (newState *QueryFilter) SyncEffectiveFieldsDuringRead(existingState QueryFilter) { } -func (c QueryFilter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - TimeRange{}.ApplySchemaCustomizations(cs, append(path, "query_start_time_range")...) +func (c QueryFilter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["query_start_time_range"] = attrs["query_start_time_range"].SetOptional() + attrs["statement_ids"] = attrs["statement_ids"].SetOptional() + attrs["statuses"] = attrs["statuses"].SetOptional() + attrs["user_ids"] = attrs["user_ids"].SetOptional() + attrs["warehouse_ids"] = attrs["warehouse_ids"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryFilter. @@ -8451,54 +8763,54 @@ func (o *QueryFilter) SetWarehouseIds(ctx context.Context, v []types.String) { type QueryInfo struct { // SQL Warehouse channel information at the time of query execution - ChannelUsed types.Object `tfsdk:"channel_used" tf:"optional,object"` + ChannelUsed types.Object `tfsdk:"channel_used"` // Total execution time of the statement ( excluding result fetch time ). - Duration types.Int64 `tfsdk:"duration" tf:"optional"` + Duration types.Int64 `tfsdk:"duration"` // Alias for `warehouse_id`. - EndpointId types.String `tfsdk:"endpoint_id" tf:"optional"` + EndpointId types.String `tfsdk:"endpoint_id"` // Message describing why the query could not complete. - ErrorMessage types.String `tfsdk:"error_message" tf:"optional"` + ErrorMessage types.String `tfsdk:"error_message"` // The ID of the user whose credentials were used to run the query. - ExecutedAsUserId types.Int64 `tfsdk:"executed_as_user_id" tf:"optional"` + ExecutedAsUserId types.Int64 `tfsdk:"executed_as_user_id"` // The email address or username of the user whose credentials were used to // run the query. - ExecutedAsUserName types.String `tfsdk:"executed_as_user_name" tf:"optional"` + ExecutedAsUserName types.String `tfsdk:"executed_as_user_name"` // The time execution of the query ended. - ExecutionEndTimeMs types.Int64 `tfsdk:"execution_end_time_ms" tf:"optional"` + ExecutionEndTimeMs types.Int64 `tfsdk:"execution_end_time_ms"` // Whether more updates for the query are expected. - IsFinal types.Bool `tfsdk:"is_final" tf:"optional"` + IsFinal types.Bool `tfsdk:"is_final"` // A key that can be used to look up query details. - LookupKey types.String `tfsdk:"lookup_key" tf:"optional"` + LookupKey types.String `tfsdk:"lookup_key"` // Metrics about query execution. - Metrics types.Object `tfsdk:"metrics" tf:"optional,object"` + Metrics types.Object `tfsdk:"metrics"` // Whether plans exist for the execution, or the reason why they are missing - PlansState types.String `tfsdk:"plans_state" tf:"optional"` + PlansState types.String `tfsdk:"plans_state"` // The time the query ended. - QueryEndTimeMs types.Int64 `tfsdk:"query_end_time_ms" tf:"optional"` + QueryEndTimeMs types.Int64 `tfsdk:"query_end_time_ms"` // The query ID. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // The time the query started. - QueryStartTimeMs types.Int64 `tfsdk:"query_start_time_ms" tf:"optional"` + QueryStartTimeMs types.Int64 `tfsdk:"query_start_time_ms"` // The text of the query. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // The number of results returned by the query. - RowsProduced types.Int64 `tfsdk:"rows_produced" tf:"optional"` + RowsProduced types.Int64 `tfsdk:"rows_produced"` // URL to the Spark UI query plan. - SparkUiUrl types.String `tfsdk:"spark_ui_url" tf:"optional"` + SparkUiUrl types.String `tfsdk:"spark_ui_url"` // Type of statement for this query - StatementType types.String `tfsdk:"statement_type" tf:"optional"` + StatementType types.String `tfsdk:"statement_type"` // Query status with one the following values: // // - `QUEUED`: Query has been received and queued. - `RUNNING`: Query has // started. - `CANCELED`: Query has been cancelled by the user. - `FAILED`: // Query has failed. - `FINISHED`: Query has completed. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` // The ID of the user who ran the query. - UserId types.Int64 `tfsdk:"user_id" tf:"optional"` + UserId types.Int64 `tfsdk:"user_id"` // The email address or username of the user who ran the query. - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` // Warehouse ID. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *QueryInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryInfo) { @@ -8507,11 +8819,31 @@ func (newState *QueryInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryInf func (newState *QueryInfo) SyncEffectiveFieldsDuringRead(existingState QueryInfo) { } -func (c QueryInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ChannelInfo{}.ApplySchemaCustomizations(cs, append(path, "channel_used")...) - QueryMetrics{}.ApplySchemaCustomizations(cs, append(path, "metrics")...) - - return cs +func (c QueryInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["channel_used"] = attrs["channel_used"].SetOptional() + attrs["duration"] = attrs["duration"].SetOptional() + attrs["endpoint_id"] = attrs["endpoint_id"].SetOptional() + attrs["error_message"] = attrs["error_message"].SetOptional() + attrs["executed_as_user_id"] = attrs["executed_as_user_id"].SetOptional() + attrs["executed_as_user_name"] = attrs["executed_as_user_name"].SetOptional() + attrs["execution_end_time_ms"] = attrs["execution_end_time_ms"].SetOptional() + attrs["is_final"] = attrs["is_final"].SetOptional() + attrs["lookup_key"] = attrs["lookup_key"].SetOptional() + attrs["metrics"] = attrs["metrics"].SetOptional() + attrs["plans_state"] = attrs["plans_state"].SetOptional() + attrs["query_end_time_ms"] = attrs["query_end_time_ms"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["query_start_time_ms"] = attrs["query_start_time_ms"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["rows_produced"] = attrs["rows_produced"].SetOptional() + attrs["spark_ui_url"] = attrs["spark_ui_url"].SetOptional() + attrs["statement_type"] = attrs["statement_type"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["user_id"] = attrs["user_id"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryInfo. @@ -8648,13 +8980,13 @@ func (o *QueryInfo) SetMetrics(ctx context.Context, v QueryMetrics) { type QueryList struct { // The total number of queries. - Count types.Int64 `tfsdk:"count" tf:"optional"` + Count types.Int64 `tfsdk:"count"` // The page number that is currently displayed. - Page types.Int64 `tfsdk:"page" tf:"optional"` + Page types.Int64 `tfsdk:"page"` // The number of queries per page. - PageSize types.Int64 `tfsdk:"page_size" tf:"optional"` + PageSize types.Int64 `tfsdk:"page_size"` // List of queries returned. - Results types.List `tfsdk:"results" tf:"optional"` + Results types.List `tfsdk:"results"` } func (newState *QueryList) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryList) { @@ -8663,10 +8995,13 @@ func (newState *QueryList) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryLis func (newState *QueryList) SyncEffectiveFieldsDuringRead(existingState QueryList) { } -func (c QueryList) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - LegacyQuery{}.ApplySchemaCustomizations(cs, append(path, "results")...) +func (c QueryList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["count"] = attrs["count"].SetOptional() + attrs["page"] = attrs["page"].SetOptional() + attrs["page_size"] = attrs["page_size"].SetOptional() + attrs["results"] = attrs["results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryList. @@ -8740,61 +9075,61 @@ func (o *QueryList) SetResults(ctx context.Context, v []LegacyQuery) { // Metrics come from the driver and are stored in the history service database. type QueryMetrics struct { // Time spent loading metadata and optimizing the query, in milliseconds. - CompilationTimeMs types.Int64 `tfsdk:"compilation_time_ms" tf:"optional"` + CompilationTimeMs types.Int64 `tfsdk:"compilation_time_ms"` // Time spent executing the query, in milliseconds. - ExecutionTimeMs types.Int64 `tfsdk:"execution_time_ms" tf:"optional"` + ExecutionTimeMs types.Int64 `tfsdk:"execution_time_ms"` // Total amount of data sent over the network between executor nodes during // shuffle, in bytes. - NetworkSentBytes types.Int64 `tfsdk:"network_sent_bytes" tf:"optional"` + NetworkSentBytes types.Int64 `tfsdk:"network_sent_bytes"` // Timestamp of when the query was enqueued waiting while the warehouse was // at max load. This field is optional and will not appear if the query // skipped the overloading queue. - OverloadingQueueStartTimestamp types.Int64 `tfsdk:"overloading_queue_start_timestamp" tf:"optional"` + OverloadingQueueStartTimestamp types.Int64 `tfsdk:"overloading_queue_start_timestamp"` // Total execution time for all individual Photon query engine tasks in the // query, in milliseconds. - PhotonTotalTimeMs types.Int64 `tfsdk:"photon_total_time_ms" tf:"optional"` + PhotonTotalTimeMs types.Int64 `tfsdk:"photon_total_time_ms"` // Timestamp of when the query was enqueued waiting for a cluster to be // provisioned for the warehouse. This field is optional and will not appear // if the query skipped the provisioning queue. - ProvisioningQueueStartTimestamp types.Int64 `tfsdk:"provisioning_queue_start_timestamp" tf:"optional"` + ProvisioningQueueStartTimestamp types.Int64 `tfsdk:"provisioning_queue_start_timestamp"` // Total number of bytes in all tables not read due to pruning - PrunedBytes types.Int64 `tfsdk:"pruned_bytes" tf:"optional"` + PrunedBytes types.Int64 `tfsdk:"pruned_bytes"` // Total number of files from all tables not read due to pruning - PrunedFilesCount types.Int64 `tfsdk:"pruned_files_count" tf:"optional"` + PrunedFilesCount types.Int64 `tfsdk:"pruned_files_count"` // Timestamp of when the underlying compute started compilation of the // query. - QueryCompilationStartTimestamp types.Int64 `tfsdk:"query_compilation_start_timestamp" tf:"optional"` + QueryCompilationStartTimestamp types.Int64 `tfsdk:"query_compilation_start_timestamp"` // Total size of data read by the query, in bytes. - ReadBytes types.Int64 `tfsdk:"read_bytes" tf:"optional"` + ReadBytes types.Int64 `tfsdk:"read_bytes"` // Size of persistent data read from the cache, in bytes. - ReadCacheBytes types.Int64 `tfsdk:"read_cache_bytes" tf:"optional"` + ReadCacheBytes types.Int64 `tfsdk:"read_cache_bytes"` // Number of files read after pruning - ReadFilesCount types.Int64 `tfsdk:"read_files_count" tf:"optional"` + ReadFilesCount types.Int64 `tfsdk:"read_files_count"` // Number of partitions read after pruning. - ReadPartitionsCount types.Int64 `tfsdk:"read_partitions_count" tf:"optional"` + ReadPartitionsCount types.Int64 `tfsdk:"read_partitions_count"` // Size of persistent data read from cloud object storage on your cloud // tenant, in bytes. - ReadRemoteBytes types.Int64 `tfsdk:"read_remote_bytes" tf:"optional"` + ReadRemoteBytes types.Int64 `tfsdk:"read_remote_bytes"` // Time spent fetching the query results after the execution finished, in // milliseconds. - ResultFetchTimeMs types.Int64 `tfsdk:"result_fetch_time_ms" tf:"optional"` + ResultFetchTimeMs types.Int64 `tfsdk:"result_fetch_time_ms"` // `true` if the query result was fetched from cache, `false` otherwise. - ResultFromCache types.Bool `tfsdk:"result_from_cache" tf:"optional"` + ResultFromCache types.Bool `tfsdk:"result_from_cache"` // Total number of rows returned by the query. - RowsProducedCount types.Int64 `tfsdk:"rows_produced_count" tf:"optional"` + RowsProducedCount types.Int64 `tfsdk:"rows_produced_count"` // Total number of rows read by the query. - RowsReadCount types.Int64 `tfsdk:"rows_read_count" tf:"optional"` + RowsReadCount types.Int64 `tfsdk:"rows_read_count"` // Size of data temporarily written to disk while executing the query, in // bytes. - SpillToDiskBytes types.Int64 `tfsdk:"spill_to_disk_bytes" tf:"optional"` + SpillToDiskBytes types.Int64 `tfsdk:"spill_to_disk_bytes"` // Sum of execution time for all of the query’s tasks, in milliseconds. - TaskTotalTimeMs types.Int64 `tfsdk:"task_total_time_ms" tf:"optional"` + TaskTotalTimeMs types.Int64 `tfsdk:"task_total_time_ms"` // Total execution time of the query from the client’s point of view, in // milliseconds. - TotalTimeMs types.Int64 `tfsdk:"total_time_ms" tf:"optional"` + TotalTimeMs types.Int64 `tfsdk:"total_time_ms"` // Size pf persistent data written to cloud object storage in your cloud // tenant, in bytes. - WriteRemoteBytes types.Int64 `tfsdk:"write_remote_bytes" tf:"optional"` + WriteRemoteBytes types.Int64 `tfsdk:"write_remote_bytes"` } func (newState *QueryMetrics) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryMetrics) { @@ -8803,9 +9138,31 @@ func (newState *QueryMetrics) SyncEffectiveFieldsDuringCreateOrUpdate(plan Query func (newState *QueryMetrics) SyncEffectiveFieldsDuringRead(existingState QueryMetrics) { } -func (c QueryMetrics) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - - return cs +func (c QueryMetrics) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["compilation_time_ms"] = attrs["compilation_time_ms"].SetOptional() + attrs["execution_time_ms"] = attrs["execution_time_ms"].SetOptional() + attrs["network_sent_bytes"] = attrs["network_sent_bytes"].SetOptional() + attrs["overloading_queue_start_timestamp"] = attrs["overloading_queue_start_timestamp"].SetOptional() + attrs["photon_total_time_ms"] = attrs["photon_total_time_ms"].SetOptional() + attrs["provisioning_queue_start_timestamp"] = attrs["provisioning_queue_start_timestamp"].SetOptional() + attrs["pruned_bytes"] = attrs["pruned_bytes"].SetOptional() + attrs["pruned_files_count"] = attrs["pruned_files_count"].SetOptional() + attrs["query_compilation_start_timestamp"] = attrs["query_compilation_start_timestamp"].SetOptional() + attrs["read_bytes"] = attrs["read_bytes"].SetOptional() + attrs["read_cache_bytes"] = attrs["read_cache_bytes"].SetOptional() + attrs["read_files_count"] = attrs["read_files_count"].SetOptional() + attrs["read_partitions_count"] = attrs["read_partitions_count"].SetOptional() + attrs["read_remote_bytes"] = attrs["read_remote_bytes"].SetOptional() + attrs["result_fetch_time_ms"] = attrs["result_fetch_time_ms"].SetOptional() + attrs["result_from_cache"] = attrs["result_from_cache"].SetOptional() + attrs["rows_produced_count"] = attrs["rows_produced_count"].SetOptional() + attrs["rows_read_count"] = attrs["rows_read_count"].SetOptional() + attrs["spill_to_disk_bytes"] = attrs["spill_to_disk_bytes"].SetOptional() + attrs["task_total_time_ms"] = attrs["task_total_time_ms"].SetOptional() + attrs["total_time_ms"] = attrs["total_time_ms"].SetOptional() + attrs["write_remote_bytes"] = attrs["write_remote_bytes"].SetOptional() + + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryMetrics. @@ -8883,15 +9240,15 @@ func (o QueryMetrics) Type(ctx context.Context) attr.Type { type QueryOptions struct { // The name of the catalog to execute this query in. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // The timestamp when this query was moved to trash. Only present when the // `is_archived` property is `true`. Trashed items are deleted after thirty // days. - MovedToTrashAt types.String `tfsdk:"moved_to_trash_at" tf:"optional"` + MovedToTrashAt types.String `tfsdk:"moved_to_trash_at"` - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // The name of the schema to execute this query in. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` } func (newState *QueryOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryOptions) { @@ -8900,10 +9257,13 @@ func (newState *QueryOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan Query func (newState *QueryOptions) SyncEffectiveFieldsDuringRead(existingState QueryOptions) { } -func (c QueryOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Parameter{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c QueryOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["moved_to_trash_at"] = attrs["moved_to_trash_at"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryOptions. @@ -8976,23 +9336,23 @@ func (o *QueryOptions) SetParameters(ctx context.Context, v []Parameter) { type QueryParameter struct { // Date-range query parameter value. Can only specify one of // `dynamic_date_range_value` or `date_range_value`. - DateRangeValue types.Object `tfsdk:"date_range_value" tf:"optional,object"` + DateRangeValue types.Object `tfsdk:"date_range_value"` // Date query parameter value. Can only specify one of `dynamic_date_value` // or `date_value`. - DateValue types.Object `tfsdk:"date_value" tf:"optional,object"` + DateValue types.Object `tfsdk:"date_value"` // Dropdown query parameter value. - EnumValue types.Object `tfsdk:"enum_value" tf:"optional,object"` + EnumValue types.Object `tfsdk:"enum_value"` // Literal parameter marker that appears between double curly braces in the // query text. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Numeric query parameter value. - NumericValue types.Object `tfsdk:"numeric_value" tf:"optional,object"` + NumericValue types.Object `tfsdk:"numeric_value"` // Query-based dropdown query parameter value. - QueryBackedValue types.Object `tfsdk:"query_backed_value" tf:"optional,object"` + QueryBackedValue types.Object `tfsdk:"query_backed_value"` // Text query parameter value. - TextValue types.Object `tfsdk:"text_value" tf:"optional,object"` + TextValue types.Object `tfsdk:"text_value"` // Text displayed in the user-facing parameter widget in the UI. - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` } func (newState *QueryParameter) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryParameter) { @@ -9001,15 +9361,17 @@ func (newState *QueryParameter) SyncEffectiveFieldsDuringCreateOrUpdate(plan Que func (newState *QueryParameter) SyncEffectiveFieldsDuringRead(existingState QueryParameter) { } -func (c QueryParameter) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DateRangeValue{}.ApplySchemaCustomizations(cs, append(path, "date_range_value")...) - DateValue{}.ApplySchemaCustomizations(cs, append(path, "date_value")...) - EnumValue{}.ApplySchemaCustomizations(cs, append(path, "enum_value")...) - NumericValue{}.ApplySchemaCustomizations(cs, append(path, "numeric_value")...) - QueryBackedValue{}.ApplySchemaCustomizations(cs, append(path, "query_backed_value")...) - TextValue{}.ApplySchemaCustomizations(cs, append(path, "text_value")...) +func (c QueryParameter) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["date_range_value"] = attrs["date_range_value"].SetOptional() + attrs["date_value"] = attrs["date_value"].SetOptional() + attrs["enum_value"] = attrs["enum_value"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["numeric_value"] = attrs["numeric_value"].SetOptional() + attrs["query_backed_value"] = attrs["query_backed_value"].SetOptional() + attrs["text_value"] = attrs["text_value"].SetOptional() + attrs["title"] = attrs["title"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryParameter. @@ -9237,27 +9599,27 @@ type QueryPostContent struct { // is distinct from the warehouse ID. [Learn more] // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list - DataSourceId types.String `tfsdk:"data_source_id" tf:"optional"` + DataSourceId types.String `tfsdk:"data_source_id"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // The title of this query that appears in list views, widget headings, and // on the query page. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Exclusively used for storing a list parameter definitions. A parameter is // an object with `title`, `name`, `type`, and `value` properties. The // `value` field here is the default value. It can be overridden at runtime. - Options types.Object `tfsdk:"options" tf:"optional"` + Options types.Object `tfsdk:"options"` // The identifier of the workspace folder containing the object. - Parent types.String `tfsdk:"parent" tf:"optional"` + Parent types.String `tfsdk:"parent"` // The text of the query to be run. - Query types.String `tfsdk:"query" tf:"optional"` + Query types.String `tfsdk:"query"` // Sets the **Run as** role for the object. Must be set to one of `"viewer"` // (signifying "run as viewer" behavior) or `"owner"` (signifying "run as // owner" behavior) - RunAsRole types.String `tfsdk:"run_as_role" tf:"optional"` + RunAsRole types.String `tfsdk:"run_as_role"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` } func (newState *QueryPostContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryPostContent) { @@ -9266,9 +9628,17 @@ func (newState *QueryPostContent) SyncEffectiveFieldsDuringCreateOrUpdate(plan Q func (newState *QueryPostContent) SyncEffectiveFieldsDuringRead(existingState QueryPostContent) { } -func (c QueryPostContent) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c QueryPostContent) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_source_id"] = attrs["data_source_id"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["parent"] = attrs["parent"].SetOptional() + attrs["query"] = attrs["query"].SetOptional() + attrs["run_as_role"] = attrs["run_as_role"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryPostContent. @@ -9348,9 +9718,9 @@ func (o *QueryPostContent) SetTags(ctx context.Context, v []types.String) { type RepeatedEndpointConfPairs struct { // Deprecated: Use configuration_pairs - ConfigPair types.List `tfsdk:"config_pair" tf:"optional"` + ConfigPair types.List `tfsdk:"config_pair"` - ConfigurationPairs types.List `tfsdk:"configuration_pairs" tf:"optional"` + ConfigurationPairs types.List `tfsdk:"configuration_pairs"` } func (newState *RepeatedEndpointConfPairs) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepeatedEndpointConfPairs) { @@ -9359,11 +9729,11 @@ func (newState *RepeatedEndpointConfPairs) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RepeatedEndpointConfPairs) SyncEffectiveFieldsDuringRead(existingState RepeatedEndpointConfPairs) { } -func (c RepeatedEndpointConfPairs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointConfPair{}.ApplySchemaCustomizations(cs, append(path, "config_pair")...) - EndpointConfPair{}.ApplySchemaCustomizations(cs, append(path, "configuration_pairs")...) +func (c RepeatedEndpointConfPairs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["config_pair"] = attrs["config_pair"].SetOptional() + attrs["configuration_pairs"] = attrs["configuration_pairs"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepeatedEndpointConfPairs. @@ -9563,28 +9933,28 @@ func (o RestoreResponse) Type(ctx context.Context) attr.Type { type ResultData struct { // The number of bytes in the result chunk. This field is not available when // using `INLINE` disposition. - ByteCount types.Int64 `tfsdk:"byte_count" tf:"optional"` + ByteCount types.Int64 `tfsdk:"byte_count"` // The position within the sequence of result set chunks. - ChunkIndex types.Int64 `tfsdk:"chunk_index" tf:"optional"` + ChunkIndex types.Int64 `tfsdk:"chunk_index"` // The `JSON_ARRAY` format is an array of arrays of values, where each // non-null value is formatted as a string. Null values are encoded as JSON // `null`. - DataArray types.List `tfsdk:"data_array" tf:"optional"` + DataArray types.List `tfsdk:"data_array"` - ExternalLinks types.List `tfsdk:"external_links" tf:"optional"` + ExternalLinks types.List `tfsdk:"external_links"` // When fetching, provides the `chunk_index` for the _next_ chunk. If // absent, indicates there are no more chunks. The next chunk can be fetched // with a :method:statementexecution/getStatementResultChunkN request. - NextChunkIndex types.Int64 `tfsdk:"next_chunk_index" tf:"optional"` + NextChunkIndex types.Int64 `tfsdk:"next_chunk_index"` // When fetching, provides a link to fetch the _next_ chunk. If absent, // indicates there are no more chunks. This link is an absolute `path` to be // joined with your `$DATABRICKS_HOST`, and should be treated as an opaque // link. This is an alternative to using `next_chunk_index`. - NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link" tf:"optional"` + NextChunkInternalLink types.String `tfsdk:"next_chunk_internal_link"` // The number of rows within the result chunk. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` // The starting row offset within the result set. - RowOffset types.Int64 `tfsdk:"row_offset" tf:"optional"` + RowOffset types.Int64 `tfsdk:"row_offset"` } func (newState *ResultData) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultData) { @@ -9593,10 +9963,17 @@ func (newState *ResultData) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultD func (newState *ResultData) SyncEffectiveFieldsDuringRead(existingState ResultData) { } -func (c ResultData) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ExternalLink{}.ApplySchemaCustomizations(cs, append(path, "external_links")...) +func (c ResultData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["byte_count"] = attrs["byte_count"].SetOptional() + attrs["chunk_index"] = attrs["chunk_index"].SetOptional() + attrs["data_array"] = attrs["data_array"].SetOptional() + attrs["external_links"] = attrs["external_links"].SetOptional() + attrs["next_chunk_index"] = attrs["next_chunk_index"].SetOptional() + attrs["next_chunk_internal_link"] = attrs["next_chunk_internal_link"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() + attrs["row_offset"] = attrs["row_offset"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultData. @@ -9708,21 +10085,21 @@ func (o *ResultData) SetExternalLinks(ctx context.Context, v []ExternalLink) { // The result manifest provides schema and metadata for the result set. type ResultManifest struct { // Array of result set chunk metadata. - Chunks types.List `tfsdk:"chunks" tf:"optional"` + Chunks types.List `tfsdk:"chunks"` - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // The schema is an ordered list of column descriptions. - Schema types.Object `tfsdk:"schema" tf:"optional,object"` + Schema types.Object `tfsdk:"schema"` // The total number of bytes in the result set. This field is not available // when using `INLINE` disposition. - TotalByteCount types.Int64 `tfsdk:"total_byte_count" tf:"optional"` + TotalByteCount types.Int64 `tfsdk:"total_byte_count"` // The total number of chunks that the result set has been divided into. - TotalChunkCount types.Int64 `tfsdk:"total_chunk_count" tf:"optional"` + TotalChunkCount types.Int64 `tfsdk:"total_chunk_count"` // The total number of rows in the result set. - TotalRowCount types.Int64 `tfsdk:"total_row_count" tf:"optional"` + TotalRowCount types.Int64 `tfsdk:"total_row_count"` // Indicates whether the result is truncated due to `row_limit` or // `byte_limit`. - Truncated types.Bool `tfsdk:"truncated" tf:"optional"` + Truncated types.Bool `tfsdk:"truncated"` } func (newState *ResultManifest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultManifest) { @@ -9731,11 +10108,16 @@ func (newState *ResultManifest) SyncEffectiveFieldsDuringCreateOrUpdate(plan Res func (newState *ResultManifest) SyncEffectiveFieldsDuringRead(existingState ResultManifest) { } -func (c ResultManifest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - BaseChunkInfo{}.ApplySchemaCustomizations(cs, append(path, "chunks")...) - ResultSchema{}.ApplySchemaCustomizations(cs, append(path, "schema")...) +func (c ResultManifest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["chunks"] = attrs["chunks"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["total_byte_count"] = attrs["total_byte_count"].SetOptional() + attrs["total_chunk_count"] = attrs["total_chunk_count"].SetOptional() + attrs["total_row_count"] = attrs["total_row_count"].SetOptional() + attrs["truncated"] = attrs["truncated"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultManifest. @@ -9842,9 +10224,9 @@ func (o *ResultManifest) SetSchema(ctx context.Context, v ResultSchema) { // The schema is an ordered list of column descriptions. type ResultSchema struct { - ColumnCount types.Int64 `tfsdk:"column_count" tf:"optional"` + ColumnCount types.Int64 `tfsdk:"column_count"` - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` } func (newState *ResultSchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultSchema) { @@ -9853,10 +10235,11 @@ func (newState *ResultSchema) SyncEffectiveFieldsDuringCreateOrUpdate(plan Resul func (newState *ResultSchema) SyncEffectiveFieldsDuringRead(existingState ResultSchema) { } -func (c ResultSchema) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnInfo{}.ApplySchemaCustomizations(cs, append(path, "columns")...) +func (c ResultSchema) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column_count"] = attrs["column_count"].SetOptional() + attrs["columns"] = attrs["columns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultSchema. @@ -9923,9 +10306,9 @@ func (o *ResultSchema) SetColumns(ctx context.Context, v []ColumnInfo) { } type ServiceError struct { - ErrorCode types.String `tfsdk:"error_code" tf:"optional"` + ErrorCode types.String `tfsdk:"error_code"` // A brief summary of the error condition. - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *ServiceError) SyncEffectiveFieldsDuringCreateOrUpdate(plan ServiceError) { @@ -9934,9 +10317,11 @@ func (newState *ServiceError) SyncEffectiveFieldsDuringCreateOrUpdate(plan Servi func (newState *ServiceError) SyncEffectiveFieldsDuringRead(existingState ServiceError) { } -func (c ServiceError) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ServiceError) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error_code"] = attrs["error_code"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ServiceError. @@ -9974,7 +10359,7 @@ func (o ServiceError) Type(ctx context.Context) attr.Type { // Set object ACL type SetRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // Object ID. The ACL for the object with this UUID is overwritten by this // request's POST content. ObjectId types.String `tfsdk:"-"` @@ -10048,11 +10433,11 @@ func (o *SetRequest) SetAccessControlList(ctx context.Context, v []AccessControl } type SetResponse struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // An object's type and UUID, separated by a forward slash (/) character. - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` // A singular noun object type. - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetResponse. @@ -10122,30 +10507,30 @@ func (o *SetResponse) SetAccessControlList(ctx context.Context, v []AccessContro type SetWorkspaceWarehouseConfigRequest struct { // Optional: Channel selection details - Channel types.Object `tfsdk:"channel" tf:"optional,object"` + Channel types.Object `tfsdk:"channel"` // Deprecated: Use sql_configuration_parameters - ConfigParam types.Object `tfsdk:"config_param" tf:"optional,object"` + ConfigParam types.Object `tfsdk:"config_param"` // Spark confs for external hive metastore configuration JSON serialized // size must be less than <= 512K - DataAccessConfig types.List `tfsdk:"data_access_config" tf:"optional"` + DataAccessConfig types.List `tfsdk:"data_access_config"` // List of Warehouse Types allowed in this workspace (limits allowed value // of the type field in CreateWarehouse and EditWarehouse). Note: Some types // cannot be disabled, they don't need to be specified in // SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing // warehouses to be converted to another type. Used by frontend to save // specific type availability in the warehouse create and edit form UI. - EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types" tf:"optional"` + EnabledWarehouseTypes types.List `tfsdk:"enabled_warehouse_types"` // Deprecated: Use sql_configuration_parameters - GlobalParam types.Object `tfsdk:"global_param" tf:"optional,object"` + GlobalParam types.Object `tfsdk:"global_param"` // GCP only: Google Service Account used to pass to cluster to access Google // Cloud Storage - GoogleServiceAccount types.String `tfsdk:"google_service_account" tf:"optional"` + GoogleServiceAccount types.String `tfsdk:"google_service_account"` // AWS Only: Instance profile used to pass IAM role to the cluster - InstanceProfileArn types.String `tfsdk:"instance_profile_arn" tf:"optional"` + InstanceProfileArn types.String `tfsdk:"instance_profile_arn"` // Security policy for warehouses - SecurityPolicy types.String `tfsdk:"security_policy" tf:"optional"` + SecurityPolicy types.String `tfsdk:"security_policy"` // SQL configuration parameters - SqlConfigurationParameters types.Object `tfsdk:"sql_configuration_parameters" tf:"optional,object"` + SqlConfigurationParameters types.Object `tfsdk:"sql_configuration_parameters"` } func (newState *SetWorkspaceWarehouseConfigRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan SetWorkspaceWarehouseConfigRequest) { @@ -10154,15 +10539,18 @@ func (newState *SetWorkspaceWarehouseConfigRequest) SyncEffectiveFieldsDuringCre func (newState *SetWorkspaceWarehouseConfigRequest) SyncEffectiveFieldsDuringRead(existingState SetWorkspaceWarehouseConfigRequest) { } -func (c SetWorkspaceWarehouseConfigRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Channel{}.ApplySchemaCustomizations(cs, append(path, "channel")...) - RepeatedEndpointConfPairs{}.ApplySchemaCustomizations(cs, append(path, "config_param")...) - EndpointConfPair{}.ApplySchemaCustomizations(cs, append(path, "data_access_config")...) - WarehouseTypePair{}.ApplySchemaCustomizations(cs, append(path, "enabled_warehouse_types")...) - RepeatedEndpointConfPairs{}.ApplySchemaCustomizations(cs, append(path, "global_param")...) - RepeatedEndpointConfPairs{}.ApplySchemaCustomizations(cs, append(path, "sql_configuration_parameters")...) +func (c SetWorkspaceWarehouseConfigRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["channel"] = attrs["channel"].SetOptional() + attrs["config_param"] = attrs["config_param"].SetOptional() + attrs["data_access_config"] = attrs["data_access_config"].SetOptional() + attrs["enabled_warehouse_types"] = attrs["enabled_warehouse_types"].SetOptional() + attrs["global_param"] = attrs["global_param"].SetOptional() + attrs["google_service_account"] = attrs["google_service_account"].SetOptional() + attrs["instance_profile_arn"] = attrs["instance_profile_arn"].SetOptional() + attrs["security_policy"] = attrs["security_policy"].SetOptional() + attrs["sql_configuration_parameters"] = attrs["sql_configuration_parameters"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetWorkspaceWarehouseConfigRequest. @@ -10396,9 +10784,9 @@ func (newState *SetWorkspaceWarehouseConfigResponse) SyncEffectiveFieldsDuringCr func (newState *SetWorkspaceWarehouseConfigResponse) SyncEffectiveFieldsDuringRead(existingState SetWorkspaceWarehouseConfigResponse) { } -func (c SetWorkspaceWarehouseConfigResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SetWorkspaceWarehouseConfigResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SetWorkspaceWarehouseConfigResponse. @@ -10474,9 +10862,9 @@ func (newState *StartWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *StartWarehouseResponse) SyncEffectiveFieldsDuringRead(existingState StartWarehouseResponse) { } -func (c StartWarehouseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StartWarehouseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StartWarehouseResponse. @@ -10508,7 +10896,7 @@ func (o StartWarehouseResponse) Type(ctx context.Context) attr.Type { type StatementParameterListItem struct { // The name of a parameter marker to be substituted in the statement. - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // The data type, given as a string. For example: `INT`, `STRING`, // `DECIMAL(10,2)`. If no type is given the type is assumed to be `STRING`. // Complex types, such as `ARRAY`, `MAP`, and `STRUCT` are not supported. @@ -10516,10 +10904,10 @@ type StatementParameterListItem struct { // reference. // // [Data types]: https://docs.databricks.com/sql/language-manual/functions/cast.html - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // The value to substitute, represented as a string. If omitted, the value // is interpreted as NULL. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *StatementParameterListItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan StatementParameterListItem) { @@ -10528,10 +10916,12 @@ func (newState *StatementParameterListItem) SyncEffectiveFieldsDuringCreateOrUpd func (newState *StatementParameterListItem) SyncEffectiveFieldsDuringRead(existingState StatementParameterListItem) { } -func (c StatementParameterListItem) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "name")...) +func (c StatementParameterListItem) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["type"] = attrs["type"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StatementParameterListItem. @@ -10571,15 +10961,15 @@ func (o StatementParameterListItem) Type(ctx context.Context) attr.Type { type StatementResponse struct { // The result manifest provides schema and metadata for the result set. - Manifest types.Object `tfsdk:"manifest" tf:"optional,object"` + Manifest types.Object `tfsdk:"manifest"` - Result types.Object `tfsdk:"result" tf:"optional,object"` + Result types.Object `tfsdk:"result"` // The statement ID is returned upon successfully submitting a SQL // statement, and is a required reference for all subsequent calls. - StatementId types.String `tfsdk:"statement_id" tf:"optional"` + StatementId types.String `tfsdk:"statement_id"` // The status response includes execution state and if relevant, error // information. - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` } func (newState *StatementResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan StatementResponse) { @@ -10588,12 +10978,13 @@ func (newState *StatementResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *StatementResponse) SyncEffectiveFieldsDuringRead(existingState StatementResponse) { } -func (c StatementResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ResultManifest{}.ApplySchemaCustomizations(cs, append(path, "manifest")...) - ResultData{}.ApplySchemaCustomizations(cs, append(path, "result")...) - StatementStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) +func (c StatementResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["manifest"] = attrs["manifest"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() + attrs["statement_id"] = attrs["statement_id"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StatementResponse. @@ -10724,7 +11115,7 @@ func (o *StatementResponse) SetStatus(ctx context.Context, v StatementStatus) { // The status response includes execution state and if relevant, error // information. type StatementStatus struct { - Error types.Object `tfsdk:"error" tf:"optional,object"` + Error types.Object `tfsdk:"error"` // Statement execution state: - `PENDING`: waiting for warehouse - // `RUNNING`: running - `SUCCEEDED`: execution was successful, result data // available for fetch - `FAILED`: execution failed; reason for failure @@ -10732,7 +11123,7 @@ type StatementStatus struct { // come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` // - `CLOSED`: execution successful, and statement closed; result no longer // available for fetch - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *StatementStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan StatementStatus) { @@ -10741,10 +11132,11 @@ func (newState *StatementStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan St func (newState *StatementStatus) SyncEffectiveFieldsDuringRead(existingState StatementStatus) { } -func (c StatementStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ServiceError{}.ApplySchemaCustomizations(cs, append(path, "error")...) +func (c StatementStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["error"] = attrs["error"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StatementStatus. @@ -10856,9 +11248,9 @@ func (newState *StopWarehouseResponse) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *StopWarehouseResponse) SyncEffectiveFieldsDuringRead(existingState StopWarehouseResponse) { } -func (c StopWarehouseResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c StopWarehouseResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in StopWarehouseResponse. @@ -10889,7 +11281,7 @@ func (o StopWarehouseResponse) Type(ctx context.Context) attr.Type { } type Success struct { - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` } func (newState *Success) SyncEffectiveFieldsDuringCreateOrUpdate(plan Success) { @@ -10898,9 +11290,10 @@ func (newState *Success) SyncEffectiveFieldsDuringCreateOrUpdate(plan Success) { func (newState *Success) SyncEffectiveFieldsDuringRead(existingState Success) { } -func (c Success) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Success) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Success. @@ -10936,12 +11329,12 @@ func (o Success) Type(ctx context.Context) attr.Type { type TerminationReason struct { // status code indicating why the cluster was terminated - Code types.String `tfsdk:"code" tf:"optional"` + Code types.String `tfsdk:"code"` // list of parameters that provide additional information about why the // cluster was terminated - Parameters types.Map `tfsdk:"parameters" tf:"optional"` + Parameters types.Map `tfsdk:"parameters"` // type of the termination - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *TerminationReason) SyncEffectiveFieldsDuringCreateOrUpdate(plan TerminationReason) { @@ -10950,9 +11343,12 @@ func (newState *TerminationReason) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *TerminationReason) SyncEffectiveFieldsDuringRead(existingState TerminationReason) { } -func (c TerminationReason) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TerminationReason) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["code"] = attrs["code"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TerminationReason. @@ -11021,7 +11417,7 @@ func (o *TerminationReason) SetParameters(ctx context.Context, v map[string]type } type TextValue struct { - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *TextValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan TextValue) { @@ -11030,9 +11426,10 @@ func (newState *TextValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan TextValu func (newState *TextValue) SyncEffectiveFieldsDuringRead(existingState TextValue) { } -func (c TextValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TextValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TextValue. @@ -11068,9 +11465,9 @@ func (o TextValue) Type(ctx context.Context) attr.Type { type TimeRange struct { // The end time in milliseconds. - EndTimeMs types.Int64 `tfsdk:"end_time_ms" tf:"optional"` + EndTimeMs types.Int64 `tfsdk:"end_time_ms"` // The start time in milliseconds. - StartTimeMs types.Int64 `tfsdk:"start_time_ms" tf:"optional"` + StartTimeMs types.Int64 `tfsdk:"start_time_ms"` } func (newState *TimeRange) SyncEffectiveFieldsDuringCreateOrUpdate(plan TimeRange) { @@ -11079,9 +11476,11 @@ func (newState *TimeRange) SyncEffectiveFieldsDuringCreateOrUpdate(plan TimeRang func (newState *TimeRange) SyncEffectiveFieldsDuringRead(existingState TimeRange) { } -func (c TimeRange) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TimeRange) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["end_time_ms"] = attrs["end_time_ms"].SetOptional() + attrs["start_time_ms"] = attrs["start_time_ms"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TimeRange. @@ -11119,7 +11518,7 @@ func (o TimeRange) Type(ctx context.Context) attr.Type { type TransferOwnershipObjectId struct { // Email address for the new owner, who must exist in the workspace. - NewOwner types.String `tfsdk:"new_owner" tf:"optional"` + NewOwner types.String `tfsdk:"new_owner"` } func (newState *TransferOwnershipObjectId) SyncEffectiveFieldsDuringCreateOrUpdate(plan TransferOwnershipObjectId) { @@ -11128,9 +11527,10 @@ func (newState *TransferOwnershipObjectId) SyncEffectiveFieldsDuringCreateOrUpda func (newState *TransferOwnershipObjectId) SyncEffectiveFieldsDuringRead(existingState TransferOwnershipObjectId) { } -func (c TransferOwnershipObjectId) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c TransferOwnershipObjectId) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["new_owner"] = attrs["new_owner"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in TransferOwnershipObjectId. @@ -11167,7 +11567,7 @@ func (o TransferOwnershipObjectId) Type(ctx context.Context) attr.Type { // Transfer object ownership type TransferOwnershipRequest struct { // Email address for the new owner, who must exist in the workspace. - NewOwner types.String `tfsdk:"new_owner" tf:"optional"` + NewOwner types.String `tfsdk:"new_owner"` // The ID of the object on which to change ownership. ObjectId types.Object `tfsdk:"-"` // The type of object on which to change ownership. @@ -11312,14 +11712,14 @@ func (o TrashQueryRequest) Type(ctx context.Context) attr.Type { } type UpdateAlertRequest struct { - Alert types.Object `tfsdk:"alert" tf:"optional,object"` + Alert types.Object `tfsdk:"alert"` Id types.String `tfsdk:"-"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` } func (newState *UpdateAlertRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAlertRequest) { @@ -11328,12 +11728,12 @@ func (newState *UpdateAlertRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateAlertRequest) SyncEffectiveFieldsDuringRead(existingState UpdateAlertRequest) { } -func (c UpdateAlertRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpdateAlertRequestAlert{}.ApplySchemaCustomizations(cs, append(path, "alert")...) - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "update_mask")...) +func (c UpdateAlertRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["alert"] = attrs["alert"].SetOptional() + attrs["id"] = attrs["id"].SetRequired() + attrs["update_mask"] = attrs["update_mask"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAlertRequest. @@ -11403,31 +11803,31 @@ func (o *UpdateAlertRequest) SetAlert(ctx context.Context, v UpdateAlertRequestA type UpdateAlertRequestAlert struct { // Trigger conditions of the alert. - Condition types.Object `tfsdk:"condition" tf:"optional,object"` + Condition types.Object `tfsdk:"condition"` // Custom body of alert notification, if it exists. See [here] for custom // templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomBody types.String `tfsdk:"custom_body" tf:"optional"` + CustomBody types.String `tfsdk:"custom_body"` // Custom subject of alert notification, if it exists. This can include // email subject entries and Slack notification headers, for example. See // [here] for custom templating instructions. // // [here]: https://docs.databricks.com/sql/user/alerts/index.html - CustomSubject types.String `tfsdk:"custom_subject" tf:"optional"` + CustomSubject types.String `tfsdk:"custom_subject"` // The display name of the alert. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Whether to notify alert subscribers when alert returns back to normal. - NotifyOnOk types.Bool `tfsdk:"notify_on_ok" tf:"optional"` + NotifyOnOk types.Bool `tfsdk:"notify_on_ok"` // The owner's username. This field is set to "Unavailable" if the user has // been deleted. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // UUID of the query attached to the alert. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // Number of seconds an alert must wait after being triggered to rearm // itself. After rearming, it can be triggered again. If 0 or not specified, // the alert will not be triggered again. - SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger" tf:"optional"` + SecondsToRetrigger types.Int64 `tfsdk:"seconds_to_retrigger"` } func (newState *UpdateAlertRequestAlert) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAlertRequestAlert) { @@ -11436,10 +11836,17 @@ func (newState *UpdateAlertRequestAlert) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateAlertRequestAlert) SyncEffectiveFieldsDuringRead(existingState UpdateAlertRequestAlert) { } -func (c UpdateAlertRequestAlert) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AlertCondition{}.ApplySchemaCustomizations(cs, append(path, "condition")...) +func (c UpdateAlertRequestAlert) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["condition"] = attrs["condition"].SetOptional() + attrs["custom_body"] = attrs["custom_body"].SetOptional() + attrs["custom_subject"] = attrs["custom_subject"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["notify_on_ok"] = attrs["notify_on_ok"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["seconds_to_retrigger"] = attrs["seconds_to_retrigger"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAlertRequestAlert. @@ -11520,12 +11927,12 @@ func (o *UpdateAlertRequestAlert) SetCondition(ctx context.Context, v AlertCondi type UpdateQueryRequest struct { Id types.String `tfsdk:"-"` - Query types.Object `tfsdk:"query" tf:"optional,object"` + Query types.Object `tfsdk:"query"` // Field mask is required to be passed into the PATCH request. Field mask // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` } func (newState *UpdateQueryRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateQueryRequest) { @@ -11534,12 +11941,12 @@ func (newState *UpdateQueryRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateQueryRequest) SyncEffectiveFieldsDuringRead(existingState UpdateQueryRequest) { } -func (c UpdateQueryRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - UpdateQueryRequestQuery{}.ApplySchemaCustomizations(cs, append(path, "query")...) - cs.SetRequired(append(path, "update_mask")...) +func (c UpdateQueryRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["query"] = attrs["query"].SetOptional() + attrs["update_mask"] = attrs["update_mask"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateQueryRequest. @@ -11609,29 +12016,29 @@ func (o *UpdateQueryRequest) SetQuery(ctx context.Context, v UpdateQueryRequestQ type UpdateQueryRequestQuery struct { // Whether to apply a 1000 row limit to the query result. - ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit" tf:"optional"` + ApplyAutoLimit types.Bool `tfsdk:"apply_auto_limit"` // Name of the catalog where this query will be executed. - Catalog types.String `tfsdk:"catalog" tf:"optional"` + Catalog types.String `tfsdk:"catalog"` // General description that conveys additional information about this query // such as usage notes. - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Display name of the query that appears in list views, widget headings, // and on the query page. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // Username of the user that owns the query. - OwnerUserName types.String `tfsdk:"owner_user_name" tf:"optional"` + OwnerUserName types.String `tfsdk:"owner_user_name"` // List of query parameter definitions. - Parameters types.List `tfsdk:"parameters" tf:"optional"` + Parameters types.List `tfsdk:"parameters"` // Text of the query to be run. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // Sets the "Run as" role for the object. - RunAsMode types.String `tfsdk:"run_as_mode" tf:"optional"` + RunAsMode types.String `tfsdk:"run_as_mode"` // Name of the schema where this query will be executed. - Schema types.String `tfsdk:"schema" tf:"optional"` + Schema types.String `tfsdk:"schema"` - Tags types.List `tfsdk:"tags" tf:"optional"` + Tags types.List `tfsdk:"tags"` // ID of the SQL warehouse attached to the query. - WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` + WarehouseId types.String `tfsdk:"warehouse_id"` } func (newState *UpdateQueryRequestQuery) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateQueryRequestQuery) { @@ -11640,10 +12047,20 @@ func (newState *UpdateQueryRequestQuery) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateQueryRequestQuery) SyncEffectiveFieldsDuringRead(existingState UpdateQueryRequestQuery) { } -func (c UpdateQueryRequestQuery) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - QueryParameter{}.ApplySchemaCustomizations(cs, append(path, "parameters")...) +func (c UpdateQueryRequestQuery) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["apply_auto_limit"] = attrs["apply_auto_limit"].SetOptional() + attrs["catalog"] = attrs["catalog"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["owner_user_name"] = attrs["owner_user_name"].SetOptional() + attrs["parameters"] = attrs["parameters"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["run_as_mode"] = attrs["run_as_mode"].SetOptional() + attrs["schema"] = attrs["schema"].SetOptional() + attrs["tags"] = attrs["tags"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateQueryRequestQuery. @@ -11792,9 +12209,9 @@ type UpdateVisualizationRequest struct { // specifies which fields of the setting payload will be updated. The field // mask needs to be supplied as single string. To specify multiple fields in // the field mask, use comma as the separator (no space). - UpdateMask types.String `tfsdk:"update_mask" tf:""` + UpdateMask types.String `tfsdk:"update_mask"` - Visualization types.Object `tfsdk:"visualization" tf:"optional,object"` + Visualization types.Object `tfsdk:"visualization"` } func (newState *UpdateVisualizationRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateVisualizationRequest) { @@ -11803,12 +12220,12 @@ func (newState *UpdateVisualizationRequest) SyncEffectiveFieldsDuringCreateOrUpd func (newState *UpdateVisualizationRequest) SyncEffectiveFieldsDuringRead(existingState UpdateVisualizationRequest) { } -func (c UpdateVisualizationRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "id")...) - cs.SetRequired(append(path, "update_mask")...) - UpdateVisualizationRequestVisualization{}.ApplySchemaCustomizations(cs, append(path, "visualization")...) +func (c UpdateVisualizationRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetRequired() + attrs["update_mask"] = attrs["update_mask"].SetRequired() + attrs["visualization"] = attrs["visualization"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateVisualizationRequest. @@ -11878,17 +12295,17 @@ func (o *UpdateVisualizationRequest) SetVisualization(ctx context.Context, v Upd type UpdateVisualizationRequestVisualization struct { // The display name of the visualization. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions types.String `tfsdk:"serialized_options" tf:"optional"` + SerializedOptions types.String `tfsdk:"serialized_options"` // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan types.String `tfsdk:"serialized_query_plan" tf:"optional"` + SerializedQueryPlan types.String `tfsdk:"serialized_query_plan"` // The type of visualization: counter, table, funnel, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` } func (newState *UpdateVisualizationRequestVisualization) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateVisualizationRequestVisualization) { @@ -11897,9 +12314,13 @@ func (newState *UpdateVisualizationRequestVisualization) SyncEffectiveFieldsDuri func (newState *UpdateVisualizationRequestVisualization) SyncEffectiveFieldsDuringRead(existingState UpdateVisualizationRequestVisualization) { } -func (c UpdateVisualizationRequestVisualization) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateVisualizationRequestVisualization) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["serialized_options"] = attrs["serialized_options"].SetOptional() + attrs["serialized_query_plan"] = attrs["serialized_query_plan"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateVisualizationRequestVisualization. @@ -11940,11 +12361,11 @@ func (o UpdateVisualizationRequestVisualization) Type(ctx context.Context) attr. } type User struct { - Email types.String `tfsdk:"email" tf:"optional"` + Email types.String `tfsdk:"email"` - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *User) SyncEffectiveFieldsDuringCreateOrUpdate(plan User) { @@ -11953,9 +12374,12 @@ func (newState *User) SyncEffectiveFieldsDuringCreateOrUpdate(plan User) { func (newState *User) SyncEffectiveFieldsDuringRead(existingState User) { } -func (c User) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c User) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["email"] = attrs["email"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in User. @@ -11995,25 +12419,25 @@ func (o User) Type(ctx context.Context) attr.Type { type Visualization struct { // The timestamp indicating when the visualization was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` + CreateTime types.String `tfsdk:"create_time"` // The display name of the visualization. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // UUID identifying the visualization. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // UUID of the query that the visualization is attached to. - QueryId types.String `tfsdk:"query_id" tf:"optional"` + QueryId types.String `tfsdk:"query_id"` // The visualization options varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying // visualization options directly. - SerializedOptions types.String `tfsdk:"serialized_options" tf:"optional"` + SerializedOptions types.String `tfsdk:"serialized_options"` // The visualization query plan varies widely from one visualization type to // the next and is unsupported. Databricks does not recommend modifying the // visualization query plan directly. - SerializedQueryPlan types.String `tfsdk:"serialized_query_plan" tf:"optional"` + SerializedQueryPlan types.String `tfsdk:"serialized_query_plan"` // The type of visualization: counter, table, funnel, and so on. - Type_ types.String `tfsdk:"type" tf:"optional"` + Type_ types.String `tfsdk:"type"` // The timestamp indicating when the visualization was updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` + UpdateTime types.String `tfsdk:"update_time"` } func (newState *Visualization) SyncEffectiveFieldsDuringCreateOrUpdate(plan Visualization) { @@ -12022,9 +12446,17 @@ func (newState *Visualization) SyncEffectiveFieldsDuringCreateOrUpdate(plan Visu func (newState *Visualization) SyncEffectiveFieldsDuringRead(existingState Visualization) { } -func (c Visualization) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c Visualization) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["create_time"] = attrs["create_time"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["query_id"] = attrs["query_id"].SetOptional() + attrs["serialized_options"] = attrs["serialized_options"].SetOptional() + attrs["serialized_query_plan"] = attrs["serialized_query_plan"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["update_time"] = attrs["update_time"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Visualization. @@ -12074,13 +12506,13 @@ func (o Visualization) Type(ctx context.Context) attr.Type { type WarehouseAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WarehouseAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehouseAccessControlRequest) { @@ -12089,9 +12521,13 @@ func (newState *WarehouseAccessControlRequest) SyncEffectiveFieldsDuringCreateOr func (newState *WarehouseAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState WarehouseAccessControlRequest) { } -func (c WarehouseAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehouseAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehouseAccessControlRequest. @@ -12133,15 +12569,15 @@ func (o WarehouseAccessControlRequest) Type(ctx context.Context) attr.Type { type WarehouseAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WarehouseAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehouseAccessControlResponse) { @@ -12150,10 +12586,14 @@ func (newState *WarehouseAccessControlResponse) SyncEffectiveFieldsDuringCreateO func (newState *WarehouseAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState WarehouseAccessControlResponse) { } -func (c WarehouseAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehousePermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c WarehouseAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehouseAccessControlResponse. @@ -12226,11 +12666,11 @@ func (o *WarehouseAccessControlResponse) SetAllPermissions(ctx context.Context, } type WarehousePermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WarehousePermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehousePermission) { @@ -12239,9 +12679,12 @@ func (newState *WarehousePermission) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *WarehousePermission) SyncEffectiveFieldsDuringRead(existingState WarehousePermission) { } -func (c WarehousePermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehousePermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermission. @@ -12310,11 +12753,11 @@ func (o *WarehousePermission) SetInheritedFromObject(ctx context.Context, v []ty } type WarehousePermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *WarehousePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehousePermissions) { @@ -12323,10 +12766,12 @@ func (newState *WarehousePermissions) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *WarehousePermissions) SyncEffectiveFieldsDuringRead(existingState WarehousePermissions) { } -func (c WarehousePermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehouseAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c WarehousePermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermissions. @@ -12395,9 +12840,9 @@ func (o *WarehousePermissions) SetAccessControlList(ctx context.Context, v []War } type WarehousePermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WarehousePermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehousePermissionsDescription) { @@ -12406,9 +12851,11 @@ func (newState *WarehousePermissionsDescription) SyncEffectiveFieldsDuringCreate func (newState *WarehousePermissionsDescription) SyncEffectiveFieldsDuringRead(existingState WarehousePermissionsDescription) { } -func (c WarehousePermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehousePermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermissionsDescription. @@ -12445,7 +12892,7 @@ func (o WarehousePermissionsDescription) Type(ctx context.Context) attr.Type { } type WarehousePermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The SQL warehouse for which to get or manage permissions. WarehouseId types.String `tfsdk:"-"` } @@ -12456,11 +12903,11 @@ func (newState *WarehousePermissionsRequest) SyncEffectiveFieldsDuringCreateOrUp func (newState *WarehousePermissionsRequest) SyncEffectiveFieldsDuringRead(existingState WarehousePermissionsRequest) { } -func (c WarehousePermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WarehouseAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "warehouse_id")...) +func (c WarehousePermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["warehouse_id"] = attrs["warehouse_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehousePermissionsRequest. @@ -12529,9 +12976,9 @@ func (o *WarehousePermissionsRequest) SetAccessControlList(ctx context.Context, type WarehouseTypePair struct { // If set to false the specific warehouse type will not be be allowed as a // value for warehouse_type in CreateWarehouse and EditWarehouse - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` // Warehouse type: `PRO` or `CLASSIC`. - WarehouseType types.String `tfsdk:"warehouse_type" tf:"optional"` + WarehouseType types.String `tfsdk:"warehouse_type"` } func (newState *WarehouseTypePair) SyncEffectiveFieldsDuringCreateOrUpdate(plan WarehouseTypePair) { @@ -12540,9 +12987,11 @@ func (newState *WarehouseTypePair) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *WarehouseTypePair) SyncEffectiveFieldsDuringRead(existingState WarehouseTypePair) { } -func (c WarehouseTypePair) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WarehouseTypePair) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetOptional() + attrs["warehouse_type"] = attrs["warehouse_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WarehouseTypePair. @@ -12580,17 +13029,17 @@ func (o WarehouseTypePair) Type(ctx context.Context) attr.Type { type Widget struct { // The unique ID for this widget. - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` - Options types.Object `tfsdk:"options" tf:"optional,object"` + Options types.Object `tfsdk:"options"` // The visualization description API changes frequently and is unsupported. // You can duplicate a visualization by copying description objects received // _from the API_ and then using them to create a new one with a POST // request to the same endpoint. Databricks does not recommend constructing // ad-hoc visualizations entirely in JSON. - Visualization types.Object `tfsdk:"visualization" tf:"optional,object"` + Visualization types.Object `tfsdk:"visualization"` // Unused field. - Width types.Int64 `tfsdk:"width" tf:"optional"` + Width types.Int64 `tfsdk:"width"` } func (newState *Widget) SyncEffectiveFieldsDuringCreateOrUpdate(plan Widget) { @@ -12599,11 +13048,13 @@ func (newState *Widget) SyncEffectiveFieldsDuringCreateOrUpdate(plan Widget) { func (newState *Widget) SyncEffectiveFieldsDuringRead(existingState Widget) { } -func (c Widget) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WidgetOptions{}.ApplySchemaCustomizations(cs, append(path, "options")...) - LegacyVisualization{}.ApplySchemaCustomizations(cs, append(path, "visualization")...) +func (c Widget) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["id"] = attrs["id"].SetOptional() + attrs["options"] = attrs["options"].SetOptional() + attrs["visualization"] = attrs["visualization"].SetOptional() + attrs["width"] = attrs["width"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Widget. @@ -12704,22 +13155,22 @@ func (o *Widget) SetVisualization(ctx context.Context, v LegacyVisualization) { type WidgetOptions struct { // Timestamp when this object was created - CreatedAt types.String `tfsdk:"created_at" tf:"optional"` + CreatedAt types.String `tfsdk:"created_at"` // Custom description of the widget - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Whether this widget is hidden on the dashboard. - IsHidden types.Bool `tfsdk:"isHidden" tf:"optional"` + IsHidden types.Bool `tfsdk:"isHidden"` // How parameters used by the visualization in this widget relate to other // widgets on the dashboard. Databricks does not recommend modifying this // definition in JSON. - ParameterMappings types.Object `tfsdk:"parameterMappings" tf:"optional"` + ParameterMappings types.Object `tfsdk:"parameterMappings"` // Coordinates of this widget on a dashboard. This portion of the API // changes frequently and is unsupported. - Position types.Object `tfsdk:"position" tf:"optional,object"` + Position types.Object `tfsdk:"position"` // Custom title of the widget - Title types.String `tfsdk:"title" tf:"optional"` + Title types.String `tfsdk:"title"` // Timestamp of the last time this object was updated. - UpdatedAt types.String `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.String `tfsdk:"updated_at"` } func (newState *WidgetOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan WidgetOptions) { @@ -12728,10 +13179,16 @@ func (newState *WidgetOptions) SyncEffectiveFieldsDuringCreateOrUpdate(plan Widg func (newState *WidgetOptions) SyncEffectiveFieldsDuringRead(existingState WidgetOptions) { } -func (c WidgetOptions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WidgetPosition{}.ApplySchemaCustomizations(cs, append(path, "position")...) +func (c WidgetOptions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["description"] = attrs["description"].SetOptional() + attrs["isHidden"] = attrs["isHidden"].SetOptional() + attrs["parameterMappings"] = attrs["parameterMappings"].SetOptional() + attrs["position"] = attrs["position"].SetOptional() + attrs["title"] = attrs["title"].SetOptional() + attrs["updated_at"] = attrs["updated_at"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WidgetOptions. @@ -12811,15 +13268,15 @@ func (o *WidgetOptions) SetPosition(ctx context.Context, v WidgetPosition) { // frequently and is unsupported. type WidgetPosition struct { // reserved for internal use - AutoHeight types.Bool `tfsdk:"autoHeight" tf:"optional"` + AutoHeight types.Bool `tfsdk:"autoHeight"` // column in the dashboard grid. Values start with 0 - Col types.Int64 `tfsdk:"col" tf:"optional"` + Col types.Int64 `tfsdk:"col"` // row in the dashboard grid. Values start with 0 - Row types.Int64 `tfsdk:"row" tf:"optional"` + Row types.Int64 `tfsdk:"row"` // width of the widget measured in dashboard grid cells - SizeX types.Int64 `tfsdk:"sizeX" tf:"optional"` + SizeX types.Int64 `tfsdk:"sizeX"` // height of the widget measured in dashboard grid cells - SizeY types.Int64 `tfsdk:"sizeY" tf:"optional"` + SizeY types.Int64 `tfsdk:"sizeY"` } func (newState *WidgetPosition) SyncEffectiveFieldsDuringCreateOrUpdate(plan WidgetPosition) { @@ -12828,9 +13285,14 @@ func (newState *WidgetPosition) SyncEffectiveFieldsDuringCreateOrUpdate(plan Wid func (newState *WidgetPosition) SyncEffectiveFieldsDuringRead(existingState WidgetPosition) { } -func (c WidgetPosition) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WidgetPosition) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["autoHeight"] = attrs["autoHeight"].SetOptional() + attrs["col"] = attrs["col"].SetOptional() + attrs["row"] = attrs["row"].SetOptional() + attrs["sizeX"] = attrs["sizeX"].SetOptional() + attrs["sizeY"] = attrs["sizeY"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WidgetPosition. diff --git a/internal/service/vectorsearch_tf/legacy_model.go b/internal/service/vectorsearch_tf/legacy_model.go index 4a5dcee86..6106b8b4d 100755 --- a/internal/service/vectorsearch_tf/legacy_model.go +++ b/internal/service/vectorsearch_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -24,7 +25,7 @@ import ( type ColumnInfo_SdkV2 struct { // Name of the column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnInfo_SdkV2) { @@ -33,9 +34,10 @@ func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan C func (newState *ColumnInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ColumnInfo_SdkV2) { } -func (c ColumnInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ColumnInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnInfo. @@ -71,9 +73,9 @@ func (o ColumnInfo_SdkV2) Type(ctx context.Context) attr.Type { type CreateEndpoint_SdkV2 struct { // Type of endpoint. - EndpointType types.String `tfsdk:"endpoint_type" tf:""` + EndpointType types.String `tfsdk:"endpoint_type"` // Name of endpoint - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *CreateEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateEndpoint_SdkV2) { @@ -82,11 +84,11 @@ func (newState *CreateEndpoint_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CreateEndpoint_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateEndpoint_SdkV2) { } -func (c CreateEndpoint_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "endpoint_type")...) - cs.SetRequired(append(path, "name")...) +func (c CreateEndpoint_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_type"] = attrs["endpoint_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateEndpoint. @@ -125,12 +127,12 @@ func (o CreateEndpoint_SdkV2) Type(ctx context.Context) attr.Type { type CreateVectorIndexRequest_SdkV2 struct { // Specification for Delta Sync Index. Required if `index_type` is // `DELTA_SYNC`. - DeltaSyncIndexSpec types.List `tfsdk:"delta_sync_index_spec" tf:"optional,object"` + DeltaSyncIndexSpec types.List `tfsdk:"delta_sync_index_spec"` // Specification for Direct Vector Access Index. Required if `index_type` is // `DIRECT_ACCESS`. - DirectAccessIndexSpec types.List `tfsdk:"direct_access_index_spec" tf:"optional,object"` + DirectAccessIndexSpec types.List `tfsdk:"direct_access_index_spec"` // Name of the endpoint to be used for serving the index - EndpointName types.String `tfsdk:"endpoint_name" tf:""` + EndpointName types.String `tfsdk:"endpoint_name"` // There are 2 types of Vector Search indexes: // // - `DELTA_SYNC`: An index that automatically syncs with a source Delta @@ -138,11 +140,11 @@ type CreateVectorIndexRequest_SdkV2 struct { // underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index // that supports direct read and write of vectors and metadata through our // REST and SDK APIs. With this model, the user manages index updates. - IndexType types.String `tfsdk:"index_type" tf:""` + IndexType types.String `tfsdk:"index_type"` // Name of the index - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Primary key of the index - PrimaryKey types.String `tfsdk:"primary_key" tf:""` + PrimaryKey types.String `tfsdk:"primary_key"` } func (newState *CreateVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVectorIndexRequest_SdkV2) { @@ -151,15 +153,17 @@ func (newState *CreateVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *CreateVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateVectorIndexRequest_SdkV2) { } -func (c CreateVectorIndexRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DeltaSyncVectorIndexSpecRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "delta_sync_index_spec")...) - DirectAccessVectorIndexSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "direct_access_index_spec")...) - cs.SetRequired(append(path, "endpoint_name")...) - cs.SetRequired(append(path, "index_type")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "primary_key")...) +func (c CreateVectorIndexRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["delta_sync_index_spec"] = attrs["delta_sync_index_spec"].SetOptional() + attrs["delta_sync_index_spec"] = attrs["delta_sync_index_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["direct_access_index_spec"] = attrs["direct_access_index_spec"].SetOptional() + attrs["direct_access_index_spec"] = attrs["direct_access_index_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["endpoint_name"] = attrs["endpoint_name"].SetRequired() + attrs["index_type"] = attrs["index_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["primary_key"] = attrs["primary_key"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVectorIndexRequest. @@ -263,7 +267,7 @@ func (o *CreateVectorIndexRequest_SdkV2) SetDirectAccessIndexSpec(ctx context.Co } type CreateVectorIndexResponse_SdkV2 struct { - VectorIndex types.List `tfsdk:"vector_index" tf:"optional,object"` + VectorIndex types.List `tfsdk:"vector_index"` } func (newState *CreateVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVectorIndexResponse_SdkV2) { @@ -272,10 +276,11 @@ func (newState *CreateVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *CreateVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateVectorIndexResponse_SdkV2) { } -func (c CreateVectorIndexResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - VectorIndex_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "vector_index")...) +func (c CreateVectorIndexResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["vector_index"] = attrs["vector_index"].SetOptional() + attrs["vector_index"] = attrs["vector_index"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVectorIndexResponse. @@ -342,9 +347,9 @@ func (o *CreateVectorIndexResponse_SdkV2) SetVectorIndex(ctx context.Context, v // Result of the upsert or delete operation. type DeleteDataResult_SdkV2 struct { // List of primary keys for rows that failed to process. - FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys" tf:"optional"` + FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys"` // Count of successfully processed rows. - SuccessRowCount types.Int64 `tfsdk:"success_row_count" tf:"optional"` + SuccessRowCount types.Int64 `tfsdk:"success_row_count"` } func (newState *DeleteDataResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDataResult_SdkV2) { @@ -353,9 +358,11 @@ func (newState *DeleteDataResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *DeleteDataResult_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDataResult_SdkV2) { } -func (c DeleteDataResult_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteDataResult_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["failed_primary_keys"] = attrs["failed_primary_keys"].SetOptional() + attrs["success_row_count"] = attrs["success_row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDataResult. @@ -427,7 +434,7 @@ type DeleteDataVectorIndexRequest_SdkV2 struct { // Vector Access Index. IndexName types.String `tfsdk:"-"` // List of primary keys for the data to be deleted. - PrimaryKeys types.List `tfsdk:"primary_keys" tf:""` + PrimaryKeys types.List `tfsdk:"primary_keys"` } func (newState *DeleteDataVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDataVectorIndexRequest_SdkV2) { @@ -436,11 +443,11 @@ func (newState *DeleteDataVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *DeleteDataVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDataVectorIndexRequest_SdkV2) { } -func (c DeleteDataVectorIndexRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) - cs.SetRequired(append(path, "primary_keys")...) +func (c DeleteDataVectorIndexRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["primary_keys"] = attrs["primary_keys"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDataVectorIndexRequest. @@ -509,9 +516,9 @@ func (o *DeleteDataVectorIndexRequest_SdkV2) SetPrimaryKeys(ctx context.Context, // Response to a delete data vector index request. type DeleteDataVectorIndexResponse_SdkV2 struct { // Result of the upsert or delete operation. - Result types.List `tfsdk:"result" tf:"optional,object"` + Result types.List `tfsdk:"result"` // Status of the delete operation. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *DeleteDataVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDataVectorIndexResponse_SdkV2) { @@ -520,10 +527,12 @@ func (newState *DeleteDataVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *DeleteDataVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteDataVectorIndexResponse_SdkV2) { } -func (c DeleteDataVectorIndexResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DeleteDataResult_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "result")...) +func (c DeleteDataVectorIndexResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["result"] = attrs["result"].SetOptional() + attrs["result"] = attrs["result"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDataVectorIndexResponse. @@ -728,16 +737,16 @@ type DeltaSyncVectorIndexSpecRequest_SdkV2 struct { // this field blank, all columns from the source table are synced with the // index. The primary key column and embedding source column or embedding // vector column are always synced. - ColumnsToSync types.List `tfsdk:"columns_to_sync" tf:"optional"` + ColumnsToSync types.List `tfsdk:"columns_to_sync"` // The columns that contain the embedding source. - EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns" tf:"optional"` + EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns"` // The columns that contain the embedding vectors. The format should be // array[double]. - EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns" tf:"optional"` + EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns"` // [Optional] Automatically sync the vector index contents and computed // embeddings to the specified Delta table. The only supported table name is // the index name with the suffix `_writeback_table`. - EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table" tf:"optional"` + EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table"` // Pipeline execution mode. // // - `TRIGGERED`: If the pipeline uses the triggered execution mode, the @@ -746,9 +755,9 @@ type DeltaSyncVectorIndexSpecRequest_SdkV2 struct { // available when the update started. - `CONTINUOUS`: If the pipeline uses // continuous execution, the pipeline processes new data as it arrives in // the source table to keep vector index fresh. - PipelineType types.String `tfsdk:"pipeline_type" tf:"optional"` + PipelineType types.String `tfsdk:"pipeline_type"` // The name of the source table. - SourceTable types.String `tfsdk:"source_table" tf:"optional"` + SourceTable types.String `tfsdk:"source_table"` } func (newState *DeltaSyncVectorIndexSpecRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeltaSyncVectorIndexSpecRequest_SdkV2) { @@ -757,11 +766,15 @@ func (newState *DeltaSyncVectorIndexSpecRequest_SdkV2) SyncEffectiveFieldsDuring func (newState *DeltaSyncVectorIndexSpecRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeltaSyncVectorIndexSpecRequest_SdkV2) { } -func (c DeltaSyncVectorIndexSpecRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmbeddingSourceColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedding_source_columns")...) - EmbeddingVectorColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedding_vector_columns")...) +func (c DeltaSyncVectorIndexSpecRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns_to_sync"] = attrs["columns_to_sync"].SetOptional() + attrs["embedding_source_columns"] = attrs["embedding_source_columns"].SetOptional() + attrs["embedding_vector_columns"] = attrs["embedding_vector_columns"].SetOptional() + attrs["embedding_writeback_table"] = attrs["embedding_writeback_table"].SetOptional() + attrs["pipeline_type"] = attrs["pipeline_type"].SetOptional() + attrs["source_table"] = attrs["source_table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeltaSyncVectorIndexSpecRequest. @@ -895,14 +908,14 @@ func (o *DeltaSyncVectorIndexSpecRequest_SdkV2) SetEmbeddingVectorColumns(ctx co type DeltaSyncVectorIndexSpecResponse_SdkV2 struct { // The columns that contain the embedding source. - EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns" tf:"optional"` + EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns"` // The columns that contain the embedding vectors. - EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns" tf:"optional"` + EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns"` // [Optional] Name of the Delta table to sync the vector index contents and // computed embeddings to. - EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table" tf:"optional"` + EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table"` // The ID of the pipeline that is used to sync the index. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // Pipeline execution mode. // // - `TRIGGERED`: If the pipeline uses the triggered execution mode, the @@ -911,9 +924,9 @@ type DeltaSyncVectorIndexSpecResponse_SdkV2 struct { // available when the update started. - `CONTINUOUS`: If the pipeline uses // continuous execution, the pipeline processes new data as it arrives in // the source table to keep vector index fresh. - PipelineType types.String `tfsdk:"pipeline_type" tf:"optional"` + PipelineType types.String `tfsdk:"pipeline_type"` // The name of the source table. - SourceTable types.String `tfsdk:"source_table" tf:"optional"` + SourceTable types.String `tfsdk:"source_table"` } func (newState *DeltaSyncVectorIndexSpecResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeltaSyncVectorIndexSpecResponse_SdkV2) { @@ -922,11 +935,15 @@ func (newState *DeltaSyncVectorIndexSpecResponse_SdkV2) SyncEffectiveFieldsDurin func (newState *DeltaSyncVectorIndexSpecResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeltaSyncVectorIndexSpecResponse_SdkV2) { } -func (c DeltaSyncVectorIndexSpecResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmbeddingSourceColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedding_source_columns")...) - EmbeddingVectorColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedding_vector_columns")...) +func (c DeltaSyncVectorIndexSpecResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_source_columns"] = attrs["embedding_source_columns"].SetOptional() + attrs["embedding_vector_columns"] = attrs["embedding_vector_columns"].SetOptional() + attrs["embedding_writeback_table"] = attrs["embedding_writeback_table"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["pipeline_type"] = attrs["pipeline_type"].SetOptional() + attrs["source_table"] = attrs["source_table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeltaSyncVectorIndexSpecResponse. @@ -1031,16 +1048,16 @@ func (o *DeltaSyncVectorIndexSpecResponse_SdkV2) SetEmbeddingVectorColumns(ctx c type DirectAccessVectorIndexSpec_SdkV2 struct { // Contains the optional model endpoint to use during query time. - EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns" tf:"optional"` + EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns"` - EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns" tf:"optional"` + EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns"` // The schema of the index in JSON format. // // Supported types are `integer`, `long`, `float`, `double`, `boolean`, // `string`, `date`, `timestamp`. // // Supported types for vector column: `array`, `array`,`. - SchemaJson types.String `tfsdk:"schema_json" tf:"optional"` + SchemaJson types.String `tfsdk:"schema_json"` } func (newState *DirectAccessVectorIndexSpec_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DirectAccessVectorIndexSpec_SdkV2) { @@ -1049,11 +1066,12 @@ func (newState *DirectAccessVectorIndexSpec_SdkV2) SyncEffectiveFieldsDuringCrea func (newState *DirectAccessVectorIndexSpec_SdkV2) SyncEffectiveFieldsDuringRead(existingState DirectAccessVectorIndexSpec_SdkV2) { } -func (c DirectAccessVectorIndexSpec_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmbeddingSourceColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedding_source_columns")...) - EmbeddingVectorColumn_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "embedding_vector_columns")...) +func (c DirectAccessVectorIndexSpec_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_source_columns"] = attrs["embedding_source_columns"].SetOptional() + attrs["embedding_vector_columns"] = attrs["embedding_vector_columns"].SetOptional() + attrs["schema_json"] = attrs["schema_json"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DirectAccessVectorIndexSpec. @@ -1152,9 +1170,9 @@ func (o *DirectAccessVectorIndexSpec_SdkV2) SetEmbeddingVectorColumns(ctx contex type EmbeddingSourceColumn_SdkV2 struct { // Name of the embedding model endpoint - EmbeddingModelEndpointName types.String `tfsdk:"embedding_model_endpoint_name" tf:"optional"` + EmbeddingModelEndpointName types.String `tfsdk:"embedding_model_endpoint_name"` // Name of the column - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *EmbeddingSourceColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmbeddingSourceColumn_SdkV2) { @@ -1163,9 +1181,11 @@ func (newState *EmbeddingSourceColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *EmbeddingSourceColumn_SdkV2) SyncEffectiveFieldsDuringRead(existingState EmbeddingSourceColumn_SdkV2) { } -func (c EmbeddingSourceColumn_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmbeddingSourceColumn_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_model_endpoint_name"] = attrs["embedding_model_endpoint_name"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmbeddingSourceColumn. @@ -1203,9 +1223,9 @@ func (o EmbeddingSourceColumn_SdkV2) Type(ctx context.Context) attr.Type { type EmbeddingVectorColumn_SdkV2 struct { // Dimension of the embedding vector - EmbeddingDimension types.Int64 `tfsdk:"embedding_dimension" tf:"optional"` + EmbeddingDimension types.Int64 `tfsdk:"embedding_dimension"` // Name of the column - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *EmbeddingVectorColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmbeddingVectorColumn_SdkV2) { @@ -1214,9 +1234,11 @@ func (newState *EmbeddingVectorColumn_SdkV2) SyncEffectiveFieldsDuringCreateOrUp func (newState *EmbeddingVectorColumn_SdkV2) SyncEffectiveFieldsDuringRead(existingState EmbeddingVectorColumn_SdkV2) { } -func (c EmbeddingVectorColumn_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmbeddingVectorColumn_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_dimension"] = attrs["embedding_dimension"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmbeddingVectorColumn. @@ -1254,23 +1276,23 @@ func (o EmbeddingVectorColumn_SdkV2) Type(ctx context.Context) attr.Type { type EndpointInfo_SdkV2 struct { // Timestamp of endpoint creation - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Creator of the endpoint - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // Current status of the endpoint - EndpointStatus types.List `tfsdk:"endpoint_status" tf:"optional,object"` + EndpointStatus types.List `tfsdk:"endpoint_status"` // Type of endpoint. - EndpointType types.String `tfsdk:"endpoint_type" tf:"optional"` + EndpointType types.String `tfsdk:"endpoint_type"` // Unique identifier of the endpoint - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Timestamp of last update to the endpoint - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // User who last updated the endpoint - LastUpdatedUser types.String `tfsdk:"last_updated_user" tf:"optional"` + LastUpdatedUser types.String `tfsdk:"last_updated_user"` // Name of endpoint - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Number of indexes on the endpoint - NumIndexes types.Int64 `tfsdk:"num_indexes" tf:"optional"` + NumIndexes types.Int64 `tfsdk:"num_indexes"` } func (newState *EndpointInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointInfo_SdkV2) { @@ -1279,10 +1301,19 @@ func (newState *EndpointInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *EndpointInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointInfo_SdkV2) { } -func (c EndpointInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "endpoint_status")...) +func (c EndpointInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["endpoint_status"] = attrs["endpoint_status"].SetOptional() + attrs["endpoint_status"] = attrs["endpoint_status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["endpoint_type"] = attrs["endpoint_type"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["last_updated_user"] = attrs["last_updated_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["num_indexes"] = attrs["num_indexes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointInfo. @@ -1365,9 +1396,9 @@ func (o *EndpointInfo_SdkV2) SetEndpointStatus(ctx context.Context, v EndpointSt // Status information of an endpoint type EndpointStatus_SdkV2 struct { // Additional status message - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Current state of the endpoint - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *EndpointStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointStatus_SdkV2) { @@ -1376,9 +1407,11 @@ func (newState *EndpointStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *EndpointStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState EndpointStatus_SdkV2) { } -func (c EndpointStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointStatus. @@ -1490,10 +1523,10 @@ func (o GetIndexRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListEndpointResponse_SdkV2 struct { // An array of Endpoint objects - Endpoints types.List `tfsdk:"endpoints" tf:"optional"` + Endpoints types.List `tfsdk:"endpoints"` // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListEndpointResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListEndpointResponse_SdkV2) { @@ -1502,10 +1535,11 @@ func (newState *ListEndpointResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *ListEndpointResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListEndpointResponse_SdkV2) { } -func (c ListEndpointResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "endpoints")...) +func (c ListEndpointResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoints"] = attrs["endpoints"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListEndpointResponse. @@ -1650,7 +1684,7 @@ func (o ListIndexesRequest_SdkV2) Type(ctx context.Context) attr.Type { } type ListValue_SdkV2 struct { - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *ListValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListValue_SdkV2) { @@ -1659,10 +1693,10 @@ func (newState *ListValue_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Li func (newState *ListValue_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListValue_SdkV2) { } -func (c ListValue_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Value_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "values")...) +func (c ListValue_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListValue. @@ -1729,9 +1763,9 @@ func (o *ListValue_SdkV2) SetValues(ctx context.Context, v []Value_SdkV2) { type ListVectorIndexesResponse_SdkV2 struct { // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - VectorIndexes types.List `tfsdk:"vector_indexes" tf:"optional"` + VectorIndexes types.List `tfsdk:"vector_indexes"` } func (newState *ListVectorIndexesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListVectorIndexesResponse_SdkV2) { @@ -1740,10 +1774,11 @@ func (newState *ListVectorIndexesResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *ListVectorIndexesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListVectorIndexesResponse_SdkV2) { } -func (c ListVectorIndexesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MiniVectorIndex_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "vector_indexes")...) +func (c ListVectorIndexesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["vector_indexes"] = attrs["vector_indexes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListVectorIndexesResponse. @@ -1812,9 +1847,9 @@ func (o *ListVectorIndexesResponse_SdkV2) SetVectorIndexes(ctx context.Context, // Key-value pair. type MapStringValueEntry_SdkV2 struct { // Column name. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Column value, nullable. - Value types.List `tfsdk:"value" tf:"optional,object"` + Value types.List `tfsdk:"value"` } func (newState *MapStringValueEntry_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MapStringValueEntry_SdkV2) { @@ -1823,10 +1858,12 @@ func (newState *MapStringValueEntry_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *MapStringValueEntry_SdkV2) SyncEffectiveFieldsDuringRead(existingState MapStringValueEntry_SdkV2) { } -func (c MapStringValueEntry_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Value_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c MapStringValueEntry_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() + attrs["value"] = attrs["value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MapStringValueEntry. @@ -1894,9 +1931,9 @@ func (o *MapStringValueEntry_SdkV2) SetValue(ctx context.Context, v Value_SdkV2) type MiniVectorIndex_SdkV2 struct { // The user who created the index. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // Name of the endpoint associated with the index - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` + EndpointName types.String `tfsdk:"endpoint_name"` // There are 2 types of Vector Search indexes: // // - `DELTA_SYNC`: An index that automatically syncs with a source Delta @@ -1904,11 +1941,11 @@ type MiniVectorIndex_SdkV2 struct { // underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index // that supports direct read and write of vectors and metadata through our // REST and SDK APIs. With this model, the user manages index updates. - IndexType types.String `tfsdk:"index_type" tf:"optional"` + IndexType types.String `tfsdk:"index_type"` // Name of the index - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Primary key of the index - PrimaryKey types.String `tfsdk:"primary_key" tf:"optional"` + PrimaryKey types.String `tfsdk:"primary_key"` } func (newState *MiniVectorIndex_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MiniVectorIndex_SdkV2) { @@ -1917,9 +1954,14 @@ func (newState *MiniVectorIndex_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *MiniVectorIndex_SdkV2) SyncEffectiveFieldsDuringRead(existingState MiniVectorIndex_SdkV2) { } -func (c MiniVectorIndex_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MiniVectorIndex_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creator"] = attrs["creator"].SetOptional() + attrs["endpoint_name"] = attrs["endpoint_name"].SetOptional() + attrs["index_type"] = attrs["index_type"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["primary_key"] = attrs["primary_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MiniVectorIndex. @@ -1964,12 +2006,12 @@ func (o MiniVectorIndex_SdkV2) Type(ctx context.Context) attr.Type { // Request payload for getting next page of results. type QueryVectorIndexNextPageRequest_SdkV2 struct { // Name of the endpoint. - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` + EndpointName types.String `tfsdk:"endpoint_name"` // Name of the vector index to query. IndexName types.String `tfsdk:"-"` // Page token returned from previous `QueryVectorIndex` or // `QueryVectorIndexNextPage` API. - PageToken types.String `tfsdk:"page_token" tf:"optional"` + PageToken types.String `tfsdk:"page_token"` } func (newState *QueryVectorIndexNextPageRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryVectorIndexNextPageRequest_SdkV2) { @@ -1978,10 +2020,12 @@ func (newState *QueryVectorIndexNextPageRequest_SdkV2) SyncEffectiveFieldsDuring func (newState *QueryVectorIndexNextPageRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryVectorIndexNextPageRequest_SdkV2) { } -func (c QueryVectorIndexNextPageRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) +func (c QueryVectorIndexNextPageRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_name"] = attrs["endpoint_name"].SetOptional() + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["page_token"] = attrs["page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryVectorIndexNextPageRequest. @@ -2021,27 +2065,27 @@ func (o QueryVectorIndexNextPageRequest_SdkV2) Type(ctx context.Context) attr.Ty type QueryVectorIndexRequest_SdkV2 struct { // List of column names to include in the response. - Columns types.List `tfsdk:"columns" tf:""` + Columns types.List `tfsdk:"columns"` // JSON string representing query filters. // // Example filters: - `{"id <": 5}`: Filter for id less than 5. - `{"id >": // 5}`: Filter for id greater than 5. - `{"id <=": 5}`: Filter for id less // than equal to 5. - `{"id >=": 5}`: Filter for id greater than equal to 5. // - `{"id": 5}`: Filter for id equal to 5. - FiltersJson types.String `tfsdk:"filters_json" tf:"optional"` + FiltersJson types.String `tfsdk:"filters_json"` // Name of the vector index to query. IndexName types.String `tfsdk:"-"` // Number of results to return. Defaults to 10. - NumResults types.Int64 `tfsdk:"num_results" tf:"optional"` + NumResults types.Int64 `tfsdk:"num_results"` // Query text. Required for Delta Sync Index using model endpoint. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // The query type to use. Choices are `ANN` and `HYBRID`. Defaults to `ANN`. - QueryType types.String `tfsdk:"query_type" tf:"optional"` + QueryType types.String `tfsdk:"query_type"` // Query vector. Required for Direct Vector Access Index and Delta Sync // Index using self-managed vectors. - QueryVector types.List `tfsdk:"query_vector" tf:"optional"` + QueryVector types.List `tfsdk:"query_vector"` // Threshold for the approximate nearest neighbor search. Defaults to 0.0. - ScoreThreshold types.Float64 `tfsdk:"score_threshold" tf:"optional"` + ScoreThreshold types.Float64 `tfsdk:"score_threshold"` } func (newState *QueryVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryVectorIndexRequest_SdkV2) { @@ -2050,11 +2094,17 @@ func (newState *QueryVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *QueryVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryVectorIndexRequest_SdkV2) { } -func (c QueryVectorIndexRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "columns")...) - cs.SetRequired(append(path, "index_name")...) +func (c QueryVectorIndexRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetRequired() + attrs["filters_json"] = attrs["filters_json"].SetOptional() + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["num_results"] = attrs["num_results"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["query_type"] = attrs["query_type"].SetOptional() + attrs["query_vector"] = attrs["query_vector"].SetOptional() + attrs["score_threshold"] = attrs["score_threshold"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryVectorIndexRequest. @@ -2163,13 +2213,13 @@ func (o *QueryVectorIndexRequest_SdkV2) SetQueryVector(ctx context.Context, v [] type QueryVectorIndexResponse_SdkV2 struct { // Metadata about the result set. - Manifest types.List `tfsdk:"manifest" tf:"optional,object"` + Manifest types.List `tfsdk:"manifest"` // [Optional] Token that can be used in `QueryVectorIndexNextPage` API to // get next page of results. If more than 1000 results satisfy the query, // they are returned in groups of 1000. Empty value means no more results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Data returned in the query result. - Result types.List `tfsdk:"result" tf:"optional,object"` + Result types.List `tfsdk:"result"` } func (newState *QueryVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryVectorIndexResponse_SdkV2) { @@ -2178,11 +2228,14 @@ func (newState *QueryVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *QueryVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState QueryVectorIndexResponse_SdkV2) { } -func (c QueryVectorIndexResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ResultManifest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "manifest")...) - ResultData_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "result")...) +func (c QueryVectorIndexResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["manifest"] = attrs["manifest"].SetOptional() + attrs["manifest"] = attrs["manifest"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() + attrs["result"] = attrs["result"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryVectorIndexResponse. @@ -2282,9 +2335,9 @@ func (o *QueryVectorIndexResponse_SdkV2) SetResult(ctx context.Context, v Result // Data returned in the query result. type ResultData_SdkV2 struct { // Data rows returned in the query. - DataArray types.List `tfsdk:"data_array" tf:"optional"` + DataArray types.List `tfsdk:"data_array"` // Number of rows in the result set. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` } func (newState *ResultData_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultData_SdkV2) { @@ -2293,9 +2346,11 @@ func (newState *ResultData_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan R func (newState *ResultData_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResultData_SdkV2) { } -func (c ResultData_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResultData_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_array"] = attrs["data_array"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultData. @@ -2366,9 +2421,9 @@ func (o *ResultData_SdkV2) SetDataArray(ctx context.Context, v []types.String) { // Metadata about the result set. type ResultManifest_SdkV2 struct { // Number of columns in the result set. - ColumnCount types.Int64 `tfsdk:"column_count" tf:"optional"` + ColumnCount types.Int64 `tfsdk:"column_count"` // Information about each column in the result set. - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` } func (newState *ResultManifest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultManifest_SdkV2) { @@ -2377,10 +2432,11 @@ func (newState *ResultManifest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ResultManifest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ResultManifest_SdkV2) { } -func (c ResultManifest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "columns")...) +func (c ResultManifest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column_count"] = attrs["column_count"].SetOptional() + attrs["columns"] = attrs["columns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultManifest. @@ -2451,9 +2507,9 @@ type ScanVectorIndexRequest_SdkV2 struct { // Name of the vector index to scan. IndexName types.String `tfsdk:"-"` // Primary key of the last entry returned in the previous scan. - LastPrimaryKey types.String `tfsdk:"last_primary_key" tf:"optional"` + LastPrimaryKey types.String `tfsdk:"last_primary_key"` // Number of results to return. Defaults to 10. - NumResults types.Int64 `tfsdk:"num_results" tf:"optional"` + NumResults types.Int64 `tfsdk:"num_results"` } func (newState *ScanVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ScanVectorIndexRequest_SdkV2) { @@ -2462,10 +2518,12 @@ func (newState *ScanVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *ScanVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ScanVectorIndexRequest_SdkV2) { } -func (c ScanVectorIndexRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) +func (c ScanVectorIndexRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["last_primary_key"] = attrs["last_primary_key"].SetOptional() + attrs["num_results"] = attrs["num_results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ScanVectorIndexRequest. @@ -2506,9 +2564,9 @@ func (o ScanVectorIndexRequest_SdkV2) Type(ctx context.Context) attr.Type { // Response to a scan vector index request. type ScanVectorIndexResponse_SdkV2 struct { // List of data entries - Data types.List `tfsdk:"data" tf:"optional"` + Data types.List `tfsdk:"data"` // Primary key of the last entry. - LastPrimaryKey types.String `tfsdk:"last_primary_key" tf:"optional"` + LastPrimaryKey types.String `tfsdk:"last_primary_key"` } func (newState *ScanVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ScanVectorIndexResponse_SdkV2) { @@ -2517,10 +2575,11 @@ func (newState *ScanVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ScanVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ScanVectorIndexResponse_SdkV2) { } -func (c ScanVectorIndexResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Struct_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "data")...) +func (c ScanVectorIndexResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data"] = attrs["data"].SetOptional() + attrs["last_primary_key"] = attrs["last_primary_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ScanVectorIndexResponse. @@ -2588,7 +2647,7 @@ func (o *ScanVectorIndexResponse_SdkV2) SetData(ctx context.Context, v []Struct_ type Struct_SdkV2 struct { // Data entry, corresponding to a row in a vector index. - Fields types.List `tfsdk:"fields" tf:"optional"` + Fields types.List `tfsdk:"fields"` } func (newState *Struct_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Struct_SdkV2) { @@ -2597,10 +2656,10 @@ func (newState *Struct_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Struc func (newState *Struct_SdkV2) SyncEffectiveFieldsDuringRead(existingState Struct_SdkV2) { } -func (c Struct_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MapStringValueEntry_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "fields")...) +func (c Struct_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fields"] = attrs["fields"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Struct. @@ -2734,9 +2793,9 @@ func (o SyncIndexResponse_SdkV2) Type(ctx context.Context) attr.Type { // Result of the upsert or delete operation. type UpsertDataResult_SdkV2 struct { // List of primary keys for rows that failed to process. - FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys" tf:"optional"` + FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys"` // Count of successfully processed rows. - SuccessRowCount types.Int64 `tfsdk:"success_row_count" tf:"optional"` + SuccessRowCount types.Int64 `tfsdk:"success_row_count"` } func (newState *UpsertDataResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertDataResult_SdkV2) { @@ -2745,9 +2804,11 @@ func (newState *UpsertDataResult_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *UpsertDataResult_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpsertDataResult_SdkV2) { } -func (c UpsertDataResult_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpsertDataResult_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["failed_primary_keys"] = attrs["failed_primary_keys"].SetOptional() + attrs["success_row_count"] = attrs["success_row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertDataResult. @@ -2819,7 +2880,7 @@ type UpsertDataVectorIndexRequest_SdkV2 struct { // Vector Access Index. IndexName types.String `tfsdk:"-"` // JSON string representing the data to be upserted. - InputsJson types.String `tfsdk:"inputs_json" tf:""` + InputsJson types.String `tfsdk:"inputs_json"` } func (newState *UpsertDataVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertDataVectorIndexRequest_SdkV2) { @@ -2828,11 +2889,11 @@ func (newState *UpsertDataVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringCre func (newState *UpsertDataVectorIndexRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpsertDataVectorIndexRequest_SdkV2) { } -func (c UpsertDataVectorIndexRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) - cs.SetRequired(append(path, "inputs_json")...) +func (c UpsertDataVectorIndexRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["inputs_json"] = attrs["inputs_json"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertDataVectorIndexRequest. @@ -2871,9 +2932,9 @@ func (o UpsertDataVectorIndexRequest_SdkV2) Type(ctx context.Context) attr.Type // Response to an upsert data vector index request. type UpsertDataVectorIndexResponse_SdkV2 struct { // Result of the upsert or delete operation. - Result types.List `tfsdk:"result" tf:"optional,object"` + Result types.List `tfsdk:"result"` // Status of the upsert operation. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *UpsertDataVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertDataVectorIndexResponse_SdkV2) { @@ -2882,10 +2943,12 @@ func (newState *UpsertDataVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringCr func (newState *UpsertDataVectorIndexResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpsertDataVectorIndexResponse_SdkV2) { } -func (c UpsertDataVectorIndexResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpsertDataResult_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "result")...) +func (c UpsertDataVectorIndexResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["result"] = attrs["result"].SetOptional() + attrs["result"] = attrs["result"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertDataVectorIndexResponse. @@ -2952,17 +3015,17 @@ func (o *UpsertDataVectorIndexResponse_SdkV2) SetResult(ctx context.Context, v U } type Value_SdkV2 struct { - BoolValue types.Bool `tfsdk:"bool_value" tf:"optional"` + BoolValue types.Bool `tfsdk:"bool_value"` - ListValue types.List `tfsdk:"list_value" tf:"optional,object"` + ListValue types.List `tfsdk:"list_value"` - NullValue types.String `tfsdk:"null_value" tf:"optional"` + NullValue types.String `tfsdk:"null_value"` - NumberValue types.Float64 `tfsdk:"number_value" tf:"optional"` + NumberValue types.Float64 `tfsdk:"number_value"` - StringValue types.String `tfsdk:"string_value" tf:"optional"` + StringValue types.String `tfsdk:"string_value"` - StructValue types.List `tfsdk:"struct_value" tf:"optional,object"` + StructValue types.List `tfsdk:"struct_value"` } func (newState *Value_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Value_SdkV2) { @@ -2971,11 +3034,17 @@ func (newState *Value_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Value_ func (newState *Value_SdkV2) SyncEffectiveFieldsDuringRead(existingState Value_SdkV2) { } -func (c Value_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListValue_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "list_value")...) - Struct_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "struct_value")...) +func (c Value_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bool_value"] = attrs["bool_value"].SetOptional() + attrs["list_value"] = attrs["list_value"].SetOptional() + attrs["list_value"] = attrs["list_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["null_value"] = attrs["null_value"].SetOptional() + attrs["number_value"] = attrs["number_value"].SetOptional() + attrs["string_value"] = attrs["string_value"].SetOptional() + attrs["struct_value"] = attrs["struct_value"].SetOptional() + attrs["struct_value"] = attrs["struct_value"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Value. @@ -3080,13 +3149,13 @@ func (o *Value_SdkV2) SetStructValue(ctx context.Context, v Struct_SdkV2) { type VectorIndex_SdkV2 struct { // The user who created the index. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` - DeltaSyncIndexSpec types.List `tfsdk:"delta_sync_index_spec" tf:"optional,object"` + DeltaSyncIndexSpec types.List `tfsdk:"delta_sync_index_spec"` - DirectAccessIndexSpec types.List `tfsdk:"direct_access_index_spec" tf:"optional,object"` + DirectAccessIndexSpec types.List `tfsdk:"direct_access_index_spec"` // Name of the endpoint associated with the index - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` + EndpointName types.String `tfsdk:"endpoint_name"` // There are 2 types of Vector Search indexes: // // - `DELTA_SYNC`: An index that automatically syncs with a source Delta @@ -3094,13 +3163,13 @@ type VectorIndex_SdkV2 struct { // underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index // that supports direct read and write of vectors and metadata through our // REST and SDK APIs. With this model, the user manages index updates. - IndexType types.String `tfsdk:"index_type" tf:"optional"` + IndexType types.String `tfsdk:"index_type"` // Name of the index - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Primary key of the index - PrimaryKey types.String `tfsdk:"primary_key" tf:"optional"` + PrimaryKey types.String `tfsdk:"primary_key"` - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status"` } func (newState *VectorIndex_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan VectorIndex_SdkV2) { @@ -3109,12 +3178,20 @@ func (newState *VectorIndex_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *VectorIndex_SdkV2) SyncEffectiveFieldsDuringRead(existingState VectorIndex_SdkV2) { } -func (c VectorIndex_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DeltaSyncVectorIndexSpecResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "delta_sync_index_spec")...) - DirectAccessVectorIndexSpec_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "direct_access_index_spec")...) - VectorIndexStatus_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "status")...) +func (c VectorIndex_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creator"] = attrs["creator"].SetOptional() + attrs["delta_sync_index_spec"] = attrs["delta_sync_index_spec"].SetOptional() + attrs["delta_sync_index_spec"] = attrs["delta_sync_index_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["direct_access_index_spec"] = attrs["direct_access_index_spec"].SetOptional() + attrs["direct_access_index_spec"] = attrs["direct_access_index_spec"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["endpoint_name"] = attrs["endpoint_name"].SetOptional() + attrs["index_type"] = attrs["index_type"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["primary_key"] = attrs["primary_key"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() + attrs["status"] = attrs["status"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VectorIndex. @@ -3252,13 +3329,13 @@ func (o *VectorIndex_SdkV2) SetStatus(ctx context.Context, v VectorIndexStatus_S type VectorIndexStatus_SdkV2 struct { // Index API Url to be used to perform operations on the index - IndexUrl types.String `tfsdk:"index_url" tf:"optional"` + IndexUrl types.String `tfsdk:"index_url"` // Number of rows indexed - IndexedRowCount types.Int64 `tfsdk:"indexed_row_count" tf:"optional"` + IndexedRowCount types.Int64 `tfsdk:"indexed_row_count"` // Message associated with the index status - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Whether the index is ready for search - Ready types.Bool `tfsdk:"ready" tf:"optional"` + Ready types.Bool `tfsdk:"ready"` } func (newState *VectorIndexStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan VectorIndexStatus_SdkV2) { @@ -3267,9 +3344,13 @@ func (newState *VectorIndexStatus_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *VectorIndexStatus_SdkV2) SyncEffectiveFieldsDuringRead(existingState VectorIndexStatus_SdkV2) { } -func (c VectorIndexStatus_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c VectorIndexStatus_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_url"] = attrs["index_url"].SetOptional() + attrs["indexed_row_count"] = attrs["indexed_row_count"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["ready"] = attrs["ready"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VectorIndexStatus. diff --git a/internal/service/vectorsearch_tf/model.go b/internal/service/vectorsearch_tf/model.go index 93f12278a..6b73ad27f 100755 --- a/internal/service/vectorsearch_tf/model.go +++ b/internal/service/vectorsearch_tf/model.go @@ -24,7 +24,7 @@ import ( type ColumnInfo struct { // Name of the column. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *ColumnInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnInfo) { @@ -33,9 +33,10 @@ func (newState *ColumnInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ColumnI func (newState *ColumnInfo) SyncEffectiveFieldsDuringRead(existingState ColumnInfo) { } -func (c ColumnInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ColumnInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ColumnInfo. @@ -71,9 +72,9 @@ func (o ColumnInfo) Type(ctx context.Context) attr.Type { type CreateEndpoint struct { // Type of endpoint. - EndpointType types.String `tfsdk:"endpoint_type" tf:""` + EndpointType types.String `tfsdk:"endpoint_type"` // Name of endpoint - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` } func (newState *CreateEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateEndpoint) { @@ -82,11 +83,11 @@ func (newState *CreateEndpoint) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CreateEndpoint) SyncEffectiveFieldsDuringRead(existingState CreateEndpoint) { } -func (c CreateEndpoint) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "endpoint_type")...) - cs.SetRequired(append(path, "name")...) +func (c CreateEndpoint) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_type"] = attrs["endpoint_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateEndpoint. @@ -125,12 +126,12 @@ func (o CreateEndpoint) Type(ctx context.Context) attr.Type { type CreateVectorIndexRequest struct { // Specification for Delta Sync Index. Required if `index_type` is // `DELTA_SYNC`. - DeltaSyncIndexSpec types.Object `tfsdk:"delta_sync_index_spec" tf:"optional,object"` + DeltaSyncIndexSpec types.Object `tfsdk:"delta_sync_index_spec"` // Specification for Direct Vector Access Index. Required if `index_type` is // `DIRECT_ACCESS`. - DirectAccessIndexSpec types.Object `tfsdk:"direct_access_index_spec" tf:"optional,object"` + DirectAccessIndexSpec types.Object `tfsdk:"direct_access_index_spec"` // Name of the endpoint to be used for serving the index - EndpointName types.String `tfsdk:"endpoint_name" tf:""` + EndpointName types.String `tfsdk:"endpoint_name"` // There are 2 types of Vector Search indexes: // // - `DELTA_SYNC`: An index that automatically syncs with a source Delta @@ -138,11 +139,11 @@ type CreateVectorIndexRequest struct { // underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index // that supports direct read and write of vectors and metadata through our // REST and SDK APIs. With this model, the user manages index updates. - IndexType types.String `tfsdk:"index_type" tf:""` + IndexType types.String `tfsdk:"index_type"` // Name of the index - Name types.String `tfsdk:"name" tf:""` + Name types.String `tfsdk:"name"` // Primary key of the index - PrimaryKey types.String `tfsdk:"primary_key" tf:""` + PrimaryKey types.String `tfsdk:"primary_key"` } func (newState *CreateVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVectorIndexRequest) { @@ -151,15 +152,15 @@ func (newState *CreateVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateVectorIndexRequest) SyncEffectiveFieldsDuringRead(existingState CreateVectorIndexRequest) { } -func (c CreateVectorIndexRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DeltaSyncVectorIndexSpecRequest{}.ApplySchemaCustomizations(cs, append(path, "delta_sync_index_spec")...) - DirectAccessVectorIndexSpec{}.ApplySchemaCustomizations(cs, append(path, "direct_access_index_spec")...) - cs.SetRequired(append(path, "endpoint_name")...) - cs.SetRequired(append(path, "index_type")...) - cs.SetRequired(append(path, "name")...) - cs.SetRequired(append(path, "primary_key")...) +func (c CreateVectorIndexRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["delta_sync_index_spec"] = attrs["delta_sync_index_spec"].SetOptional() + attrs["direct_access_index_spec"] = attrs["direct_access_index_spec"].SetOptional() + attrs["endpoint_name"] = attrs["endpoint_name"].SetRequired() + attrs["index_type"] = attrs["index_type"].SetRequired() + attrs["name"] = attrs["name"].SetRequired() + attrs["primary_key"] = attrs["primary_key"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVectorIndexRequest. @@ -263,7 +264,7 @@ func (o *CreateVectorIndexRequest) SetDirectAccessIndexSpec(ctx context.Context, } type CreateVectorIndexResponse struct { - VectorIndex types.Object `tfsdk:"vector_index" tf:"optional,object"` + VectorIndex types.Object `tfsdk:"vector_index"` } func (newState *CreateVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateVectorIndexResponse) { @@ -272,10 +273,10 @@ func (newState *CreateVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateVectorIndexResponse) SyncEffectiveFieldsDuringRead(existingState CreateVectorIndexResponse) { } -func (c CreateVectorIndexResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - VectorIndex{}.ApplySchemaCustomizations(cs, append(path, "vector_index")...) +func (c CreateVectorIndexResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["vector_index"] = attrs["vector_index"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateVectorIndexResponse. @@ -342,9 +343,9 @@ func (o *CreateVectorIndexResponse) SetVectorIndex(ctx context.Context, v Vector // Result of the upsert or delete operation. type DeleteDataResult struct { // List of primary keys for rows that failed to process. - FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys" tf:"optional"` + FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys"` // Count of successfully processed rows. - SuccessRowCount types.Int64 `tfsdk:"success_row_count" tf:"optional"` + SuccessRowCount types.Int64 `tfsdk:"success_row_count"` } func (newState *DeleteDataResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDataResult) { @@ -353,9 +354,11 @@ func (newState *DeleteDataResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan D func (newState *DeleteDataResult) SyncEffectiveFieldsDuringRead(existingState DeleteDataResult) { } -func (c DeleteDataResult) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteDataResult) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["failed_primary_keys"] = attrs["failed_primary_keys"].SetOptional() + attrs["success_row_count"] = attrs["success_row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDataResult. @@ -427,7 +430,7 @@ type DeleteDataVectorIndexRequest struct { // Vector Access Index. IndexName types.String `tfsdk:"-"` // List of primary keys for the data to be deleted. - PrimaryKeys types.List `tfsdk:"primary_keys" tf:""` + PrimaryKeys types.List `tfsdk:"primary_keys"` } func (newState *DeleteDataVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDataVectorIndexRequest) { @@ -436,11 +439,11 @@ func (newState *DeleteDataVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *DeleteDataVectorIndexRequest) SyncEffectiveFieldsDuringRead(existingState DeleteDataVectorIndexRequest) { } -func (c DeleteDataVectorIndexRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) - cs.SetRequired(append(path, "primary_keys")...) +func (c DeleteDataVectorIndexRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["primary_keys"] = attrs["primary_keys"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDataVectorIndexRequest. @@ -509,9 +512,9 @@ func (o *DeleteDataVectorIndexRequest) SetPrimaryKeys(ctx context.Context, v []t // Response to a delete data vector index request. type DeleteDataVectorIndexResponse struct { // Result of the upsert or delete operation. - Result types.Object `tfsdk:"result" tf:"optional,object"` + Result types.Object `tfsdk:"result"` // Status of the delete operation. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *DeleteDataVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteDataVectorIndexResponse) { @@ -520,10 +523,11 @@ func (newState *DeleteDataVectorIndexResponse) SyncEffectiveFieldsDuringCreateOr func (newState *DeleteDataVectorIndexResponse) SyncEffectiveFieldsDuringRead(existingState DeleteDataVectorIndexResponse) { } -func (c DeleteDataVectorIndexResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DeleteDataResult{}.ApplySchemaCustomizations(cs, append(path, "result")...) +func (c DeleteDataVectorIndexResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["result"] = attrs["result"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteDataVectorIndexResponse. @@ -728,16 +732,16 @@ type DeltaSyncVectorIndexSpecRequest struct { // this field blank, all columns from the source table are synced with the // index. The primary key column and embedding source column or embedding // vector column are always synced. - ColumnsToSync types.List `tfsdk:"columns_to_sync" tf:"optional"` + ColumnsToSync types.List `tfsdk:"columns_to_sync"` // The columns that contain the embedding source. - EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns" tf:"optional"` + EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns"` // The columns that contain the embedding vectors. The format should be // array[double]. - EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns" tf:"optional"` + EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns"` // [Optional] Automatically sync the vector index contents and computed // embeddings to the specified Delta table. The only supported table name is // the index name with the suffix `_writeback_table`. - EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table" tf:"optional"` + EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table"` // Pipeline execution mode. // // - `TRIGGERED`: If the pipeline uses the triggered execution mode, the @@ -746,9 +750,9 @@ type DeltaSyncVectorIndexSpecRequest struct { // available when the update started. - `CONTINUOUS`: If the pipeline uses // continuous execution, the pipeline processes new data as it arrives in // the source table to keep vector index fresh. - PipelineType types.String `tfsdk:"pipeline_type" tf:"optional"` + PipelineType types.String `tfsdk:"pipeline_type"` // The name of the source table. - SourceTable types.String `tfsdk:"source_table" tf:"optional"` + SourceTable types.String `tfsdk:"source_table"` } func (newState *DeltaSyncVectorIndexSpecRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeltaSyncVectorIndexSpecRequest) { @@ -757,11 +761,15 @@ func (newState *DeltaSyncVectorIndexSpecRequest) SyncEffectiveFieldsDuringCreate func (newState *DeltaSyncVectorIndexSpecRequest) SyncEffectiveFieldsDuringRead(existingState DeltaSyncVectorIndexSpecRequest) { } -func (c DeltaSyncVectorIndexSpecRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmbeddingSourceColumn{}.ApplySchemaCustomizations(cs, append(path, "embedding_source_columns")...) - EmbeddingVectorColumn{}.ApplySchemaCustomizations(cs, append(path, "embedding_vector_columns")...) +func (c DeltaSyncVectorIndexSpecRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns_to_sync"] = attrs["columns_to_sync"].SetOptional() + attrs["embedding_source_columns"] = attrs["embedding_source_columns"].SetOptional() + attrs["embedding_vector_columns"] = attrs["embedding_vector_columns"].SetOptional() + attrs["embedding_writeback_table"] = attrs["embedding_writeback_table"].SetOptional() + attrs["pipeline_type"] = attrs["pipeline_type"].SetOptional() + attrs["source_table"] = attrs["source_table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeltaSyncVectorIndexSpecRequest. @@ -895,14 +903,14 @@ func (o *DeltaSyncVectorIndexSpecRequest) SetEmbeddingVectorColumns(ctx context. type DeltaSyncVectorIndexSpecResponse struct { // The columns that contain the embedding source. - EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns" tf:"optional"` + EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns"` // The columns that contain the embedding vectors. - EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns" tf:"optional"` + EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns"` // [Optional] Name of the Delta table to sync the vector index contents and // computed embeddings to. - EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table" tf:"optional"` + EmbeddingWritebackTable types.String `tfsdk:"embedding_writeback_table"` // The ID of the pipeline that is used to sync the index. - PipelineId types.String `tfsdk:"pipeline_id" tf:"optional"` + PipelineId types.String `tfsdk:"pipeline_id"` // Pipeline execution mode. // // - `TRIGGERED`: If the pipeline uses the triggered execution mode, the @@ -911,9 +919,9 @@ type DeltaSyncVectorIndexSpecResponse struct { // available when the update started. - `CONTINUOUS`: If the pipeline uses // continuous execution, the pipeline processes new data as it arrives in // the source table to keep vector index fresh. - PipelineType types.String `tfsdk:"pipeline_type" tf:"optional"` + PipelineType types.String `tfsdk:"pipeline_type"` // The name of the source table. - SourceTable types.String `tfsdk:"source_table" tf:"optional"` + SourceTable types.String `tfsdk:"source_table"` } func (newState *DeltaSyncVectorIndexSpecResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeltaSyncVectorIndexSpecResponse) { @@ -922,11 +930,15 @@ func (newState *DeltaSyncVectorIndexSpecResponse) SyncEffectiveFieldsDuringCreat func (newState *DeltaSyncVectorIndexSpecResponse) SyncEffectiveFieldsDuringRead(existingState DeltaSyncVectorIndexSpecResponse) { } -func (c DeltaSyncVectorIndexSpecResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmbeddingSourceColumn{}.ApplySchemaCustomizations(cs, append(path, "embedding_source_columns")...) - EmbeddingVectorColumn{}.ApplySchemaCustomizations(cs, append(path, "embedding_vector_columns")...) +func (c DeltaSyncVectorIndexSpecResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_source_columns"] = attrs["embedding_source_columns"].SetOptional() + attrs["embedding_vector_columns"] = attrs["embedding_vector_columns"].SetOptional() + attrs["embedding_writeback_table"] = attrs["embedding_writeback_table"].SetOptional() + attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() + attrs["pipeline_type"] = attrs["pipeline_type"].SetOptional() + attrs["source_table"] = attrs["source_table"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeltaSyncVectorIndexSpecResponse. @@ -1031,16 +1043,16 @@ func (o *DeltaSyncVectorIndexSpecResponse) SetEmbeddingVectorColumns(ctx context type DirectAccessVectorIndexSpec struct { // Contains the optional model endpoint to use during query time. - EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns" tf:"optional"` + EmbeddingSourceColumns types.List `tfsdk:"embedding_source_columns"` - EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns" tf:"optional"` + EmbeddingVectorColumns types.List `tfsdk:"embedding_vector_columns"` // The schema of the index in JSON format. // // Supported types are `integer`, `long`, `float`, `double`, `boolean`, // `string`, `date`, `timestamp`. // // Supported types for vector column: `array`, `array`,`. - SchemaJson types.String `tfsdk:"schema_json" tf:"optional"` + SchemaJson types.String `tfsdk:"schema_json"` } func (newState *DirectAccessVectorIndexSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan DirectAccessVectorIndexSpec) { @@ -1049,11 +1061,12 @@ func (newState *DirectAccessVectorIndexSpec) SyncEffectiveFieldsDuringCreateOrUp func (newState *DirectAccessVectorIndexSpec) SyncEffectiveFieldsDuringRead(existingState DirectAccessVectorIndexSpec) { } -func (c DirectAccessVectorIndexSpec) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EmbeddingSourceColumn{}.ApplySchemaCustomizations(cs, append(path, "embedding_source_columns")...) - EmbeddingVectorColumn{}.ApplySchemaCustomizations(cs, append(path, "embedding_vector_columns")...) +func (c DirectAccessVectorIndexSpec) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_source_columns"] = attrs["embedding_source_columns"].SetOptional() + attrs["embedding_vector_columns"] = attrs["embedding_vector_columns"].SetOptional() + attrs["schema_json"] = attrs["schema_json"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DirectAccessVectorIndexSpec. @@ -1152,9 +1165,9 @@ func (o *DirectAccessVectorIndexSpec) SetEmbeddingVectorColumns(ctx context.Cont type EmbeddingSourceColumn struct { // Name of the embedding model endpoint - EmbeddingModelEndpointName types.String `tfsdk:"embedding_model_endpoint_name" tf:"optional"` + EmbeddingModelEndpointName types.String `tfsdk:"embedding_model_endpoint_name"` // Name of the column - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *EmbeddingSourceColumn) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmbeddingSourceColumn) { @@ -1163,9 +1176,11 @@ func (newState *EmbeddingSourceColumn) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *EmbeddingSourceColumn) SyncEffectiveFieldsDuringRead(existingState EmbeddingSourceColumn) { } -func (c EmbeddingSourceColumn) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmbeddingSourceColumn) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_model_endpoint_name"] = attrs["embedding_model_endpoint_name"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmbeddingSourceColumn. @@ -1203,9 +1218,9 @@ func (o EmbeddingSourceColumn) Type(ctx context.Context) attr.Type { type EmbeddingVectorColumn struct { // Dimension of the embedding vector - EmbeddingDimension types.Int64 `tfsdk:"embedding_dimension" tf:"optional"` + EmbeddingDimension types.Int64 `tfsdk:"embedding_dimension"` // Name of the column - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *EmbeddingVectorColumn) SyncEffectiveFieldsDuringCreateOrUpdate(plan EmbeddingVectorColumn) { @@ -1214,9 +1229,11 @@ func (newState *EmbeddingVectorColumn) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *EmbeddingVectorColumn) SyncEffectiveFieldsDuringRead(existingState EmbeddingVectorColumn) { } -func (c EmbeddingVectorColumn) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EmbeddingVectorColumn) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["embedding_dimension"] = attrs["embedding_dimension"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EmbeddingVectorColumn. @@ -1254,23 +1271,23 @@ func (o EmbeddingVectorColumn) Type(ctx context.Context) attr.Type { type EndpointInfo struct { // Timestamp of endpoint creation - CreationTimestamp types.Int64 `tfsdk:"creation_timestamp" tf:"optional"` + CreationTimestamp types.Int64 `tfsdk:"creation_timestamp"` // Creator of the endpoint - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // Current status of the endpoint - EndpointStatus types.Object `tfsdk:"endpoint_status" tf:"optional,object"` + EndpointStatus types.Object `tfsdk:"endpoint_status"` // Type of endpoint. - EndpointType types.String `tfsdk:"endpoint_type" tf:"optional"` + EndpointType types.String `tfsdk:"endpoint_type"` // Unique identifier of the endpoint - Id types.String `tfsdk:"id" tf:"optional"` + Id types.String `tfsdk:"id"` // Timestamp of last update to the endpoint - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` // User who last updated the endpoint - LastUpdatedUser types.String `tfsdk:"last_updated_user" tf:"optional"` + LastUpdatedUser types.String `tfsdk:"last_updated_user"` // Name of endpoint - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Number of indexes on the endpoint - NumIndexes types.Int64 `tfsdk:"num_indexes" tf:"optional"` + NumIndexes types.Int64 `tfsdk:"num_indexes"` } func (newState *EndpointInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointInfo) { @@ -1279,10 +1296,18 @@ func (newState *EndpointInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Endpo func (newState *EndpointInfo) SyncEffectiveFieldsDuringRead(existingState EndpointInfo) { } -func (c EndpointInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointStatus{}.ApplySchemaCustomizations(cs, append(path, "endpoint_status")...) +func (c EndpointInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creation_timestamp"] = attrs["creation_timestamp"].SetOptional() + attrs["creator"] = attrs["creator"].SetOptional() + attrs["endpoint_status"] = attrs["endpoint_status"].SetOptional() + attrs["endpoint_type"] = attrs["endpoint_type"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() + attrs["last_updated_user"] = attrs["last_updated_user"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["num_indexes"] = attrs["num_indexes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointInfo. @@ -1365,9 +1390,9 @@ func (o *EndpointInfo) SetEndpointStatus(ctx context.Context, v EndpointStatus) // Status information of an endpoint type EndpointStatus struct { // Additional status message - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Current state of the endpoint - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state"` } func (newState *EndpointStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan EndpointStatus) { @@ -1376,9 +1401,11 @@ func (newState *EndpointStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan End func (newState *EndpointStatus) SyncEffectiveFieldsDuringRead(existingState EndpointStatus) { } -func (c EndpointStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c EndpointStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["message"] = attrs["message"].SetOptional() + attrs["state"] = attrs["state"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in EndpointStatus. @@ -1490,10 +1517,10 @@ func (o GetIndexRequest) Type(ctx context.Context) attr.Type { type ListEndpointResponse struct { // An array of Endpoint objects - Endpoints types.List `tfsdk:"endpoints" tf:"optional"` + Endpoints types.List `tfsdk:"endpoints"` // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` } func (newState *ListEndpointResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListEndpointResponse) { @@ -1502,10 +1529,11 @@ func (newState *ListEndpointResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ListEndpointResponse) SyncEffectiveFieldsDuringRead(existingState ListEndpointResponse) { } -func (c ListEndpointResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - EndpointInfo{}.ApplySchemaCustomizations(cs, append(path, "endpoints")...) +func (c ListEndpointResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoints"] = attrs["endpoints"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListEndpointResponse. @@ -1650,7 +1678,7 @@ func (o ListIndexesRequest) Type(ctx context.Context) attr.Type { } type ListValue struct { - Values types.List `tfsdk:"values" tf:"optional"` + Values types.List `tfsdk:"values"` } func (newState *ListValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListValue) { @@ -1659,10 +1687,10 @@ func (newState *ListValue) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListValu func (newState *ListValue) SyncEffectiveFieldsDuringRead(existingState ListValue) { } -func (c ListValue) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Value{}.ApplySchemaCustomizations(cs, append(path, "values")...) +func (c ListValue) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["values"] = attrs["values"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListValue. @@ -1729,9 +1757,9 @@ func (o *ListValue) SetValues(ctx context.Context, v []Value) { type ListVectorIndexesResponse struct { // A token that can be used to get the next page of results. If not present, // there are no more results to show. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` - VectorIndexes types.List `tfsdk:"vector_indexes" tf:"optional"` + VectorIndexes types.List `tfsdk:"vector_indexes"` } func (newState *ListVectorIndexesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListVectorIndexesResponse) { @@ -1740,10 +1768,11 @@ func (newState *ListVectorIndexesResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListVectorIndexesResponse) SyncEffectiveFieldsDuringRead(existingState ListVectorIndexesResponse) { } -func (c ListVectorIndexesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MiniVectorIndex{}.ApplySchemaCustomizations(cs, append(path, "vector_indexes")...) +func (c ListVectorIndexesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["vector_indexes"] = attrs["vector_indexes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListVectorIndexesResponse. @@ -1812,9 +1841,9 @@ func (o *ListVectorIndexesResponse) SetVectorIndexes(ctx context.Context, v []Mi // Key-value pair. type MapStringValueEntry struct { // Column name. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // Column value, nullable. - Value types.Object `tfsdk:"value" tf:"optional,object"` + Value types.Object `tfsdk:"value"` } func (newState *MapStringValueEntry) SyncEffectiveFieldsDuringCreateOrUpdate(plan MapStringValueEntry) { @@ -1823,10 +1852,11 @@ func (newState *MapStringValueEntry) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *MapStringValueEntry) SyncEffectiveFieldsDuringRead(existingState MapStringValueEntry) { } -func (c MapStringValueEntry) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Value{}.ApplySchemaCustomizations(cs, append(path, "value")...) +func (c MapStringValueEntry) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MapStringValueEntry. @@ -1894,9 +1924,9 @@ func (o *MapStringValueEntry) SetValue(ctx context.Context, v Value) { type MiniVectorIndex struct { // The user who created the index. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` // Name of the endpoint associated with the index - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` + EndpointName types.String `tfsdk:"endpoint_name"` // There are 2 types of Vector Search indexes: // // - `DELTA_SYNC`: An index that automatically syncs with a source Delta @@ -1904,11 +1934,11 @@ type MiniVectorIndex struct { // underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index // that supports direct read and write of vectors and metadata through our // REST and SDK APIs. With this model, the user manages index updates. - IndexType types.String `tfsdk:"index_type" tf:"optional"` + IndexType types.String `tfsdk:"index_type"` // Name of the index - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Primary key of the index - PrimaryKey types.String `tfsdk:"primary_key" tf:"optional"` + PrimaryKey types.String `tfsdk:"primary_key"` } func (newState *MiniVectorIndex) SyncEffectiveFieldsDuringCreateOrUpdate(plan MiniVectorIndex) { @@ -1917,9 +1947,14 @@ func (newState *MiniVectorIndex) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mi func (newState *MiniVectorIndex) SyncEffectiveFieldsDuringRead(existingState MiniVectorIndex) { } -func (c MiniVectorIndex) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MiniVectorIndex) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creator"] = attrs["creator"].SetOptional() + attrs["endpoint_name"] = attrs["endpoint_name"].SetOptional() + attrs["index_type"] = attrs["index_type"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["primary_key"] = attrs["primary_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MiniVectorIndex. @@ -1964,12 +1999,12 @@ func (o MiniVectorIndex) Type(ctx context.Context) attr.Type { // Request payload for getting next page of results. type QueryVectorIndexNextPageRequest struct { // Name of the endpoint. - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` + EndpointName types.String `tfsdk:"endpoint_name"` // Name of the vector index to query. IndexName types.String `tfsdk:"-"` // Page token returned from previous `QueryVectorIndex` or // `QueryVectorIndexNextPage` API. - PageToken types.String `tfsdk:"page_token" tf:"optional"` + PageToken types.String `tfsdk:"page_token"` } func (newState *QueryVectorIndexNextPageRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryVectorIndexNextPageRequest) { @@ -1978,10 +2013,12 @@ func (newState *QueryVectorIndexNextPageRequest) SyncEffectiveFieldsDuringCreate func (newState *QueryVectorIndexNextPageRequest) SyncEffectiveFieldsDuringRead(existingState QueryVectorIndexNextPageRequest) { } -func (c QueryVectorIndexNextPageRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) +func (c QueryVectorIndexNextPageRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoint_name"] = attrs["endpoint_name"].SetOptional() + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["page_token"] = attrs["page_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryVectorIndexNextPageRequest. @@ -2021,27 +2058,27 @@ func (o QueryVectorIndexNextPageRequest) Type(ctx context.Context) attr.Type { type QueryVectorIndexRequest struct { // List of column names to include in the response. - Columns types.List `tfsdk:"columns" tf:""` + Columns types.List `tfsdk:"columns"` // JSON string representing query filters. // // Example filters: - `{"id <": 5}`: Filter for id less than 5. - `{"id >": // 5}`: Filter for id greater than 5. - `{"id <=": 5}`: Filter for id less // than equal to 5. - `{"id >=": 5}`: Filter for id greater than equal to 5. // - `{"id": 5}`: Filter for id equal to 5. - FiltersJson types.String `tfsdk:"filters_json" tf:"optional"` + FiltersJson types.String `tfsdk:"filters_json"` // Name of the vector index to query. IndexName types.String `tfsdk:"-"` // Number of results to return. Defaults to 10. - NumResults types.Int64 `tfsdk:"num_results" tf:"optional"` + NumResults types.Int64 `tfsdk:"num_results"` // Query text. Required for Delta Sync Index using model endpoint. - QueryText types.String `tfsdk:"query_text" tf:"optional"` + QueryText types.String `tfsdk:"query_text"` // The query type to use. Choices are `ANN` and `HYBRID`. Defaults to `ANN`. - QueryType types.String `tfsdk:"query_type" tf:"optional"` + QueryType types.String `tfsdk:"query_type"` // Query vector. Required for Direct Vector Access Index and Delta Sync // Index using self-managed vectors. - QueryVector types.List `tfsdk:"query_vector" tf:"optional"` + QueryVector types.List `tfsdk:"query_vector"` // Threshold for the approximate nearest neighbor search. Defaults to 0.0. - ScoreThreshold types.Float64 `tfsdk:"score_threshold" tf:"optional"` + ScoreThreshold types.Float64 `tfsdk:"score_threshold"` } func (newState *QueryVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryVectorIndexRequest) { @@ -2050,11 +2087,17 @@ func (newState *QueryVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *QueryVectorIndexRequest) SyncEffectiveFieldsDuringRead(existingState QueryVectorIndexRequest) { } -func (c QueryVectorIndexRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "columns")...) - cs.SetRequired(append(path, "index_name")...) +func (c QueryVectorIndexRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["columns"] = attrs["columns"].SetRequired() + attrs["filters_json"] = attrs["filters_json"].SetOptional() + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["num_results"] = attrs["num_results"].SetOptional() + attrs["query_text"] = attrs["query_text"].SetOptional() + attrs["query_type"] = attrs["query_type"].SetOptional() + attrs["query_vector"] = attrs["query_vector"].SetOptional() + attrs["score_threshold"] = attrs["score_threshold"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryVectorIndexRequest. @@ -2163,13 +2206,13 @@ func (o *QueryVectorIndexRequest) SetQueryVector(ctx context.Context, v []types. type QueryVectorIndexResponse struct { // Metadata about the result set. - Manifest types.Object `tfsdk:"manifest" tf:"optional,object"` + Manifest types.Object `tfsdk:"manifest"` // [Optional] Token that can be used in `QueryVectorIndexNextPage` API to // get next page of results. If more than 1000 results satisfy the query, // they are returned in groups of 1000. Empty value means no more results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // Data returned in the query result. - Result types.Object `tfsdk:"result" tf:"optional,object"` + Result types.Object `tfsdk:"result"` } func (newState *QueryVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan QueryVectorIndexResponse) { @@ -2178,11 +2221,12 @@ func (newState *QueryVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *QueryVectorIndexResponse) SyncEffectiveFieldsDuringRead(existingState QueryVectorIndexResponse) { } -func (c QueryVectorIndexResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ResultManifest{}.ApplySchemaCustomizations(cs, append(path, "manifest")...) - ResultData{}.ApplySchemaCustomizations(cs, append(path, "result")...) +func (c QueryVectorIndexResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["manifest"] = attrs["manifest"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["result"] = attrs["result"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in QueryVectorIndexResponse. @@ -2282,9 +2326,9 @@ func (o *QueryVectorIndexResponse) SetResult(ctx context.Context, v ResultData) // Data returned in the query result. type ResultData struct { // Data rows returned in the query. - DataArray types.List `tfsdk:"data_array" tf:"optional"` + DataArray types.List `tfsdk:"data_array"` // Number of rows in the result set. - RowCount types.Int64 `tfsdk:"row_count" tf:"optional"` + RowCount types.Int64 `tfsdk:"row_count"` } func (newState *ResultData) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultData) { @@ -2293,9 +2337,11 @@ func (newState *ResultData) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultD func (newState *ResultData) SyncEffectiveFieldsDuringRead(existingState ResultData) { } -func (c ResultData) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ResultData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data_array"] = attrs["data_array"].SetOptional() + attrs["row_count"] = attrs["row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultData. @@ -2366,9 +2412,9 @@ func (o *ResultData) SetDataArray(ctx context.Context, v []types.String) { // Metadata about the result set. type ResultManifest struct { // Number of columns in the result set. - ColumnCount types.Int64 `tfsdk:"column_count" tf:"optional"` + ColumnCount types.Int64 `tfsdk:"column_count"` // Information about each column in the result set. - Columns types.List `tfsdk:"columns" tf:"optional"` + Columns types.List `tfsdk:"columns"` } func (newState *ResultManifest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ResultManifest) { @@ -2377,10 +2423,11 @@ func (newState *ResultManifest) SyncEffectiveFieldsDuringCreateOrUpdate(plan Res func (newState *ResultManifest) SyncEffectiveFieldsDuringRead(existingState ResultManifest) { } -func (c ResultManifest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ColumnInfo{}.ApplySchemaCustomizations(cs, append(path, "columns")...) +func (c ResultManifest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["column_count"] = attrs["column_count"].SetOptional() + attrs["columns"] = attrs["columns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ResultManifest. @@ -2451,9 +2498,9 @@ type ScanVectorIndexRequest struct { // Name of the vector index to scan. IndexName types.String `tfsdk:"-"` // Primary key of the last entry returned in the previous scan. - LastPrimaryKey types.String `tfsdk:"last_primary_key" tf:"optional"` + LastPrimaryKey types.String `tfsdk:"last_primary_key"` // Number of results to return. Defaults to 10. - NumResults types.Int64 `tfsdk:"num_results" tf:"optional"` + NumResults types.Int64 `tfsdk:"num_results"` } func (newState *ScanVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ScanVectorIndexRequest) { @@ -2462,10 +2509,12 @@ func (newState *ScanVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ScanVectorIndexRequest) SyncEffectiveFieldsDuringRead(existingState ScanVectorIndexRequest) { } -func (c ScanVectorIndexRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) +func (c ScanVectorIndexRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["last_primary_key"] = attrs["last_primary_key"].SetOptional() + attrs["num_results"] = attrs["num_results"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ScanVectorIndexRequest. @@ -2506,9 +2555,9 @@ func (o ScanVectorIndexRequest) Type(ctx context.Context) attr.Type { // Response to a scan vector index request. type ScanVectorIndexResponse struct { // List of data entries - Data types.List `tfsdk:"data" tf:"optional"` + Data types.List `tfsdk:"data"` // Primary key of the last entry. - LastPrimaryKey types.String `tfsdk:"last_primary_key" tf:"optional"` + LastPrimaryKey types.String `tfsdk:"last_primary_key"` } func (newState *ScanVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ScanVectorIndexResponse) { @@ -2517,10 +2566,11 @@ func (newState *ScanVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ScanVectorIndexResponse) SyncEffectiveFieldsDuringRead(existingState ScanVectorIndexResponse) { } -func (c ScanVectorIndexResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - Struct{}.ApplySchemaCustomizations(cs, append(path, "data")...) +func (c ScanVectorIndexResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["data"] = attrs["data"].SetOptional() + attrs["last_primary_key"] = attrs["last_primary_key"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ScanVectorIndexResponse. @@ -2588,7 +2638,7 @@ func (o *ScanVectorIndexResponse) SetData(ctx context.Context, v []Struct) { type Struct struct { // Data entry, corresponding to a row in a vector index. - Fields types.List `tfsdk:"fields" tf:"optional"` + Fields types.List `tfsdk:"fields"` } func (newState *Struct) SyncEffectiveFieldsDuringCreateOrUpdate(plan Struct) { @@ -2597,10 +2647,10 @@ func (newState *Struct) SyncEffectiveFieldsDuringCreateOrUpdate(plan Struct) { func (newState *Struct) SyncEffectiveFieldsDuringRead(existingState Struct) { } -func (c Struct) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - MapStringValueEntry{}.ApplySchemaCustomizations(cs, append(path, "fields")...) +func (c Struct) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["fields"] = attrs["fields"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Struct. @@ -2734,9 +2784,9 @@ func (o SyncIndexResponse) Type(ctx context.Context) attr.Type { // Result of the upsert or delete operation. type UpsertDataResult struct { // List of primary keys for rows that failed to process. - FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys" tf:"optional"` + FailedPrimaryKeys types.List `tfsdk:"failed_primary_keys"` // Count of successfully processed rows. - SuccessRowCount types.Int64 `tfsdk:"success_row_count" tf:"optional"` + SuccessRowCount types.Int64 `tfsdk:"success_row_count"` } func (newState *UpsertDataResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertDataResult) { @@ -2745,9 +2795,11 @@ func (newState *UpsertDataResult) SyncEffectiveFieldsDuringCreateOrUpdate(plan U func (newState *UpsertDataResult) SyncEffectiveFieldsDuringRead(existingState UpsertDataResult) { } -func (c UpsertDataResult) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpsertDataResult) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["failed_primary_keys"] = attrs["failed_primary_keys"].SetOptional() + attrs["success_row_count"] = attrs["success_row_count"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertDataResult. @@ -2819,7 +2871,7 @@ type UpsertDataVectorIndexRequest struct { // Vector Access Index. IndexName types.String `tfsdk:"-"` // JSON string representing the data to be upserted. - InputsJson types.String `tfsdk:"inputs_json" tf:""` + InputsJson types.String `tfsdk:"inputs_json"` } func (newState *UpsertDataVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertDataVectorIndexRequest) { @@ -2828,11 +2880,11 @@ func (newState *UpsertDataVectorIndexRequest) SyncEffectiveFieldsDuringCreateOrU func (newState *UpsertDataVectorIndexRequest) SyncEffectiveFieldsDuringRead(existingState UpsertDataVectorIndexRequest) { } -func (c UpsertDataVectorIndexRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "index_name")...) - cs.SetRequired(append(path, "inputs_json")...) +func (c UpsertDataVectorIndexRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_name"] = attrs["index_name"].SetRequired() + attrs["inputs_json"] = attrs["inputs_json"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertDataVectorIndexRequest. @@ -2871,9 +2923,9 @@ func (o UpsertDataVectorIndexRequest) Type(ctx context.Context) attr.Type { // Response to an upsert data vector index request. type UpsertDataVectorIndexResponse struct { // Result of the upsert or delete operation. - Result types.Object `tfsdk:"result" tf:"optional,object"` + Result types.Object `tfsdk:"result"` // Status of the upsert operation. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status"` } func (newState *UpsertDataVectorIndexResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpsertDataVectorIndexResponse) { @@ -2882,10 +2934,11 @@ func (newState *UpsertDataVectorIndexResponse) SyncEffectiveFieldsDuringCreateOr func (newState *UpsertDataVectorIndexResponse) SyncEffectiveFieldsDuringRead(existingState UpsertDataVectorIndexResponse) { } -func (c UpsertDataVectorIndexResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - UpsertDataResult{}.ApplySchemaCustomizations(cs, append(path, "result")...) +func (c UpsertDataVectorIndexResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["result"] = attrs["result"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpsertDataVectorIndexResponse. @@ -2952,17 +3005,17 @@ func (o *UpsertDataVectorIndexResponse) SetResult(ctx context.Context, v UpsertD } type Value struct { - BoolValue types.Bool `tfsdk:"bool_value" tf:"optional"` + BoolValue types.Bool `tfsdk:"bool_value"` - ListValue types.Object `tfsdk:"list_value" tf:"optional,object"` + ListValue types.Object `tfsdk:"list_value"` - NullValue types.String `tfsdk:"null_value" tf:"optional"` + NullValue types.String `tfsdk:"null_value"` - NumberValue types.Float64 `tfsdk:"number_value" tf:"optional"` + NumberValue types.Float64 `tfsdk:"number_value"` - StringValue types.String `tfsdk:"string_value" tf:"optional"` + StringValue types.String `tfsdk:"string_value"` - StructValue types.Object `tfsdk:"struct_value" tf:"optional,object"` + StructValue types.Object `tfsdk:"struct_value"` } func (newState *Value) SyncEffectiveFieldsDuringCreateOrUpdate(plan Value) { @@ -2971,11 +3024,15 @@ func (newState *Value) SyncEffectiveFieldsDuringCreateOrUpdate(plan Value) { func (newState *Value) SyncEffectiveFieldsDuringRead(existingState Value) { } -func (c Value) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ListValue{}.ApplySchemaCustomizations(cs, append(path, "list_value")...) - Struct{}.ApplySchemaCustomizations(cs, append(path, "struct_value")...) +func (c Value) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bool_value"] = attrs["bool_value"].SetOptional() + attrs["list_value"] = attrs["list_value"].SetOptional() + attrs["null_value"] = attrs["null_value"].SetOptional() + attrs["number_value"] = attrs["number_value"].SetOptional() + attrs["string_value"] = attrs["string_value"].SetOptional() + attrs["struct_value"] = attrs["struct_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Value. @@ -3080,13 +3137,13 @@ func (o *Value) SetStructValue(ctx context.Context, v Struct) { type VectorIndex struct { // The user who created the index. - Creator types.String `tfsdk:"creator" tf:"optional"` + Creator types.String `tfsdk:"creator"` - DeltaSyncIndexSpec types.Object `tfsdk:"delta_sync_index_spec" tf:"optional,object"` + DeltaSyncIndexSpec types.Object `tfsdk:"delta_sync_index_spec"` - DirectAccessIndexSpec types.Object `tfsdk:"direct_access_index_spec" tf:"optional,object"` + DirectAccessIndexSpec types.Object `tfsdk:"direct_access_index_spec"` // Name of the endpoint associated with the index - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` + EndpointName types.String `tfsdk:"endpoint_name"` // There are 2 types of Vector Search indexes: // // - `DELTA_SYNC`: An index that automatically syncs with a source Delta @@ -3094,13 +3151,13 @@ type VectorIndex struct { // underlying data in the Delta Table changes. - `DIRECT_ACCESS`: An index // that supports direct read and write of vectors and metadata through our // REST and SDK APIs. With this model, the user manages index updates. - IndexType types.String `tfsdk:"index_type" tf:"optional"` + IndexType types.String `tfsdk:"index_type"` // Name of the index - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` // Primary key of the index - PrimaryKey types.String `tfsdk:"primary_key" tf:"optional"` + PrimaryKey types.String `tfsdk:"primary_key"` - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status"` } func (newState *VectorIndex) SyncEffectiveFieldsDuringCreateOrUpdate(plan VectorIndex) { @@ -3109,12 +3166,17 @@ func (newState *VectorIndex) SyncEffectiveFieldsDuringCreateOrUpdate(plan Vector func (newState *VectorIndex) SyncEffectiveFieldsDuringRead(existingState VectorIndex) { } -func (c VectorIndex) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - DeltaSyncVectorIndexSpecResponse{}.ApplySchemaCustomizations(cs, append(path, "delta_sync_index_spec")...) - DirectAccessVectorIndexSpec{}.ApplySchemaCustomizations(cs, append(path, "direct_access_index_spec")...) - VectorIndexStatus{}.ApplySchemaCustomizations(cs, append(path, "status")...) +func (c VectorIndex) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["creator"] = attrs["creator"].SetOptional() + attrs["delta_sync_index_spec"] = attrs["delta_sync_index_spec"].SetOptional() + attrs["direct_access_index_spec"] = attrs["direct_access_index_spec"].SetOptional() + attrs["endpoint_name"] = attrs["endpoint_name"].SetOptional() + attrs["index_type"] = attrs["index_type"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() + attrs["primary_key"] = attrs["primary_key"].SetOptional() + attrs["status"] = attrs["status"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VectorIndex. @@ -3252,13 +3314,13 @@ func (o *VectorIndex) SetStatus(ctx context.Context, v VectorIndexStatus) { type VectorIndexStatus struct { // Index API Url to be used to perform operations on the index - IndexUrl types.String `tfsdk:"index_url" tf:"optional"` + IndexUrl types.String `tfsdk:"index_url"` // Number of rows indexed - IndexedRowCount types.Int64 `tfsdk:"indexed_row_count" tf:"optional"` + IndexedRowCount types.Int64 `tfsdk:"indexed_row_count"` // Message associated with the index status - Message types.String `tfsdk:"message" tf:"optional"` + Message types.String `tfsdk:"message"` // Whether the index is ready for search - Ready types.Bool `tfsdk:"ready" tf:"optional"` + Ready types.Bool `tfsdk:"ready"` } func (newState *VectorIndexStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan VectorIndexStatus) { @@ -3267,9 +3329,13 @@ func (newState *VectorIndexStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *VectorIndexStatus) SyncEffectiveFieldsDuringRead(existingState VectorIndexStatus) { } -func (c VectorIndexStatus) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c VectorIndexStatus) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["index_url"] = attrs["index_url"].SetOptional() + attrs["indexed_row_count"] = attrs["indexed_row_count"].SetOptional() + attrs["message"] = attrs["message"].SetOptional() + attrs["ready"] = attrs["ready"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in VectorIndexStatus. diff --git a/internal/service/workspace_tf/legacy_model.go b/internal/service/workspace_tf/legacy_model.go index f03d556bb..dd26a9d3c 100755 --- a/internal/service/workspace_tf/legacy_model.go +++ b/internal/service/workspace_tf/legacy_model.go @@ -17,6 +17,7 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -24,9 +25,9 @@ import ( type AclItem_SdkV2 struct { // The permission level applied to the principal. - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` // The principal in which the permission is applied. - Principal types.String `tfsdk:"principal" tf:""` + Principal types.String `tfsdk:"principal"` } func (newState *AclItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AclItem_SdkV2) { @@ -35,11 +36,11 @@ func (newState *AclItem_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AclI func (newState *AclItem_SdkV2) SyncEffectiveFieldsDuringRead(existingState AclItem_SdkV2) { } -func (c AclItem_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "permission")...) - cs.SetRequired(append(path, "principal")...) +func (c AclItem_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission"] = attrs["permission"].SetRequired() + attrs["principal"] = attrs["principal"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AclItem. @@ -77,10 +78,10 @@ func (o AclItem_SdkV2) Type(ctx context.Context) attr.Type { type AzureKeyVaultSecretScopeMetadata_SdkV2 struct { // The DNS of the KeyVault - DnsName types.String `tfsdk:"dns_name" tf:""` + DnsName types.String `tfsdk:"dns_name"` // The resource id of the azure KeyVault that user wants to associate the // scope with. - ResourceId types.String `tfsdk:"resource_id" tf:""` + ResourceId types.String `tfsdk:"resource_id"` } func (newState *AzureKeyVaultSecretScopeMetadata_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureKeyVaultSecretScopeMetadata_SdkV2) { @@ -89,11 +90,11 @@ func (newState *AzureKeyVaultSecretScopeMetadata_SdkV2) SyncEffectiveFieldsDurin func (newState *AzureKeyVaultSecretScopeMetadata_SdkV2) SyncEffectiveFieldsDuringRead(existingState AzureKeyVaultSecretScopeMetadata_SdkV2) { } -func (c AzureKeyVaultSecretScopeMetadata_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dns_name")...) - cs.SetRequired(append(path, "resource_id")...) +func (c AzureKeyVaultSecretScopeMetadata_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dns_name"] = attrs["dns_name"].SetRequired() + attrs["resource_id"] = attrs["resource_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureKeyVaultSecretScopeMetadata. @@ -134,7 +135,7 @@ type CreateCredentialsRequest_SdkV2 struct { // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account, depending // on which provider you are using. For GitHub, GitHub Enterprise Server, or // Azure DevOps Services, either email or username may be used. For GitLab, @@ -142,13 +143,13 @@ type CreateCredentialsRequest_SdkV2 struct { // BitBucket or BitBucket Server, username must be used. For all other // providers please see your provider's Personal Access Token authentication // documentation to see what is supported. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` // The personal access token used to authenticate to the corresponding Git // provider. For certain providers, support may exist for other types of // scoped access tokens. [Learn more]. // // [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html - PersonalAccessToken types.String `tfsdk:"personal_access_token" tf:"optional"` + PersonalAccessToken types.String `tfsdk:"personal_access_token"` } func (newState *CreateCredentialsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialsRequest_SdkV2) { @@ -157,10 +158,12 @@ func (newState *CreateCredentialsRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *CreateCredentialsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCredentialsRequest_SdkV2) { } -func (c CreateCredentialsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "git_provider")...) +func (c CreateCredentialsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_username"] = attrs["git_username"].SetOptional() + attrs["personal_access_token"] = attrs["personal_access_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialsRequest. @@ -200,12 +203,12 @@ func (o CreateCredentialsRequest_SdkV2) Type(ctx context.Context) attr.Type { type CreateCredentialsResponse_SdkV2 struct { // ID of the credential object in the workspace. - CredentialId types.Int64 `tfsdk:"credential_id" tf:""` + CredentialId types.Int64 `tfsdk:"credential_id"` // The Git provider associated with the credential. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account and // associated with the credential. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` } func (newState *CreateCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialsResponse_SdkV2) { @@ -214,11 +217,12 @@ func (newState *CreateCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *CreateCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateCredentialsResponse_SdkV2) { } -func (c CreateCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) - cs.SetRequired(append(path, "git_provider")...) +func (c CreateCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_username"] = attrs["git_username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialsResponse. @@ -260,17 +264,17 @@ type CreateRepoRequest_SdkV2 struct { // Desired path for the repo in the workspace. Almost any path in the // workspace can be chosen. If repo is created in `/Repos`, path must be in // the format `/Repos/{folder}/{repo-name}`. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider. This field is case-insensitive. The available Git providers // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - Provider types.String `tfsdk:"provider" tf:""` + Provider types.String `tfsdk:"provider"` // If specified, the repo will be created with sparse checkout enabled. You // cannot enable/disable sparse checkout after the repo is created. - SparseCheckout types.List `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.List `tfsdk:"sparse_checkout"` // URL of the Git repository to be linked. - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` } func (newState *CreateRepoRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRepoRequest_SdkV2) { @@ -279,12 +283,14 @@ func (newState *CreateRepoRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *CreateRepoRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRepoRequest_SdkV2) { } -func (c CreateRepoRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "provider")...) - SparseCheckout_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) - cs.SetRequired(append(path, "url")...) +func (c CreateRepoRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetRequired() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["url"] = attrs["url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRepoRequest. @@ -356,20 +362,20 @@ func (o *CreateRepoRequest_SdkV2) SetSparseCheckout(ctx context.Context, v Spars type CreateRepoResponse_SdkV2 struct { // Branch that the Git folder (repo) is checked out to. - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // SHA-1 hash representing the commit ID of the current HEAD of the Git // folder (repo). - HeadCommitId types.String `tfsdk:"head_commit_id" tf:"optional"` + HeadCommitId types.String `tfsdk:"head_commit_id"` // ID of the Git folder (repo) object in the workspace. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // Path of the Git folder (repo) in the workspace. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider of the linked Git repository. - Provider types.String `tfsdk:"provider" tf:"optional"` + Provider types.String `tfsdk:"provider"` // Sparse checkout settings for the Git folder (repo). - SparseCheckout types.List `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.List `tfsdk:"sparse_checkout"` // URL of the linked Git repository. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *CreateRepoResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRepoResponse_SdkV2) { @@ -378,10 +384,17 @@ func (newState *CreateRepoResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateRepoResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateRepoResponse_SdkV2) { } -func (c CreateRepoResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparseCheckout_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c CreateRepoResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["head_commit_id"] = attrs["head_commit_id"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRepoResponse. @@ -459,15 +472,15 @@ func (o *CreateRepoResponse_SdkV2) SetSparseCheckout(ctx context.Context, v Spar type CreateScope_SdkV2 struct { // The metadata for the secret scope if the type is `AZURE_KEYVAULT` - BackendAzureKeyvault types.List `tfsdk:"backend_azure_keyvault" tf:"optional,object"` + BackendAzureKeyvault types.List `tfsdk:"backend_azure_keyvault"` // The principal that is initially granted `MANAGE` permission to the // created scope. - InitialManagePrincipal types.String `tfsdk:"initial_manage_principal" tf:"optional"` + InitialManagePrincipal types.String `tfsdk:"initial_manage_principal"` // Scope name requested by the user. Scope names are unique. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` // The backend type the scope will be created with. If not specified, will // default to `DATABRICKS` - ScopeBackendType types.String `tfsdk:"scope_backend_type" tf:"optional"` + ScopeBackendType types.String `tfsdk:"scope_backend_type"` } func (newState *CreateScope_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateScope_SdkV2) { @@ -476,11 +489,14 @@ func (newState *CreateScope_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateScope_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateScope_SdkV2) { } -func (c CreateScope_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AzureKeyVaultSecretScopeMetadata_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "backend_azure_keyvault")...) - cs.SetRequired(append(path, "scope")...) +func (c CreateScope_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["backend_azure_keyvault"] = attrs["backend_azure_keyvault"].SetOptional() + attrs["backend_azure_keyvault"] = attrs["backend_azure_keyvault"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["initial_manage_principal"] = attrs["initial_manage_principal"].SetOptional() + attrs["scope"] = attrs["scope"].SetRequired() + attrs["scope_backend_type"] = attrs["scope_backend_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateScope. @@ -582,12 +598,12 @@ func (o CreateScopeResponse_SdkV2) Type(ctx context.Context) attr.Type { type CredentialInfo_SdkV2 struct { // ID of the credential object in the workspace. - CredentialId types.Int64 `tfsdk:"credential_id" tf:""` + CredentialId types.Int64 `tfsdk:"credential_id"` // The Git provider associated with the credential. - GitProvider types.String `tfsdk:"git_provider" tf:"optional"` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account and // associated with the credential. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` } func (newState *CredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CredentialInfo_SdkV2) { @@ -596,10 +612,12 @@ func (newState *CredentialInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *CredentialInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState CredentialInfo_SdkV2) { } -func (c CredentialInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) +func (c CredentialInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetOptional() + attrs["git_username"] = attrs["git_username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CredentialInfo. @@ -639,12 +657,12 @@ func (o CredentialInfo_SdkV2) Type(ctx context.Context) attr.Type { type Delete_SdkV2 struct { // The absolute path of the notebook or directory. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` // The flag that specifies whether to delete the object recursively. It is // `false` by default. Please note this deleting directory is not atomic. If // it fails in the middle, some of objects under this directory may be // deleted and cannot be undone. - Recursive types.Bool `tfsdk:"recursive" tf:"optional"` + Recursive types.Bool `tfsdk:"recursive"` } func (newState *Delete_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete_SdkV2) { @@ -653,10 +671,11 @@ func (newState *Delete_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delet func (newState *Delete_SdkV2) SyncEffectiveFieldsDuringRead(existingState Delete_SdkV2) { } -func (c Delete_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Delete_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() + attrs["recursive"] = attrs["recursive"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Delete. @@ -694,9 +713,9 @@ func (o Delete_SdkV2) Type(ctx context.Context) attr.Type { type DeleteAcl_SdkV2 struct { // The principal to remove an existing ACL from. - Principal types.String `tfsdk:"principal" tf:""` + Principal types.String `tfsdk:"principal"` // The name of the scope to remove permissions from. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *DeleteAcl_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAcl_SdkV2) { @@ -705,11 +724,11 @@ func (newState *DeleteAcl_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan De func (newState *DeleteAcl_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteAcl_SdkV2) { } -func (c DeleteAcl_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "principal")...) - cs.SetRequired(append(path, "scope")...) +func (c DeleteAcl_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAcl. @@ -821,9 +840,9 @@ func (newState *DeleteCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *DeleteCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteCredentialsResponse_SdkV2) { } -func (c DeleteCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCredentialsResponse. @@ -899,9 +918,9 @@ func (newState *DeleteRepoResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *DeleteRepoResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteRepoResponse_SdkV2) { } -func (c DeleteRepoResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteRepoResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRepoResponse. @@ -940,9 +959,9 @@ func (newState *DeleteResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DeleteResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteResponse_SdkV2) { } -func (c DeleteResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteResponse. @@ -974,7 +993,7 @@ func (o DeleteResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeleteScope_SdkV2 struct { // Name of the scope to delete. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *DeleteScope_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteScope_SdkV2) { @@ -983,10 +1002,10 @@ func (newState *DeleteScope_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteScope_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteScope_SdkV2) { } -func (c DeleteScope_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "scope")...) +func (c DeleteScope_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteScope. @@ -1052,9 +1071,9 @@ func (o DeleteScopeResponse_SdkV2) Type(ctx context.Context) attr.Type { type DeleteSecret_SdkV2 struct { // Name of the secret to delete. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // The name of the scope that contains the secret to delete. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *DeleteSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteSecret_SdkV2) { @@ -1063,11 +1082,11 @@ func (newState *DeleteSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteSecret_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteSecret_SdkV2) { } -func (c DeleteSecret_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "scope")...) +func (c DeleteSecret_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteSecret. @@ -1112,9 +1131,9 @@ func (newState *DeleteSecretResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *DeleteSecretResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteSecretResponse_SdkV2) { } -func (c DeleteSecretResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteSecretResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteSecretResponse. @@ -1202,9 +1221,9 @@ func (o ExportRequest_SdkV2) Type(ctx context.Context) attr.Type { type ExportResponse_SdkV2 struct { // The base64-encoded content. If the limit (10MB) is exceeded, exception // with error code **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // The file type of the exported file. - FileType types.String `tfsdk:"file_type" tf:"optional"` + FileType types.String `tfsdk:"file_type"` } func (newState *ExportResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExportResponse_SdkV2) { @@ -1213,9 +1232,11 @@ func (newState *ExportResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ExportResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ExportResponse_SdkV2) { } -func (c ExportResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExportResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["file_type"] = attrs["file_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExportResponse. @@ -1331,12 +1352,12 @@ func (o GetCredentialsRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetCredentialsResponse_SdkV2 struct { // ID of the credential object in the workspace. - CredentialId types.Int64 `tfsdk:"credential_id" tf:""` + CredentialId types.Int64 `tfsdk:"credential_id"` // The Git provider associated with the credential. - GitProvider types.String `tfsdk:"git_provider" tf:"optional"` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account and // associated with the credential. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` } func (newState *GetCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetCredentialsResponse_SdkV2) { @@ -1345,10 +1366,12 @@ func (newState *GetCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *GetCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetCredentialsResponse_SdkV2) { } -func (c GetCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) +func (c GetCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetOptional() + attrs["git_username"] = attrs["git_username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetCredentialsResponse. @@ -1425,7 +1448,7 @@ func (o GetRepoPermissionLevelsRequest_SdkV2) Type(ctx context.Context) attr.Typ type GetRepoPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetRepoPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRepoPermissionLevelsResponse_SdkV2) { @@ -1434,10 +1457,10 @@ func (newState *GetRepoPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuring func (newState *GetRepoPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetRepoPermissionLevelsResponse_SdkV2) { } -func (c GetRepoPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetRepoPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRepoPermissionLevelsResponse. @@ -1577,19 +1600,19 @@ func (o GetRepoRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetRepoResponse_SdkV2 struct { // Branch that the local version of the repo is checked out to. - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // SHA-1 hash representing the commit ID of the current HEAD of the repo. - HeadCommitId types.String `tfsdk:"head_commit_id" tf:"optional"` + HeadCommitId types.String `tfsdk:"head_commit_id"` // ID of the Git folder (repo) object in the workspace. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // Path of the Git folder (repo) in the workspace. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider of the linked Git repository. - Provider types.String `tfsdk:"provider" tf:"optional"` + Provider types.String `tfsdk:"provider"` // Sparse checkout settings for the Git folder (repo). - SparseCheckout types.List `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.List `tfsdk:"sparse_checkout"` // URL of the linked Git repository. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *GetRepoResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRepoResponse_SdkV2) { @@ -1598,10 +1621,17 @@ func (newState *GetRepoResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *GetRepoResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetRepoResponse_SdkV2) { } -func (c GetRepoResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparseCheckout_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c GetRepoResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["head_commit_id"] = attrs["head_commit_id"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRepoResponse. @@ -1720,9 +1750,9 @@ func (o GetSecretRequest_SdkV2) Type(ctx context.Context) attr.Type { type GetSecretResponse_SdkV2 struct { // A unique name to identify the secret. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The value of the secret in its byte representation. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *GetSecretResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetSecretResponse_SdkV2) { @@ -1731,9 +1761,11 @@ func (newState *GetSecretResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *GetSecretResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetSecretResponse_SdkV2) { } -func (c GetSecretResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetSecretResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetSecretResponse. @@ -1849,7 +1881,7 @@ func (o GetWorkspaceObjectPermissionLevelsRequest_SdkV2) Type(ctx context.Contex type GetWorkspaceObjectPermissionLevelsResponse_SdkV2 struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetWorkspaceObjectPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWorkspaceObjectPermissionLevelsResponse_SdkV2) { @@ -1858,10 +1890,10 @@ func (newState *GetWorkspaceObjectPermissionLevelsResponse_SdkV2) SyncEffectiveF func (newState *GetWorkspaceObjectPermissionLevelsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetWorkspaceObjectPermissionLevelsResponse_SdkV2) { } -func (c GetWorkspaceObjectPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectPermissionsDescription_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetWorkspaceObjectPermissionLevelsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWorkspaceObjectPermissionLevelsResponse. @@ -1972,7 +2004,7 @@ type Import_SdkV2 struct { // If the limit (10MB) is exceeded, exception with error code // **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown. This parameter might be absent, // and instead a posted file is used. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // This specifies the format of the file to be imported. // // The value is case sensitive. @@ -1986,17 +2018,17 @@ type Import_SdkV2 struct { // notebook is imported in Databricks archive format. Required for // directories. - `R_MARKDOWN`: The notebook is imported from R Markdown // format. - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // The language of the object. This value is set only if the object type is // `NOTEBOOK`. - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` // The flag that specifies whether to overwrite existing object. It is // `false` by default. For `DBC` format, `overwrite` is not supported since // it may contain a directory. - Overwrite types.Bool `tfsdk:"overwrite" tf:"optional"` + Overwrite types.Bool `tfsdk:"overwrite"` // The absolute path of the object or directory. Importing a directory is // only supported for the `DBC` and `SOURCE` formats. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Import_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Import_SdkV2) { @@ -2005,10 +2037,14 @@ func (newState *Import_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Impor func (newState *Import_SdkV2) SyncEffectiveFieldsDuringRead(existingState Import_SdkV2) { } -func (c Import_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Import_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() + attrs["overwrite"] = attrs["overwrite"].SetOptional() + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Import. @@ -2059,9 +2095,9 @@ func (newState *ImportResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *ImportResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ImportResponse_SdkV2) { } -func (c ImportResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ImportResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ImportResponse. @@ -2130,7 +2166,7 @@ func (o ListAclsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListAclsResponse_SdkV2 struct { // The associated ACLs rule applied to principals in the given scope. - Items types.List `tfsdk:"items" tf:"optional"` + Items types.List `tfsdk:"items"` } func (newState *ListAclsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAclsResponse_SdkV2) { @@ -2139,10 +2175,10 @@ func (newState *ListAclsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *ListAclsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAclsResponse_SdkV2) { } -func (c ListAclsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AclItem_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "items")...) +func (c ListAclsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["items"] = attrs["items"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAclsResponse. @@ -2208,7 +2244,7 @@ func (o *ListAclsResponse_SdkV2) SetItems(ctx context.Context, v []AclItem_SdkV2 type ListCredentialsResponse_SdkV2 struct { // List of credentials. - Credentials types.List `tfsdk:"credentials" tf:"optional"` + Credentials types.List `tfsdk:"credentials"` } func (newState *ListCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCredentialsResponse_SdkV2) { @@ -2217,10 +2253,10 @@ func (newState *ListCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOr func (newState *ListCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCredentialsResponse_SdkV2) { } -func (c ListCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CredentialInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "credentials")...) +func (c ListCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credentials"] = attrs["credentials"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCredentialsResponse. @@ -2332,9 +2368,9 @@ func (o ListReposRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListReposResponse_SdkV2 struct { // Token that can be specified as a query parameter to the `GET /repos` // endpoint to retrieve the next page of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of Git folders (repos). - Repos types.List `tfsdk:"repos" tf:"optional"` + Repos types.List `tfsdk:"repos"` } func (newState *ListReposResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListReposResponse_SdkV2) { @@ -2343,10 +2379,11 @@ func (newState *ListReposResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListReposResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListReposResponse_SdkV2) { } -func (c ListReposResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "repos")...) +func (c ListReposResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["repos"] = attrs["repos"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListReposResponse. @@ -2414,7 +2451,7 @@ func (o *ListReposResponse_SdkV2) SetRepos(ctx context.Context, v []RepoInfo_Sdk type ListResponse_SdkV2 struct { // List of objects. - Objects types.List `tfsdk:"objects" tf:"optional"` + Objects types.List `tfsdk:"objects"` } func (newState *ListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListResponse_SdkV2) { @@ -2423,10 +2460,10 @@ func (newState *ListResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListResponse_SdkV2) { } -func (c ListResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ObjectInfo_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "objects")...) +func (c ListResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["objects"] = attrs["objects"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListResponse. @@ -2492,7 +2529,7 @@ func (o *ListResponse_SdkV2) SetObjects(ctx context.Context, v []ObjectInfo_SdkV type ListScopesResponse_SdkV2 struct { // The available secret scopes. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` } func (newState *ListScopesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListScopesResponse_SdkV2) { @@ -2501,10 +2538,10 @@ func (newState *ListScopesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *ListScopesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListScopesResponse_SdkV2) { } -func (c ListScopesResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SecretScope_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "scopes")...) +func (c ListScopesResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scopes"] = attrs["scopes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListScopesResponse. @@ -2607,7 +2644,7 @@ func (o ListSecretsRequest_SdkV2) Type(ctx context.Context) attr.Type { type ListSecretsResponse_SdkV2 struct { // Metadata information of all secrets contained within the given scope. - Secrets types.List `tfsdk:"secrets" tf:"optional"` + Secrets types.List `tfsdk:"secrets"` } func (newState *ListSecretsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSecretsResponse_SdkV2) { @@ -2616,10 +2653,10 @@ func (newState *ListSecretsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpda func (newState *ListSecretsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListSecretsResponse_SdkV2) { } -func (c ListSecretsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SecretMetadata_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "secrets")...) +func (c ListSecretsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["secrets"] = attrs["secrets"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSecretsResponse. @@ -2728,7 +2765,7 @@ type Mkdirs_SdkV2 struct { // The absolute path of the directory. If the parent directories do not // exist, it will also create them. If the directory already exists, this // command will do nothing and succeed. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Mkdirs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mkdirs_SdkV2) { @@ -2737,10 +2774,10 @@ func (newState *Mkdirs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mkdir func (newState *Mkdirs_SdkV2) SyncEffectiveFieldsDuringRead(existingState Mkdirs_SdkV2) { } -func (c Mkdirs_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Mkdirs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Mkdirs. @@ -2783,9 +2820,9 @@ func (newState *MkdirsResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *MkdirsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState MkdirsResponse_SdkV2) { } -func (c MkdirsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MkdirsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MkdirsResponse. @@ -2817,27 +2854,27 @@ func (o MkdirsResponse_SdkV2) Type(ctx context.Context) attr.Type { type ObjectInfo_SdkV2 struct { // Only applicable to files. The creation UTC timestamp. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The language of the object. This value is set only if the object type is // `NOTEBOOK`. - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` // Only applicable to files, the last modified UTC timestamp. - ModifiedAt types.Int64 `tfsdk:"modified_at" tf:"optional"` + ModifiedAt types.Int64 `tfsdk:"modified_at"` // Unique identifier for the object. - ObjectId types.Int64 `tfsdk:"object_id" tf:"optional"` + ObjectId types.Int64 `tfsdk:"object_id"` // The type of the object in workspace. // // - `NOTEBOOK`: document that contains runnable code, visualizations, and // explanatory text. - `DIRECTORY`: directory - `LIBRARY`: library - `FILE`: // file - `REPO`: repository - `DASHBOARD`: Lakeview dashboard - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` // The absolute path of the object. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // A unique identifier for the object that is consistent across all // Databricks APIs. - ResourceId types.String `tfsdk:"resource_id" tf:"optional"` + ResourceId types.String `tfsdk:"resource_id"` // Only applicable to files. The file size in bytes can be returned. - Size types.Int64 `tfsdk:"size" tf:"optional"` + Size types.Int64 `tfsdk:"size"` } func (newState *ObjectInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ObjectInfo_SdkV2) { @@ -2846,9 +2883,17 @@ func (newState *ObjectInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan O func (newState *ObjectInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ObjectInfo_SdkV2) { } -func (c ObjectInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ObjectInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() + attrs["modified_at"] = attrs["modified_at"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["resource_id"] = attrs["resource_id"].SetOptional() + attrs["size"] = attrs["size"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ObjectInfo. @@ -2898,11 +2943,11 @@ func (o ObjectInfo_SdkV2) Type(ctx context.Context) attr.Type { type PutAcl_SdkV2 struct { // The permission level applied to the principal. - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` // The principal in which the permission is applied. - Principal types.String `tfsdk:"principal" tf:""` + Principal types.String `tfsdk:"principal"` // The name of the scope to apply permissions to. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *PutAcl_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutAcl_SdkV2) { @@ -2911,12 +2956,12 @@ func (newState *PutAcl_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutAc func (newState *PutAcl_SdkV2) SyncEffectiveFieldsDuringRead(existingState PutAcl_SdkV2) { } -func (c PutAcl_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "permission")...) - cs.SetRequired(append(path, "principal")...) - cs.SetRequired(append(path, "scope")...) +func (c PutAcl_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission"] = attrs["permission"].SetRequired() + attrs["principal"] = attrs["principal"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutAcl. @@ -2986,13 +3031,13 @@ func (o PutAclResponse_SdkV2) Type(ctx context.Context) attr.Type { type PutSecret_SdkV2 struct { // If specified, value will be stored as bytes. - BytesValue types.String `tfsdk:"bytes_value" tf:"optional"` + BytesValue types.String `tfsdk:"bytes_value"` // A unique name to identify the secret. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // The name of the scope to which the secret will be associated with. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` // If specified, note that the value will be stored in UTF-8 (MB4) form. - StringValue types.String `tfsdk:"string_value" tf:"optional"` + StringValue types.String `tfsdk:"string_value"` } func (newState *PutSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutSecret_SdkV2) { @@ -3001,11 +3046,13 @@ func (newState *PutSecret_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Pu func (newState *PutSecret_SdkV2) SyncEffectiveFieldsDuringRead(existingState PutSecret_SdkV2) { } -func (c PutSecret_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "scope")...) +func (c PutSecret_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bytes_value"] = attrs["bytes_value"].SetOptional() + attrs["key"] = attrs["key"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() + attrs["string_value"] = attrs["string_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutSecret. @@ -3077,13 +3124,13 @@ func (o PutSecretResponse_SdkV2) Type(ctx context.Context) attr.Type { type RepoAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RepoAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoAccessControlRequest_SdkV2) { @@ -3092,9 +3139,13 @@ func (newState *RepoAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *RepoAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoAccessControlRequest_SdkV2) { } -func (c RepoAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepoAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoAccessControlRequest. @@ -3136,15 +3187,15 @@ func (o RepoAccessControlRequest_SdkV2) Type(ctx context.Context) attr.Type { type RepoAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RepoAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoAccessControlResponse_SdkV2) { @@ -3153,10 +3204,14 @@ func (newState *RepoAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *RepoAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoAccessControlResponse_SdkV2) { } -func (c RepoAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c RepoAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoAccessControlResponse. @@ -3231,19 +3286,19 @@ func (o *RepoAccessControlResponse_SdkV2) SetAllPermissions(ctx context.Context, // Git folder (repo) information. type RepoInfo_SdkV2 struct { // Name of the current git branch of the git folder (repo). - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // Current git commit id of the git folder (repo). - HeadCommitId types.String `tfsdk:"head_commit_id" tf:"optional"` + HeadCommitId types.String `tfsdk:"head_commit_id"` // Id of the git folder (repo) in the Workspace. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // Root path of the git folder (repo) in the Workspace. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider of the remote git repository, e.g. `gitHub`. - Provider types.String `tfsdk:"provider" tf:"optional"` + Provider types.String `tfsdk:"provider"` // Sparse checkout config for the git folder (repo). - SparseCheckout types.List `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.List `tfsdk:"sparse_checkout"` // URL of the remote git repository. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *RepoInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInfo_SdkV2) { @@ -3252,10 +3307,17 @@ func (newState *RepoInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan Rep func (newState *RepoInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoInfo_SdkV2) { } -func (c RepoInfo_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparseCheckout_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c RepoInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["head_commit_id"] = attrs["head_commit_id"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoInfo. @@ -3332,11 +3394,11 @@ func (o *RepoInfo_SdkV2) SetSparseCheckout(ctx context.Context, v SparseCheckout } type RepoPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RepoPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoPermission_SdkV2) { @@ -3345,9 +3407,12 @@ func (newState *RepoPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *RepoPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoPermission_SdkV2) { } -func (c RepoPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepoPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermission. @@ -3416,11 +3481,11 @@ func (o *RepoPermission_SdkV2) SetInheritedFromObject(ctx context.Context, v []t } type RepoPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *RepoPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoPermissions_SdkV2) { @@ -3429,10 +3494,12 @@ func (newState *RepoPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(p func (newState *RepoPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoPermissions_SdkV2) { } -func (c RepoPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c RepoPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermissions. @@ -3501,9 +3568,9 @@ func (o *RepoPermissions_SdkV2) SetAccessControlList(ctx context.Context, v []Re } type RepoPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RepoPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoPermissionsDescription_SdkV2) { @@ -3512,9 +3579,11 @@ func (newState *RepoPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *RepoPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoPermissionsDescription_SdkV2) { } -func (c RepoPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepoPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermissionsDescription. @@ -3551,7 +3620,7 @@ func (o RepoPermissionsDescription_SdkV2) Type(ctx context.Context) attr.Type { } type RepoPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The repo for which to get or manage permissions. RepoId types.String `tfsdk:"-"` } @@ -3562,11 +3631,11 @@ func (newState *RepoPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrU func (newState *RepoPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState RepoPermissionsRequest_SdkV2) { } -func (c RepoPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "repo_id")...) +func (c RepoPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["repo_id"] = attrs["repo_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermissionsRequest. @@ -3634,9 +3703,9 @@ func (o *RepoPermissionsRequest_SdkV2) SetAccessControlList(ctx context.Context, type SecretMetadata_SdkV2 struct { // A unique name to identify the secret. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The last updated timestamp (in milliseconds) for the secret. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` } func (newState *SecretMetadata_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretMetadata_SdkV2) { @@ -3645,9 +3714,11 @@ func (newState *SecretMetadata_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SecretMetadata_SdkV2) SyncEffectiveFieldsDuringRead(existingState SecretMetadata_SdkV2) { } -func (c SecretMetadata_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SecretMetadata_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecretMetadata. @@ -3685,11 +3756,11 @@ func (o SecretMetadata_SdkV2) Type(ctx context.Context) attr.Type { type SecretScope_SdkV2 struct { // The type of secret scope backend. - BackendType types.String `tfsdk:"backend_type" tf:"optional"` + BackendType types.String `tfsdk:"backend_type"` // The metadata for the secret scope if the type is `AZURE_KEYVAULT` - KeyvaultMetadata types.List `tfsdk:"keyvault_metadata" tf:"optional,object"` + KeyvaultMetadata types.List `tfsdk:"keyvault_metadata"` // A unique name to identify the secret scope. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *SecretScope_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretScope_SdkV2) { @@ -3698,10 +3769,13 @@ func (newState *SecretScope_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *SecretScope_SdkV2) SyncEffectiveFieldsDuringRead(existingState SecretScope_SdkV2) { } -func (c SecretScope_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AzureKeyVaultSecretScopeMetadata_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "keyvault_metadata")...) +func (c SecretScope_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["backend_type"] = attrs["backend_type"].SetOptional() + attrs["keyvault_metadata"] = attrs["keyvault_metadata"].SetOptional() + attrs["keyvault_metadata"] = attrs["keyvault_metadata"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecretScope. @@ -3775,7 +3849,7 @@ type SparseCheckout_SdkV2 struct { // details. // // [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling - Patterns types.List `tfsdk:"patterns" tf:"optional"` + Patterns types.List `tfsdk:"patterns"` } func (newState *SparseCheckout_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparseCheckout_SdkV2) { @@ -3784,9 +3858,10 @@ func (newState *SparseCheckout_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SparseCheckout_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparseCheckout_SdkV2) { } -func (c SparseCheckout_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparseCheckout_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["patterns"] = attrs["patterns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparseCheckout. @@ -3856,7 +3931,7 @@ type SparseCheckoutUpdate_SdkV2 struct { // details. // // [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling - Patterns types.List `tfsdk:"patterns" tf:"optional"` + Patterns types.List `tfsdk:"patterns"` } func (newState *SparseCheckoutUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparseCheckoutUpdate_SdkV2) { @@ -3865,9 +3940,10 @@ func (newState *SparseCheckoutUpdate_SdkV2) SyncEffectiveFieldsDuringCreateOrUpd func (newState *SparseCheckoutUpdate_SdkV2) SyncEffectiveFieldsDuringRead(existingState SparseCheckoutUpdate_SdkV2) { } -func (c SparseCheckoutUpdate_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparseCheckoutUpdate_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["patterns"] = attrs["patterns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparseCheckoutUpdate. @@ -3938,7 +4014,7 @@ type UpdateCredentialsRequest_SdkV2 struct { // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account, depending // on which provider you are using. For GitHub, GitHub Enterprise Server, or // Azure DevOps Services, either email or username may be used. For GitLab, @@ -3946,13 +4022,13 @@ type UpdateCredentialsRequest_SdkV2 struct { // BitBucket or BitBucket Server, username must be used. For all other // providers please see your provider's Personal Access Token authentication // documentation to see what is supported. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` // The personal access token used to authenticate to the corresponding Git // provider. For certain providers, support may exist for other types of // scoped access tokens. [Learn more]. // // [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html - PersonalAccessToken types.String `tfsdk:"personal_access_token" tf:"optional"` + PersonalAccessToken types.String `tfsdk:"personal_access_token"` } func (newState *UpdateCredentialsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCredentialsRequest_SdkV2) { @@ -3961,11 +4037,13 @@ func (newState *UpdateCredentialsRequest_SdkV2) SyncEffectiveFieldsDuringCreateO func (newState *UpdateCredentialsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCredentialsRequest_SdkV2) { } -func (c UpdateCredentialsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) - cs.SetRequired(append(path, "git_provider")...) +func (c UpdateCredentialsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_username"] = attrs["git_username"].SetOptional() + attrs["personal_access_token"] = attrs["personal_access_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCredentialsRequest. @@ -4014,9 +4092,9 @@ func (newState *UpdateCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *UpdateCredentialsResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateCredentialsResponse_SdkV2) { } -func (c UpdateCredentialsResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateCredentialsResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCredentialsResponse. @@ -4048,17 +4126,17 @@ func (o UpdateCredentialsResponse_SdkV2) Type(ctx context.Context) attr.Type { type UpdateRepoRequest_SdkV2 struct { // Branch that the local version of the repo is checked out to. - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // ID of the Git folder (repo) object in the workspace. RepoId types.Int64 `tfsdk:"-"` // If specified, update the sparse checkout settings. The update will fail // if sparse checkout is not enabled for the repo. - SparseCheckout types.List `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.List `tfsdk:"sparse_checkout"` // Tag that the local version of the repo is checked out to. Updating the // repo to a tag puts the repo in a detached HEAD state. Before committing // new changes, you must update the repo to a branch instead of the detached // HEAD. - Tag types.String `tfsdk:"tag" tf:"optional"` + Tag types.String `tfsdk:"tag"` } func (newState *UpdateRepoRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRepoRequest_SdkV2) { @@ -4067,11 +4145,14 @@ func (newState *UpdateRepoRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *UpdateRepoRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRepoRequest_SdkV2) { } -func (c UpdateRepoRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "repo_id")...) - SparseCheckoutUpdate_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c UpdateRepoRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["repo_id"] = attrs["repo_id"].SetRequired() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["tag"] = attrs["tag"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRepoRequest. @@ -4150,9 +4231,9 @@ func (newState *UpdateRepoResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateRepoResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateRepoResponse_SdkV2) { } -func (c UpdateRepoResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateRepoResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRepoResponse. @@ -4184,13 +4265,13 @@ func (o UpdateRepoResponse_SdkV2) Type(ctx context.Context) attr.Type { type WorkspaceObjectAccessControlRequest_SdkV2 struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WorkspaceObjectAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectAccessControlRequest_SdkV2) { @@ -4199,9 +4280,13 @@ func (newState *WorkspaceObjectAccessControlRequest_SdkV2) SyncEffectiveFieldsDu func (newState *WorkspaceObjectAccessControlRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectAccessControlRequest_SdkV2) { } -func (c WorkspaceObjectAccessControlRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceObjectAccessControlRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectAccessControlRequest. @@ -4243,15 +4328,15 @@ func (o WorkspaceObjectAccessControlRequest_SdkV2) Type(ctx context.Context) att type WorkspaceObjectAccessControlResponse_SdkV2 struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WorkspaceObjectAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectAccessControlResponse_SdkV2) { @@ -4260,10 +4345,14 @@ func (newState *WorkspaceObjectAccessControlResponse_SdkV2) SyncEffectiveFieldsD func (newState *WorkspaceObjectAccessControlResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectAccessControlResponse_SdkV2) { } -func (c WorkspaceObjectAccessControlResponse_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectPermission_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c WorkspaceObjectAccessControlResponse_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectAccessControlResponse. @@ -4336,11 +4425,11 @@ func (o *WorkspaceObjectAccessControlResponse_SdkV2) SetAllPermissions(ctx conte } type WorkspaceObjectPermission_SdkV2 struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WorkspaceObjectPermission_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectPermission_SdkV2) { @@ -4349,9 +4438,12 @@ func (newState *WorkspaceObjectPermission_SdkV2) SyncEffectiveFieldsDuringCreate func (newState *WorkspaceObjectPermission_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermission_SdkV2) { } -func (c WorkspaceObjectPermission_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceObjectPermission_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermission. @@ -4420,11 +4512,11 @@ func (o *WorkspaceObjectPermission_SdkV2) SetInheritedFromObject(ctx context.Con } type WorkspaceObjectPermissions_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *WorkspaceObjectPermissions_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectPermissions_SdkV2) { @@ -4433,10 +4525,12 @@ func (newState *WorkspaceObjectPermissions_SdkV2) SyncEffectiveFieldsDuringCreat func (newState *WorkspaceObjectPermissions_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermissions_SdkV2) { } -func (c WorkspaceObjectPermissions_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectAccessControlResponse_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c WorkspaceObjectPermissions_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermissions. @@ -4505,9 +4599,9 @@ func (o *WorkspaceObjectPermissions_SdkV2) SetAccessControlList(ctx context.Cont } type WorkspaceObjectPermissionsDescription_SdkV2 struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WorkspaceObjectPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectPermissionsDescription_SdkV2) { @@ -4516,9 +4610,11 @@ func (newState *WorkspaceObjectPermissionsDescription_SdkV2) SyncEffectiveFields func (newState *WorkspaceObjectPermissionsDescription_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermissionsDescription_SdkV2) { } -func (c WorkspaceObjectPermissionsDescription_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceObjectPermissionsDescription_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermissionsDescription. @@ -4555,7 +4651,7 @@ func (o WorkspaceObjectPermissionsDescription_SdkV2) Type(ctx context.Context) a } type WorkspaceObjectPermissionsRequest_SdkV2 struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The workspace object for which to get or manage permissions. WorkspaceObjectId types.String `tfsdk:"-"` // The workspace object type for which to get or manage permissions. @@ -4568,12 +4664,12 @@ func (newState *WorkspaceObjectPermissionsRequest_SdkV2) SyncEffectiveFieldsDuri func (newState *WorkspaceObjectPermissionsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermissionsRequest_SdkV2) { } -func (c WorkspaceObjectPermissionsRequest_SdkV2) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectAccessControlRequest_SdkV2{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "workspace_object_id")...) - cs.SetRequired(append(path, "workspace_object_type")...) +func (c WorkspaceObjectPermissionsRequest_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["workspace_object_id"] = attrs["workspace_object_id"].SetRequired() + attrs["workspace_object_type"] = attrs["workspace_object_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermissionsRequest. diff --git a/internal/service/workspace_tf/model.go b/internal/service/workspace_tf/model.go index 87bb9504a..79addb20a 100755 --- a/internal/service/workspace_tf/model.go +++ b/internal/service/workspace_tf/model.go @@ -24,9 +24,9 @@ import ( type AclItem struct { // The permission level applied to the principal. - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` // The principal in which the permission is applied. - Principal types.String `tfsdk:"principal" tf:""` + Principal types.String `tfsdk:"principal"` } func (newState *AclItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan AclItem) { @@ -35,11 +35,11 @@ func (newState *AclItem) SyncEffectiveFieldsDuringCreateOrUpdate(plan AclItem) { func (newState *AclItem) SyncEffectiveFieldsDuringRead(existingState AclItem) { } -func (c AclItem) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "permission")...) - cs.SetRequired(append(path, "principal")...) +func (c AclItem) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission"] = attrs["permission"].SetRequired() + attrs["principal"] = attrs["principal"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AclItem. @@ -77,10 +77,10 @@ func (o AclItem) Type(ctx context.Context) attr.Type { type AzureKeyVaultSecretScopeMetadata struct { // The DNS of the KeyVault - DnsName types.String `tfsdk:"dns_name" tf:""` + DnsName types.String `tfsdk:"dns_name"` // The resource id of the azure KeyVault that user wants to associate the // scope with. - ResourceId types.String `tfsdk:"resource_id" tf:""` + ResourceId types.String `tfsdk:"resource_id"` } func (newState *AzureKeyVaultSecretScopeMetadata) SyncEffectiveFieldsDuringCreateOrUpdate(plan AzureKeyVaultSecretScopeMetadata) { @@ -89,11 +89,11 @@ func (newState *AzureKeyVaultSecretScopeMetadata) SyncEffectiveFieldsDuringCreat func (newState *AzureKeyVaultSecretScopeMetadata) SyncEffectiveFieldsDuringRead(existingState AzureKeyVaultSecretScopeMetadata) { } -func (c AzureKeyVaultSecretScopeMetadata) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "dns_name")...) - cs.SetRequired(append(path, "resource_id")...) +func (c AzureKeyVaultSecretScopeMetadata) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["dns_name"] = attrs["dns_name"].SetRequired() + attrs["resource_id"] = attrs["resource_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in AzureKeyVaultSecretScopeMetadata. @@ -134,7 +134,7 @@ type CreateCredentialsRequest struct { // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account, depending // on which provider you are using. For GitHub, GitHub Enterprise Server, or // Azure DevOps Services, either email or username may be used. For GitLab, @@ -142,13 +142,13 @@ type CreateCredentialsRequest struct { // BitBucket or BitBucket Server, username must be used. For all other // providers please see your provider's Personal Access Token authentication // documentation to see what is supported. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` // The personal access token used to authenticate to the corresponding Git // provider. For certain providers, support may exist for other types of // scoped access tokens. [Learn more]. // // [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html - PersonalAccessToken types.String `tfsdk:"personal_access_token" tf:"optional"` + PersonalAccessToken types.String `tfsdk:"personal_access_token"` } func (newState *CreateCredentialsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialsRequest) { @@ -157,10 +157,12 @@ func (newState *CreateCredentialsRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *CreateCredentialsRequest) SyncEffectiveFieldsDuringRead(existingState CreateCredentialsRequest) { } -func (c CreateCredentialsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "git_provider")...) +func (c CreateCredentialsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_username"] = attrs["git_username"].SetOptional() + attrs["personal_access_token"] = attrs["personal_access_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialsRequest. @@ -200,12 +202,12 @@ func (o CreateCredentialsRequest) Type(ctx context.Context) attr.Type { type CreateCredentialsResponse struct { // ID of the credential object in the workspace. - CredentialId types.Int64 `tfsdk:"credential_id" tf:""` + CredentialId types.Int64 `tfsdk:"credential_id"` // The Git provider associated with the credential. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account and // associated with the credential. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` } func (newState *CreateCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateCredentialsResponse) { @@ -214,11 +216,12 @@ func (newState *CreateCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *CreateCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState CreateCredentialsResponse) { } -func (c CreateCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) - cs.SetRequired(append(path, "git_provider")...) +func (c CreateCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_username"] = attrs["git_username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateCredentialsResponse. @@ -260,17 +263,17 @@ type CreateRepoRequest struct { // Desired path for the repo in the workspace. Almost any path in the // workspace can be chosen. If repo is created in `/Repos`, path must be in // the format `/Repos/{folder}/{repo-name}`. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider. This field is case-insensitive. The available Git providers // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - Provider types.String `tfsdk:"provider" tf:""` + Provider types.String `tfsdk:"provider"` // If specified, the repo will be created with sparse checkout enabled. You // cannot enable/disable sparse checkout after the repo is created. - SparseCheckout types.Object `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.Object `tfsdk:"sparse_checkout"` // URL of the Git repository to be linked. - Url types.String `tfsdk:"url" tf:""` + Url types.String `tfsdk:"url"` } func (newState *CreateRepoRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRepoRequest) { @@ -279,12 +282,13 @@ func (newState *CreateRepoRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateRepoRequest) SyncEffectiveFieldsDuringRead(existingState CreateRepoRequest) { } -func (c CreateRepoRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "provider")...) - SparseCheckout{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) - cs.SetRequired(append(path, "url")...) +func (c CreateRepoRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetRequired() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["url"] = attrs["url"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRepoRequest. @@ -356,20 +360,20 @@ func (o *CreateRepoRequest) SetSparseCheckout(ctx context.Context, v SparseCheck type CreateRepoResponse struct { // Branch that the Git folder (repo) is checked out to. - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // SHA-1 hash representing the commit ID of the current HEAD of the Git // folder (repo). - HeadCommitId types.String `tfsdk:"head_commit_id" tf:"optional"` + HeadCommitId types.String `tfsdk:"head_commit_id"` // ID of the Git folder (repo) object in the workspace. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // Path of the Git folder (repo) in the workspace. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider of the linked Git repository. - Provider types.String `tfsdk:"provider" tf:"optional"` + Provider types.String `tfsdk:"provider"` // Sparse checkout settings for the Git folder (repo). - SparseCheckout types.Object `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.Object `tfsdk:"sparse_checkout"` // URL of the linked Git repository. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *CreateRepoResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateRepoResponse) { @@ -378,10 +382,16 @@ func (newState *CreateRepoResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *CreateRepoResponse) SyncEffectiveFieldsDuringRead(existingState CreateRepoResponse) { } -func (c CreateRepoResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparseCheckout{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c CreateRepoResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["head_commit_id"] = attrs["head_commit_id"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateRepoResponse. @@ -459,15 +469,15 @@ func (o *CreateRepoResponse) SetSparseCheckout(ctx context.Context, v SparseChec type CreateScope struct { // The metadata for the secret scope if the type is `AZURE_KEYVAULT` - BackendAzureKeyvault types.Object `tfsdk:"backend_azure_keyvault" tf:"optional,object"` + BackendAzureKeyvault types.Object `tfsdk:"backend_azure_keyvault"` // The principal that is initially granted `MANAGE` permission to the // created scope. - InitialManagePrincipal types.String `tfsdk:"initial_manage_principal" tf:"optional"` + InitialManagePrincipal types.String `tfsdk:"initial_manage_principal"` // Scope name requested by the user. Scope names are unique. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` // The backend type the scope will be created with. If not specified, will // default to `DATABRICKS` - ScopeBackendType types.String `tfsdk:"scope_backend_type" tf:"optional"` + ScopeBackendType types.String `tfsdk:"scope_backend_type"` } func (newState *CreateScope) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateScope) { @@ -476,11 +486,13 @@ func (newState *CreateScope) SyncEffectiveFieldsDuringCreateOrUpdate(plan Create func (newState *CreateScope) SyncEffectiveFieldsDuringRead(existingState CreateScope) { } -func (c CreateScope) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AzureKeyVaultSecretScopeMetadata{}.ApplySchemaCustomizations(cs, append(path, "backend_azure_keyvault")...) - cs.SetRequired(append(path, "scope")...) +func (c CreateScope) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["backend_azure_keyvault"] = attrs["backend_azure_keyvault"].SetOptional() + attrs["initial_manage_principal"] = attrs["initial_manage_principal"].SetOptional() + attrs["scope"] = attrs["scope"].SetRequired() + attrs["scope_backend_type"] = attrs["scope_backend_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateScope. @@ -582,12 +594,12 @@ func (o CreateScopeResponse) Type(ctx context.Context) attr.Type { type CredentialInfo struct { // ID of the credential object in the workspace. - CredentialId types.Int64 `tfsdk:"credential_id" tf:""` + CredentialId types.Int64 `tfsdk:"credential_id"` // The Git provider associated with the credential. - GitProvider types.String `tfsdk:"git_provider" tf:"optional"` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account and // associated with the credential. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` } func (newState *CredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan CredentialInfo) { @@ -596,10 +608,12 @@ func (newState *CredentialInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan Cre func (newState *CredentialInfo) SyncEffectiveFieldsDuringRead(existingState CredentialInfo) { } -func (c CredentialInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) +func (c CredentialInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetOptional() + attrs["git_username"] = attrs["git_username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CredentialInfo. @@ -639,12 +653,12 @@ func (o CredentialInfo) Type(ctx context.Context) attr.Type { type Delete struct { // The absolute path of the notebook or directory. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` // The flag that specifies whether to delete the object recursively. It is // `false` by default. Please note this deleting directory is not atomic. If // it fails in the middle, some of objects under this directory may be // deleted and cannot be undone. - Recursive types.Bool `tfsdk:"recursive" tf:"optional"` + Recursive types.Bool `tfsdk:"recursive"` } func (newState *Delete) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete) { @@ -653,10 +667,11 @@ func (newState *Delete) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete) { func (newState *Delete) SyncEffectiveFieldsDuringRead(existingState Delete) { } -func (c Delete) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Delete) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() + attrs["recursive"] = attrs["recursive"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Delete. @@ -694,9 +709,9 @@ func (o Delete) Type(ctx context.Context) attr.Type { type DeleteAcl struct { // The principal to remove an existing ACL from. - Principal types.String `tfsdk:"principal" tf:""` + Principal types.String `tfsdk:"principal"` // The name of the scope to remove permissions from. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *DeleteAcl) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAcl) { @@ -705,11 +720,11 @@ func (newState *DeleteAcl) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAc func (newState *DeleteAcl) SyncEffectiveFieldsDuringRead(existingState DeleteAcl) { } -func (c DeleteAcl) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "principal")...) - cs.SetRequired(append(path, "scope")...) +func (c DeleteAcl) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["principal"] = attrs["principal"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAcl. @@ -821,9 +836,9 @@ func (newState *DeleteCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *DeleteCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState DeleteCredentialsResponse) { } -func (c DeleteCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteCredentialsResponse. @@ -899,9 +914,9 @@ func (newState *DeleteRepoResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *DeleteRepoResponse) SyncEffectiveFieldsDuringRead(existingState DeleteRepoResponse) { } -func (c DeleteRepoResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteRepoResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteRepoResponse. @@ -940,9 +955,9 @@ func (newState *DeleteResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Del func (newState *DeleteResponse) SyncEffectiveFieldsDuringRead(existingState DeleteResponse) { } -func (c DeleteResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteResponse. @@ -974,7 +989,7 @@ func (o DeleteResponse) Type(ctx context.Context) attr.Type { type DeleteScope struct { // Name of the scope to delete. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *DeleteScope) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteScope) { @@ -983,10 +998,10 @@ func (newState *DeleteScope) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delete func (newState *DeleteScope) SyncEffectiveFieldsDuringRead(existingState DeleteScope) { } -func (c DeleteScope) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "scope")...) +func (c DeleteScope) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteScope. @@ -1052,9 +1067,9 @@ func (o DeleteScopeResponse) Type(ctx context.Context) attr.Type { type DeleteSecret struct { // Name of the secret to delete. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // The name of the scope that contains the secret to delete. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *DeleteSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteSecret) { @@ -1063,11 +1078,11 @@ func (newState *DeleteSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan Delet func (newState *DeleteSecret) SyncEffectiveFieldsDuringRead(existingState DeleteSecret) { } -func (c DeleteSecret) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "scope")...) +func (c DeleteSecret) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteSecret. @@ -1112,9 +1127,9 @@ func (newState *DeleteSecretResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *DeleteSecretResponse) SyncEffectiveFieldsDuringRead(existingState DeleteSecretResponse) { } -func (c DeleteSecretResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c DeleteSecretResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteSecretResponse. @@ -1202,9 +1217,9 @@ func (o ExportRequest) Type(ctx context.Context) attr.Type { type ExportResponse struct { // The base64-encoded content. If the limit (10MB) is exceeded, exception // with error code **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // The file type of the exported file. - FileType types.String `tfsdk:"file_type" tf:"optional"` + FileType types.String `tfsdk:"file_type"` } func (newState *ExportResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ExportResponse) { @@ -1213,9 +1228,11 @@ func (newState *ExportResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Exp func (newState *ExportResponse) SyncEffectiveFieldsDuringRead(existingState ExportResponse) { } -func (c ExportResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ExportResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["file_type"] = attrs["file_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ExportResponse. @@ -1331,12 +1348,12 @@ func (o GetCredentialsRequest) Type(ctx context.Context) attr.Type { type GetCredentialsResponse struct { // ID of the credential object in the workspace. - CredentialId types.Int64 `tfsdk:"credential_id" tf:""` + CredentialId types.Int64 `tfsdk:"credential_id"` // The Git provider associated with the credential. - GitProvider types.String `tfsdk:"git_provider" tf:"optional"` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account and // associated with the credential. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` } func (newState *GetCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetCredentialsResponse) { @@ -1345,10 +1362,12 @@ func (newState *GetCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *GetCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState GetCredentialsResponse) { } -func (c GetCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) +func (c GetCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetOptional() + attrs["git_username"] = attrs["git_username"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetCredentialsResponse. @@ -1425,7 +1444,7 @@ func (o GetRepoPermissionLevelsRequest) Type(ctx context.Context) attr.Type { type GetRepoPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetRepoPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRepoPermissionLevelsResponse) { @@ -1434,10 +1453,10 @@ func (newState *GetRepoPermissionLevelsResponse) SyncEffectiveFieldsDuringCreate func (newState *GetRepoPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetRepoPermissionLevelsResponse) { } -func (c GetRepoPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetRepoPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRepoPermissionLevelsResponse. @@ -1577,19 +1596,19 @@ func (o GetRepoRequest) Type(ctx context.Context) attr.Type { type GetRepoResponse struct { // Branch that the local version of the repo is checked out to. - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // SHA-1 hash representing the commit ID of the current HEAD of the repo. - HeadCommitId types.String `tfsdk:"head_commit_id" tf:"optional"` + HeadCommitId types.String `tfsdk:"head_commit_id"` // ID of the Git folder (repo) object in the workspace. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // Path of the Git folder (repo) in the workspace. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider of the linked Git repository. - Provider types.String `tfsdk:"provider" tf:"optional"` + Provider types.String `tfsdk:"provider"` // Sparse checkout settings for the Git folder (repo). - SparseCheckout types.Object `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.Object `tfsdk:"sparse_checkout"` // URL of the linked Git repository. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *GetRepoResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetRepoResponse) { @@ -1598,10 +1617,16 @@ func (newState *GetRepoResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Ge func (newState *GetRepoResponse) SyncEffectiveFieldsDuringRead(existingState GetRepoResponse) { } -func (c GetRepoResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparseCheckout{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c GetRepoResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["head_commit_id"] = attrs["head_commit_id"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetRepoResponse. @@ -1720,9 +1745,9 @@ func (o GetSecretRequest) Type(ctx context.Context) attr.Type { type GetSecretResponse struct { // A unique name to identify the secret. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The value of the secret in its byte representation. - Value types.String `tfsdk:"value" tf:"optional"` + Value types.String `tfsdk:"value"` } func (newState *GetSecretResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetSecretResponse) { @@ -1731,9 +1756,11 @@ func (newState *GetSecretResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *GetSecretResponse) SyncEffectiveFieldsDuringRead(existingState GetSecretResponse) { } -func (c GetSecretResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c GetSecretResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["value"] = attrs["value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetSecretResponse. @@ -1849,7 +1876,7 @@ func (o GetWorkspaceObjectPermissionLevelsRequest) Type(ctx context.Context) att type GetWorkspaceObjectPermissionLevelsResponse struct { // Specific permission levels - PermissionLevels types.List `tfsdk:"permission_levels" tf:"optional"` + PermissionLevels types.List `tfsdk:"permission_levels"` } func (newState *GetWorkspaceObjectPermissionLevelsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetWorkspaceObjectPermissionLevelsResponse) { @@ -1858,10 +1885,10 @@ func (newState *GetWorkspaceObjectPermissionLevelsResponse) SyncEffectiveFieldsD func (newState *GetWorkspaceObjectPermissionLevelsResponse) SyncEffectiveFieldsDuringRead(existingState GetWorkspaceObjectPermissionLevelsResponse) { } -func (c GetWorkspaceObjectPermissionLevelsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectPermissionsDescription{}.ApplySchemaCustomizations(cs, append(path, "permission_levels")...) +func (c GetWorkspaceObjectPermissionLevelsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission_levels"] = attrs["permission_levels"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetWorkspaceObjectPermissionLevelsResponse. @@ -1972,7 +1999,7 @@ type Import struct { // If the limit (10MB) is exceeded, exception with error code // **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown. This parameter might be absent, // and instead a posted file is used. - Content types.String `tfsdk:"content" tf:"optional"` + Content types.String `tfsdk:"content"` // This specifies the format of the file to be imported. // // The value is case sensitive. @@ -1986,17 +2013,17 @@ type Import struct { // notebook is imported in Databricks archive format. Required for // directories. - `R_MARKDOWN`: The notebook is imported from R Markdown // format. - Format types.String `tfsdk:"format" tf:"optional"` + Format types.String `tfsdk:"format"` // The language of the object. This value is set only if the object type is // `NOTEBOOK`. - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` // The flag that specifies whether to overwrite existing object. It is // `false` by default. For `DBC` format, `overwrite` is not supported since // it may contain a directory. - Overwrite types.Bool `tfsdk:"overwrite" tf:"optional"` + Overwrite types.Bool `tfsdk:"overwrite"` // The absolute path of the object or directory. Importing a directory is // only supported for the `DBC` and `SOURCE` formats. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Import) SyncEffectiveFieldsDuringCreateOrUpdate(plan Import) { @@ -2005,10 +2032,14 @@ func (newState *Import) SyncEffectiveFieldsDuringCreateOrUpdate(plan Import) { func (newState *Import) SyncEffectiveFieldsDuringRead(existingState Import) { } -func (c Import) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Import) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["content"] = attrs["content"].SetOptional() + attrs["format"] = attrs["format"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() + attrs["overwrite"] = attrs["overwrite"].SetOptional() + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Import. @@ -2059,9 +2090,9 @@ func (newState *ImportResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Imp func (newState *ImportResponse) SyncEffectiveFieldsDuringRead(existingState ImportResponse) { } -func (c ImportResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ImportResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ImportResponse. @@ -2130,7 +2161,7 @@ func (o ListAclsRequest) Type(ctx context.Context) attr.Type { type ListAclsResponse struct { // The associated ACLs rule applied to principals in the given scope. - Items types.List `tfsdk:"items" tf:"optional"` + Items types.List `tfsdk:"items"` } func (newState *ListAclsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAclsResponse) { @@ -2139,10 +2170,10 @@ func (newState *ListAclsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan L func (newState *ListAclsResponse) SyncEffectiveFieldsDuringRead(existingState ListAclsResponse) { } -func (c ListAclsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AclItem{}.ApplySchemaCustomizations(cs, append(path, "items")...) +func (c ListAclsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["items"] = attrs["items"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAclsResponse. @@ -2208,7 +2239,7 @@ func (o *ListAclsResponse) SetItems(ctx context.Context, v []AclItem) { type ListCredentialsResponse struct { // List of credentials. - Credentials types.List `tfsdk:"credentials" tf:"optional"` + Credentials types.List `tfsdk:"credentials"` } func (newState *ListCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCredentialsResponse) { @@ -2217,10 +2248,10 @@ func (newState *ListCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpdate func (newState *ListCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState ListCredentialsResponse) { } -func (c ListCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - CredentialInfo{}.ApplySchemaCustomizations(cs, append(path, "credentials")...) +func (c ListCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credentials"] = attrs["credentials"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCredentialsResponse. @@ -2332,9 +2363,9 @@ func (o ListReposRequest) Type(ctx context.Context) attr.Type { type ListReposResponse struct { // Token that can be specified as a query parameter to the `GET /repos` // endpoint to retrieve the next page of results. - NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + NextPageToken types.String `tfsdk:"next_page_token"` // List of Git folders (repos). - Repos types.List `tfsdk:"repos" tf:"optional"` + Repos types.List `tfsdk:"repos"` } func (newState *ListReposResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListReposResponse) { @@ -2343,10 +2374,11 @@ func (newState *ListReposResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListReposResponse) SyncEffectiveFieldsDuringRead(existingState ListReposResponse) { } -func (c ListReposResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoInfo{}.ApplySchemaCustomizations(cs, append(path, "repos")...) +func (c ListReposResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() + attrs["repos"] = attrs["repos"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListReposResponse. @@ -2414,7 +2446,7 @@ func (o *ListReposResponse) SetRepos(ctx context.Context, v []RepoInfo) { type ListResponse struct { // List of objects. - Objects types.List `tfsdk:"objects" tf:"optional"` + Objects types.List `tfsdk:"objects"` } func (newState *ListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListResponse) { @@ -2423,10 +2455,10 @@ func (newState *ListResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListR func (newState *ListResponse) SyncEffectiveFieldsDuringRead(existingState ListResponse) { } -func (c ListResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - ObjectInfo{}.ApplySchemaCustomizations(cs, append(path, "objects")...) +func (c ListResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["objects"] = attrs["objects"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListResponse. @@ -2492,7 +2524,7 @@ func (o *ListResponse) SetObjects(ctx context.Context, v []ObjectInfo) { type ListScopesResponse struct { // The available secret scopes. - Scopes types.List `tfsdk:"scopes" tf:"optional"` + Scopes types.List `tfsdk:"scopes"` } func (newState *ListScopesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListScopesResponse) { @@ -2501,10 +2533,10 @@ func (newState *ListScopesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *ListScopesResponse) SyncEffectiveFieldsDuringRead(existingState ListScopesResponse) { } -func (c ListScopesResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SecretScope{}.ApplySchemaCustomizations(cs, append(path, "scopes")...) +func (c ListScopesResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["scopes"] = attrs["scopes"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListScopesResponse. @@ -2607,7 +2639,7 @@ func (o ListSecretsRequest) Type(ctx context.Context) attr.Type { type ListSecretsResponse struct { // Metadata information of all secrets contained within the given scope. - Secrets types.List `tfsdk:"secrets" tf:"optional"` + Secrets types.List `tfsdk:"secrets"` } func (newState *ListSecretsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSecretsResponse) { @@ -2616,10 +2648,10 @@ func (newState *ListSecretsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(pla func (newState *ListSecretsResponse) SyncEffectiveFieldsDuringRead(existingState ListSecretsResponse) { } -func (c ListSecretsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SecretMetadata{}.ApplySchemaCustomizations(cs, append(path, "secrets")...) +func (c ListSecretsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["secrets"] = attrs["secrets"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ListSecretsResponse. @@ -2728,7 +2760,7 @@ type Mkdirs struct { // The absolute path of the directory. If the parent directories do not // exist, it will also create them. If the directory already exists, this // command will do nothing and succeed. - Path types.String `tfsdk:"path" tf:""` + Path types.String `tfsdk:"path"` } func (newState *Mkdirs) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mkdirs) { @@ -2737,10 +2769,10 @@ func (newState *Mkdirs) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mkdirs) { func (newState *Mkdirs) SyncEffectiveFieldsDuringRead(existingState Mkdirs) { } -func (c Mkdirs) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "path")...) +func (c Mkdirs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["path"] = attrs["path"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in Mkdirs. @@ -2783,9 +2815,9 @@ func (newState *MkdirsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan Mkd func (newState *MkdirsResponse) SyncEffectiveFieldsDuringRead(existingState MkdirsResponse) { } -func (c MkdirsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c MkdirsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in MkdirsResponse. @@ -2817,27 +2849,27 @@ func (o MkdirsResponse) Type(ctx context.Context) attr.Type { type ObjectInfo struct { // Only applicable to files. The creation UTC timestamp. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at"` // The language of the object. This value is set only if the object type is // `NOTEBOOK`. - Language types.String `tfsdk:"language" tf:"optional"` + Language types.String `tfsdk:"language"` // Only applicable to files, the last modified UTC timestamp. - ModifiedAt types.Int64 `tfsdk:"modified_at" tf:"optional"` + ModifiedAt types.Int64 `tfsdk:"modified_at"` // Unique identifier for the object. - ObjectId types.Int64 `tfsdk:"object_id" tf:"optional"` + ObjectId types.Int64 `tfsdk:"object_id"` // The type of the object in workspace. // // - `NOTEBOOK`: document that contains runnable code, visualizations, and // explanatory text. - `DIRECTORY`: directory - `LIBRARY`: library - `FILE`: // file - `REPO`: repository - `DASHBOARD`: Lakeview dashboard - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` // The absolute path of the object. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // A unique identifier for the object that is consistent across all // Databricks APIs. - ResourceId types.String `tfsdk:"resource_id" tf:"optional"` + ResourceId types.String `tfsdk:"resource_id"` // Only applicable to files. The file size in bytes can be returned. - Size types.Int64 `tfsdk:"size" tf:"optional"` + Size types.Int64 `tfsdk:"size"` } func (newState *ObjectInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ObjectInfo) { @@ -2846,9 +2878,17 @@ func (newState *ObjectInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ObjectI func (newState *ObjectInfo) SyncEffectiveFieldsDuringRead(existingState ObjectInfo) { } -func (c ObjectInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c ObjectInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["created_at"] = attrs["created_at"].SetOptional() + attrs["language"] = attrs["language"].SetOptional() + attrs["modified_at"] = attrs["modified_at"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["resource_id"] = attrs["resource_id"].SetOptional() + attrs["size"] = attrs["size"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in ObjectInfo. @@ -2898,11 +2938,11 @@ func (o ObjectInfo) Type(ctx context.Context) attr.Type { type PutAcl struct { // The permission level applied to the principal. - Permission types.String `tfsdk:"permission" tf:""` + Permission types.String `tfsdk:"permission"` // The principal in which the permission is applied. - Principal types.String `tfsdk:"principal" tf:""` + Principal types.String `tfsdk:"principal"` // The name of the scope to apply permissions to. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` } func (newState *PutAcl) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutAcl) { @@ -2911,12 +2951,12 @@ func (newState *PutAcl) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutAcl) { func (newState *PutAcl) SyncEffectiveFieldsDuringRead(existingState PutAcl) { } -func (c PutAcl) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "permission")...) - cs.SetRequired(append(path, "principal")...) - cs.SetRequired(append(path, "scope")...) +func (c PutAcl) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["permission"] = attrs["permission"].SetRequired() + attrs["principal"] = attrs["principal"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutAcl. @@ -2986,13 +3026,13 @@ func (o PutAclResponse) Type(ctx context.Context) attr.Type { type PutSecret struct { // If specified, value will be stored as bytes. - BytesValue types.String `tfsdk:"bytes_value" tf:"optional"` + BytesValue types.String `tfsdk:"bytes_value"` // A unique name to identify the secret. - Key types.String `tfsdk:"key" tf:""` + Key types.String `tfsdk:"key"` // The name of the scope to which the secret will be associated with. - Scope types.String `tfsdk:"scope" tf:""` + Scope types.String `tfsdk:"scope"` // If specified, note that the value will be stored in UTF-8 (MB4) form. - StringValue types.String `tfsdk:"string_value" tf:"optional"` + StringValue types.String `tfsdk:"string_value"` } func (newState *PutSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutSecret) { @@ -3001,11 +3041,13 @@ func (newState *PutSecret) SyncEffectiveFieldsDuringCreateOrUpdate(plan PutSecre func (newState *PutSecret) SyncEffectiveFieldsDuringRead(existingState PutSecret) { } -func (c PutSecret) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "key")...) - cs.SetRequired(append(path, "scope")...) +func (c PutSecret) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["bytes_value"] = attrs["bytes_value"].SetOptional() + attrs["key"] = attrs["key"].SetRequired() + attrs["scope"] = attrs["scope"].SetRequired() + attrs["string_value"] = attrs["string_value"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in PutSecret. @@ -3077,13 +3119,13 @@ func (o PutSecretResponse) Type(ctx context.Context) attr.Type { type RepoAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RepoAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoAccessControlRequest) { @@ -3092,9 +3134,13 @@ func (newState *RepoAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *RepoAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState RepoAccessControlRequest) { } -func (c RepoAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepoAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoAccessControlRequest. @@ -3136,15 +3182,15 @@ func (o RepoAccessControlRequest) Type(ctx context.Context) attr.Type { type RepoAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *RepoAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoAccessControlResponse) { @@ -3153,10 +3199,14 @@ func (newState *RepoAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *RepoAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState RepoAccessControlResponse) { } -func (c RepoAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c RepoAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoAccessControlResponse. @@ -3231,19 +3281,19 @@ func (o *RepoAccessControlResponse) SetAllPermissions(ctx context.Context, v []R // Git folder (repo) information. type RepoInfo struct { // Name of the current git branch of the git folder (repo). - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // Current git commit id of the git folder (repo). - HeadCommitId types.String `tfsdk:"head_commit_id" tf:"optional"` + HeadCommitId types.String `tfsdk:"head_commit_id"` // Id of the git folder (repo) in the Workspace. - Id types.Int64 `tfsdk:"id" tf:"optional"` + Id types.Int64 `tfsdk:"id"` // Root path of the git folder (repo) in the Workspace. - Path types.String `tfsdk:"path" tf:"optional"` + Path types.String `tfsdk:"path"` // Git provider of the remote git repository, e.g. `gitHub`. - Provider types.String `tfsdk:"provider" tf:"optional"` + Provider types.String `tfsdk:"provider"` // Sparse checkout config for the git folder (repo). - SparseCheckout types.Object `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.Object `tfsdk:"sparse_checkout"` // URL of the remote git repository. - Url types.String `tfsdk:"url" tf:"optional"` + Url types.String `tfsdk:"url"` } func (newState *RepoInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInfo) { @@ -3252,10 +3302,16 @@ func (newState *RepoInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoInfo) func (newState *RepoInfo) SyncEffectiveFieldsDuringRead(existingState RepoInfo) { } -func (c RepoInfo) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - SparseCheckout{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c RepoInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["head_commit_id"] = attrs["head_commit_id"].SetOptional() + attrs["id"] = attrs["id"].SetOptional() + attrs["path"] = attrs["path"].SetOptional() + attrs["provider"] = attrs["provider"].SetOptional() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["url"] = attrs["url"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoInfo. @@ -3332,11 +3388,11 @@ func (o *RepoInfo) SetSparseCheckout(ctx context.Context, v SparseCheckout) { } type RepoPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RepoPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoPermission) { @@ -3345,9 +3401,12 @@ func (newState *RepoPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan Rep func (newState *RepoPermission) SyncEffectiveFieldsDuringRead(existingState RepoPermission) { } -func (c RepoPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepoPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermission. @@ -3416,11 +3475,11 @@ func (o *RepoPermission) SetInheritedFromObject(ctx context.Context, v []types.S } type RepoPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *RepoPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoPermissions) { @@ -3429,10 +3488,12 @@ func (newState *RepoPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan Re func (newState *RepoPermissions) SyncEffectiveFieldsDuringRead(existingState RepoPermissions) { } -func (c RepoPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c RepoPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermissions. @@ -3501,9 +3562,9 @@ func (o *RepoPermissions) SetAccessControlList(ctx context.Context, v []RepoAcce } type RepoPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *RepoPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan RepoPermissionsDescription) { @@ -3512,9 +3573,11 @@ func (newState *RepoPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpd func (newState *RepoPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState RepoPermissionsDescription) { } -func (c RepoPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c RepoPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermissionsDescription. @@ -3551,7 +3614,7 @@ func (o RepoPermissionsDescription) Type(ctx context.Context) attr.Type { } type RepoPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The repo for which to get or manage permissions. RepoId types.String `tfsdk:"-"` } @@ -3562,11 +3625,11 @@ func (newState *RepoPermissionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate( func (newState *RepoPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState RepoPermissionsRequest) { } -func (c RepoPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - RepoAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "repo_id")...) +func (c RepoPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["repo_id"] = attrs["repo_id"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in RepoPermissionsRequest. @@ -3634,9 +3697,9 @@ func (o *RepoPermissionsRequest) SetAccessControlList(ctx context.Context, v []R type SecretMetadata struct { // A unique name to identify the secret. - Key types.String `tfsdk:"key" tf:"optional"` + Key types.String `tfsdk:"key"` // The last updated timestamp (in milliseconds) for the secret. - LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp" tf:"optional"` + LastUpdatedTimestamp types.Int64 `tfsdk:"last_updated_timestamp"` } func (newState *SecretMetadata) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretMetadata) { @@ -3645,9 +3708,11 @@ func (newState *SecretMetadata) SyncEffectiveFieldsDuringCreateOrUpdate(plan Sec func (newState *SecretMetadata) SyncEffectiveFieldsDuringRead(existingState SecretMetadata) { } -func (c SecretMetadata) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SecretMetadata) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["key"] = attrs["key"].SetOptional() + attrs["last_updated_timestamp"] = attrs["last_updated_timestamp"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecretMetadata. @@ -3685,11 +3750,11 @@ func (o SecretMetadata) Type(ctx context.Context) attr.Type { type SecretScope struct { // The type of secret scope backend. - BackendType types.String `tfsdk:"backend_type" tf:"optional"` + BackendType types.String `tfsdk:"backend_type"` // The metadata for the secret scope if the type is `AZURE_KEYVAULT` - KeyvaultMetadata types.Object `tfsdk:"keyvault_metadata" tf:"optional,object"` + KeyvaultMetadata types.Object `tfsdk:"keyvault_metadata"` // A unique name to identify the secret scope. - Name types.String `tfsdk:"name" tf:"optional"` + Name types.String `tfsdk:"name"` } func (newState *SecretScope) SyncEffectiveFieldsDuringCreateOrUpdate(plan SecretScope) { @@ -3698,10 +3763,12 @@ func (newState *SecretScope) SyncEffectiveFieldsDuringCreateOrUpdate(plan Secret func (newState *SecretScope) SyncEffectiveFieldsDuringRead(existingState SecretScope) { } -func (c SecretScope) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - AzureKeyVaultSecretScopeMetadata{}.ApplySchemaCustomizations(cs, append(path, "keyvault_metadata")...) +func (c SecretScope) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["backend_type"] = attrs["backend_type"].SetOptional() + attrs["keyvault_metadata"] = attrs["keyvault_metadata"].SetOptional() + attrs["name"] = attrs["name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SecretScope. @@ -3775,7 +3842,7 @@ type SparseCheckout struct { // details. // // [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling - Patterns types.List `tfsdk:"patterns" tf:"optional"` + Patterns types.List `tfsdk:"patterns"` } func (newState *SparseCheckout) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparseCheckout) { @@ -3784,9 +3851,10 @@ func (newState *SparseCheckout) SyncEffectiveFieldsDuringCreateOrUpdate(plan Spa func (newState *SparseCheckout) SyncEffectiveFieldsDuringRead(existingState SparseCheckout) { } -func (c SparseCheckout) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparseCheckout) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["patterns"] = attrs["patterns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparseCheckout. @@ -3856,7 +3924,7 @@ type SparseCheckoutUpdate struct { // details. // // [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling - Patterns types.List `tfsdk:"patterns" tf:"optional"` + Patterns types.List `tfsdk:"patterns"` } func (newState *SparseCheckoutUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(plan SparseCheckoutUpdate) { @@ -3865,9 +3933,10 @@ func (newState *SparseCheckoutUpdate) SyncEffectiveFieldsDuringCreateOrUpdate(pl func (newState *SparseCheckoutUpdate) SyncEffectiveFieldsDuringRead(existingState SparseCheckoutUpdate) { } -func (c SparseCheckoutUpdate) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c SparseCheckoutUpdate) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["patterns"] = attrs["patterns"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in SparseCheckoutUpdate. @@ -3938,7 +4007,7 @@ type UpdateCredentialsRequest struct { // are `gitHub`, `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, // `gitHubEnterprise`, `bitbucketServer`, `gitLabEnterpriseEdition` and // `awsCodeCommit`. - GitProvider types.String `tfsdk:"git_provider" tf:""` + GitProvider types.String `tfsdk:"git_provider"` // The username or email provided with your Git provider account, depending // on which provider you are using. For GitHub, GitHub Enterprise Server, or // Azure DevOps Services, either email or username may be used. For GitLab, @@ -3946,13 +4015,13 @@ type UpdateCredentialsRequest struct { // BitBucket or BitBucket Server, username must be used. For all other // providers please see your provider's Personal Access Token authentication // documentation to see what is supported. - GitUsername types.String `tfsdk:"git_username" tf:"optional"` + GitUsername types.String `tfsdk:"git_username"` // The personal access token used to authenticate to the corresponding Git // provider. For certain providers, support may exist for other types of // scoped access tokens. [Learn more]. // // [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html - PersonalAccessToken types.String `tfsdk:"personal_access_token" tf:"optional"` + PersonalAccessToken types.String `tfsdk:"personal_access_token"` } func (newState *UpdateCredentialsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateCredentialsRequest) { @@ -3961,11 +4030,13 @@ func (newState *UpdateCredentialsRequest) SyncEffectiveFieldsDuringCreateOrUpdat func (newState *UpdateCredentialsRequest) SyncEffectiveFieldsDuringRead(existingState UpdateCredentialsRequest) { } -func (c UpdateCredentialsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "credential_id")...) - cs.SetRequired(append(path, "git_provider")...) +func (c UpdateCredentialsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["credential_id"] = attrs["credential_id"].SetRequired() + attrs["git_provider"] = attrs["git_provider"].SetRequired() + attrs["git_username"] = attrs["git_username"].SetOptional() + attrs["personal_access_token"] = attrs["personal_access_token"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCredentialsRequest. @@ -4014,9 +4085,9 @@ func (newState *UpdateCredentialsResponse) SyncEffectiveFieldsDuringCreateOrUpda func (newState *UpdateCredentialsResponse) SyncEffectiveFieldsDuringRead(existingState UpdateCredentialsResponse) { } -func (c UpdateCredentialsResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateCredentialsResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateCredentialsResponse. @@ -4048,17 +4119,17 @@ func (o UpdateCredentialsResponse) Type(ctx context.Context) attr.Type { type UpdateRepoRequest struct { // Branch that the local version of the repo is checked out to. - Branch types.String `tfsdk:"branch" tf:"optional"` + Branch types.String `tfsdk:"branch"` // ID of the Git folder (repo) object in the workspace. RepoId types.Int64 `tfsdk:"-"` // If specified, update the sparse checkout settings. The update will fail // if sparse checkout is not enabled for the repo. - SparseCheckout types.Object `tfsdk:"sparse_checkout" tf:"optional,object"` + SparseCheckout types.Object `tfsdk:"sparse_checkout"` // Tag that the local version of the repo is checked out to. Updating the // repo to a tag puts the repo in a detached HEAD state. Before committing // new changes, you must update the repo to a branch instead of the detached // HEAD. - Tag types.String `tfsdk:"tag" tf:"optional"` + Tag types.String `tfsdk:"tag"` } func (newState *UpdateRepoRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateRepoRequest) { @@ -4067,11 +4138,13 @@ func (newState *UpdateRepoRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateRepoRequest) SyncEffectiveFieldsDuringRead(existingState UpdateRepoRequest) { } -func (c UpdateRepoRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - cs.SetRequired(append(path, "repo_id")...) - SparseCheckoutUpdate{}.ApplySchemaCustomizations(cs, append(path, "sparse_checkout")...) +func (c UpdateRepoRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["branch"] = attrs["branch"].SetOptional() + attrs["repo_id"] = attrs["repo_id"].SetRequired() + attrs["sparse_checkout"] = attrs["sparse_checkout"].SetOptional() + attrs["tag"] = attrs["tag"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRepoRequest. @@ -4150,9 +4223,9 @@ func (newState *UpdateRepoResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan func (newState *UpdateRepoResponse) SyncEffectiveFieldsDuringRead(existingState UpdateRepoResponse) { } -func (c UpdateRepoResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c UpdateRepoResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateRepoResponse. @@ -4184,13 +4257,13 @@ func (o UpdateRepoResponse) Type(ctx context.Context) attr.Type { type WorkspaceObjectAccessControlRequest struct { // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` // application ID of a service principal - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WorkspaceObjectAccessControlRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectAccessControlRequest) { @@ -4199,9 +4272,13 @@ func (newState *WorkspaceObjectAccessControlRequest) SyncEffectiveFieldsDuringCr func (newState *WorkspaceObjectAccessControlRequest) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectAccessControlRequest) { } -func (c WorkspaceObjectAccessControlRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceObjectAccessControlRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectAccessControlRequest. @@ -4243,15 +4320,15 @@ func (o WorkspaceObjectAccessControlRequest) Type(ctx context.Context) attr.Type type WorkspaceObjectAccessControlResponse struct { // All permissions. - AllPermissions types.List `tfsdk:"all_permissions" tf:"optional"` + AllPermissions types.List `tfsdk:"all_permissions"` // Display name of the user or service principal. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` + DisplayName types.String `tfsdk:"display_name"` // name of the group - GroupName types.String `tfsdk:"group_name" tf:"optional"` + GroupName types.String `tfsdk:"group_name"` // Name of the service principal. - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name"` // name of the user - UserName types.String `tfsdk:"user_name" tf:"optional"` + UserName types.String `tfsdk:"user_name"` } func (newState *WorkspaceObjectAccessControlResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectAccessControlResponse) { @@ -4260,10 +4337,14 @@ func (newState *WorkspaceObjectAccessControlResponse) SyncEffectiveFieldsDuringC func (newState *WorkspaceObjectAccessControlResponse) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectAccessControlResponse) { } -func (c WorkspaceObjectAccessControlResponse) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectPermission{}.ApplySchemaCustomizations(cs, append(path, "all_permissions")...) +func (c WorkspaceObjectAccessControlResponse) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["all_permissions"] = attrs["all_permissions"].SetOptional() + attrs["display_name"] = attrs["display_name"].SetOptional() + attrs["group_name"] = attrs["group_name"].SetOptional() + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectAccessControlResponse. @@ -4336,11 +4417,11 @@ func (o *WorkspaceObjectAccessControlResponse) SetAllPermissions(ctx context.Con } type WorkspaceObjectPermission struct { - Inherited types.Bool `tfsdk:"inherited" tf:"optional"` + Inherited types.Bool `tfsdk:"inherited"` - InheritedFromObject types.List `tfsdk:"inherited_from_object" tf:"optional"` + InheritedFromObject types.List `tfsdk:"inherited_from_object"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WorkspaceObjectPermission) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectPermission) { @@ -4349,9 +4430,12 @@ func (newState *WorkspaceObjectPermission) SyncEffectiveFieldsDuringCreateOrUpda func (newState *WorkspaceObjectPermission) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermission) { } -func (c WorkspaceObjectPermission) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceObjectPermission) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["inherited"] = attrs["inherited"].SetOptional() + attrs["inherited_from_object"] = attrs["inherited_from_object"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermission. @@ -4420,11 +4504,11 @@ func (o *WorkspaceObjectPermission) SetInheritedFromObject(ctx context.Context, } type WorkspaceObjectPermissions struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` - ObjectId types.String `tfsdk:"object_id" tf:"optional"` + ObjectId types.String `tfsdk:"object_id"` - ObjectType types.String `tfsdk:"object_type" tf:"optional"` + ObjectType types.String `tfsdk:"object_type"` } func (newState *WorkspaceObjectPermissions) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectPermissions) { @@ -4433,10 +4517,12 @@ func (newState *WorkspaceObjectPermissions) SyncEffectiveFieldsDuringCreateOrUpd func (newState *WorkspaceObjectPermissions) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermissions) { } -func (c WorkspaceObjectPermissions) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectAccessControlResponse{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) +func (c WorkspaceObjectPermissions) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["object_id"] = attrs["object_id"].SetOptional() + attrs["object_type"] = attrs["object_type"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermissions. @@ -4505,9 +4591,9 @@ func (o *WorkspaceObjectPermissions) SetAccessControlList(ctx context.Context, v } type WorkspaceObjectPermissionsDescription struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` // Permission level - PermissionLevel types.String `tfsdk:"permission_level" tf:"optional"` + PermissionLevel types.String `tfsdk:"permission_level"` } func (newState *WorkspaceObjectPermissionsDescription) SyncEffectiveFieldsDuringCreateOrUpdate(plan WorkspaceObjectPermissionsDescription) { @@ -4516,9 +4602,11 @@ func (newState *WorkspaceObjectPermissionsDescription) SyncEffectiveFieldsDuring func (newState *WorkspaceObjectPermissionsDescription) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermissionsDescription) { } -func (c WorkspaceObjectPermissionsDescription) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { +func (c WorkspaceObjectPermissionsDescription) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + attrs["permission_level"] = attrs["permission_level"].SetOptional() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermissionsDescription. @@ -4555,7 +4643,7 @@ func (o WorkspaceObjectPermissionsDescription) Type(ctx context.Context) attr.Ty } type WorkspaceObjectPermissionsRequest struct { - AccessControlList types.List `tfsdk:"access_control_list" tf:"optional"` + AccessControlList types.List `tfsdk:"access_control_list"` // The workspace object for which to get or manage permissions. WorkspaceObjectId types.String `tfsdk:"-"` // The workspace object type for which to get or manage permissions. @@ -4568,12 +4656,12 @@ func (newState *WorkspaceObjectPermissionsRequest) SyncEffectiveFieldsDuringCrea func (newState *WorkspaceObjectPermissionsRequest) SyncEffectiveFieldsDuringRead(existingState WorkspaceObjectPermissionsRequest) { } -func (c WorkspaceObjectPermissionsRequest) ApplySchemaCustomizations(cs tfschema.CustomizableSchema, path ...string) tfschema.CustomizableSchema { - WorkspaceObjectAccessControlRequest{}.ApplySchemaCustomizations(cs, append(path, "access_control_list")...) - cs.SetRequired(append(path, "workspace_object_id")...) - cs.SetRequired(append(path, "workspace_object_type")...) +func (c WorkspaceObjectPermissionsRequest) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["access_control_list"] = attrs["access_control_list"].SetOptional() + attrs["workspace_object_id"] = attrs["workspace_object_id"].SetRequired() + attrs["workspace_object_type"] = attrs["workspace_object_type"].SetRequired() - return cs + return attrs } // GetComplexFieldTypes returns a map of the types of elements in complex fields in WorkspaceObjectPermissionsRequest. From 5226eb4cf59728145dfe0b89a38b903add0742a4 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 8 Jan 2025 17:50:19 +0100 Subject: [PATCH 4/6] remove tf annotations from custom structs --- .../providers/pluginfw/products/app/data_app.go | 11 +++++++++-- .../pluginfw/products/catalog/data_functions.go | 17 +++++++++++++---- .../qualitymonitor/resource_quality_monitor.go | 1 + .../registered_model/data_registered_model.go | 16 ++++++++++++---- .../data_registered_model_versions.go | 10 ++++++++-- .../pluginfw/products/volume/data_volumes.go | 13 ++++++++++--- 6 files changed, 53 insertions(+), 15 deletions(-) diff --git a/internal/providers/pluginfw/products/app/data_app.go b/internal/providers/pluginfw/products/app/data_app.go index d93b0cb42..2d36537fa 100644 --- a/internal/providers/pluginfw/products/app/data_app.go +++ b/internal/providers/pluginfw/products/app/data_app.go @@ -24,8 +24,15 @@ type dataSourceApp struct { } type dataApp struct { - Name types.String `tfsdk:"name" tf:"required"` - App types.Object `tfsdk:"app" tf:"computed"` + Name types.String `tfsdk:"name"` + App types.Object `tfsdk:"app"` +} + +func (dataApp) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["app"] = attrs["app"].SetComputed() + + return attrs } func (dataApp) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/catalog/data_functions.go b/internal/providers/pluginfw/products/catalog/data_functions.go index 4ce99e5b5..d7fa94457 100644 --- a/internal/providers/pluginfw/products/catalog/data_functions.go +++ b/internal/providers/pluginfw/products/catalog/data_functions.go @@ -32,10 +32,19 @@ type FunctionsDataSource struct { } type FunctionsData struct { - CatalogName types.String `tfsdk:"catalog_name" tf:"required"` - SchemaName types.String `tfsdk:"schema_name" tf:"required"` - IncludeBrowse types.Bool `tfsdk:"include_browse" tf:"optional"` - Functions types.List `tfsdk:"functions" tf:"optional,computed"` + CatalogName types.String `tfsdk:"catalog_name"` + SchemaName types.String `tfsdk:"schema_name"` + IncludeBrowse types.Bool `tfsdk:"include_browse"` + Functions types.List `tfsdk:"functions"` +} + +func (FunctionsData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["include_browse"] = attrs["include_browse"].SetOptional() + attrs["functions"] = attrs["functions"].SetOptional().SetComputed() + + return attrs } func (FunctionsData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go index c547bd386..c70f249d7 100644 --- a/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go +++ b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go @@ -90,6 +90,7 @@ func (r *QualityMonitorResource) Schema(ctx context.Context, req resource.Schema c.SetOptional("warehouse_id") c.SetOptional("skip_builtin_dashboard") c.SetComputed("id") + c.SetOptional("id") return c }) resp.Schema = schema.Schema{ diff --git a/internal/providers/pluginfw/products/registered_model/data_registered_model.go b/internal/providers/pluginfw/products/registered_model/data_registered_model.go index 02b808b84..6dd8257b7 100644 --- a/internal/providers/pluginfw/products/registered_model/data_registered_model.go +++ b/internal/providers/pluginfw/products/registered_model/data_registered_model.go @@ -34,10 +34,18 @@ type RegisteredModelDataSource struct { } type RegisteredModelData struct { - FullName types.String `tfsdk:"full_name" tf:"required"` - IncludeAliases types.Bool `tfsdk:"include_aliases" tf:"optional"` - IncludeBrowse types.Bool `tfsdk:"include_browse" tf:"optional"` - ModelInfo types.List `tfsdk:"model_info" tf:"optional,computed"` + FullName types.String `tfsdk:"full_name"` + IncludeAliases types.Bool `tfsdk:"include_aliases"` + IncludeBrowse types.Bool `tfsdk:"include_browse"` + ModelInfo types.List `tfsdk:"model_info"` +} + +func (RegisteredModelData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["include_aliases"] = attrs["include_aliases"].SetOptional() + attrs["include_browse"] = attrs["include_browse"].SetOptional() + attrs["model_info"] = attrs["model_info"].SetOptional().SetComputed() + return attrs } func (RegisteredModelData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go b/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go index febc5152e..3d17b589a 100644 --- a/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go +++ b/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go @@ -27,8 +27,14 @@ type RegisteredModelVersionsDataSource struct { } type RegisteredModelVersionsData struct { - FullName types.String `tfsdk:"full_name" tf:"required"` - ModelVersions types.List `tfsdk:"model_versions" tf:"optional,computed"` + FullName types.String `tfsdk:"full_name"` + ModelVersions types.List `tfsdk:"model_versions"` +} + +func (RegisteredModelVersionsData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["model_versions"] = attrs["model_versions"].SetOptional().SetComputed() + return attrs } func (RegisteredModelVersionsData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/volume/data_volumes.go b/internal/providers/pluginfw/products/volume/data_volumes.go index 64593ecb2..e5772cce4 100644 --- a/internal/providers/pluginfw/products/volume/data_volumes.go +++ b/internal/providers/pluginfw/products/volume/data_volumes.go @@ -31,9 +31,16 @@ type VolumesDataSource struct { } type VolumesList struct { - CatalogName types.String `tfsdk:"catalog_name" tf:"required"` - SchemaName types.String `tfsdk:"schema_name" tf:"required"` - Ids types.List `tfsdk:"ids" tf:"optional,computed"` + CatalogName types.String `tfsdk:"catalog_name"` + SchemaName types.String `tfsdk:"schema_name"` + Ids types.List `tfsdk:"ids"` +} + +func (VolumesList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["ids"] = attrs["ids"].SetOptional().SetComputed() + return attrs } func (VolumesList) GetComplexFieldTypes(context.Context) map[string]reflect.Type { From 80e3d439ea172d800671fe53ae05bdc021103981 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Thu, 9 Jan 2025 11:00:50 +0100 Subject: [PATCH 5/6] nuke tf:... annotations --- .../pluginfw/converters/converters_test.go | 46 +++---- .../pluginfw/products/app/data_apps.go | 8 +- .../pluginfw/products/cluster/data_cluster.go | 14 +- .../data_notification_destinations.go | 14 +- .../serving/data_serving_endpoints.go | 8 +- .../pluginfw/products/sharing/data_shares.go | 8 +- .../tfschema/customizable_schema_test.go | 19 ++- .../pluginfw/tfschema/struct_to_schema.go | 50 +------- .../tfschema/struct_to_schema_test.go | 120 +++++++++++++++--- 9 files changed, 187 insertions(+), 100 deletions(-) diff --git a/internal/providers/pluginfw/converters/converters_test.go b/internal/providers/pluginfw/converters/converters_test.go index c8f4bf172..0f616782f 100644 --- a/internal/providers/pluginfw/converters/converters_test.go +++ b/internal/providers/pluginfw/converters/converters_test.go @@ -15,28 +15,28 @@ import ( ) type DummyTfSdk struct { - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` - Workers types.Int64 `tfsdk:"workers" tf:""` - Floats types.Float64 `tfsdk:"floats" tf:""` - Description types.String `tfsdk:"description" tf:""` - Tasks types.String `tfsdk:"task" tf:"optional"` - NoPointerNested types.List `tfsdk:"no_pointer_nested" tf:"optional"` - NestedList types.List `tfsdk:"nested_list" tf:"optional"` - NestedPointerList types.List `tfsdk:"nested_pointer_list" tf:"optional"` - Map types.Map `tfsdk:"map" tf:"optional"` - NestedMap types.Map `tfsdk:"nested_map" tf:"optional"` - Repeated types.List `tfsdk:"repeated" tf:"optional"` - Attributes types.Map `tfsdk:"attributes" tf:"optional"` - EnumField types.String `tfsdk:"enum_field" tf:"optional"` - AdditionalField types.String `tfsdk:"additional_field" tf:"optional"` - DistinctField types.String `tfsdk:"distinct_field" tf:"optional"` - SliceStructPtr types.List `tfsdk:"slice_struct_ptr" tf:"optional"` + Enabled types.Bool `tfsdk:"enabled"` + Workers types.Int64 `tfsdk:"workers"` + Floats types.Float64 `tfsdk:"floats"` + Description types.String `tfsdk:"description"` + Tasks types.String `tfsdk:"task"` + NoPointerNested types.List `tfsdk:"no_pointer_nested"` + NestedList types.List `tfsdk:"nested_list"` + NestedPointerList types.List `tfsdk:"nested_pointer_list"` + Map types.Map `tfsdk:"map"` + NestedMap types.Map `tfsdk:"nested_map"` + Repeated types.List `tfsdk:"repeated"` + Attributes types.Map `tfsdk:"attributes"` + EnumField types.String `tfsdk:"enum_field"` + AdditionalField types.String `tfsdk:"additional_field"` + DistinctField types.String `tfsdk:"distinct_field"` + SliceStructPtr types.List `tfsdk:"slice_struct_ptr"` Irrelevant types.String `tfsdk:"-"` - Object types.Object `tfsdk:"object" tf:"optional"` - ObjectPtr types.Object `tfsdk:"object_ptr" tf:"optional"` - Type_ types.String `tfsdk:"type" tf:""` // Test Type_ renaming - EmptyStructList types.List `tfsdk:"empty_struct_list" tf:"optional"` - EmptyStructObject types.Object `tfsdk:"empty_struct_object" tf:"optional"` + Object types.Object `tfsdk:"object"` + ObjectPtr types.Object `tfsdk:"object_ptr"` + Type_ types.String `tfsdk:"type"` // Test Type_ renaming + EmptyStructList types.List `tfsdk:"empty_struct_list"` + EmptyStructObject types.Object `tfsdk:"empty_struct_object"` } func (DummyTfSdk) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { @@ -84,8 +84,8 @@ func (f *TestEnum) Type() string { } type DummyNestedTfSdk struct { - Name types.String `tfsdk:"name" tf:"optional"` - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Name types.String `tfsdk:"name"` + Enabled types.Bool `tfsdk:"enabled"` } type DummyNestedTfSdkEmpty struct{} diff --git a/internal/providers/pluginfw/products/app/data_apps.go b/internal/providers/pluginfw/products/app/data_apps.go index e5cbc2592..19ebeeb6e 100644 --- a/internal/providers/pluginfw/products/app/data_apps.go +++ b/internal/providers/pluginfw/products/app/data_apps.go @@ -25,7 +25,13 @@ type dataSourceApps struct { } type dataApps struct { - Apps types.List `tfsdk:"app" tf:"computed"` + Apps types.List `tfsdk:"app"` +} + +func (dataApps) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["app"] = attrs["app"].SetComputed() + + return attrs } func (dataApps) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/cluster/data_cluster.go b/internal/providers/pluginfw/products/cluster/data_cluster.go index f85063794..e43740f3b 100644 --- a/internal/providers/pluginfw/products/cluster/data_cluster.go +++ b/internal/providers/pluginfw/products/cluster/data_cluster.go @@ -34,9 +34,17 @@ type ClusterDataSource struct { } type ClusterInfo struct { - ClusterId types.String `tfsdk:"cluster_id" tf:"optional,computed"` - Name types.String `tfsdk:"cluster_name" tf:"optional,computed"` - ClusterInfo types.List `tfsdk:"cluster_info" tf:"optional,computed"` + ClusterId types.String `tfsdk:"cluster_id"` + Name types.String `tfsdk:"cluster_name"` + ClusterInfo types.List `tfsdk:"cluster_info"` +} + +func (ClusterInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["cluster_id"] = attrs["cluster_id"].SetOptional().SetComputed() + attrs["cluster_name"] = attrs["cluster_name"].SetOptional().SetComputed() + attrs["cluster_info"] = attrs["cluster_info"].SetOptional().SetComputed() + + return attrs } func (ClusterInfo) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations.go b/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations.go index 5e6688bb7..1d5f5d6b7 100755 --- a/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations.go +++ b/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations.go @@ -34,9 +34,17 @@ type NotificationDestinationsDataSource struct { } type NotificationDestinationsInfo struct { - DisplayNameContains types.String `tfsdk:"display_name_contains" tf:"optional"` - Type types.String `tfsdk:"type" tf:"optional"` - NotificationDestinations types.List `tfsdk:"notification_destinations" tf:"computed"` + DisplayNameContains types.String `tfsdk:"display_name_contains"` + Type types.String `tfsdk:"type"` + NotificationDestinations types.List `tfsdk:"notification_destinations"` +} + +func (NotificationDestinationsInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["display_name_contains"] = attrs["display_name_contains"].SetOptional() + attrs["type"] = attrs["type"].SetOptional() + attrs["notification_destinations"] = attrs["notification_destinations"].SetComputed() + + return attrs } func (NotificationDestinationsInfo) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/serving/data_serving_endpoints.go b/internal/providers/pluginfw/products/serving/data_serving_endpoints.go index d695bc93e..53a95a070 100644 --- a/internal/providers/pluginfw/products/serving/data_serving_endpoints.go +++ b/internal/providers/pluginfw/products/serving/data_serving_endpoints.go @@ -27,7 +27,13 @@ type ServingEndpointsDataSource struct { } type ServingEndpointsData struct { - Endpoints types.List `tfsdk:"endpoints" tf:"optional,computed"` + Endpoints types.List `tfsdk:"endpoints"` +} + +func (ServingEndpointsData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["endpoints"] = attrs["endpoints"].SetOptional().SetComputed() + + return attrs } func (ServingEndpointsData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/sharing/data_shares.go b/internal/providers/pluginfw/products/sharing/data_shares.go index 457ba8633..bdc5301d0 100644 --- a/internal/providers/pluginfw/products/sharing/data_shares.go +++ b/internal/providers/pluginfw/products/sharing/data_shares.go @@ -18,7 +18,13 @@ import ( const dataSourceNameShares = "shares" type SharesList struct { - Shares types.List `tfsdk:"shares" tf:"computed,optional,slice_set"` + Shares types.List `tfsdk:"shares"` +} + +func (SharesList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["shares"] = attrs["shares"].SetComputed().SetOptional() + + return attrs } func (SharesList) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/tfschema/customizable_schema_test.go b/internal/providers/pluginfw/tfschema/customizable_schema_test.go index c2d691da4..e16354cf2 100644 --- a/internal/providers/pluginfw/tfschema/customizable_schema_test.go +++ b/internal/providers/pluginfw/tfschema/customizable_schema_test.go @@ -6,6 +6,7 @@ import ( "reflect" "testing" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" @@ -15,10 +16,16 @@ import ( ) type TestTfSdk struct { - Description types.String `tfsdk:"description" tf:""` - Nested types.List `tfsdk:"nested" tf:"optional"` - NestedSliceObject types.List `tfsdk:"nested_slice_object" tf:"optional,object"` - Map types.Map `tfsdk:"map" tf:"optional"` + Description types.String `tfsdk:"description"` + Nested types.List `tfsdk:"nested"` + NestedSliceObject types.List `tfsdk:"nested_slice_object"` + Map types.Map `tfsdk:"map"` +} + +func (TestTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["nested_slice_object"] = attrs["nested_slice_object"].(ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(AttributeBuilder) + + return attrs } func (TestTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { @@ -30,8 +37,8 @@ func (TestTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { } type NestedTfSdk struct { - Name types.String `tfsdk:"name" tf:"optional"` - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Name types.String `tfsdk:"name"` + Enabled types.Bool `tfsdk:"enabled"` } type stringLengthBetweenValidator struct { diff --git a/internal/providers/pluginfw/tfschema/struct_to_schema.go b/internal/providers/pluginfw/tfschema/struct_to_schema.go index 9a26dca10..5617c7456 100644 --- a/internal/providers/pluginfw/tfschema/struct_to_schema.go +++ b/internal/providers/pluginfw/tfschema/struct_to_schema.go @@ -4,12 +4,10 @@ import ( "context" "fmt" "reflect" - "strings" "github.com/databricks/terraform-provider-databricks/common" tfcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/tfreflect" - "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" dataschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -21,12 +19,6 @@ type CustomizableSchemaProvider interface { ApplySchemaCustomizations(map[string]AttributeBuilder) map[string]AttributeBuilder } -type structTag struct { - optional bool - computed bool - singleObject bool -} - func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { scmAttr := map[string]AttributeBuilder{} rk := v.Kind() @@ -38,15 +30,16 @@ func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { panic(fmt.Errorf("schema value of Struct is expected, but got %s: %#v. %s", rk.String(), v, common.TerraformBugErrorMessage)) } - schemaProvider, implementsSchemaProvider := v.Interface().(CustomizableSchemaProvider) - for _, field := range tfreflect.ListAllFields(v) { typeField := field.StructField fieldName := typeField.Tag.Get("tfsdk") if fieldName == "-" { continue } - structTag, hasStructTag := getStructTag(typeField) + if typeField.Tag.Get("tf") != "" { + panic(`"tf:..." annotations are no longer supported. You should implement the CustomizableSchemaProvider interface on the struct and apply the appropriate schema customizations there.`) + } + value := field.Value.Interface() if _, ok := value.(attr.Value); !ok { panic(fmt.Errorf("unexpected type %T in tfsdk structs, expected a plugin framework value type. %s", value, common.TerraformBugErrorMessage)) @@ -102,9 +95,6 @@ func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { switch value.(type) { case types.List: validators := []validator.List{} - if structTag.singleObject { - validators = append(validators, listvalidator.SizeAtMost(1)) - } scmAttr[fieldName] = ListNestedAttributeBuilder{ NestedObject: nestedSchema.ToNestedAttributeObject(), Validators: validators, @@ -145,44 +135,14 @@ func typeToSchema(ctx context.Context, v reflect.Value) NestedBlockObject { } panic(fmt.Errorf("unexpected type %T in tfsdk structs, expected a plugin framework value type. %s", value, common.TerraformBugErrorMessage)) } - - attr := scmAttr[fieldName] - - if hasStructTag && !implementsSchemaProvider { - if structTag.computed { - // Computed attributes are always computed and may be optional. - attr = attr.SetComputed() - if structTag.optional { - attr = attr.SetOptional() - } - } else { - // Non-computed attributes must be either optional or required. - if structTag.optional { - attr = attr.SetOptional() - } else { - attr = attr.SetRequired() - } - } - } - - scmAttr[fieldName] = attr } - if implementsSchemaProvider { + if schemaProvider, ok := v.Interface().(CustomizableSchemaProvider); ok { scmAttr = schemaProvider.ApplySchemaCustomizations(scmAttr) } return NestedBlockObject{Attributes: scmAttr} } -func getStructTag(field reflect.StructField) (structTag, bool) { - tagValue := field.Tag.Get("tf") - return structTag{ - optional: strings.Contains(tagValue, "optional"), - computed: strings.Contains(tagValue, "computed"), - singleObject: strings.Contains(tagValue, "object"), - }, tagValue != "" -} - // ResourceStructToSchema builds a resource schema from a tfsdk struct, with custoimzations applied. func ResourceStructToSchema(ctx context.Context, v any, customizeSchema func(CustomizableSchema) CustomizableSchema) schema.Schema { attributes, blocks := ResourceStructToSchemaMap(ctx, v, customizeSchema) diff --git a/internal/providers/pluginfw/tfschema/struct_to_schema_test.go b/internal/providers/pluginfw/tfschema/struct_to_schema_test.go index 7eda21249..dd06920e9 100644 --- a/internal/providers/pluginfw/tfschema/struct_to_schema_test.go +++ b/internal/providers/pluginfw/tfschema/struct_to_schema_test.go @@ -16,29 +16,61 @@ import ( ) type TestStringTfSdk struct { - Description types.String `tfsdk:"description" tf:"optional"` + Description types.String `tfsdk:"description"` +} + +func (TestStringTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + return attrs } type TestBoolTfSdk struct { - Enabled types.Bool `tfsdk:"enabled" tf:"required"` + Enabled types.Bool `tfsdk:"enabled"` +} + +func (TestBoolTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["enabled"] = attrs["enabled"].SetRequired() + return attrs } type TestIntTfSdk struct { - Workers types.Int64 `tfsdk:"workers" tf:"optional"` + Workers types.Int64 `tfsdk:"workers"` +} + +func (TestIntTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["workers"] = attrs["workers"].SetOptional() + return attrs } type TestComputedTfSdk struct { - ComputedTag types.String `tfsdk:"computedtag" tf:"computed"` - MultipleTags types.String `tfsdk:"multipletags" tf:"computed,optional"` - NonComputed types.String `tfsdk:"noncomputed" tf:"optional"` + ComputedTag types.String `tfsdk:"computedtag"` + MultipleTags types.String `tfsdk:"multipletags"` + NonComputed types.String `tfsdk:"noncomputed"` +} + +func (TestComputedTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["computedtag"] = attrs["computedtag"].SetComputed() + attrs["multipletags"] = attrs["multipletags"].SetComputed().SetOptional() + attrs["noncomputed"] = attrs["noncomputed"].SetOptional() + return attrs } type TestFloatTfSdk struct { - Float types.Float64 `tfsdk:"float" tf:"optional"` + Float types.Float64 `tfsdk:"float"` +} + +func (TestFloatTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["float"] = attrs["float"].SetOptional() + return attrs } type TestListTfSdk struct { - Repeated types.List `tfsdk:"repeated" tf:"optional"` + Repeated types.List `tfsdk:"repeated"` +} + +func (TestListTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["repeated"] = attrs["repeated"].SetOptional() + return attrs } func (TestListTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { @@ -48,7 +80,12 @@ func (TestListTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Ty } type TestMapTfSdk struct { - Attributes types.Map `tfsdk:"attributes" tf:"optional"` + Attributes types.Map `tfsdk:"attributes"` +} + +func (TestMapTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["attributes"] = attrs["attributes"].SetOptional() + return attrs } func (TestMapTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { @@ -58,7 +95,12 @@ func (TestMapTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Typ } type TestObjectTfSdk struct { - Object types.Object `tfsdk:"object" tf:"optional"` + Object types.Object `tfsdk:"object"` +} + +func (TestObjectTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["object"] = attrs["object"].SetOptional() + return attrs } func (TestObjectTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { @@ -68,7 +110,12 @@ func (TestObjectTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect. } type TestNestedListTfSdk struct { - NestedList types.List `tfsdk:"nested_list" tf:"optional"` + NestedList types.List `tfsdk:"nested_list"` +} + +func (TestNestedListTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["nested_list"] = attrs["nested_list"].SetOptional() + return attrs } func (TestNestedListTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { @@ -78,12 +125,23 @@ func (TestNestedListTfSdk) GetComplexFieldTypes(context.Context) map[string]refl } type DummyNested struct { - Name types.String `tfsdk:"name" tf:"optional"` - Enabled types.Bool `tfsdk:"enabled" tf:"optional"` + Name types.String `tfsdk:"name"` + Enabled types.Bool `tfsdk:"enabled"` +} + +func (DummyNested) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["name"] = attrs["name"].SetOptional() + attrs["enabled"] = attrs["enabled"].SetOptional() + return attrs } type TestNestedMapTfSdk struct { - NestedMap types.Map `tfsdk:"nested_map" tf:"optional"` + NestedMap types.Map `tfsdk:"nested_map"` +} + +func (TestNestedMapTfSdk) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["nested_map"] = attrs["nested_map"].SetOptional() + return attrs } func (TestNestedMapTfSdk) GetComplexFieldTypes(context.Context) map[string]reflect.Type { @@ -94,6 +152,10 @@ func (TestNestedMapTfSdk) GetComplexFieldTypes(context.Context) map[string]refle var dummyType = tfcommon.NewObjectTyper(DummyNested{}).Type(context.Background()).(types.ObjectType) +type TestDeprecatedTfTags struct { + Foo types.String `tfsdk:"foo" tf:"computed"` +} + var tests = []struct { name string testStruct any @@ -225,15 +287,30 @@ func testStructToSchemaPanics(t *testing.T, testStruct any, expectedError string } type TestTfSdkList struct { - Description types.List `tfsdk:"description" tf:"optional"` + Description types.List `tfsdk:"description"` +} + +func (TestTfSdkList) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + return attrs } type TestTfSdkMapWithoutMetadata struct { - Description types.Map `tfsdk:"description" tf:"optional"` + Description types.Map `tfsdk:"description"` +} + +func (TestTfSdkMapWithoutMetadata) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["description"] = attrs["description"].SetOptional() + return attrs } type TestSliceOfSlice struct { - NestedList [][]string `tfsdk:"nested_list" tf:"optional"` + NestedList [][]string `tfsdk:"nested_list"` +} + +func (TestSliceOfSlice) ApplySchemaCustomizations(attrs map[string]AttributeBuilder) map[string]AttributeBuilder { + attrs["nested_list"] = attrs["nested_list"].SetOptional() + return attrs } var error_tests = []struct { @@ -278,3 +355,12 @@ func TestComputedField(t *testing.T) { // Test that NonComputed field is not computed assert.True(t, !scm.Attributes["noncomputed"].IsComputed()) } + +func TestDeprecatedTagsPanics(t *testing.T) { + defer func() { + if r := recover(); r == nil { + t.Error("Expected panic for TestDeprecatedTfTags") + } + }() + ResourceStructToSchema(context.Background(), TestDeprecatedTfTags{}, nil) +} From c313cf223d44ce04ce90b1a5c4f2bafc427b94c1 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Thu, 9 Jan 2025 12:38:43 +0100 Subject: [PATCH 6/6] update contributing guidelines for ApplySchemaCustomizations --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f45fd0571..c0b120089 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,7 +123,7 @@ We are migrating the resource from SDKv2 to Plugin Framework provider and hence 2. Create a file with resource_resource-name.go and write the CRUD methods, schema for that resource. For reference, please take a look at existing resources eg: `resource_app.go`. - Make sure to set the user agent in all the CRUD methods. - In the `Metadata()`, use the method `GetDatabricksProductionName()`. - - In the `Schema()` method, import the appropriate struct from the `internal/service/{package}_tf` package and use the `ResourceStructToSchema` method to convert the struct to schema. Use the struct that does not have the `_SdkV2` suffix. + - In the `Schema()` method, import the appropriate struct from the `internal/service/{package}_tf` package and use the `ResourceStructToSchema` method to convert the struct to schema. Use the struct that does not have the `_SdkV2` suffix. The schema for the struct is automatically generated and maintained within the `ApplySchemaCustomizations` method of that struct. If you need to customize the schema further, pass in a `CustomizableSchema` to `ResourceStructToSchema` and customize the schema there. If you need to use a manually crafted struct in place of the auto-generated one, you must implement the `ApplySchemaCustomizations` method in a similar way. 3. Create a file with `resource_resource-name_acc_test.go` and add integration tests here. 4. Create a file with `resource_resource-name_test.go` and add unit tests here. Note: Please make sure to abstract specific method of the resource so they are unit test friendly and not testing internal part of terraform plugin framework library. You can compare the diagnostics, for example: please take a look at: `data_cluster_test.go` 5. Add the resource under `internal/providers/pluginfw/pluginfw.go` in `Resources()` method. Please update the list so that it stays in alphabetically sorted order.