From 4b343ec41118e14871506b8e46bc0c5f8d5b60c5 Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Sun, 17 Mar 2024 11:32:23 +0100 Subject: [PATCH] Rebase to the latest `main` and fix code --- settings/all_settings.go | 8 ++++---- ...ce_compliance_security_profile_account_setting.go | 12 ++++++------ ..._compliance_security_profile_workspace_setting.go | 12 ++++++------ ...e_enhanced_security_monitoring_account_setting.go | 12 ++++++------ ...enhanced_security_monitoring_workspace_setting.go | 12 ++++++------ 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/settings/all_settings.go b/settings/all_settings.go index 051e1584c5..c25870790a 100644 --- a/settings/all_settings.go +++ b/settings/all_settings.go @@ -17,9 +17,9 @@ func AllSettingsResources() map[string]common.Resource { return map[string]common.Resource{ "default_namespace": makeSettingResource[settings.DefaultNamespaceSetting, *databricks.WorkspaceClient](defaultNamespaceSetting), "restrict_workspace_admins": makeSettingResource[settings.RestrictWorkspaceAdminsSetting, *databricks.WorkspaceClient](restrictWsAdminsSetting), - "compliance_security_profile_account": makeSettingResource[settings.CSPEnablementAccountSetting, *databricks.AccountClient](cspEnablementAccountSetting), - "enhanced_security_monitoring_account": makeSettingResource[settings.ESMEnablementAccountSetting, *databricks.AccountClient](esmEnablementAccountSetting), - "compliance_security_profile_workspace": makeSettingResource[settings.CSPEnablementSetting, *databricks.WorkspaceClient](cspEnablementWorkspaceSetting), - "enhanced_security_monitoring_workspace": makeSettingResource[settings.ESMEnablementSetting, *databricks.WorkspaceClient](esmEnablementWorkspaceSetting), + "compliance_security_profile_account": makeSettingResource[settings.CspEnablementAccountSetting, *databricks.AccountClient](cspEnablementAccountSetting), + "enhanced_security_monitoring_account": makeSettingResource[settings.EsmEnablementAccountSetting, *databricks.AccountClient](esmEnablementAccountSetting), + "compliance_security_profile_workspace": makeSettingResource[settings.CspEnablementSetting, *databricks.WorkspaceClient](cspEnablementWorkspaceSetting), + "enhanced_security_monitoring_workspace": makeSettingResource[settings.EsmEnablementSetting, *databricks.WorkspaceClient](esmEnablementWorkspaceSetting), } } diff --git a/settings/resource_compliance_security_profile_account_setting.go b/settings/resource_compliance_security_profile_account_setting.go index 2dca8a1ac6..ac3f1c4c06 100644 --- a/settings/resource_compliance_security_profile_account_setting.go +++ b/settings/resource_compliance_security_profile_account_setting.go @@ -8,16 +8,16 @@ import ( ) // Compliance Security Profile Account level setting -var cspEnablementAccountSetting = accountSetting[settings.CSPEnablementAccountSetting]{ - settingStruct: settings.CSPEnablementAccountSetting{}, - readFunc: func(ctx context.Context, w *databricks.AccountClient, etag string) (*settings.CSPEnablementAccountSetting, error) { - return w.Settings.GetCSPEnablementAccountSetting(ctx, settings.GetCSPEnablementAccountRequest{ +var cspEnablementAccountSetting = accountSetting[settings.CspEnablementAccountSetting]{ + settingStruct: settings.CspEnablementAccountSetting{}, + readFunc: func(ctx context.Context, w *databricks.AccountClient, etag string) (*settings.CspEnablementAccountSetting, error) { + return w.Settings.CspEnablementAccount().Get(ctx, settings.GetCspEnablementAccountRequest{ Etag: etag, }) }, - updateFunc: func(ctx context.Context, w *databricks.AccountClient, t settings.CSPEnablementAccountSetting) (string, error) { + updateFunc: func(ctx context.Context, w *databricks.AccountClient, t settings.CspEnablementAccountSetting) (string, error) { t.SettingName = "default" - res, err := w.Settings.UpdateCSPEnablementAccountSetting(ctx, settings.UpdateCSPEnablementAccountRequest{ + res, err := w.Settings.CspEnablementAccount().Update(ctx, settings.UpdateCspEnablementAccountSettingRequest{ AllowMissing: true, Setting: t, FieldMask: "csp_enablement_account.value", diff --git a/settings/resource_compliance_security_profile_workspace_setting.go b/settings/resource_compliance_security_profile_workspace_setting.go index 19cbdedcac..3f76db387b 100644 --- a/settings/resource_compliance_security_profile_workspace_setting.go +++ b/settings/resource_compliance_security_profile_workspace_setting.go @@ -8,16 +8,16 @@ import ( ) // Compliance Security Profile Workspace level setting -var cspEnablementWorkspaceSetting = workspaceSetting[settings.CSPEnablementSetting]{ - settingStruct: settings.CSPEnablementSetting{}, - readFunc: func(ctx context.Context, w *databricks.WorkspaceClient, etag string) (*settings.CSPEnablementSetting, error) { - return w.Settings.GetCSPEnablementSetting(ctx, settings.GetCSPEnablementSettingRequest{ +var cspEnablementWorkspaceSetting = workspaceSetting[settings.CspEnablementSetting]{ + settingStruct: settings.CspEnablementSetting{}, + readFunc: func(ctx context.Context, w *databricks.WorkspaceClient, etag string) (*settings.CspEnablementSetting, error) { + return w.Settings.CspEnablement().Get(ctx, settings.GetCspEnablementRequest{ Etag: etag, }) }, - updateFunc: func(ctx context.Context, w *databricks.WorkspaceClient, t settings.CSPEnablementSetting) (string, error) { + updateFunc: func(ctx context.Context, w *databricks.WorkspaceClient, t settings.CspEnablementSetting) (string, error) { t.SettingName = "default" - res, err := w.Settings.UpdateCSPEnablementSetting(ctx, settings.UpdateCSPEnablementSettingRequest{ + res, err := w.Settings.CspEnablement().Update(ctx, settings.UpdateCspEnablementSettingRequest{ AllowMissing: true, Setting: t, FieldMask: "csp_enablement_workspace.value", diff --git a/settings/resource_enhanced_security_monitoring_account_setting.go b/settings/resource_enhanced_security_monitoring_account_setting.go index fba2ec1a11..7669c5eba0 100644 --- a/settings/resource_enhanced_security_monitoring_account_setting.go +++ b/settings/resource_enhanced_security_monitoring_account_setting.go @@ -8,16 +8,16 @@ import ( ) // Enhanced Security Monitoring Account level setting -var esmEnablementAccountSetting = accountSetting[settings.ESMEnablementAccountSetting]{ - settingStruct: settings.ESMEnablementAccountSetting{}, - readFunc: func(ctx context.Context, w *databricks.AccountClient, etag string) (*settings.ESMEnablementAccountSetting, error) { - return w.Settings.GetESMEnablementAccountSetting(ctx, settings.GetESMEnablementAccountSettingRequest{ +var esmEnablementAccountSetting = accountSetting[settings.EsmEnablementAccountSetting]{ + settingStruct: settings.EsmEnablementAccountSetting{}, + readFunc: func(ctx context.Context, w *databricks.AccountClient, etag string) (*settings.EsmEnablementAccountSetting, error) { + return w.Settings.EsmEnablementAccount().Get(ctx, settings.GetEsmEnablementAccountRequest{ Etag: etag, }) }, - updateFunc: func(ctx context.Context, w *databricks.AccountClient, t settings.ESMEnablementAccountSetting) (string, error) { + updateFunc: func(ctx context.Context, w *databricks.AccountClient, t settings.EsmEnablementAccountSetting) (string, error) { t.SettingName = "default" - res, err := w.Settings.UpdateESMEnablementAccountSetting(ctx, settings.UpdateESMEnablementAccountSettingRequest{ + res, err := w.Settings.EsmEnablementAccount().Update(ctx, settings.UpdateEsmEnablementAccountSettingRequest{ AllowMissing: true, Setting: t, FieldMask: "esm_enablement_account.value", diff --git a/settings/resource_enhanced_security_monitoring_workspace_setting.go b/settings/resource_enhanced_security_monitoring_workspace_setting.go index 6f5cecf1ab..6093c602cc 100644 --- a/settings/resource_enhanced_security_monitoring_workspace_setting.go +++ b/settings/resource_enhanced_security_monitoring_workspace_setting.go @@ -8,16 +8,16 @@ import ( ) // Enhanced Security Monitoring Workspace level setting -var esmEnablementWorkspaceSetting = workspaceSetting[settings.ESMEnablementSetting]{ - settingStruct: settings.ESMEnablementSetting{}, - readFunc: func(ctx context.Context, w *databricks.WorkspaceClient, etag string) (*settings.ESMEnablementSetting, error) { - return w.Settings.GetESMEnablementSetting(ctx, settings.GetESMEnablementSettingRequest{ +var esmEnablementWorkspaceSetting = workspaceSetting[settings.EsmEnablementSetting]{ + settingStruct: settings.EsmEnablementSetting{}, + readFunc: func(ctx context.Context, w *databricks.WorkspaceClient, etag string) (*settings.EsmEnablementSetting, error) { + return w.Settings.EsmEnablement().Get(ctx, settings.GetEsmEnablementRequest{ Etag: etag, }) }, - updateFunc: func(ctx context.Context, w *databricks.WorkspaceClient, t settings.ESMEnablementSetting) (string, error) { + updateFunc: func(ctx context.Context, w *databricks.WorkspaceClient, t settings.EsmEnablementSetting) (string, error) { t.SettingName = "default" - res, err := w.Settings.UpdateESMEnablementSetting(ctx, settings.UpdateESMEnablementSettingRequest{ + res, err := w.Settings.EsmEnablement().Update(ctx, settings.UpdateEsmEnablementSettingRequest{ AllowMissing: true, Setting: t, FieldMask: "esm_enablement_workspace.value",