Skip to content

Commit

Permalink
Rebase to the latest main and fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Mar 17, 2024
1 parent 70ff44d commit 4b343ec
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions settings/all_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
12 changes: 6 additions & 6 deletions settings/resource_compliance_security_profile_account_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4b343ec

Please sign in to comment.