From f716018d47dc52a8a342bd4f03882e3b5e732b6f Mon Sep 17 00:00:00 2001 From: Omer Lachish <289488+rauchy@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:53:48 +0100 Subject: [PATCH] [Internal] Generate models with correctly computed annotations (#4316) ## Changes In this PR, we've tackled an issue with our plugin framework models. Previously, fields that were meant to be computed were mistakenly generated with "computed,optional" annotations instead of just "computed." Also, if any fields were indicated as having effective values, the effective fields also ended up with the wrong "computed,optional" tag rather than the correct "computed." We've regenerated the models to correct these annotations. ## Tests - [ ] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] relevant acceptance tests are passing - [ ] using Go SDK --------- Co-authored-by: Omer Lachish --- .../pluginfw/products/app/resource_app.go | 18 ------- internal/service/apps_tf/model.go | 48 ++++++++--------- internal/service/catalog_tf/model.go | 12 ++--- internal/service/cleanrooms_tf/model.go | 36 ++++++------- internal/service/dashboards_tf/model.go | 52 +++++++++---------- internal/service/jobs_tf/model.go | 4 +- internal/service/provisioning_tf/model.go | 22 ++++---- internal/service/settings_tf/model.go | 20 +++---- internal/service/sharing_tf/model.go | 24 ++++----- 9 files changed, 109 insertions(+), 127 deletions(-) diff --git a/internal/providers/pluginfw/products/app/resource_app.go b/internal/providers/pluginfw/products/app/resource_app.go index 9a6fe6826..0bd570b59 100644 --- a/internal/providers/pluginfw/products/app/resource_app.go +++ b/internal/providers/pluginfw/products/app/resource_app.go @@ -37,24 +37,6 @@ func (a resourceApp) Metadata(ctx context.Context, req resource.MetadataRequest, func (a resourceApp) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = tfschema.ResourceStructToSchema(ctx, apps_tf.App{}, func(cs tfschema.CustomizableSchema) tfschema.CustomizableSchema { cs.AddPlanModifier(stringplanmodifier.RequiresReplace(), "name") - // Computed fields - for _, p := range []string{ - "active_deployment", - "app_status", - "compute_status", - "create_time", - "creator", - "default_source_code_path", - "pending_deployment", - "service_principal_client_id", - "service_principal_id", - "service_principal_name", - "update_time", - "updater", - "url", - } { - cs.SetReadOnly(p) - } exclusiveFields := []string{"job", "secret", "serving_endpoint", "sql_warehouse"} paths := path.Expressions{} for _, field := range exclusiveFields[1:] { diff --git a/internal/service/apps_tf/model.go b/internal/service/apps_tf/model.go index e570ec50e..031b9ff04 100755 --- a/internal/service/apps_tf/model.go +++ b/internal/service/apps_tf/model.go @@ -24,19 +24,19 @@ 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:"optional,object"` + ActiveDeployment types.Object `tfsdk:"active_deployment" tf:"computed,object"` - AppStatus types.Object `tfsdk:"app_status" tf:"optional,object"` + AppStatus types.Object `tfsdk:"app_status" tf:"computed,object"` - ComputeStatus types.Object `tfsdk:"compute_status" tf:"optional,object"` + ComputeStatus types.Object `tfsdk:"compute_status" tf:"computed,object"` // The creation time of the app. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"computed,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed"` // The email of the user that created the app. - Creator types.String `tfsdk:"creator" tf:"computed,optional"` + Creator types.String `tfsdk:"creator" tf:"computed"` // 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:"optional"` + DefaultSourceCodePath types.String `tfsdk:"default_source_code_path" tf:"computed"` // The description of the app. Description types.String `tfsdk:"description" tf:"optional"` // The name of the app. The name must contain only lowercase alphanumeric @@ -44,21 +44,21 @@ type App struct { Name types.String `tfsdk:"name" tf:""` // 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:"optional,object"` + PendingDeployment types.Object `tfsdk:"pending_deployment" tf:"computed,object"` // Resources for the app. Resources types.List `tfsdk:"resources" tf:"optional"` - ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id" tf:"computed,optional"` + ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id" tf:"computed"` - ServicePrincipalId types.Int64 `tfsdk:"service_principal_id" tf:"computed,optional"` + ServicePrincipalId types.Int64 `tfsdk:"service_principal_id" tf:"computed"` - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"computed,optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"computed"` // The update time of the app. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed"` // The email of the user that last updated the app. - Updater types.String `tfsdk:"updater" tf:"computed,optional"` + Updater types.String `tfsdk:"updater" tf:"computed"` // The URL of the app once it is deployed. - Url types.String `tfsdk:"url" tf:"computed,optional"` + Url types.String `tfsdk:"url" tf:"computed"` } func (newState *App) SyncEffectiveFieldsDuringCreateOrUpdate(plan App) { @@ -418,11 +418,11 @@ 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,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed"` // The email of the user creates the deployment. - Creator types.String `tfsdk:"creator" tf:"computed,optional"` + Creator types.String `tfsdk:"creator" tf:"computed"` // The deployment artifacts for an app. - DeploymentArtifacts types.Object `tfsdk:"deployment_artifacts" tf:"optional,object"` + DeploymentArtifacts types.Object `tfsdk:"deployment_artifacts" tf:"computed,object"` // The unique id of the deployment. DeploymentId types.String `tfsdk:"deployment_id" tf:"optional"` // The mode of which the deployment will manage the source code. @@ -436,9 +436,9 @@ type AppDeployment struct { // the deployment. SourceCodePath types.String `tfsdk:"source_code_path" tf:"optional"` // Status and status message of the deployment - Status types.Object `tfsdk:"status" tf:"optional,object"` + Status types.Object `tfsdk:"status" tf:"computed,object"` // The update time of the deployment. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed"` } func (newState *AppDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeployment) { @@ -596,9 +596,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,optional"` + Message types.String `tfsdk:"message" tf:"computed"` // State of the deployment. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state" tf:"computed"` } func (newState *AppDeploymentStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeploymentStatus) { @@ -1291,9 +1291,9 @@ func (o AppResourceSqlWarehouse) Type(ctx context.Context) attr.Type { type ApplicationStatus struct { // Application status message - Message types.String `tfsdk:"message" tf:"computed,optional"` + Message types.String `tfsdk:"message" tf:"computed"` // State of the application. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state" tf:"computed"` } func (newState *ApplicationStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ApplicationStatus) { @@ -1337,9 +1337,9 @@ func (o ApplicationStatus) Type(ctx context.Context) attr.Type { type ComputeStatus struct { // Compute status message - Message types.String `tfsdk:"message" tf:"computed,optional"` + Message types.String `tfsdk:"message" tf:"computed"` // State of the app compute. - State types.String `tfsdk:"state" tf:"optional"` + State types.String `tfsdk:"state" tf:"computed"` } func (newState *ComputeStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComputeStatus) { diff --git a/internal/service/catalog_tf/model.go b/internal/service/catalog_tf/model.go index 2c1bf7ab2..dab13b6fd 100755 --- a/internal/service/catalog_tf/model.go +++ b/internal/service/catalog_tf/model.go @@ -921,13 +921,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:"optional"` + ExternalId types.String `tfsdk:"external_id" tf:"computed"` // The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary // credentials. RoleArn types.String `tfsdk:"role_arn" tf:"optional"` // 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" tf:"computed"` } func (newState *AwsIamRole) SyncEffectiveFieldsDuringCreateOrUpdate(plan AwsIamRole) { @@ -12916,14 +12916,14 @@ type OnlineTable struct { // Specification of the online table. Spec types.List `tfsdk:"spec" tf:"optional,object"` // Online Table data synchronization status - Status types.List `tfsdk:"status" tf:"optional,object"` + Status types.List `tfsdk:"status" tf:"computed,object"` // Data serving REST API URL for this table - TableServingUrl types.String `tfsdk:"table_serving_url" tf:"computed,optional"` + TableServingUrl types.String `tfsdk:"table_serving_url" tf:"computed"` // 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:"optional"` + UnityCatalogProvisioningState types.String `tfsdk:"unity_catalog_provisioning_state" tf:"computed"` } func (newState *OnlineTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTable) { @@ -13042,7 +13042,7 @@ type OnlineTableSpec struct { PerformFullCopy types.Bool `tfsdk:"perform_full_copy" tf:"optional"` // ID of the associated pipeline. Generated by the server - cannot be set by // the caller. - PipelineId types.String `tfsdk:"pipeline_id" tf:"computed,optional"` + PipelineId types.String `tfsdk:"pipeline_id" tf:"computed"` // Primary Key columns to be used for data insert/update in the destination. PrimaryKeyColumns types.List `tfsdk:"primary_key_columns" tf:"optional"` // Pipeline runs continuously after generating the initial data. diff --git a/internal/service/cleanrooms_tf/model.go b/internal/service/cleanrooms_tf/model.go index 71f1a6263..3c8ef5ba7 100755 --- a/internal/service/cleanrooms_tf/model.go +++ b/internal/service/cleanrooms_tf/model.go @@ -29,13 +29,13 @@ 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:"optional"` + AccessRestricted types.String `tfsdk:"access_restricted" tf:"computed"` Comment types.String `tfsdk:"comment" tf:"optional"` // When the clean room was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"optional"` + CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed"` // The alias of the collaborator tied to the local clean room. - LocalCollaboratorAlias types.String `tfsdk:"local_collaborator_alias" tf:"optional"` + LocalCollaboratorAlias types.String `tfsdk:"local_collaborator_alias" tf:"computed"` // The name of the clean room. It should follow [UC securable naming // requirements]. // @@ -44,7 +44,7 @@ type CleanRoom struct { // 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:"optional,object"` + OutputCatalog types.List `tfsdk:"output_catalog" tf:"computed,object"` // This is Databricks username of the owner of the local clean room // securable for permission management. Owner types.String `tfsdk:"owner" tf:"optional"` @@ -53,9 +53,9 @@ type CleanRoom struct { // will not be filled in the ListCleanRooms call. RemoteDetailedInfo types.List `tfsdk:"remote_detailed_info" tf:"optional,object"` // Clean room status. - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status" tf:"computed"` // When the clean room was last updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed"` } func (newState *CleanRoom) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoom) { @@ -175,7 +175,7 @@ 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:"optional"` + AddedAt types.Int64 `tfsdk:"added_at" tf:"computed"` // The type of the asset. AssetType types.String `tfsdk:"asset_type" tf:"optional"` // Foreign table details available to all collaborators of the clean room. @@ -196,9 +196,9 @@ type CleanRoomAsset struct { // Present if and only if **asset_type** is **NOTEBOOK_FILE** Notebook types.List `tfsdk:"notebook" tf:"optional,object"` // The alias of the collaborator who owns this asset - OwnerCollaboratorAlias types.String `tfsdk:"owner_collaborator_alias" tf:"optional"` + OwnerCollaboratorAlias types.String `tfsdk:"owner_collaborator_alias" tf:"computed"` // Status of the asset - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status" tf:"computed"` // 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"` @@ -512,7 +512,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:"optional"` + Columns types.List `tfsdk:"columns" tf:"computed"` } func (newState *CleanRoomAssetForeignTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetForeignTable) { @@ -627,7 +627,7 @@ 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:"optional"` + Etag types.String `tfsdk:"etag" tf:"computed"` // 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"` @@ -674,7 +674,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:"optional"` + Columns types.List `tfsdk:"columns" tf:"computed"` } func (newState *CleanRoomAssetTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetTable) { @@ -823,7 +823,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:"optional"` + Columns types.List `tfsdk:"columns" tf:"computed"` } func (newState *CleanRoomAssetView) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomAssetView) { @@ -993,7 +993,7 @@ type CleanRoomCollaborator struct { // 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:"optional"` + DisplayName types.String `tfsdk:"display_name" tf:"computed"` // 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"` @@ -1009,7 +1009,7 @@ type CleanRoomCollaborator struct { // [Organization // name](:method:metastores/list#metastores-delta_sharing_organization_name) // configured in the metastore - OrganizationName types.String `tfsdk:"organization_name" tf:"optional"` + OrganizationName types.String `tfsdk:"organization_name" tf:"computed"` } func (newState *CleanRoomCollaborator) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomCollaborator) { @@ -1197,7 +1197,7 @@ type CleanRoomOutputCatalog struct { // [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"` - Status types.String `tfsdk:"status" tf:"optional"` + Status types.String `tfsdk:"status" tf:"computed"` } func (newState *CleanRoomOutputCatalog) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomOutputCatalog) { @@ -1242,7 +1242,7 @@ 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:"optional"` + CentralCleanRoomId types.String `tfsdk:"central_clean_room_id" tf:"computed"` // Cloud vendor (aws,azure,gcp) of the central clean room. CloudVendor types.String `tfsdk:"cloud_vendor" tf:"optional"` // Collaborators in the central clean room. There should one and only one @@ -1257,7 +1257,7 @@ type CleanRoomRemoteDetail struct { // compliance standards. ComplianceSecurityProfile types.List `tfsdk:"compliance_security_profile" tf:"optional,object"` // Collaborator who creates the clean room. - Creator types.List `tfsdk:"creator" tf:"optional,object"` + Creator types.List `tfsdk:"creator" tf:"computed,object"` // Egress network policy to apply to the central clean room workspace. EgressNetworkPolicy types.List `tfsdk:"egress_network_policy" tf:"optional,object"` // Region of the central clean room. diff --git a/internal/service/dashboards_tf/model.go b/internal/service/dashboards_tf/model.go index c77ba8ef1..71b2320c1 100755 --- a/internal/service/dashboards_tf/model.go +++ b/internal/service/dashboards_tf/model.go @@ -306,25 +306,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,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed"` // UUID identifying the dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed,optional"` + DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` // The display name of the dashboard. DisplayName types.String `tfsdk:"display_name" tf:"optional"` // 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,optional"` + Etag types.String `tfsdk:"etag" tf:"computed"` // The state of the dashboard resource. Used for tracking trashed status. - LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` + LifecycleState types.String `tfsdk:"lifecycle_state" tf:"computed"` // 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,optional"` + ParentPath types.String `tfsdk:"parent_path" tf:"computed"` // 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,optional"` + Path types.String `tfsdk:"path" tf:"computed"` // 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` @@ -335,7 +335,7 @@ type Dashboard struct { SerializedDashboard types.String `tfsdk:"serialized_dashboard" tf:"optional"` // 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,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed"` // The warehouse ID used to run the dashboard. WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` } @@ -1609,7 +1609,7 @@ type ListDashboardsResponse struct { Dashboards types.List `tfsdk:"dashboards" tf:"optional"` // 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,optional"` + NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` } func (newState *ListDashboardsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDashboardsResponse) { @@ -1737,7 +1737,7 @@ 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,optional"` + NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` Schedules types.List `tfsdk:"schedules" tf:"optional"` } @@ -1871,7 +1871,7 @@ 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,optional"` + NextPageToken types.String `tfsdk:"next_page_token" tf:"computed"` Subscriptions types.List `tfsdk:"subscriptions" tf:"optional"` } @@ -2096,11 +2096,11 @@ 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,optional"` + DisplayName types.String `tfsdk:"display_name" tf:"computed"` // Indicates whether credentials are embedded in the published dashboard. EmbedCredentials types.Bool `tfsdk:"embed_credentials" tf:"optional"` // The timestamp of when the published dashboard was last revised. - RevisionCreateTime types.String `tfsdk:"revision_create_time" tf:"computed,optional"` + RevisionCreateTime types.String `tfsdk:"revision_create_time" tf:"computed"` // The warehouse ID used to run the published dashboard. WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` } @@ -2431,24 +2431,24 @@ 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,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed"` // The cron expression describing the frequency of the periodic refresh for // this schedule. CronSchedule types.List `tfsdk:"cron_schedule" tf:"object"` // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed,optional"` + DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` // The display name for schedule. DisplayName types.String `tfsdk:"display_name" tf:"optional"` // 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,optional"` + Etag types.String `tfsdk:"etag" tf:"computed"` // The status indicates whether this schedule is paused or not. PauseStatus types.String `tfsdk:"pause_status" tf:"optional"` // UUID identifying the schedule. - ScheduleId types.String `tfsdk:"schedule_id" tf:"computed,optional"` + ScheduleId types.String `tfsdk:"schedule_id" tf:"computed"` // A timestamp indicating when the schedule was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed"` // The warehouse id to run the dashboard with for the schedule. WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` } @@ -2645,25 +2645,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,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed"` // 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,optional"` + CreatedByUserId types.Int64 `tfsdk:"created_by_user_id" tf:"computed"` // UUID identifying the dashboard to which the subscription belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"computed,optional"` + DashboardId types.String `tfsdk:"dashboard_id" tf:"computed"` // 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,optional"` + Etag types.String `tfsdk:"etag" tf:"computed"` // UUID identifying the schedule to which the subscription belongs. - ScheduleId types.String `tfsdk:"schedule_id" tf:"computed,optional"` + ScheduleId types.String `tfsdk:"schedule_id" tf:"computed"` // Subscriber details for users and destinations to be added as subscribers // to the schedule. Subscriber types.List `tfsdk:"subscriber" tf:"object"` // UUID identifying the subscription. - SubscriptionId types.String `tfsdk:"subscription_id" tf:"computed,optional"` + SubscriptionId types.String `tfsdk:"subscription_id" tf:"computed"` // A timestamp indicating when the subscription was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed"` } func (newState *Subscription) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscription) { @@ -2750,7 +2750,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,optional"` + DestinationId types.String `tfsdk:"destination_id" tf:"computed"` } func (newState *SubscriptionSubscriberDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberDestination) { @@ -2792,7 +2792,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,optional"` + UserId types.Int64 `tfsdk:"user_id" tf:"computed"` } func (newState *SubscriptionSubscriberUser) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberUser) { diff --git a/internal/service/jobs_tf/model.go b/internal/service/jobs_tf/model.go index c1c45c860..2c6cdea10 100755 --- a/internal/service/jobs_tf/model.go +++ b/internal/service/jobs_tf/model.go @@ -35,7 +35,7 @@ type BaseJob struct { // 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,optional"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed"` // The canonical identifier for this job. JobId types.Int64 `tfsdk:"job_id" tf:"optional"` // Settings for this job and all of its runs. These settings can be updated @@ -3653,7 +3653,7 @@ type Job struct { // 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,optional"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed"` // The canonical identifier for this job. JobId types.Int64 `tfsdk:"job_id" tf:"optional"` // The email of an active workspace user or the application ID of a service diff --git a/internal/service/provisioning_tf/model.go b/internal/service/provisioning_tf/model.go index 14101d476..88a788e44 100755 --- a/internal/service/provisioning_tf/model.go +++ b/internal/service/provisioning_tf/model.go @@ -1341,7 +1341,7 @@ type Credential struct { AwsCredentials types.List `tfsdk:"aws_credentials" tf:"optional,object"` // Time in epoch milliseconds when the credential was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // Databricks credential configuration ID. CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` // The human-readable name of the credential configuration object. @@ -1473,7 +1473,7 @@ type CustomerManagedKey struct { AwsKeyInfo types.List `tfsdk:"aws_key_info" tf:"optional,object"` // Time in epoch milliseconds when the customer key was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // ID of the encryption key configuration object. CustomerManagedKeyId types.String `tfsdk:"customer_managed_key_id" tf:"optional"` @@ -2615,9 +2615,9 @@ type Network struct { // The Databricks account ID associated with this network configuration. AccountId types.String `tfsdk:"account_id" tf:"optional"` // Time in epoch milliseconds when the network was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // Array of error messages about the network configuration. - ErrorMessages types.List `tfsdk:"error_messages" tf:"computed,optional"` + ErrorMessages types.List `tfsdk:"error_messages" tf:"computed"` // 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"` @@ -2640,9 +2640,9 @@ type Network struct { // 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,optional"` + VpcStatus types.String `tfsdk:"vpc_status" tf:"computed"` // Array of warning messages about the network configuration. - WarningMessages types.List `tfsdk:"warning_messages" tf:"computed,optional"` + WarningMessages types.List `tfsdk:"warning_messages" tf:"computed"` // Workspace ID associated with this network configuration. WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` } @@ -3275,9 +3275,9 @@ 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,optional"` + AccountId types.String `tfsdk:"account_id" tf:"computed"` // Time in epoch milliseconds when the storage configuration was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // Root S3 bucket information. RootBucketInfo types.List `tfsdk:"root_bucket_info" tf:"optional,object"` // Databricks storage configuration ID. @@ -3815,7 +3815,7 @@ type Workspace struct { // providers. CloudResourceContainer types.List `tfsdk:"cloud_resource_container" tf:"optional,object"` // Time in epoch milliseconds when the workspace was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // ID of the workspace's credential configuration object. CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` // The custom tags key-value pairing that is attached to this workspace. The @@ -3897,9 +3897,9 @@ type Workspace struct { // 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,optional"` + WorkspaceStatus types.String `tfsdk:"workspace_status" tf:"computed"` // Message describing the current workspace status. - WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message" tf:"computed,optional"` + WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message" tf:"computed"` } func (newState *Workspace) SyncEffectiveFieldsDuringCreateOrUpdate(plan Workspace) { diff --git a/internal/service/settings_tf/model.go b/internal/service/settings_tf/model.go index bc3f2a8f1..d5e83f079 100755 --- a/internal/service/settings_tf/model.go +++ b/internal/service/settings_tf/model.go @@ -6844,13 +6844,13 @@ type NccAzurePrivateEndpointRule struct { // clean-up. ConnectionState types.String `tfsdk:"connection_state" tf:"optional"` // Time in epoch milliseconds when this object was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // Whether this private endpoint is deactivated. - Deactivated types.Bool `tfsdk:"deactivated" tf:"computed,optional"` + Deactivated types.Bool `tfsdk:"deactivated" tf:"computed"` // Time in epoch milliseconds when this object was deactivated. - DeactivatedAt types.Int64 `tfsdk:"deactivated_at" tf:"computed,optional"` + DeactivatedAt types.Int64 `tfsdk:"deactivated_at" tf:"computed"` // The name of the Azure private endpoint resource. - EndpointName types.String `tfsdk:"endpoint_name" tf:"computed,optional"` + EndpointName types.String `tfsdk:"endpoint_name" tf:"computed"` // 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`. @@ -6861,9 +6861,9 @@ type NccAzurePrivateEndpointRule struct { // The Azure resource ID of the target resource. ResourceId types.String `tfsdk:"resource_id" tf:"optional"` // The ID of a private endpoint rule. - RuleId types.String `tfsdk:"rule_id" tf:"computed,optional"` + RuleId types.String `tfsdk:"rule_id" tf:"computed"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed,optional"` + UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed"` } func (newState *NccAzurePrivateEndpointRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAzurePrivateEndpointRule) { @@ -7040,7 +7040,7 @@ 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.List `tfsdk:"default_rules" tf:"computed,optional"` + DefaultRules types.List `tfsdk:"default_rules" tf:"computed,object"` // The network connectivity rules that configured for each destinations. // These rules override default rules. TargetRules types.List `tfsdk:"target_rules" tf:"optional,object"` @@ -7333,7 +7333,7 @@ type NetworkConnectivityConfiguration struct { // The Databricks account ID that hosts the credential. AccountId types.String `tfsdk:"account_id" tf:"optional"` // Time in epoch milliseconds when this object was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed"` // The network connectivity rules that apply to network traffic from your // serverless compute resources. EgressConfig types.List `tfsdk:"egress_config" tf:"optional,object"` @@ -7343,13 +7343,13 @@ type NetworkConnectivityConfiguration struct { // `^[0-9a-zA-Z-_]{3,30}$`. Name types.String `tfsdk:"name" tf:"optional"` // Databricks network connectivity configuration ID. - NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"computed,optional"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"computed"` // 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"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed,optional"` + UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed"` } func (newState *NetworkConnectivityConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkConnectivityConfiguration) { diff --git a/internal/service/sharing_tf/model.go b/internal/service/sharing_tf/model.go index 9b7d073b3..b50f924d9 100755 --- a/internal/service/sharing_tf/model.go +++ b/internal/service/sharing_tf/model.go @@ -2281,9 +2281,9 @@ type ShareInfo struct { // User-provided free-form text description. Comment types.String `tfsdk:"comment" tf:"optional"` // Time at which this share was created, in epoch milliseconds. - CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed,optional"` + CreatedAt types.Int64 `tfsdk:"created_at" tf:"computed"` // Username of share creator. - CreatedBy types.String `tfsdk:"created_by" tf:"computed,optional"` + CreatedBy types.String `tfsdk:"created_by" tf:"computed"` // Name of the share. Name types.String `tfsdk:"name" tf:"optional"` // A list of shared data objects within the share. @@ -2295,9 +2295,9 @@ type ShareInfo struct { // Storage root URL for the share. StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` // Time at which this share was updated, in epoch milliseconds. - UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed,optional"` + UpdatedAt types.Int64 `tfsdk:"updated_at" tf:"computed"` // Username of share updater. - UpdatedBy types.String `tfsdk:"updated_by" tf:"computed,optional"` + UpdatedBy types.String `tfsdk:"updated_by" tf:"computed"` } func (newState *ShareInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo) { @@ -2523,12 +2523,12 @@ 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,optional"` + AddedAt types.Int64 `tfsdk:"added_at" tf:"computed"` // Username of the sharer. - AddedBy types.String `tfsdk:"added_by" tf:"computed,optional"` + AddedBy types.String `tfsdk:"added_by" tf:"computed"` // 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,optional"` + EffectiveCdfEnabled types.Bool `tfsdk:"effective_cdf_enabled" tf:"computed"` // A user-provided comment when adding the data object to the share. // [Update:OPT] Comment types.String `tfsdk:"comment" tf:"optional"` @@ -2541,7 +2541,7 @@ type SharedDataObject struct { // 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,optional"` + EffectiveHistoryDataSharingStatus types.String `tfsdk:"effective_history_data_sharing_status" tf:"computed"` // A fully qualified name that uniquely identifies a data object. // // For example, a table's fully qualified name is in the format of @@ -2554,7 +2554,7 @@ type SharedDataObject struct { // `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,optional"` + EffectiveSharedAs types.String `tfsdk:"effective_shared_as" tf:"computed"` // 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 >= @@ -2563,9 +2563,9 @@ type SharedDataObject struct { // // 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,optional"` + EffectiveStartVersion types.Int64 `tfsdk:"effective_start_version" tf:"computed"` // One of: **ACTIVE**, **PERMISSION_DENIED**. - Status types.String `tfsdk:"status" tf:"computed,optional"` + Status types.String `tfsdk:"status" tf:"computed"` // 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 @@ -3040,7 +3040,7 @@ type UpdateShare struct { // New name for the share. NewName types.String `tfsdk:"new_name" tf:"optional"` // Username of current owner of share. - Owner types.String `tfsdk:"owner" tf:"computed,optional"` + Owner types.String `tfsdk:"owner" tf:"computed"` // Storage root URL for the share. StorageRoot types.String `tfsdk:"storage_root" tf:"optional"` // Array of shared data object updates.