From 448f86685a924d8f33d1ed77db6a789536a7cff9 Mon Sep 17 00:00:00 2001 From: Omer Lachish <289488+rauchy@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:02:05 +0100 Subject: [PATCH] [Internal] Generate effective fields based of isServiceProposedIfEmpty (#4282) ## Changes This PR introduces a change that uses the new isServiceProposedIfEmpty annotation to generate the TFSDK structs. With this update, only the fields with this annotation will have an EffectiveField combo. Previously, fields that were marked as Computed would automatically get this combo, but that's no longer the case. As a result, most of the EffectiveField combos are now removed. ## 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 --- internal/service/apps_tf/model.go | 126 +------ internal/service/catalog_tf/model.go | 28 +- internal/service/dashboards_tf/model.go | 441 +++------------------- internal/service/jobs_tf/model.go | 18 +- internal/service/provisioning_tf/model.go | 87 +---- internal/service/settings_tf/model.go | 84 +---- 6 files changed, 94 insertions(+), 690 deletions(-) diff --git a/internal/service/apps_tf/model.go b/internal/service/apps_tf/model.go index 99e4649905..2da3b843f9 100755 --- a/internal/service/apps_tf/model.go +++ b/internal/service/apps_tf/model.go @@ -23,11 +23,9 @@ type App struct { ComputeStatus []ComputeStatus `tfsdk:"compute_status" tf:"optional,object"` // The creation time of the app. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` - EffectiveCreateTime types.String `tfsdk:"effective_create_time" tf:"computed,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed,optional"` // The email of the user that created the app. - Creator types.String `tfsdk:"creator" tf:"optional"` - EffectiveCreator types.String `tfsdk:"effective_creator" tf:"computed,optional"` + Creator types.String `tfsdk:"creator" tf:"computed,optional"` // 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. @@ -43,77 +41,23 @@ type App struct { // Resources for the app. Resources []AppResource `tfsdk:"resources" tf:"optional"` - ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id" tf:"optional"` - EffectiveServicePrincipalClientId types.String `tfsdk:"effective_service_principal_client_id" tf:"computed,optional"` + ServicePrincipalClientId types.String `tfsdk:"service_principal_client_id" tf:"computed,optional"` - ServicePrincipalId types.Int64 `tfsdk:"service_principal_id" tf:"optional"` - EffectiveServicePrincipalId types.Int64 `tfsdk:"effective_service_principal_id" tf:"computed,optional"` + ServicePrincipalId types.Int64 `tfsdk:"service_principal_id" tf:"computed,optional"` - ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"optional"` - EffectiveServicePrincipalName types.String `tfsdk:"effective_service_principal_name" tf:"computed,optional"` + ServicePrincipalName types.String `tfsdk:"service_principal_name" tf:"computed,optional"` // The update time of the app. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` - EffectiveUpdateTime types.String `tfsdk:"effective_update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` // The email of the user that last updated the app. - Updater types.String `tfsdk:"updater" tf:"optional"` - EffectiveUpdater types.String `tfsdk:"effective_updater" tf:"computed,optional"` + Updater types.String `tfsdk:"updater" tf:"computed,optional"` // The URL of the app once it is deployed. - Url types.String `tfsdk:"url" tf:"optional"` - EffectiveUrl types.String `tfsdk:"effective_url" tf:"computed,optional"` + Url types.String `tfsdk:"url" tf:"computed,optional"` } func (newState *App) SyncEffectiveFieldsDuringCreateOrUpdate(plan App) { - newState.EffectiveCreateTime = newState.CreateTime - newState.CreateTime = plan.CreateTime - newState.EffectiveCreator = newState.Creator - newState.Creator = plan.Creator - newState.EffectiveServicePrincipalClientId = newState.ServicePrincipalClientId - newState.ServicePrincipalClientId = plan.ServicePrincipalClientId - newState.EffectiveServicePrincipalId = newState.ServicePrincipalId - newState.ServicePrincipalId = plan.ServicePrincipalId - newState.EffectiveServicePrincipalName = newState.ServicePrincipalName - newState.ServicePrincipalName = plan.ServicePrincipalName - newState.EffectiveUpdateTime = newState.UpdateTime - newState.UpdateTime = plan.UpdateTime - newState.EffectiveUpdater = newState.Updater - newState.Updater = plan.Updater - newState.EffectiveUrl = newState.Url - newState.Url = plan.Url } func (newState *App) SyncEffectiveFieldsDuringRead(existingState App) { - newState.EffectiveCreateTime = existingState.EffectiveCreateTime - if existingState.EffectiveCreateTime.ValueString() == newState.CreateTime.ValueString() { - newState.CreateTime = existingState.CreateTime - } - newState.EffectiveCreator = existingState.EffectiveCreator - if existingState.EffectiveCreator.ValueString() == newState.Creator.ValueString() { - newState.Creator = existingState.Creator - } - newState.EffectiveServicePrincipalClientId = existingState.EffectiveServicePrincipalClientId - if existingState.EffectiveServicePrincipalClientId.ValueString() == newState.ServicePrincipalClientId.ValueString() { - newState.ServicePrincipalClientId = existingState.ServicePrincipalClientId - } - newState.EffectiveServicePrincipalId = existingState.EffectiveServicePrincipalId - if existingState.EffectiveServicePrincipalId.ValueInt64() == newState.ServicePrincipalId.ValueInt64() { - newState.ServicePrincipalId = existingState.ServicePrincipalId - } - newState.EffectiveServicePrincipalName = existingState.EffectiveServicePrincipalName - if existingState.EffectiveServicePrincipalName.ValueString() == newState.ServicePrincipalName.ValueString() { - newState.ServicePrincipalName = existingState.ServicePrincipalName - } - newState.EffectiveUpdateTime = existingState.EffectiveUpdateTime - if existingState.EffectiveUpdateTime.ValueString() == newState.UpdateTime.ValueString() { - newState.UpdateTime = existingState.UpdateTime - } - newState.EffectiveUpdater = existingState.EffectiveUpdater - if existingState.EffectiveUpdater.ValueString() == newState.Updater.ValueString() { - newState.Updater = existingState.Updater - } - newState.EffectiveUrl = existingState.EffectiveUrl - if existingState.EffectiveUrl.ValueString() == newState.Url.ValueString() { - newState.Url = existingState.Url - } } type AppAccessControlRequest struct { @@ -154,11 +98,9 @@ func (newState *AppAccessControlResponse) SyncEffectiveFieldsDuringRead(existing type AppDeployment struct { // The creation time of the deployment. Formatted timestamp in ISO 6801. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` - EffectiveCreateTime types.String `tfsdk:"effective_create_time" tf:"computed,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed,optional"` // The email of the user creates the deployment. - Creator types.String `tfsdk:"creator" tf:"optional"` - EffectiveCreator types.String `tfsdk:"effective_creator" tf:"computed,optional"` + Creator types.String `tfsdk:"creator" tf:"computed,optional"` // The deployment artifacts for an app. DeploymentArtifacts []AppDeploymentArtifacts `tfsdk:"deployment_artifacts" tf:"optional,object"` // The unique id of the deployment. @@ -176,32 +118,13 @@ type AppDeployment struct { // Status and status message of the deployment Status []AppDeploymentStatus `tfsdk:"status" tf:"optional,object"` // The update time of the deployment. Formatted timestamp in ISO 6801. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` - EffectiveUpdateTime types.String `tfsdk:"effective_update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` } func (newState *AppDeployment) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeployment) { - newState.EffectiveCreateTime = newState.CreateTime - newState.CreateTime = plan.CreateTime - newState.EffectiveCreator = newState.Creator - newState.Creator = plan.Creator - newState.EffectiveUpdateTime = newState.UpdateTime - newState.UpdateTime = plan.UpdateTime } func (newState *AppDeployment) SyncEffectiveFieldsDuringRead(existingState AppDeployment) { - newState.EffectiveCreateTime = existingState.EffectiveCreateTime - if existingState.EffectiveCreateTime.ValueString() == newState.CreateTime.ValueString() { - newState.CreateTime = existingState.CreateTime - } - newState.EffectiveCreator = existingState.EffectiveCreator - if existingState.EffectiveCreator.ValueString() == newState.Creator.ValueString() { - newState.Creator = existingState.Creator - } - newState.EffectiveUpdateTime = existingState.EffectiveUpdateTime - if existingState.EffectiveUpdateTime.ValueString() == newState.UpdateTime.ValueString() { - newState.UpdateTime = existingState.UpdateTime - } } type AppDeploymentArtifacts struct { @@ -218,22 +141,15 @@ func (newState *AppDeploymentArtifacts) SyncEffectiveFieldsDuringRead(existingSt type AppDeploymentStatus struct { // Message corresponding with the deployment state. - Message types.String `tfsdk:"message" tf:"optional"` - EffectiveMessage types.String `tfsdk:"effective_message" tf:"computed,optional"` + Message types.String `tfsdk:"message" tf:"computed,optional"` // State of the deployment. State types.String `tfsdk:"state" tf:"optional"` } func (newState *AppDeploymentStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan AppDeploymentStatus) { - newState.EffectiveMessage = newState.Message - newState.Message = plan.Message } func (newState *AppDeploymentStatus) SyncEffectiveFieldsDuringRead(existingState AppDeploymentStatus) { - newState.EffectiveMessage = existingState.EffectiveMessage - if existingState.EffectiveMessage.ValueString() == newState.Message.ValueString() { - newState.Message = existingState.Message - } } type AppPermission struct { @@ -369,42 +285,28 @@ func (newState *AppResourceSqlWarehouse) SyncEffectiveFieldsDuringRead(existingS type ApplicationStatus struct { // Application status message - Message types.String `tfsdk:"message" tf:"optional"` - EffectiveMessage types.String `tfsdk:"effective_message" tf:"computed,optional"` + Message types.String `tfsdk:"message" tf:"computed,optional"` // State of the application. State types.String `tfsdk:"state" tf:"optional"` } func (newState *ApplicationStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ApplicationStatus) { - newState.EffectiveMessage = newState.Message - newState.Message = plan.Message } func (newState *ApplicationStatus) SyncEffectiveFieldsDuringRead(existingState ApplicationStatus) { - newState.EffectiveMessage = existingState.EffectiveMessage - if existingState.EffectiveMessage.ValueString() == newState.Message.ValueString() { - newState.Message = existingState.Message - } } type ComputeStatus struct { // Compute status message - Message types.String `tfsdk:"message" tf:"optional"` - EffectiveMessage types.String `tfsdk:"effective_message" tf:"computed,optional"` + Message types.String `tfsdk:"message" tf:"computed,optional"` // State of the app compute. State types.String `tfsdk:"state" tf:"optional"` } func (newState *ComputeStatus) SyncEffectiveFieldsDuringCreateOrUpdate(plan ComputeStatus) { - newState.EffectiveMessage = newState.Message - newState.Message = plan.Message } func (newState *ComputeStatus) SyncEffectiveFieldsDuringRead(existingState ComputeStatus) { - newState.EffectiveMessage = existingState.EffectiveMessage - if existingState.EffectiveMessage.ValueString() == newState.Message.ValueString() { - newState.Message = existingState.Message - } } // Create an app deployment diff --git a/internal/service/catalog_tf/model.go b/internal/service/catalog_tf/model.go index 0790391169..aef640cdfa 100755 --- a/internal/service/catalog_tf/model.go +++ b/internal/service/catalog_tf/model.go @@ -619,7 +619,9 @@ type CreateCredentialRequest struct { // The Azure service principal configuration. AzureServicePrincipal []AzureServicePrincipal `tfsdk:"azure_service_principal" tf:"optional,object"` // Comment associated with the credential. - Comment types.String `tfsdk:"comment" tf:"optional"` + Comment types.String `tfsdk:"comment" tf:"optional"` + // TODO(UC-978): Document GCP service account key usage for service + // credentials. GcpServiceAccountKey []GcpServiceAccountKey `tfsdk:"gcp_service_account_key" tf:"optional,object"` // The credential name. The name must be unique among storage and service // credentials within the metastore. @@ -1736,11 +1738,11 @@ func (newState *GcpOauthToken) SyncEffectiveFieldsDuringRead(existingState GcpOa // GCP long-lived credential. GCP Service Account. type GcpServiceAccountKey struct { - // The email of the service account. + // The email of the service account. [Create:REQ Update:OPT]. Email types.String `tfsdk:"email" tf:"optional"` - // The service account's RSA private key. + // The service account's RSA private key. [Create:REQ Update:OPT] PrivateKey types.String `tfsdk:"private_key" tf:"optional"` - // The ID of the service account's private key. + // The ID of the service account's private key. [Create:REQ Update:OPT] PrivateKeyId types.String `tfsdk:"private_key_id" tf:"optional"` } @@ -3266,8 +3268,7 @@ type OnlineTable struct { // Online Table data synchronization status Status []OnlineTableStatus `tfsdk:"status" tf:"optional,object"` // Data serving REST API URL for this table - TableServingUrl types.String `tfsdk:"table_serving_url" tf:"optional"` - EffectiveTableServingUrl types.String `tfsdk:"effective_table_serving_url" tf:"computed,optional"` + TableServingUrl types.String `tfsdk:"table_serving_url" tf:"computed,optional"` // 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 @@ -3276,15 +3277,9 @@ type OnlineTable struct { } func (newState *OnlineTable) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTable) { - newState.EffectiveTableServingUrl = newState.TableServingUrl - newState.TableServingUrl = plan.TableServingUrl } func (newState *OnlineTable) SyncEffectiveFieldsDuringRead(existingState OnlineTable) { - newState.EffectiveTableServingUrl = existingState.EffectiveTableServingUrl - if existingState.EffectiveTableServingUrl.ValueString() == newState.TableServingUrl.ValueString() { - newState.TableServingUrl = existingState.TableServingUrl - } } // Specification of an online table. @@ -3299,8 +3294,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:"optional"` - EffectivePipelineId types.String `tfsdk:"effective_pipeline_id" tf:"computed,optional"` + PipelineId types.String `tfsdk:"pipeline_id" tf:"computed,optional"` // Primary Key columns to be used for data insert/update in the destination. PrimaryKeyColumns []types.String `tfsdk:"primary_key_columns" tf:"optional"` // Pipeline runs continuously after generating the initial data. @@ -3316,15 +3310,9 @@ type OnlineTableSpec struct { } func (newState *OnlineTableSpec) SyncEffectiveFieldsDuringCreateOrUpdate(plan OnlineTableSpec) { - newState.EffectivePipelineId = newState.PipelineId - newState.PipelineId = plan.PipelineId } func (newState *OnlineTableSpec) SyncEffectiveFieldsDuringRead(existingState OnlineTableSpec) { - newState.EffectivePipelineId = existingState.EffectivePipelineId - if existingState.EffectivePipelineId.ValueString() == newState.PipelineId.ValueString() { - newState.PipelineId = existingState.PipelineId - } } type OnlineTableSpecContinuousSchedulingPolicy struct { diff --git a/internal/service/dashboards_tf/model.go b/internal/service/dashboards_tf/model.go index 75ecbb8840..2b6ff5a197 100755 --- a/internal/service/dashboards_tf/model.go +++ b/internal/service/dashboards_tf/model.go @@ -29,52 +29,31 @@ func (newState *CreateDashboardRequest) SyncEffectiveFieldsDuringRead(existingSt // Create dashboard schedule type CreateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` Schedule []Schedule `tfsdk:"schedule" tf:"optional,object"` } func (newState *CreateScheduleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateScheduleRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId } func (newState *CreateScheduleRequest) SyncEffectiveFieldsDuringRead(existingState CreateScheduleRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } } // Create schedule subscription type CreateSubscriptionRequest struct { // UUID identifying the dashboard to which the subscription belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // UUID identifying the schedule to which the subscription belongs. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` Subscription []Subscription `tfsdk:"subscription" tf:"optional,object"` } func (newState *CreateSubscriptionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateSubscriptionRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId } func (newState *CreateSubscriptionRequest) SyncEffectiveFieldsDuringRead(existingState CreateSubscriptionRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } } type CronSchedule struct { @@ -98,30 +77,25 @@ func (newState *CronSchedule) SyncEffectiveFieldsDuringRead(existingState CronSc type Dashboard struct { // The timestamp of when the dashboard was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` - EffectiveCreateTime types.String `tfsdk:"effective_create_time" tf:"computed,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed,optional"` // UUID identifying the dashboard. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` - EffectiveDashboardId types.String `tfsdk:"effective_dashboard_id" tf:"computed,optional"` + DashboardId types.String `tfsdk:"dashboard_id" tf:"computed,optional"` // 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:"optional"` - EffectiveEtag types.String `tfsdk:"effective_etag" tf:"computed,optional"` + Etag types.String `tfsdk:"etag" tf:"computed,optional"` // The state of the dashboard resource. Used for tracking trashed status. LifecycleState types.String `tfsdk:"lifecycle_state" tf:"optional"` // 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:"optional"` - EffectiveParentPath types.String `tfsdk:"effective_parent_path" tf:"computed,optional"` + ParentPath types.String `tfsdk:"parent_path" tf:"computed,optional"` // 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:"optional"` - EffectivePath types.String `tfsdk:"effective_path" tf:"computed,optional"` + Path types.String `tfsdk:"path" tf:"computed,optional"` // 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` @@ -132,90 +106,32 @@ 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:"optional"` - EffectiveUpdateTime types.String `tfsdk:"effective_update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` // The warehouse ID used to run the dashboard. WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` } func (newState *Dashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan Dashboard) { - newState.EffectiveCreateTime = newState.CreateTime - newState.CreateTime = plan.CreateTime - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveEtag = newState.Etag - newState.Etag = plan.Etag - newState.EffectiveParentPath = newState.ParentPath - newState.ParentPath = plan.ParentPath - newState.EffectivePath = newState.Path - newState.Path = plan.Path - newState.EffectiveUpdateTime = newState.UpdateTime - newState.UpdateTime = plan.UpdateTime } func (newState *Dashboard) SyncEffectiveFieldsDuringRead(existingState Dashboard) { - newState.EffectiveCreateTime = existingState.EffectiveCreateTime - if existingState.EffectiveCreateTime.ValueString() == newState.CreateTime.ValueString() { - newState.CreateTime = existingState.CreateTime - } - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveEtag = existingState.EffectiveEtag - if existingState.EffectiveEtag.ValueString() == newState.Etag.ValueString() { - newState.Etag = existingState.Etag - } - newState.EffectiveParentPath = existingState.EffectiveParentPath - if existingState.EffectiveParentPath.ValueString() == newState.ParentPath.ValueString() { - newState.ParentPath = existingState.ParentPath - } - newState.EffectivePath = existingState.EffectivePath - if existingState.EffectivePath.ValueString() == newState.Path.ValueString() { - newState.Path = existingState.Path - } - newState.EffectiveUpdateTime = existingState.EffectiveUpdateTime - if existingState.EffectiveUpdateTime.ValueString() == newState.UpdateTime.ValueString() { - newState.UpdateTime = existingState.UpdateTime - } } // Delete dashboard schedule type DeleteScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // The etag for the schedule. Optionally, it can be provided to verify that // the schedule has not been modified from its last retrieval. - Etag types.String `tfsdk:"-"` - EffectiveEtag types.String `tfsdk:"-"` + Etag types.String `tfsdk:"-"` // UUID identifying the schedule. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` } func (newState *DeleteScheduleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteScheduleRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveEtag = newState.Etag - newState.Etag = plan.Etag - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId } func (newState *DeleteScheduleRequest) SyncEffectiveFieldsDuringRead(existingState DeleteScheduleRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveEtag = existingState.EffectiveEtag - if existingState.EffectiveEtag.ValueString() == newState.Etag.ValueString() { - newState.Etag = existingState.Etag - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } } type DeleteScheduleResponse struct { @@ -230,48 +146,20 @@ func (newState *DeleteScheduleResponse) SyncEffectiveFieldsDuringRead(existingSt // Delete schedule subscription type DeleteSubscriptionRequest struct { // UUID identifying the dashboard which the subscription belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // The etag for the subscription. Can be optionally provided to ensure that // the subscription has not been modified since the last read. - Etag types.String `tfsdk:"-"` - EffectiveEtag types.String `tfsdk:"-"` + Etag types.String `tfsdk:"-"` // UUID identifying the schedule which the subscription belongs. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` // UUID identifying the subscription. - SubscriptionId types.String `tfsdk:"-"` - EffectiveSubscriptionId types.String `tfsdk:"-"` + SubscriptionId types.String `tfsdk:"-"` } func (newState *DeleteSubscriptionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteSubscriptionRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveEtag = newState.Etag - newState.Etag = plan.Etag - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId - newState.EffectiveSubscriptionId = newState.SubscriptionId - newState.SubscriptionId = plan.SubscriptionId } func (newState *DeleteSubscriptionRequest) SyncEffectiveFieldsDuringRead(existingState DeleteSubscriptionRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveEtag = existingState.EffectiveEtag - if existingState.EffectiveEtag.ValueString() == newState.Etag.ValueString() { - newState.Etag = existingState.Etag - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } - newState.EffectiveSubscriptionId = existingState.EffectiveSubscriptionId - if existingState.EffectiveSubscriptionId.ValueString() == newState.SubscriptionId.ValueString() { - newState.SubscriptionId = existingState.SubscriptionId - } } type DeleteSubscriptionResponse struct { @@ -497,66 +385,31 @@ func (newState *GetPublishedDashboardRequest) SyncEffectiveFieldsDuringRead(exis // Get dashboard schedule type GetScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // UUID identifying the schedule. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` } func (newState *GetScheduleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetScheduleRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId } func (newState *GetScheduleRequest) SyncEffectiveFieldsDuringRead(existingState GetScheduleRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } } // Get schedule subscription type GetSubscriptionRequest struct { // UUID identifying the dashboard which the subscription belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // UUID identifying the schedule which the subscription belongs. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` // UUID identifying the subscription. - SubscriptionId types.String `tfsdk:"-"` - EffectiveSubscriptionId types.String `tfsdk:"-"` + SubscriptionId types.String `tfsdk:"-"` } func (newState *GetSubscriptionRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetSubscriptionRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId - newState.EffectiveSubscriptionId = newState.SubscriptionId - newState.SubscriptionId = plan.SubscriptionId } func (newState *GetSubscriptionRequest) SyncEffectiveFieldsDuringRead(existingState GetSubscriptionRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } - newState.EffectiveSubscriptionId = existingState.EffectiveSubscriptionId - if existingState.EffectiveSubscriptionId.ValueString() == newState.SubscriptionId.ValueString() { - newState.SubscriptionId = existingState.SubscriptionId - } } // List dashboards @@ -565,8 +418,7 @@ type ListDashboardsRequest struct { PageSize types.Int64 `tfsdk:"-"` // A page token, received from a previous `ListDashboards` call. This token // can be used to retrieve the subsequent page. - PageToken types.String `tfsdk:"-"` - EffectivePageToken types.String `tfsdk:"-"` + PageToken types.String `tfsdk:"-"` // The flag to include dashboards located in the trash. If unspecified, only // active dashboards will be returned. ShowTrashed types.Bool `tfsdk:"-"` @@ -575,150 +427,88 @@ type ListDashboardsRequest struct { } func (newState *ListDashboardsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDashboardsRequest) { - newState.EffectivePageToken = newState.PageToken - newState.PageToken = plan.PageToken } func (newState *ListDashboardsRequest) SyncEffectiveFieldsDuringRead(existingState ListDashboardsRequest) { - newState.EffectivePageToken = existingState.EffectivePageToken - if existingState.EffectivePageToken.ValueString() == newState.PageToken.ValueString() { - newState.PageToken = existingState.PageToken - } } type ListDashboardsResponse struct { Dashboards []Dashboard `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:"optional"` - EffectiveNextPageToken types.String `tfsdk:"effective_next_page_token" tf:"computed,optional"` + NextPageToken types.String `tfsdk:"next_page_token" tf:"computed,optional"` } func (newState *ListDashboardsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListDashboardsResponse) { - newState.EffectiveNextPageToken = newState.NextPageToken - newState.NextPageToken = plan.NextPageToken } func (newState *ListDashboardsResponse) SyncEffectiveFieldsDuringRead(existingState ListDashboardsResponse) { - newState.EffectiveNextPageToken = existingState.EffectiveNextPageToken - if existingState.EffectiveNextPageToken.ValueString() == newState.NextPageToken.ValueString() { - newState.NextPageToken = existingState.NextPageToken - } } // List dashboard schedules type ListSchedulesRequest struct { // UUID identifying the dashboard to which the schedules belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // The number of schedules to return per page. PageSize types.Int64 `tfsdk:"-"` // A page token, received from a previous `ListSchedules` call. Use this to // retrieve the subsequent page. - PageToken types.String `tfsdk:"-"` - EffectivePageToken types.String `tfsdk:"-"` + PageToken types.String `tfsdk:"-"` } func (newState *ListSchedulesRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSchedulesRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectivePageToken = newState.PageToken - newState.PageToken = plan.PageToken } func (newState *ListSchedulesRequest) SyncEffectiveFieldsDuringRead(existingState ListSchedulesRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectivePageToken = existingState.EffectivePageToken - if existingState.EffectivePageToken.ValueString() == newState.PageToken.ValueString() { - newState.PageToken = existingState.PageToken - } } 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:"optional"` - EffectiveNextPageToken types.String `tfsdk:"effective_next_page_token" tf:"computed,optional"` + NextPageToken types.String `tfsdk:"next_page_token" tf:"computed,optional"` Schedules []Schedule `tfsdk:"schedules" tf:"optional"` } func (newState *ListSchedulesResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSchedulesResponse) { - newState.EffectiveNextPageToken = newState.NextPageToken - newState.NextPageToken = plan.NextPageToken } func (newState *ListSchedulesResponse) SyncEffectiveFieldsDuringRead(existingState ListSchedulesResponse) { - newState.EffectiveNextPageToken = existingState.EffectiveNextPageToken - if existingState.EffectiveNextPageToken.ValueString() == newState.NextPageToken.ValueString() { - newState.NextPageToken = existingState.NextPageToken - } } // List schedule subscriptions type ListSubscriptionsRequest struct { // UUID identifying the dashboard which the subscriptions belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` // The number of subscriptions to return per page. PageSize types.Int64 `tfsdk:"-"` // A page token, received from a previous `ListSubscriptions` call. Use this // to retrieve the subsequent page. - PageToken types.String `tfsdk:"-"` - EffectivePageToken types.String `tfsdk:"-"` + PageToken types.String `tfsdk:"-"` // UUID identifying the schedule which the subscriptions belongs. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` } func (newState *ListSubscriptionsRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSubscriptionsRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectivePageToken = newState.PageToken - newState.PageToken = plan.PageToken - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId } func (newState *ListSubscriptionsRequest) SyncEffectiveFieldsDuringRead(existingState ListSubscriptionsRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectivePageToken = existingState.EffectivePageToken - if existingState.EffectivePageToken.ValueString() == newState.PageToken.ValueString() { - newState.PageToken = existingState.PageToken - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } } 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:"optional"` - EffectiveNextPageToken types.String `tfsdk:"effective_next_page_token" tf:"computed,optional"` + NextPageToken types.String `tfsdk:"next_page_token" tf:"computed,optional"` Subscriptions []Subscription `tfsdk:"subscriptions" tf:"optional"` } func (newState *ListSubscriptionsResponse) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListSubscriptionsResponse) { - newState.EffectiveNextPageToken = newState.NextPageToken - newState.NextPageToken = plan.NextPageToken } func (newState *ListSubscriptionsResponse) SyncEffectiveFieldsDuringRead(existingState ListSubscriptionsResponse) { - newState.EffectiveNextPageToken = existingState.EffectiveNextPageToken - if existingState.EffectiveNextPageToken.ValueString() == newState.NextPageToken.ValueString() { - newState.NextPageToken = existingState.NextPageToken - } } type MessageError struct { @@ -769,33 +559,19 @@ func (newState *PublishRequest) SyncEffectiveFieldsDuringRead(existingState Publ type PublishedDashboard struct { // The display name of the published dashboard. - DisplayName types.String `tfsdk:"display_name" tf:"optional"` - EffectiveDisplayName types.String `tfsdk:"effective_display_name" tf:"computed,optional"` + DisplayName types.String `tfsdk:"display_name" tf:"computed,optional"` // 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:"optional"` - EffectiveRevisionCreateTime types.String `tfsdk:"effective_revision_create_time" tf:"computed,optional"` + RevisionCreateTime types.String `tfsdk:"revision_create_time" tf:"computed,optional"` // The warehouse ID used to run the published dashboard. WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` } func (newState *PublishedDashboard) SyncEffectiveFieldsDuringCreateOrUpdate(plan PublishedDashboard) { - newState.EffectiveDisplayName = newState.DisplayName - newState.DisplayName = plan.DisplayName - newState.EffectiveRevisionCreateTime = newState.RevisionCreateTime - newState.RevisionCreateTime = plan.RevisionCreateTime } func (newState *PublishedDashboard) SyncEffectiveFieldsDuringRead(existingState PublishedDashboard) { - newState.EffectiveDisplayName = existingState.EffectiveDisplayName - if existingState.EffectiveDisplayName.ValueString() == newState.DisplayName.ValueString() { - newState.DisplayName = existingState.DisplayName - } - newState.EffectiveRevisionCreateTime = existingState.EffectiveRevisionCreateTime - if existingState.EffectiveRevisionCreateTime.ValueString() == newState.RevisionCreateTime.ValueString() { - newState.RevisionCreateTime = existingState.RevisionCreateTime - } } type QueryAttachment struct { @@ -842,67 +618,32 @@ func (newState *Result) SyncEffectiveFieldsDuringRead(existingState Result) { type Schedule struct { // A timestamp indicating when the schedule was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` - EffectiveCreateTime types.String `tfsdk:"effective_create_time" tf:"computed,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed,optional"` // The cron expression describing the frequency of the periodic refresh for // this schedule. CronSchedule []CronSchedule `tfsdk:"cron_schedule" tf:"object"` // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` - EffectiveDashboardId types.String `tfsdk:"effective_dashboard_id" tf:"computed,optional"` + DashboardId types.String `tfsdk:"dashboard_id" tf:"computed,optional"` // 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:"optional"` - EffectiveEtag types.String `tfsdk:"effective_etag" tf:"computed,optional"` + Etag types.String `tfsdk:"etag" tf:"computed,optional"` // 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:"optional"` - EffectiveScheduleId types.String `tfsdk:"effective_schedule_id" tf:"computed,optional"` + ScheduleId types.String `tfsdk:"schedule_id" tf:"computed,optional"` // A timestamp indicating when the schedule was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` - EffectiveUpdateTime types.String `tfsdk:"effective_update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` // The warehouse id to run the dashboard with for the schedule. WarehouseId types.String `tfsdk:"warehouse_id" tf:"optional"` } func (newState *Schedule) SyncEffectiveFieldsDuringCreateOrUpdate(plan Schedule) { - newState.EffectiveCreateTime = newState.CreateTime - newState.CreateTime = plan.CreateTime - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveEtag = newState.Etag - newState.Etag = plan.Etag - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId - newState.EffectiveUpdateTime = newState.UpdateTime - newState.UpdateTime = plan.UpdateTime } func (newState *Schedule) SyncEffectiveFieldsDuringRead(existingState Schedule) { - newState.EffectiveCreateTime = existingState.EffectiveCreateTime - if existingState.EffectiveCreateTime.ValueString() == newState.CreateTime.ValueString() { - newState.CreateTime = existingState.CreateTime - } - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveEtag = existingState.EffectiveEtag - if existingState.EffectiveEtag.ValueString() == newState.Etag.ValueString() { - newState.Etag = existingState.Etag - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } - newState.EffectiveUpdateTime = existingState.EffectiveUpdateTime - if existingState.EffectiveUpdateTime.ValueString() == newState.UpdateTime.ValueString() { - newState.UpdateTime = existingState.UpdateTime - } } type Subscriber struct { @@ -922,117 +663,54 @@ func (newState *Subscriber) SyncEffectiveFieldsDuringRead(existingState Subscrib type Subscription struct { // A timestamp indicating when the subscription was created. - CreateTime types.String `tfsdk:"create_time" tf:"optional"` - EffectiveCreateTime types.String `tfsdk:"effective_create_time" tf:"computed,optional"` + CreateTime types.String `tfsdk:"create_time" tf:"computed,optional"` // 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:"optional"` - EffectiveCreatedByUserId types.Int64 `tfsdk:"effective_created_by_user_id" tf:"computed,optional"` + CreatedByUserId types.Int64 `tfsdk:"created_by_user_id" tf:"computed,optional"` // UUID identifying the dashboard to which the subscription belongs. - DashboardId types.String `tfsdk:"dashboard_id" tf:"optional"` - EffectiveDashboardId types.String `tfsdk:"effective_dashboard_id" tf:"computed,optional"` + DashboardId types.String `tfsdk:"dashboard_id" tf:"computed,optional"` // 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:"optional"` - EffectiveEtag types.String `tfsdk:"effective_etag" tf:"computed,optional"` + Etag types.String `tfsdk:"etag" tf:"computed,optional"` // UUID identifying the schedule to which the subscription belongs. - ScheduleId types.String `tfsdk:"schedule_id" tf:"optional"` - EffectiveScheduleId types.String `tfsdk:"effective_schedule_id" tf:"computed,optional"` + ScheduleId types.String `tfsdk:"schedule_id" tf:"computed,optional"` // Subscriber details for users and destinations to be added as subscribers // to the schedule. Subscriber []Subscriber `tfsdk:"subscriber" tf:"object"` // UUID identifying the subscription. - SubscriptionId types.String `tfsdk:"subscription_id" tf:"optional"` - EffectiveSubscriptionId types.String `tfsdk:"effective_subscription_id" tf:"computed,optional"` + SubscriptionId types.String `tfsdk:"subscription_id" tf:"computed,optional"` // A timestamp indicating when the subscription was last updated. - UpdateTime types.String `tfsdk:"update_time" tf:"optional"` - EffectiveUpdateTime types.String `tfsdk:"effective_update_time" tf:"computed,optional"` + UpdateTime types.String `tfsdk:"update_time" tf:"computed,optional"` } func (newState *Subscription) SyncEffectiveFieldsDuringCreateOrUpdate(plan Subscription) { - newState.EffectiveCreateTime = newState.CreateTime - newState.CreateTime = plan.CreateTime - newState.EffectiveCreatedByUserId = newState.CreatedByUserId - newState.CreatedByUserId = plan.CreatedByUserId - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveEtag = newState.Etag - newState.Etag = plan.Etag - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId - newState.EffectiveSubscriptionId = newState.SubscriptionId - newState.SubscriptionId = plan.SubscriptionId - newState.EffectiveUpdateTime = newState.UpdateTime - newState.UpdateTime = plan.UpdateTime } func (newState *Subscription) SyncEffectiveFieldsDuringRead(existingState Subscription) { - newState.EffectiveCreateTime = existingState.EffectiveCreateTime - if existingState.EffectiveCreateTime.ValueString() == newState.CreateTime.ValueString() { - newState.CreateTime = existingState.CreateTime - } - newState.EffectiveCreatedByUserId = existingState.EffectiveCreatedByUserId - if existingState.EffectiveCreatedByUserId.ValueInt64() == newState.CreatedByUserId.ValueInt64() { - newState.CreatedByUserId = existingState.CreatedByUserId - } - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveEtag = existingState.EffectiveEtag - if existingState.EffectiveEtag.ValueString() == newState.Etag.ValueString() { - newState.Etag = existingState.Etag - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } - newState.EffectiveSubscriptionId = existingState.EffectiveSubscriptionId - if existingState.EffectiveSubscriptionId.ValueString() == newState.SubscriptionId.ValueString() { - newState.SubscriptionId = existingState.SubscriptionId - } - newState.EffectiveUpdateTime = existingState.EffectiveUpdateTime - if existingState.EffectiveUpdateTime.ValueString() == newState.UpdateTime.ValueString() { - newState.UpdateTime = existingState.UpdateTime - } } type SubscriptionSubscriberDestination struct { // The canonical identifier of the destination to receive email // notification. - DestinationId types.String `tfsdk:"destination_id" tf:""` - EffectiveDestinationId types.String `tfsdk:"effective_destination_id" tf:"computed,optional"` + DestinationId types.String `tfsdk:"destination_id" tf:"computed,optional"` } func (newState *SubscriptionSubscriberDestination) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberDestination) { - newState.EffectiveDestinationId = newState.DestinationId - newState.DestinationId = plan.DestinationId } func (newState *SubscriptionSubscriberDestination) SyncEffectiveFieldsDuringRead(existingState SubscriptionSubscriberDestination) { - newState.EffectiveDestinationId = existingState.EffectiveDestinationId - if existingState.EffectiveDestinationId.ValueString() == newState.DestinationId.ValueString() { - newState.DestinationId = existingState.DestinationId - } } type SubscriptionSubscriberUser struct { // UserId of the subscriber. - UserId types.Int64 `tfsdk:"user_id" tf:""` - EffectiveUserId types.Int64 `tfsdk:"effective_user_id" tf:"computed,optional"` + UserId types.Int64 `tfsdk:"user_id" tf:"computed,optional"` } func (newState *SubscriptionSubscriberUser) SyncEffectiveFieldsDuringCreateOrUpdate(plan SubscriptionSubscriberUser) { - newState.EffectiveUserId = newState.UserId - newState.UserId = plan.UserId } func (newState *SubscriptionSubscriberUser) SyncEffectiveFieldsDuringRead(existingState SubscriptionSubscriberUser) { - newState.EffectiveUserId = existingState.EffectiveUserId - if existingState.EffectiveUserId.ValueInt64() == newState.UserId.ValueInt64() { - newState.UserId = existingState.UserId - } } type TextAttachment struct { @@ -1094,48 +772,27 @@ func (newState *UnpublishDashboardResponse) SyncEffectiveFieldsDuringRead(existi type UpdateDashboardRequest struct { Dashboard []Dashboard `tfsdk:"dashboard" tf:"optional,object"` // UUID identifying the dashboard. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` } func (newState *UpdateDashboardRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateDashboardRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId } func (newState *UpdateDashboardRequest) SyncEffectiveFieldsDuringRead(existingState UpdateDashboardRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } } // Update dashboard schedule type UpdateScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. - DashboardId types.String `tfsdk:"-"` - EffectiveDashboardId types.String `tfsdk:"-"` + DashboardId types.String `tfsdk:"-"` Schedule []Schedule `tfsdk:"schedule" tf:"optional,object"` // UUID identifying the schedule. - ScheduleId types.String `tfsdk:"-"` - EffectiveScheduleId types.String `tfsdk:"-"` + ScheduleId types.String `tfsdk:"-"` } func (newState *UpdateScheduleRequest) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateScheduleRequest) { - newState.EffectiveDashboardId = newState.DashboardId - newState.DashboardId = plan.DashboardId - newState.EffectiveScheduleId = newState.ScheduleId - newState.ScheduleId = plan.ScheduleId } func (newState *UpdateScheduleRequest) SyncEffectiveFieldsDuringRead(existingState UpdateScheduleRequest) { - newState.EffectiveDashboardId = existingState.EffectiveDashboardId - if existingState.EffectiveDashboardId.ValueString() == newState.DashboardId.ValueString() { - newState.DashboardId = existingState.DashboardId - } - newState.EffectiveScheduleId = existingState.EffectiveScheduleId - if existingState.EffectiveScheduleId.ValueString() == newState.ScheduleId.ValueString() { - newState.ScheduleId = existingState.ScheduleId - } } diff --git a/internal/service/jobs_tf/model.go b/internal/service/jobs_tf/model.go index cbd6a41ee8..51e158e64f 100755 --- a/internal/service/jobs_tf/model.go +++ b/internal/service/jobs_tf/model.go @@ -28,8 +28,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:"optional"` - EffectiveEffectiveBudgetPolicyId types.String `tfsdk:"effective_effective_budget_policy_id" tf:"computed,optional"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed,optional"` // 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 @@ -38,15 +37,9 @@ type BaseJob struct { } func (newState *BaseJob) SyncEffectiveFieldsDuringCreateOrUpdate(plan BaseJob) { - newState.EffectiveEffectiveBudgetPolicyId = newState.EffectiveBudgetPolicyId - newState.EffectiveBudgetPolicyId = plan.EffectiveBudgetPolicyId } func (newState *BaseJob) SyncEffectiveFieldsDuringRead(existingState BaseJob) { - newState.EffectiveEffectiveBudgetPolicyId = existingState.EffectiveEffectiveBudgetPolicyId - if existingState.EffectiveEffectiveBudgetPolicyId.ValueString() == newState.EffectiveBudgetPolicyId.ValueString() { - newState.EffectiveBudgetPolicyId = existingState.EffectiveBudgetPolicyId - } } type BaseRun struct { @@ -921,8 +914,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:"optional"` - EffectiveEffectiveBudgetPolicyId types.String `tfsdk:"effective_effective_budget_policy_id" tf:"computed,optional"` + EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id" tf:"computed,optional"` // 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 @@ -939,15 +931,9 @@ type Job struct { } func (newState *Job) SyncEffectiveFieldsDuringCreateOrUpdate(plan Job) { - newState.EffectiveEffectiveBudgetPolicyId = newState.EffectiveBudgetPolicyId - newState.EffectiveBudgetPolicyId = plan.EffectiveBudgetPolicyId } func (newState *Job) SyncEffectiveFieldsDuringRead(existingState Job) { - newState.EffectiveEffectiveBudgetPolicyId = existingState.EffectiveEffectiveBudgetPolicyId - if existingState.EffectiveEffectiveBudgetPolicyId.ValueString() == newState.EffectiveBudgetPolicyId.ValueString() { - newState.EffectiveBudgetPolicyId = existingState.EffectiveBudgetPolicyId - } } type JobAccessControlRequest struct { diff --git a/internal/service/provisioning_tf/model.go b/internal/service/provisioning_tf/model.go index 49b5d02e78..5ccfa54fbb 100755 --- a/internal/service/provisioning_tf/model.go +++ b/internal/service/provisioning_tf/model.go @@ -330,8 +330,7 @@ type Credential struct { AwsCredentials []AwsCredentials `tfsdk:"aws_credentials" tf:"optional,object"` // Time in epoch milliseconds when the credential was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // Databricks credential configuration ID. CredentialsId types.String `tfsdk:"credentials_id" tf:"optional"` // The human-readable name of the credential configuration object. @@ -339,15 +338,9 @@ type Credential struct { } func (newState *Credential) SyncEffectiveFieldsDuringCreateOrUpdate(plan Credential) { - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime } func (newState *Credential) SyncEffectiveFieldsDuringRead(existingState Credential) { - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } } // The general workspace configurations that are specific to Google Cloud. @@ -369,8 +362,7 @@ type CustomerManagedKey struct { AwsKeyInfo []AwsKeyInfo `tfsdk:"aws_key_info" tf:"optional,object"` // Time in epoch milliseconds when the customer key was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // ID of the encryption key configuration object. CustomerManagedKeyId types.String `tfsdk:"customer_managed_key_id" tf:"optional"` @@ -380,15 +372,9 @@ type CustomerManagedKey struct { } func (newState *CustomerManagedKey) SyncEffectiveFieldsDuringCreateOrUpdate(plan CustomerManagedKey) { - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime } func (newState *CustomerManagedKey) SyncEffectiveFieldsDuringRead(existingState CustomerManagedKey) { - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } } // Delete credential configuration @@ -714,11 +700,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:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // Array of error messages about the network configuration. - ErrorMessages []NetworkHealth `tfsdk:"error_messages" tf:"optional"` - EffectiveErrorMessages []NetworkHealth `tfsdk:"effective_error_messages" tf:"computed,optional"` + ErrorMessages []NetworkHealth `tfsdk:"error_messages" tf:"computed,optional"` // The Google Cloud specific information for this network (for example, the // VPC ID, subnet ID, and secondary IP ranges). GcpNetworkInfo []GcpNetworkInfo `tfsdk:"gcp_network_info" tf:"optional,object"` @@ -741,31 +725,17 @@ 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:"optional"` - EffectiveVpcStatus types.String `tfsdk:"effective_vpc_status" tf:"computed,optional"` + VpcStatus types.String `tfsdk:"vpc_status" tf:"computed,optional"` // Array of warning messages about the network configuration. - WarningMessages []NetworkWarning `tfsdk:"warning_messages" tf:"optional"` - EffectiveWarningMessages []NetworkWarning `tfsdk:"effective_warning_messages" tf:"computed,optional"` + WarningMessages []NetworkWarning `tfsdk:"warning_messages" tf:"computed,optional"` // Workspace ID associated with this network configuration. WorkspaceId types.Int64 `tfsdk:"workspace_id" tf:"optional"` } func (newState *Network) SyncEffectiveFieldsDuringCreateOrUpdate(plan Network) { - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime - newState.EffectiveVpcStatus = newState.VpcStatus - newState.VpcStatus = plan.VpcStatus } func (newState *Network) SyncEffectiveFieldsDuringRead(existingState Network) { - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } - newState.EffectiveVpcStatus = existingState.EffectiveVpcStatus - if existingState.EffectiveVpcStatus.ValueString() == newState.VpcStatus.ValueString() { - newState.VpcStatus = existingState.VpcStatus - } } type NetworkHealth struct { @@ -871,11 +841,9 @@ func (newState *RootBucketInfo) SyncEffectiveFieldsDuringRead(existingState Root type StorageConfiguration struct { // The Databricks account ID that hosts the credential. - AccountId types.String `tfsdk:"account_id" tf:"optional"` - EffectiveAccountId types.String `tfsdk:"effective_account_id" tf:"computed,optional"` + AccountId types.String `tfsdk:"account_id" tf:"computed,optional"` // Time in epoch milliseconds when the storage configuration was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // Root S3 bucket information. RootBucketInfo []RootBucketInfo `tfsdk:"root_bucket_info" tf:"optional,object"` // Databricks storage configuration ID. @@ -885,21 +853,9 @@ type StorageConfiguration struct { } func (newState *StorageConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan StorageConfiguration) { - newState.EffectiveAccountId = newState.AccountId - newState.AccountId = plan.AccountId - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime } func (newState *StorageConfiguration) SyncEffectiveFieldsDuringRead(existingState StorageConfiguration) { - newState.EffectiveAccountId = existingState.EffectiveAccountId - if existingState.EffectiveAccountId.ValueString() == newState.AccountId.ValueString() { - newState.AccountId = existingState.AccountId - } - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } } type StsRole struct { @@ -1067,8 +1023,7 @@ type Workspace struct { // providers. CloudResourceContainer []CloudResourceContainer `tfsdk:"cloud_resource_container" tf:"optional,object"` // Time in epoch milliseconds when the workspace was created. - CreationTime types.Int64 `tfsdk:"creation_time" tf:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // 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 @@ -1150,33 +1105,13 @@ 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:"optional"` - EffectiveWorkspaceStatus types.String `tfsdk:"effective_workspace_status" tf:"computed,optional"` + WorkspaceStatus types.String `tfsdk:"workspace_status" tf:"computed,optional"` // Message describing the current workspace status. - WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message" tf:"optional"` - EffectiveWorkspaceStatusMessage types.String `tfsdk:"effective_workspace_status_message" tf:"computed,optional"` + WorkspaceStatusMessage types.String `tfsdk:"workspace_status_message" tf:"computed,optional"` } func (newState *Workspace) SyncEffectiveFieldsDuringCreateOrUpdate(plan Workspace) { - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime - newState.EffectiveWorkspaceStatus = newState.WorkspaceStatus - newState.WorkspaceStatus = plan.WorkspaceStatus - newState.EffectiveWorkspaceStatusMessage = newState.WorkspaceStatusMessage - newState.WorkspaceStatusMessage = plan.WorkspaceStatusMessage } func (newState *Workspace) SyncEffectiveFieldsDuringRead(existingState Workspace) { - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } - newState.EffectiveWorkspaceStatus = existingState.EffectiveWorkspaceStatus - if existingState.EffectiveWorkspaceStatus.ValueString() == newState.WorkspaceStatus.ValueString() { - newState.WorkspaceStatus = existingState.WorkspaceStatus - } - newState.EffectiveWorkspaceStatusMessage = existingState.EffectiveWorkspaceStatusMessage - if existingState.EffectiveWorkspaceStatusMessage.ValueString() == newState.WorkspaceStatusMessage.ValueString() { - newState.WorkspaceStatusMessage = existingState.WorkspaceStatusMessage - } } diff --git a/internal/service/settings_tf/model.go b/internal/service/settings_tf/model.go index 1f2dfd5b33..e34e7c4d5f 100755 --- a/internal/service/settings_tf/model.go +++ b/internal/service/settings_tf/model.go @@ -1600,17 +1600,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:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // Whether this private endpoint is deactivated. - Deactivated types.Bool `tfsdk:"deactivated" tf:"optional"` - EffectiveDeactivated types.Bool `tfsdk:"effective_deactivated" tf:"computed,optional"` + Deactivated types.Bool `tfsdk:"deactivated" tf:"computed,optional"` // Time in epoch milliseconds when this object was deactivated. - DeactivatedAt types.Int64 `tfsdk:"deactivated_at" tf:"optional"` - EffectiveDeactivatedAt types.Int64 `tfsdk:"effective_deactivated_at" tf:"computed,optional"` + DeactivatedAt types.Int64 `tfsdk:"deactivated_at" tf:"computed,optional"` // The name of the Azure private endpoint resource. - EndpointName types.String `tfsdk:"endpoint_name" tf:"optional"` - EffectiveEndpointName types.String `tfsdk:"effective_endpoint_name" tf:"computed,optional"` + EndpointName types.String `tfsdk:"endpoint_name" tf:"computed,optional"` // 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`. @@ -1621,53 +1617,15 @@ 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:"optional"` - EffectiveRuleId types.String `tfsdk:"effective_rule_id" tf:"computed,optional"` + RuleId types.String `tfsdk:"rule_id" tf:"computed,optional"` // Time in epoch milliseconds when this object was updated. - UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"optional"` - EffectiveUpdatedTime types.Int64 `tfsdk:"effective_updated_time" tf:"computed,optional"` + UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed,optional"` } func (newState *NccAzurePrivateEndpointRule) SyncEffectiveFieldsDuringCreateOrUpdate(plan NccAzurePrivateEndpointRule) { - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime - newState.EffectiveDeactivated = newState.Deactivated - newState.Deactivated = plan.Deactivated - newState.EffectiveDeactivatedAt = newState.DeactivatedAt - newState.DeactivatedAt = plan.DeactivatedAt - newState.EffectiveEndpointName = newState.EndpointName - newState.EndpointName = plan.EndpointName - newState.EffectiveRuleId = newState.RuleId - newState.RuleId = plan.RuleId - newState.EffectiveUpdatedTime = newState.UpdatedTime - newState.UpdatedTime = plan.UpdatedTime } func (newState *NccAzurePrivateEndpointRule) SyncEffectiveFieldsDuringRead(existingState NccAzurePrivateEndpointRule) { - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } - newState.EffectiveDeactivated = existingState.EffectiveDeactivated - if existingState.EffectiveDeactivated.ValueBool() == newState.Deactivated.ValueBool() { - newState.Deactivated = existingState.Deactivated - } - newState.EffectiveDeactivatedAt = existingState.EffectiveDeactivatedAt - if existingState.EffectiveDeactivatedAt.ValueInt64() == newState.DeactivatedAt.ValueInt64() { - newState.DeactivatedAt = existingState.DeactivatedAt - } - newState.EffectiveEndpointName = existingState.EffectiveEndpointName - if existingState.EffectiveEndpointName.ValueString() == newState.EndpointName.ValueString() { - newState.EndpointName = existingState.EndpointName - } - newState.EffectiveRuleId = existingState.EffectiveRuleId - if existingState.EffectiveRuleId.ValueString() == newState.RuleId.ValueString() { - newState.RuleId = existingState.RuleId - } - newState.EffectiveUpdatedTime = existingState.EffectiveUpdatedTime - if existingState.EffectiveUpdatedTime.ValueInt64() == newState.UpdatedTime.ValueInt64() { - newState.UpdatedTime = existingState.UpdatedTime - } } // The stable Azure service endpoints. You can configure the firewall of your @@ -1695,8 +1653,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 []NccEgressDefaultRules `tfsdk:"default_rules" tf:"optional,object"` - EffectiveDefaultRules []NccEgressDefaultRules `tfsdk:"effective_default_rules" tf:"computed,optional"` + DefaultRules []NccEgressDefaultRules `tfsdk:"default_rules" tf:"computed,optional"` // The network connectivity rules that configured for each destinations. // These rules override default rules. TargetRules []NccEgressTargetRules `tfsdk:"target_rules" tf:"optional,object"` @@ -1744,8 +1701,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:"optional"` - EffectiveCreationTime types.Int64 `tfsdk:"effective_creation_time" tf:"computed,optional"` + CreationTime types.Int64 `tfsdk:"creation_time" tf:"computed,optional"` // The network connectivity rules that apply to network traffic from your // serverless compute resources. EgressConfig []NccEgressConfig `tfsdk:"egress_config" tf:"optional,object"` @@ -1755,39 +1711,19 @@ 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:"optional"` - EffectiveNetworkConnectivityConfigId types.String `tfsdk:"effective_network_connectivity_config_id" tf:"computed,optional"` + NetworkConnectivityConfigId types.String `tfsdk:"network_connectivity_config_id" tf:"computed,optional"` // 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:"optional"` - EffectiveUpdatedTime types.Int64 `tfsdk:"effective_updated_time" tf:"computed,optional"` + UpdatedTime types.Int64 `tfsdk:"updated_time" tf:"computed,optional"` } func (newState *NetworkConnectivityConfiguration) SyncEffectiveFieldsDuringCreateOrUpdate(plan NetworkConnectivityConfiguration) { - newState.EffectiveCreationTime = newState.CreationTime - newState.CreationTime = plan.CreationTime - newState.EffectiveNetworkConnectivityConfigId = newState.NetworkConnectivityConfigId - newState.NetworkConnectivityConfigId = plan.NetworkConnectivityConfigId - newState.EffectiveUpdatedTime = newState.UpdatedTime - newState.UpdatedTime = plan.UpdatedTime } func (newState *NetworkConnectivityConfiguration) SyncEffectiveFieldsDuringRead(existingState NetworkConnectivityConfiguration) { - newState.EffectiveCreationTime = existingState.EffectiveCreationTime - if existingState.EffectiveCreationTime.ValueInt64() == newState.CreationTime.ValueInt64() { - newState.CreationTime = existingState.CreationTime - } - newState.EffectiveNetworkConnectivityConfigId = existingState.EffectiveNetworkConnectivityConfigId - if existingState.EffectiveNetworkConnectivityConfigId.ValueString() == newState.NetworkConnectivityConfigId.ValueString() { - newState.NetworkConnectivityConfigId = existingState.NetworkConnectivityConfigId - } - newState.EffectiveUpdatedTime = existingState.EffectiveUpdatedTime - if existingState.EffectiveUpdatedTime.ValueInt64() == newState.UpdatedTime.ValueInt64() { - newState.UpdatedTime = existingState.UpdatedTime - } } type NotificationDestination struct {