From 081084ed5331fdbe862df91d05765aee5efbbc7f Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Tue, 22 Jul 2025 19:47:44 +0530 Subject: [PATCH] TEST DO NOT MERGE --- .codegen/_openapi_sha | 2 +- .gitattributes | 7 + account_client.go | 5 + experimental/mocks/mock_account_client.go | 10 + experimental/mocks/mock_workspace_client.go | 28 + .../mock_request_for_access_interface.go | 215 ++++++++ .../compute/mock_libraries_interface.go | 414 ++++++++++++++ .../dashboards/mock_genie_interface.go | 181 +++++++ .../mock_lakeview_embedded_interface.go | 94 ++++ .../mock_query_execution_interface.go | 202 +++++++ .../database/mock_database_interface.go | 511 ++++++++++++++++++ .../service/ml/mock_experiments_interface.go | 59 ++ .../pipelines/mock_pipelines_interface.go | 59 ++ .../mock_account_settings_v2_interface.go | 155 ++++++ .../mock_workspace_settings_v2_interface.go | 155 ++++++ internal/testspecs/service/basicv2/api.go | 42 ++ internal/testspecs/service/basicv2/impl.go | 102 ++++ internal/testspecs/service/basicv2/model.go | 88 +++ service/catalog/api.go | 40 +- service/catalog/impl.go | 40 ++ service/catalog/interface.go | 29 + service/catalog/model.go | 328 +++++++++++ service/compute/api.go | 61 +++ service/compute/impl.go | 84 +++ service/compute/interface.go | 25 + service/compute/model.go | 241 +++++++++ service/dashboards/api.go | 93 +++- service/dashboards/impl.go | 64 +++ service/dashboards/interface.go | 39 ++ service/dashboards/model.go | 172 ++++++ service/database/api.go | 49 ++ service/database/impl.go | 121 +++++ service/database/interface.go | 15 + service/database/model.go | 130 +++++ service/jobs/model.go | 118 ++++ service/ml/api.go | 3 + service/ml/impl.go | 10 + service/ml/interface.go | 3 + service/ml/model.go | 10 + service/pipelines/api.go | 4 + service/pipelines/impl.go | 10 + service/pipelines/interface.go | 5 + service/pipelines/model.go | 18 + service/pkg.go | 19 +- service/qualitymonitorv2/model.go | 39 ++ service/serving/model.go | 3 + service/settings/model.go | 4 +- service/settingsv2/api.go | 54 ++ service/settingsv2/impl.go | 63 +++ service/settingsv2/interface.go | 31 ++ service/settingsv2/model.go | 96 ++++ service/sharing/model.go | 13 + service/vectorsearch/model.go | 42 ++ workspace_client.go | 19 + 54 files changed, 4416 insertions(+), 8 deletions(-) create mode 100644 experimental/mocks/service/catalog/mock_request_for_access_interface.go create mode 100644 experimental/mocks/service/dashboards/mock_query_execution_interface.go create mode 100644 experimental/mocks/service/settingsv2/mock_account_settings_v2_interface.go create mode 100644 experimental/mocks/service/settingsv2/mock_workspace_settings_v2_interface.go create mode 100755 internal/testspecs/service/basicv2/api.go create mode 100755 internal/testspecs/service/basicv2/impl.go create mode 100755 internal/testspecs/service/basicv2/model.go create mode 100755 service/settingsv2/api.go create mode 100755 service/settingsv2/impl.go create mode 100755 service/settingsv2/interface.go create mode 100755 service/settingsv2/model.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 62eb1dbba..3361d4966 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -69902d1abe35bd9e78e0231927bf14d11b383a16 \ No newline at end of file +file:/Users/tanmay.rustagi/emu/universe/bazel-bin/openapi/all-internal.json \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 0ca0850a8..724d00f63 100644 --- a/.gitattributes +++ b/.gitattributes @@ -175,6 +175,9 @@ service/apps/api.go linguist-generated=true service/apps/impl.go linguist-generated=true service/apps/interface.go linguist-generated=true service/apps/model.go linguist-generated=true +service/basicv2/api.go linguist-generated=true +service/basicv2/impl.go linguist-generated=true +service/basicv2/model.go linguist-generated=true service/billing/api.go linguist-generated=true service/billing/impl.go linguist-generated=true service/billing/interface.go linguist-generated=true @@ -244,6 +247,10 @@ service/settings/api.go linguist-generated=true service/settings/impl.go linguist-generated=true service/settings/interface.go linguist-generated=true service/settings/model.go linguist-generated=true +service/settingsv2/api.go linguist-generated=true +service/settingsv2/impl.go linguist-generated=true +service/settingsv2/interface.go linguist-generated=true +service/settingsv2/model.go linguist-generated=true service/sharing/api.go linguist-generated=true service/sharing/impl.go linguist-generated=true service/sharing/interface.go linguist-generated=true diff --git a/account_client.go b/account_client.go index fa466e0f8..0d1552276 100755 --- a/account_client.go +++ b/account_client.go @@ -14,6 +14,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/oauth2" "github.com/databricks/databricks-sdk-go/service/provisioning" "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/databricks/databricks-sdk-go/service/settingsv2" ) type AccountClient struct { @@ -358,6 +359,9 @@ type AccountClient struct { // level. Settings settings.AccountSettingsInterface + // APIs to manage account level settings + SettingsV2 settingsv2.AccountSettingsV2Interface + // These APIs manage storage configurations for this workspace. A root // storage S3 bucket in your account is required to store objects like // cluster logs, notebook revisions, and job results. You can also use the @@ -469,6 +473,7 @@ func NewAccountClient(c ...*Config) (*AccountClient, error) { ServicePrincipalSecrets: oauth2.NewServicePrincipalSecrets(apiClient), ServicePrincipals: iam.NewAccountServicePrincipals(apiClient), Settings: settings.NewAccountSettings(apiClient), + SettingsV2: settingsv2.NewAccountSettingsV2(apiClient), Storage: provisioning.NewStorage(apiClient), StorageCredentials: catalog.NewAccountStorageCredentials(apiClient), UsageDashboards: billing.NewUsageDashboards(apiClient), diff --git a/experimental/mocks/mock_account_client.go b/experimental/mocks/mock_account_client.go index 543978a7b..1cac1ee39 100755 --- a/experimental/mocks/mock_account_client.go +++ b/experimental/mocks/mock_account_client.go @@ -14,6 +14,7 @@ import ( "github.com/databricks/databricks-sdk-go/experimental/mocks/service/oauth2" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/provisioning" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/settings" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/settingsv2" ) type MockAccountClient struct { @@ -53,6 +54,7 @@ func NewMockAccountClient(t interface { ServicePrincipalSecrets: oauth2.NewMockServicePrincipalSecretsInterface(t), ServicePrincipals: iam.NewMockAccountServicePrincipalsInterface(t), Settings: settings.NewMockAccountSettingsInterface(t), + SettingsV2: settingsv2.NewMockAccountSettingsV2Interface(t), Storage: provisioning.NewMockStorageInterface(t), StorageCredentials: catalog.NewMockAccountStorageCredentialsInterface(t), UsageDashboards: billing.NewMockUsageDashboardsInterface(t), @@ -330,6 +332,14 @@ func (m *MockAccountClient) GetMockAccountSettingsAPI() *settings.MockAccountSet return api } +func (m *MockAccountClient) GetMockAccountSettingsV2API() *settingsv2.MockAccountSettingsV2Interface { + api, ok := m.AccountClient.SettingsV2.(*settingsv2.MockAccountSettingsV2Interface) + if !ok { + panic(fmt.Sprintf("expected SettingsV2 to be *settingsv2.MockAccountSettingsV2Interface, actual was %T", m.AccountClient.SettingsV2)) + } + return api +} + func (m *MockAccountClient) GetMockStorageAPI() *provisioning.MockStorageInterface { api, ok := m.AccountClient.Storage.(*provisioning.MockStorageInterface) if !ok { diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index eb808452e..9bc2cee3b 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -25,6 +25,7 @@ import ( "github.com/databricks/databricks-sdk-go/experimental/mocks/service/qualitymonitorv2" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/serving" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/settings" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/settingsv2" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/sharing" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/sql" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/vectorsearch" @@ -119,6 +120,7 @@ func NewMockWorkspaceClient(t interface { QualityMonitors: catalog.NewMockQualityMonitorsInterface(t), Queries: sql.NewMockQueriesInterface(t), QueriesLegacy: sql.NewMockQueriesLegacyInterface(t), + QueryExecution: dashboards.NewMockQueryExecutionInterface(t), QueryHistory: sql.NewMockQueryHistoryInterface(t), QueryVisualizations: sql.NewMockQueryVisualizationsInterface(t), QueryVisualizationsLegacy: sql.NewMockQueryVisualizationsLegacyInterface(t), @@ -128,6 +130,7 @@ func NewMockWorkspaceClient(t interface { RedashConfig: sql.NewMockRedashConfigInterface(t), RegisteredModels: catalog.NewMockRegisteredModelsInterface(t), Repos: workspace.NewMockReposInterface(t), + RequestForAccess: catalog.NewMockRequestForAccessInterface(t), ResourceQuotas: catalog.NewMockResourceQuotasInterface(t), Schemas: catalog.NewMockSchemasInterface(t), Secrets: workspace.NewMockSecretsInterface(t), @@ -153,6 +156,7 @@ func NewMockWorkspaceClient(t interface { Workspace: workspace.NewMockWorkspaceInterface(t), WorkspaceBindings: catalog.NewMockWorkspaceBindingsInterface(t), WorkspaceConf: settings.NewMockWorkspaceConfInterface(t), + WorkspaceSettingsV2: settingsv2.NewMockWorkspaceSettingsV2Interface(t), }, } @@ -929,6 +933,14 @@ func (m *MockWorkspaceClient) GetMockQueriesLegacyAPI() *sql.MockQueriesLegacyIn return api } +func (m *MockWorkspaceClient) GetMockQueryExecutionAPI() *dashboards.MockQueryExecutionInterface { + api, ok := m.WorkspaceClient.QueryExecution.(*dashboards.MockQueryExecutionInterface) + if !ok { + panic(fmt.Sprintf("expected QueryExecution to be *dashboards.MockQueryExecutionInterface, actual was %T", m.WorkspaceClient.QueryExecution)) + } + return api +} + func (m *MockWorkspaceClient) GetMockQueryHistoryAPI() *sql.MockQueryHistoryInterface { api, ok := m.WorkspaceClient.QueryHistory.(*sql.MockQueryHistoryInterface) if !ok { @@ -1001,6 +1013,14 @@ func (m *MockWorkspaceClient) GetMockReposAPI() *workspace.MockReposInterface { return api } +func (m *MockWorkspaceClient) GetMockRequestForAccessAPI() *catalog.MockRequestForAccessInterface { + api, ok := m.WorkspaceClient.RequestForAccess.(*catalog.MockRequestForAccessInterface) + if !ok { + panic(fmt.Sprintf("expected RequestForAccess to be *catalog.MockRequestForAccessInterface, actual was %T", m.WorkspaceClient.RequestForAccess)) + } + return api +} + func (m *MockWorkspaceClient) GetMockResourceQuotasAPI() *catalog.MockResourceQuotasInterface { api, ok := m.WorkspaceClient.ResourceQuotas.(*catalog.MockResourceQuotasInterface) if !ok { @@ -1200,3 +1220,11 @@ func (m *MockWorkspaceClient) GetMockWorkspaceConfAPI() *settings.MockWorkspaceC } return api } + +func (m *MockWorkspaceClient) GetMockWorkspaceSettingsV2API() *settingsv2.MockWorkspaceSettingsV2Interface { + api, ok := m.WorkspaceClient.WorkspaceSettingsV2.(*settingsv2.MockWorkspaceSettingsV2Interface) + if !ok { + panic(fmt.Sprintf("expected WorkspaceSettingsV2 to be *settingsv2.MockWorkspaceSettingsV2Interface, actual was %T", m.WorkspaceClient.WorkspaceSettingsV2)) + } + return api +} diff --git a/experimental/mocks/service/catalog/mock_request_for_access_interface.go b/experimental/mocks/service/catalog/mock_request_for_access_interface.go new file mode 100644 index 000000000..74e552616 --- /dev/null +++ b/experimental/mocks/service/catalog/mock_request_for_access_interface.go @@ -0,0 +1,215 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package catalog + +import ( + context "context" + + catalog "github.com/databricks/databricks-sdk-go/service/catalog" + + mock "github.com/stretchr/testify/mock" +) + +// MockRequestForAccessInterface is an autogenerated mock type for the RequestForAccessInterface type +type MockRequestForAccessInterface struct { + mock.Mock +} + +type MockRequestForAccessInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockRequestForAccessInterface) EXPECT() *MockRequestForAccessInterface_Expecter { + return &MockRequestForAccessInterface_Expecter{mock: &_m.Mock} +} + +// BatchCreateAccessRequests provides a mock function with given fields: ctx, request +func (_m *MockRequestForAccessInterface) BatchCreateAccessRequests(ctx context.Context, request catalog.BatchCreateAccessRequestsRequest) (*catalog.BatchCreateAccessRequestsResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for BatchCreateAccessRequests") + } + + var r0 *catalog.BatchCreateAccessRequestsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.BatchCreateAccessRequestsRequest) (*catalog.BatchCreateAccessRequestsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.BatchCreateAccessRequestsRequest) *catalog.BatchCreateAccessRequestsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.BatchCreateAccessRequestsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.BatchCreateAccessRequestsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockRequestForAccessInterface_BatchCreateAccessRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCreateAccessRequests' +type MockRequestForAccessInterface_BatchCreateAccessRequests_Call struct { + *mock.Call +} + +// BatchCreateAccessRequests is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.BatchCreateAccessRequestsRequest +func (_e *MockRequestForAccessInterface_Expecter) BatchCreateAccessRequests(ctx interface{}, request interface{}) *MockRequestForAccessInterface_BatchCreateAccessRequests_Call { + return &MockRequestForAccessInterface_BatchCreateAccessRequests_Call{Call: _e.mock.On("BatchCreateAccessRequests", ctx, request)} +} + +func (_c *MockRequestForAccessInterface_BatchCreateAccessRequests_Call) Run(run func(ctx context.Context, request catalog.BatchCreateAccessRequestsRequest)) *MockRequestForAccessInterface_BatchCreateAccessRequests_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.BatchCreateAccessRequestsRequest)) + }) + return _c +} + +func (_c *MockRequestForAccessInterface_BatchCreateAccessRequests_Call) Return(_a0 *catalog.BatchCreateAccessRequestsResponse, _a1 error) *MockRequestForAccessInterface_BatchCreateAccessRequests_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockRequestForAccessInterface_BatchCreateAccessRequests_Call) RunAndReturn(run func(context.Context, catalog.BatchCreateAccessRequestsRequest) (*catalog.BatchCreateAccessRequestsResponse, error)) *MockRequestForAccessInterface_BatchCreateAccessRequests_Call { + _c.Call.Return(run) + return _c +} + +// GetAccessRequestDestinations provides a mock function with given fields: ctx, request +func (_m *MockRequestForAccessInterface) GetAccessRequestDestinations(ctx context.Context, request catalog.GetAccessRequestDestinationsRequest) (*catalog.AccessRequestDestinations, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetAccessRequestDestinations") + } + + var r0 *catalog.AccessRequestDestinations + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetAccessRequestDestinationsRequest) (*catalog.AccessRequestDestinations, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetAccessRequestDestinationsRequest) *catalog.AccessRequestDestinations); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.AccessRequestDestinations) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetAccessRequestDestinationsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockRequestForAccessInterface_GetAccessRequestDestinations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAccessRequestDestinations' +type MockRequestForAccessInterface_GetAccessRequestDestinations_Call struct { + *mock.Call +} + +// GetAccessRequestDestinations is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetAccessRequestDestinationsRequest +func (_e *MockRequestForAccessInterface_Expecter) GetAccessRequestDestinations(ctx interface{}, request interface{}) *MockRequestForAccessInterface_GetAccessRequestDestinations_Call { + return &MockRequestForAccessInterface_GetAccessRequestDestinations_Call{Call: _e.mock.On("GetAccessRequestDestinations", ctx, request)} +} + +func (_c *MockRequestForAccessInterface_GetAccessRequestDestinations_Call) Run(run func(ctx context.Context, request catalog.GetAccessRequestDestinationsRequest)) *MockRequestForAccessInterface_GetAccessRequestDestinations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetAccessRequestDestinationsRequest)) + }) + return _c +} + +func (_c *MockRequestForAccessInterface_GetAccessRequestDestinations_Call) Return(_a0 *catalog.AccessRequestDestinations, _a1 error) *MockRequestForAccessInterface_GetAccessRequestDestinations_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockRequestForAccessInterface_GetAccessRequestDestinations_Call) RunAndReturn(run func(context.Context, catalog.GetAccessRequestDestinationsRequest) (*catalog.AccessRequestDestinations, error)) *MockRequestForAccessInterface_GetAccessRequestDestinations_Call { + _c.Call.Return(run) + return _c +} + +// UpdateAccessRequestDestinations provides a mock function with given fields: ctx, request +func (_m *MockRequestForAccessInterface) UpdateAccessRequestDestinations(ctx context.Context, request catalog.UpdateAccessRequestDestinationsRequest) (*catalog.AccessRequestDestinations, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateAccessRequestDestinations") + } + + var r0 *catalog.AccessRequestDestinations + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateAccessRequestDestinationsRequest) (*catalog.AccessRequestDestinations, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.UpdateAccessRequestDestinationsRequest) *catalog.AccessRequestDestinations); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.AccessRequestDestinations) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.UpdateAccessRequestDestinationsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAccessRequestDestinations' +type MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call struct { + *mock.Call +} + +// UpdateAccessRequestDestinations is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.UpdateAccessRequestDestinationsRequest +func (_e *MockRequestForAccessInterface_Expecter) UpdateAccessRequestDestinations(ctx interface{}, request interface{}) *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call { + return &MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call{Call: _e.mock.On("UpdateAccessRequestDestinations", ctx, request)} +} + +func (_c *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call) Run(run func(ctx context.Context, request catalog.UpdateAccessRequestDestinationsRequest)) *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.UpdateAccessRequestDestinationsRequest)) + }) + return _c +} + +func (_c *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call) Return(_a0 *catalog.AccessRequestDestinations, _a1 error) *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call) RunAndReturn(run func(context.Context, catalog.UpdateAccessRequestDestinationsRequest) (*catalog.AccessRequestDestinations, error)) *MockRequestForAccessInterface_UpdateAccessRequestDestinations_Call { + _c.Call.Return(run) + return _c +} + +// NewMockRequestForAccessInterface creates a new instance of MockRequestForAccessInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockRequestForAccessInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockRequestForAccessInterface { + mock := &MockRequestForAccessInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/compute/mock_libraries_interface.go b/experimental/mocks/service/compute/mock_libraries_interface.go index 23304e2d5..c7a5d55ca 100644 --- a/experimental/mocks/service/compute/mock_libraries_interface.go +++ b/experimental/mocks/service/compute/mock_libraries_interface.go @@ -300,6 +300,159 @@ func (_c *MockLibrariesInterface_ClusterStatusByClusterId_Call) RunAndReturn(run return _c } +// CreateDefaultBaseEnvironment provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) CreateDefaultBaseEnvironment(ctx context.Context, request compute.CreateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateDefaultBaseEnvironment") + } + + var r0 *compute.DefaultBaseEnvironment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) *compute.DefaultBaseEnvironment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*compute.DefaultBaseEnvironment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLibrariesInterface_CreateDefaultBaseEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDefaultBaseEnvironment' +type MockLibrariesInterface_CreateDefaultBaseEnvironment_Call struct { + *mock.Call +} + +// CreateDefaultBaseEnvironment is a helper method to define mock.On call +// - ctx context.Context +// - request compute.CreateDefaultBaseEnvironmentRequest +func (_e *MockLibrariesInterface_Expecter) CreateDefaultBaseEnvironment(ctx interface{}, request interface{}) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + return &MockLibrariesInterface_CreateDefaultBaseEnvironment_Call{Call: _e.mock.On("CreateDefaultBaseEnvironment", ctx, request)} +} + +func (_c *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call) Run(run func(ctx context.Context, request compute.CreateDefaultBaseEnvironmentRequest)) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.CreateDefaultBaseEnvironmentRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call) Return(_a0 *compute.DefaultBaseEnvironment, _a1 error) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call) RunAndReturn(run func(context.Context, compute.CreateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)) *MockLibrariesInterface_CreateDefaultBaseEnvironment_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDefaultBaseEnvironment provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) DeleteDefaultBaseEnvironment(ctx context.Context, request compute.DeleteDefaultBaseEnvironmentRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteDefaultBaseEnvironment") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, compute.DeleteDefaultBaseEnvironmentRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDefaultBaseEnvironment' +type MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call struct { + *mock.Call +} + +// DeleteDefaultBaseEnvironment is a helper method to define mock.On call +// - ctx context.Context +// - request compute.DeleteDefaultBaseEnvironmentRequest +func (_e *MockLibrariesInterface_Expecter) DeleteDefaultBaseEnvironment(ctx interface{}, request interface{}) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + return &MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call{Call: _e.mock.On("DeleteDefaultBaseEnvironment", ctx, request)} +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call) Run(run func(ctx context.Context, request compute.DeleteDefaultBaseEnvironmentRequest)) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.DeleteDefaultBaseEnvironmentRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call) Return(_a0 error) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call) RunAndReturn(run func(context.Context, compute.DeleteDefaultBaseEnvironmentRequest) error) *MockLibrariesInterface_DeleteDefaultBaseEnvironment_Call { + _c.Call.Return(run) + return _c +} + +// DeleteDefaultBaseEnvironmentById provides a mock function with given fields: ctx, id +func (_m *MockLibrariesInterface) DeleteDefaultBaseEnvironmentById(ctx context.Context, id string) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for DeleteDefaultBaseEnvironmentById") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDefaultBaseEnvironmentById' +type MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call struct { + *mock.Call +} + +// DeleteDefaultBaseEnvironmentById is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *MockLibrariesInterface_Expecter) DeleteDefaultBaseEnvironmentById(ctx interface{}, id interface{}) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + return &MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call{Call: _e.mock.On("DeleteDefaultBaseEnvironmentById", ctx, id)} +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call) Run(run func(ctx context.Context, id string)) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call) Return(_a0 error) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call) RunAndReturn(run func(context.Context, string) error) *MockLibrariesInterface_DeleteDefaultBaseEnvironmentById_Call { + _c.Call.Return(run) + return _c +} + // Install provides a mock function with given fields: ctx, request func (_m *MockLibrariesInterface) Install(ctx context.Context, request compute.InstallLibraries) error { ret := _m.Called(ctx, request) @@ -347,6 +500,208 @@ func (_c *MockLibrariesInterface_Install_Call) RunAndReturn(run func(context.Con return _c } +// ListDefaultBaseEnvironments provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) ListDefaultBaseEnvironments(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest) listing.Iterator[compute.DefaultBaseEnvironment] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDefaultBaseEnvironments") + } + + var r0 listing.Iterator[compute.DefaultBaseEnvironment] + if rf, ok := ret.Get(0).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) listing.Iterator[compute.DefaultBaseEnvironment]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[compute.DefaultBaseEnvironment]) + } + } + + return r0 +} + +// MockLibrariesInterface_ListDefaultBaseEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDefaultBaseEnvironments' +type MockLibrariesInterface_ListDefaultBaseEnvironments_Call struct { + *mock.Call +} + +// ListDefaultBaseEnvironments is a helper method to define mock.On call +// - ctx context.Context +// - request compute.ListDefaultBaseEnvironmentsRequest +func (_e *MockLibrariesInterface_Expecter) ListDefaultBaseEnvironments(ctx interface{}, request interface{}) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + return &MockLibrariesInterface_ListDefaultBaseEnvironments_Call{Call: _e.mock.On("ListDefaultBaseEnvironments", ctx, request)} +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironments_Call) Run(run func(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest)) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.ListDefaultBaseEnvironmentsRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironments_Call) Return(_a0 listing.Iterator[compute.DefaultBaseEnvironment]) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironments_Call) RunAndReturn(run func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) listing.Iterator[compute.DefaultBaseEnvironment]) *MockLibrariesInterface_ListDefaultBaseEnvironments_Call { + _c.Call.Return(run) + return _c +} + +// ListDefaultBaseEnvironmentsAll provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) ListDefaultBaseEnvironmentsAll(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest) ([]compute.DefaultBaseEnvironment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDefaultBaseEnvironmentsAll") + } + + var r0 []compute.DefaultBaseEnvironment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) ([]compute.DefaultBaseEnvironment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) []compute.DefaultBaseEnvironment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]compute.DefaultBaseEnvironment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDefaultBaseEnvironmentsAll' +type MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call struct { + *mock.Call +} + +// ListDefaultBaseEnvironmentsAll is a helper method to define mock.On call +// - ctx context.Context +// - request compute.ListDefaultBaseEnvironmentsRequest +func (_e *MockLibrariesInterface_Expecter) ListDefaultBaseEnvironmentsAll(ctx interface{}, request interface{}) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + return &MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call{Call: _e.mock.On("ListDefaultBaseEnvironmentsAll", ctx, request)} +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call) Run(run func(ctx context.Context, request compute.ListDefaultBaseEnvironmentsRequest)) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.ListDefaultBaseEnvironmentsRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call) Return(_a0 []compute.DefaultBaseEnvironment, _a1 error) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call) RunAndReturn(run func(context.Context, compute.ListDefaultBaseEnvironmentsRequest) ([]compute.DefaultBaseEnvironment, error)) *MockLibrariesInterface_ListDefaultBaseEnvironmentsAll_Call { + _c.Call.Return(run) + return _c +} + +// RefreshDefaultBaseEnvironments provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) RefreshDefaultBaseEnvironments(ctx context.Context, request compute.RefreshDefaultBaseEnvironmentsRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for RefreshDefaultBaseEnvironments") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, compute.RefreshDefaultBaseEnvironmentsRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshDefaultBaseEnvironments' +type MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call struct { + *mock.Call +} + +// RefreshDefaultBaseEnvironments is a helper method to define mock.On call +// - ctx context.Context +// - request compute.RefreshDefaultBaseEnvironmentsRequest +func (_e *MockLibrariesInterface_Expecter) RefreshDefaultBaseEnvironments(ctx interface{}, request interface{}) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + return &MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call{Call: _e.mock.On("RefreshDefaultBaseEnvironments", ctx, request)} +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call) Run(run func(ctx context.Context, request compute.RefreshDefaultBaseEnvironmentsRequest)) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.RefreshDefaultBaseEnvironmentsRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call) Return(_a0 error) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call) RunAndReturn(run func(context.Context, compute.RefreshDefaultBaseEnvironmentsRequest) error) *MockLibrariesInterface_RefreshDefaultBaseEnvironments_Call { + _c.Call.Return(run) + return _c +} + +// RefreshDefaultBaseEnvironmentsByIds provides a mock function with given fields: ctx, ids +func (_m *MockLibrariesInterface) RefreshDefaultBaseEnvironmentsByIds(ctx context.Context, ids []string) error { + ret := _m.Called(ctx, ids) + + if len(ret) == 0 { + panic("no return value specified for RefreshDefaultBaseEnvironmentsByIds") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []string) error); ok { + r0 = rf(ctx, ids) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshDefaultBaseEnvironmentsByIds' +type MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call struct { + *mock.Call +} + +// RefreshDefaultBaseEnvironmentsByIds is a helper method to define mock.On call +// - ctx context.Context +// - ids []string +func (_e *MockLibrariesInterface_Expecter) RefreshDefaultBaseEnvironmentsByIds(ctx interface{}, ids interface{}) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + return &MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call{Call: _e.mock.On("RefreshDefaultBaseEnvironmentsByIds", ctx, ids)} +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call) Run(run func(ctx context.Context, ids []string)) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]string)) + }) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call) Return(_a0 error) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call) RunAndReturn(run func(context.Context, []string) error) *MockLibrariesInterface_RefreshDefaultBaseEnvironmentsByIds_Call { + _c.Call.Return(run) + return _c +} + // Uninstall provides a mock function with given fields: ctx, request func (_m *MockLibrariesInterface) Uninstall(ctx context.Context, request compute.UninstallLibraries) error { ret := _m.Called(ctx, request) @@ -456,6 +811,65 @@ func (_c *MockLibrariesInterface_UpdateAndWait_Call) RunAndReturn(run func(conte return _c } +// UpdateDefaultBaseEnvironment provides a mock function with given fields: ctx, request +func (_m *MockLibrariesInterface) UpdateDefaultBaseEnvironment(ctx context.Context, request compute.UpdateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateDefaultBaseEnvironment") + } + + var r0 *compute.DefaultBaseEnvironment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) *compute.DefaultBaseEnvironment); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*compute.DefaultBaseEnvironment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDefaultBaseEnvironment' +type MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call struct { + *mock.Call +} + +// UpdateDefaultBaseEnvironment is a helper method to define mock.On call +// - ctx context.Context +// - request compute.UpdateDefaultBaseEnvironmentRequest +func (_e *MockLibrariesInterface_Expecter) UpdateDefaultBaseEnvironment(ctx interface{}, request interface{}) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + return &MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call{Call: _e.mock.On("UpdateDefaultBaseEnvironment", ctx, request)} +} + +func (_c *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call) Run(run func(ctx context.Context, request compute.UpdateDefaultBaseEnvironmentRequest)) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(compute.UpdateDefaultBaseEnvironmentRequest)) + }) + return _c +} + +func (_c *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call) Return(_a0 *compute.DefaultBaseEnvironment, _a1 error) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call) RunAndReturn(run func(context.Context, compute.UpdateDefaultBaseEnvironmentRequest) (*compute.DefaultBaseEnvironment, error)) *MockLibrariesInterface_UpdateDefaultBaseEnvironment_Call { + _c.Call.Return(run) + return _c +} + // NewMockLibrariesInterface creates a new instance of MockLibrariesInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockLibrariesInterface(t interface { diff --git a/experimental/mocks/service/dashboards/mock_genie_interface.go b/experimental/mocks/service/dashboards/mock_genie_interface.go index 19af714a6..cb76b0adf 100644 --- a/experimental/mocks/service/dashboards/mock_genie_interface.go +++ b/experimental/mocks/service/dashboards/mock_genie_interface.go @@ -372,6 +372,187 @@ func (_c *MockGenieInterface_ExecuteMessageQuery_Call) RunAndReturn(run func(con return _c } +// GenerateDownloadFullQueryResult provides a mock function with given fields: ctx, request +func (_m *MockGenieInterface) GenerateDownloadFullQueryResult(ctx context.Context, request dashboards.GenieGenerateDownloadFullQueryResultRequest) (*dashboards.GenieGenerateDownloadFullQueryResultResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GenerateDownloadFullQueryResult") + } + + var r0 *dashboards.GenieGenerateDownloadFullQueryResultResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieGenerateDownloadFullQueryResultRequest) (*dashboards.GenieGenerateDownloadFullQueryResultResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieGenerateDownloadFullQueryResultRequest) *dashboards.GenieGenerateDownloadFullQueryResultResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.GenieGenerateDownloadFullQueryResultResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GenieGenerateDownloadFullQueryResultRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGenieInterface_GenerateDownloadFullQueryResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateDownloadFullQueryResult' +type MockGenieInterface_GenerateDownloadFullQueryResult_Call struct { + *mock.Call +} + +// GenerateDownloadFullQueryResult is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GenieGenerateDownloadFullQueryResultRequest +func (_e *MockGenieInterface_Expecter) GenerateDownloadFullQueryResult(ctx interface{}, request interface{}) *MockGenieInterface_GenerateDownloadFullQueryResult_Call { + return &MockGenieInterface_GenerateDownloadFullQueryResult_Call{Call: _e.mock.On("GenerateDownloadFullQueryResult", ctx, request)} +} + +func (_c *MockGenieInterface_GenerateDownloadFullQueryResult_Call) Run(run func(ctx context.Context, request dashboards.GenieGenerateDownloadFullQueryResultRequest)) *MockGenieInterface_GenerateDownloadFullQueryResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GenieGenerateDownloadFullQueryResultRequest)) + }) + return _c +} + +func (_c *MockGenieInterface_GenerateDownloadFullQueryResult_Call) Return(_a0 *dashboards.GenieGenerateDownloadFullQueryResultResponse, _a1 error) *MockGenieInterface_GenerateDownloadFullQueryResult_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGenieInterface_GenerateDownloadFullQueryResult_Call) RunAndReturn(run func(context.Context, dashboards.GenieGenerateDownloadFullQueryResultRequest) (*dashboards.GenieGenerateDownloadFullQueryResultResponse, error)) *MockGenieInterface_GenerateDownloadFullQueryResult_Call { + _c.Call.Return(run) + return _c +} + +// GetDownloadFullQueryResult provides a mock function with given fields: ctx, request +func (_m *MockGenieInterface) GetDownloadFullQueryResult(ctx context.Context, request dashboards.GenieGetDownloadFullQueryResultRequest) (*dashboards.GenieGetDownloadFullQueryResultResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetDownloadFullQueryResult") + } + + var r0 *dashboards.GenieGetDownloadFullQueryResultResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieGetDownloadFullQueryResultRequest) (*dashboards.GenieGetDownloadFullQueryResultResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GenieGetDownloadFullQueryResultRequest) *dashboards.GenieGetDownloadFullQueryResultResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.GenieGetDownloadFullQueryResultResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GenieGetDownloadFullQueryResultRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGenieInterface_GetDownloadFullQueryResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDownloadFullQueryResult' +type MockGenieInterface_GetDownloadFullQueryResult_Call struct { + *mock.Call +} + +// GetDownloadFullQueryResult is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GenieGetDownloadFullQueryResultRequest +func (_e *MockGenieInterface_Expecter) GetDownloadFullQueryResult(ctx interface{}, request interface{}) *MockGenieInterface_GetDownloadFullQueryResult_Call { + return &MockGenieInterface_GetDownloadFullQueryResult_Call{Call: _e.mock.On("GetDownloadFullQueryResult", ctx, request)} +} + +func (_c *MockGenieInterface_GetDownloadFullQueryResult_Call) Run(run func(ctx context.Context, request dashboards.GenieGetDownloadFullQueryResultRequest)) *MockGenieInterface_GetDownloadFullQueryResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GenieGetDownloadFullQueryResultRequest)) + }) + return _c +} + +func (_c *MockGenieInterface_GetDownloadFullQueryResult_Call) Return(_a0 *dashboards.GenieGetDownloadFullQueryResultResponse, _a1 error) *MockGenieInterface_GetDownloadFullQueryResult_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGenieInterface_GetDownloadFullQueryResult_Call) RunAndReturn(run func(context.Context, dashboards.GenieGetDownloadFullQueryResultRequest) (*dashboards.GenieGetDownloadFullQueryResultResponse, error)) *MockGenieInterface_GetDownloadFullQueryResult_Call { + _c.Call.Return(run) + return _c +} + +// GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId provides a mock function with given fields: ctx, spaceId, conversationId, messageId, attachmentId, downloadId +func (_m *MockGenieInterface) GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId(ctx context.Context, spaceId string, conversationId string, messageId string, attachmentId string, downloadId string) (*dashboards.GenieGetDownloadFullQueryResultResponse, error) { + ret := _m.Called(ctx, spaceId, conversationId, messageId, attachmentId, downloadId) + + if len(ret) == 0 { + panic("no return value specified for GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId") + } + + var r0 *dashboards.GenieGetDownloadFullQueryResultResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) (*dashboards.GenieGetDownloadFullQueryResultResponse, error)); ok { + return rf(ctx, spaceId, conversationId, messageId, attachmentId, downloadId) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) *dashboards.GenieGetDownloadFullQueryResultResponse); ok { + r0 = rf(ctx, spaceId, conversationId, messageId, attachmentId, downloadId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.GenieGetDownloadFullQueryResultResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string) error); ok { + r1 = rf(ctx, spaceId, conversationId, messageId, attachmentId, downloadId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId' +type MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call struct { + *mock.Call +} + +// GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId is a helper method to define mock.On call +// - ctx context.Context +// - spaceId string +// - conversationId string +// - messageId string +// - attachmentId string +// - downloadId string +func (_e *MockGenieInterface_Expecter) GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId(ctx interface{}, spaceId interface{}, conversationId interface{}, messageId interface{}, attachmentId interface{}, downloadId interface{}) *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call { + return &MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call{Call: _e.mock.On("GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId", ctx, spaceId, conversationId, messageId, attachmentId, downloadId)} +} + +func (_c *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call) Run(run func(ctx context.Context, spaceId string, conversationId string, messageId string, attachmentId string, downloadId string)) *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string), args[5].(string)) + }) + return _c +} + +func (_c *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call) Return(_a0 *dashboards.GenieGetDownloadFullQueryResultResponse, _a1 error) *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call) RunAndReturn(run func(context.Context, string, string, string, string, string) (*dashboards.GenieGetDownloadFullQueryResultResponse, error)) *MockGenieInterface_GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId_Call { + _c.Call.Return(run) + return _c +} + // GetMessage provides a mock function with given fields: ctx, request func (_m *MockGenieInterface) GetMessage(ctx context.Context, request dashboards.GenieGetConversationMessageRequest) (*dashboards.GenieMessage, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go b/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go index eea99e9b6..51479c6ef 100644 --- a/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go +++ b/experimental/mocks/service/dashboards/mock_lakeview_embedded_interface.go @@ -22,6 +22,100 @@ func (_m *MockLakeviewEmbeddedInterface) EXPECT() *MockLakeviewEmbeddedInterface return &MockLakeviewEmbeddedInterface_Expecter{mock: &_m.Mock} } +// GetPublishedDashboardEmbedded provides a mock function with given fields: ctx, request +func (_m *MockLakeviewEmbeddedInterface) GetPublishedDashboardEmbedded(ctx context.Context, request dashboards.GetPublishedDashboardEmbeddedRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetPublishedDashboardEmbedded") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetPublishedDashboardEmbeddedRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublishedDashboardEmbedded' +type MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call struct { + *mock.Call +} + +// GetPublishedDashboardEmbedded is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GetPublishedDashboardEmbeddedRequest +func (_e *MockLakeviewEmbeddedInterface_Expecter) GetPublishedDashboardEmbedded(ctx interface{}, request interface{}) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + return &MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call{Call: _e.mock.On("GetPublishedDashboardEmbedded", ctx, request)} +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call) Run(run func(ctx context.Context, request dashboards.GetPublishedDashboardEmbeddedRequest)) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GetPublishedDashboardEmbeddedRequest)) + }) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call) Return(_a0 error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call) RunAndReturn(run func(context.Context, dashboards.GetPublishedDashboardEmbeddedRequest) error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbedded_Call { + _c.Call.Return(run) + return _c +} + +// GetPublishedDashboardEmbeddedByDashboardId provides a mock function with given fields: ctx, dashboardId +func (_m *MockLakeviewEmbeddedInterface) GetPublishedDashboardEmbeddedByDashboardId(ctx context.Context, dashboardId string) error { + ret := _m.Called(ctx, dashboardId) + + if len(ret) == 0 { + panic("no return value specified for GetPublishedDashboardEmbeddedByDashboardId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, dashboardId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublishedDashboardEmbeddedByDashboardId' +type MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call struct { + *mock.Call +} + +// GetPublishedDashboardEmbeddedByDashboardId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +func (_e *MockLakeviewEmbeddedInterface_Expecter) GetPublishedDashboardEmbeddedByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + return &MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call{Call: _e.mock.On("GetPublishedDashboardEmbeddedByDashboardId", ctx, dashboardId)} +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call) Return(_a0 error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call) RunAndReturn(run func(context.Context, string) error) *MockLakeviewEmbeddedInterface_GetPublishedDashboardEmbeddedByDashboardId_Call { + _c.Call.Return(run) + return _c +} + // GetPublishedDashboardTokenInfo provides a mock function with given fields: ctx, request func (_m *MockLakeviewEmbeddedInterface) GetPublishedDashboardTokenInfo(ctx context.Context, request dashboards.GetPublishedDashboardTokenInfoRequest) (*dashboards.GetPublishedDashboardTokenInfoResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/dashboards/mock_query_execution_interface.go b/experimental/mocks/service/dashboards/mock_query_execution_interface.go new file mode 100644 index 000000000..ead40a712 --- /dev/null +++ b/experimental/mocks/service/dashboards/mock_query_execution_interface.go @@ -0,0 +1,202 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package dashboards + +import ( + context "context" + + dashboards "github.com/databricks/databricks-sdk-go/service/dashboards" + mock "github.com/stretchr/testify/mock" +) + +// MockQueryExecutionInterface is an autogenerated mock type for the QueryExecutionInterface type +type MockQueryExecutionInterface struct { + mock.Mock +} + +type MockQueryExecutionInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockQueryExecutionInterface) EXPECT() *MockQueryExecutionInterface_Expecter { + return &MockQueryExecutionInterface_Expecter{mock: &_m.Mock} +} + +// CancelPublishedQueryExecution provides a mock function with given fields: ctx, request +func (_m *MockQueryExecutionInterface) CancelPublishedQueryExecution(ctx context.Context, request dashboards.CancelPublishedQueryExecutionRequest) (*dashboards.CancelQueryExecutionResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CancelPublishedQueryExecution") + } + + var r0 *dashboards.CancelQueryExecutionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) (*dashboards.CancelQueryExecutionResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) *dashboards.CancelQueryExecutionResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.CancelQueryExecutionResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryExecutionInterface_CancelPublishedQueryExecution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelPublishedQueryExecution' +type MockQueryExecutionInterface_CancelPublishedQueryExecution_Call struct { + *mock.Call +} + +// CancelPublishedQueryExecution is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.CancelPublishedQueryExecutionRequest +func (_e *MockQueryExecutionInterface_Expecter) CancelPublishedQueryExecution(ctx interface{}, request interface{}) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + return &MockQueryExecutionInterface_CancelPublishedQueryExecution_Call{Call: _e.mock.On("CancelPublishedQueryExecution", ctx, request)} +} + +func (_c *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call) Run(run func(ctx context.Context, request dashboards.CancelPublishedQueryExecutionRequest)) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.CancelPublishedQueryExecutionRequest)) + }) + return _c +} + +func (_c *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call) Return(_a0 *dashboards.CancelQueryExecutionResponse, _a1 error) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call) RunAndReturn(run func(context.Context, dashboards.CancelPublishedQueryExecutionRequest) (*dashboards.CancelQueryExecutionResponse, error)) *MockQueryExecutionInterface_CancelPublishedQueryExecution_Call { + _c.Call.Return(run) + return _c +} + +// ExecutePublishedDashboardQuery provides a mock function with given fields: ctx, request +func (_m *MockQueryExecutionInterface) ExecutePublishedDashboardQuery(ctx context.Context, request dashboards.ExecutePublishedDashboardQueryRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ExecutePublishedDashboardQuery") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ExecutePublishedDashboardQueryRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecutePublishedDashboardQuery' +type MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call struct { + *mock.Call +} + +// ExecutePublishedDashboardQuery is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.ExecutePublishedDashboardQueryRequest +func (_e *MockQueryExecutionInterface_Expecter) ExecutePublishedDashboardQuery(ctx interface{}, request interface{}) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + return &MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call{Call: _e.mock.On("ExecutePublishedDashboardQuery", ctx, request)} +} + +func (_c *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call) Run(run func(ctx context.Context, request dashboards.ExecutePublishedDashboardQueryRequest)) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.ExecutePublishedDashboardQueryRequest)) + }) + return _c +} + +func (_c *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call) Return(_a0 error) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call) RunAndReturn(run func(context.Context, dashboards.ExecutePublishedDashboardQueryRequest) error) *MockQueryExecutionInterface_ExecutePublishedDashboardQuery_Call { + _c.Call.Return(run) + return _c +} + +// PollPublishedQueryStatus provides a mock function with given fields: ctx, request +func (_m *MockQueryExecutionInterface) PollPublishedQueryStatus(ctx context.Context, request dashboards.PollPublishedQueryStatusRequest) (*dashboards.PollQueryStatusResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for PollPublishedQueryStatus") + } + + var r0 *dashboards.PollQueryStatusResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.PollPublishedQueryStatusRequest) (*dashboards.PollQueryStatusResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.PollPublishedQueryStatusRequest) *dashboards.PollQueryStatusResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.PollQueryStatusResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.PollPublishedQueryStatusRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryExecutionInterface_PollPublishedQueryStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PollPublishedQueryStatus' +type MockQueryExecutionInterface_PollPublishedQueryStatus_Call struct { + *mock.Call +} + +// PollPublishedQueryStatus is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.PollPublishedQueryStatusRequest +func (_e *MockQueryExecutionInterface_Expecter) PollPublishedQueryStatus(ctx interface{}, request interface{}) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + return &MockQueryExecutionInterface_PollPublishedQueryStatus_Call{Call: _e.mock.On("PollPublishedQueryStatus", ctx, request)} +} + +func (_c *MockQueryExecutionInterface_PollPublishedQueryStatus_Call) Run(run func(ctx context.Context, request dashboards.PollPublishedQueryStatusRequest)) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.PollPublishedQueryStatusRequest)) + }) + return _c +} + +func (_c *MockQueryExecutionInterface_PollPublishedQueryStatus_Call) Return(_a0 *dashboards.PollQueryStatusResponse, _a1 error) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryExecutionInterface_PollPublishedQueryStatus_Call) RunAndReturn(run func(context.Context, dashboards.PollPublishedQueryStatusRequest) (*dashboards.PollQueryStatusResponse, error)) *MockQueryExecutionInterface_PollPublishedQueryStatus_Call { + _c.Call.Return(run) + return _c +} + +// NewMockQueryExecutionInterface creates a new instance of MockQueryExecutionInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockQueryExecutionInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockQueryExecutionInterface { + mock := &MockQueryExecutionInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/database/mock_database_interface.go b/experimental/mocks/service/database/mock_database_interface.go index a6e946783..7c602ce22 100644 --- a/experimental/mocks/service/database/mock_database_interface.go +++ b/experimental/mocks/service/database/mock_database_interface.go @@ -790,6 +790,65 @@ func (_c *MockDatabaseInterface_DeleteSyncedDatabaseTableByName_Call) RunAndRetu return _c } +// FailoverDatabaseInstance provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) FailoverDatabaseInstance(ctx context.Context, request database.FailoverDatabaseInstanceRequest) (*database.DatabaseInstance, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for FailoverDatabaseInstance") + } + + var r0 *database.DatabaseInstance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.FailoverDatabaseInstanceRequest) (*database.DatabaseInstance, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.FailoverDatabaseInstanceRequest) *database.DatabaseInstance); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseInstance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.FailoverDatabaseInstanceRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_FailoverDatabaseInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FailoverDatabaseInstance' +type MockDatabaseInterface_FailoverDatabaseInstance_Call struct { + *mock.Call +} + +// FailoverDatabaseInstance is a helper method to define mock.On call +// - ctx context.Context +// - request database.FailoverDatabaseInstanceRequest +func (_e *MockDatabaseInterface_Expecter) FailoverDatabaseInstance(ctx interface{}, request interface{}) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + return &MockDatabaseInterface_FailoverDatabaseInstance_Call{Call: _e.mock.On("FailoverDatabaseInstance", ctx, request)} +} + +func (_c *MockDatabaseInterface_FailoverDatabaseInstance_Call) Run(run func(ctx context.Context, request database.FailoverDatabaseInstanceRequest)) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.FailoverDatabaseInstanceRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_FailoverDatabaseInstance_Call) Return(_a0 *database.DatabaseInstance, _a1 error) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_FailoverDatabaseInstance_Call) RunAndReturn(run func(context.Context, database.FailoverDatabaseInstanceRequest) (*database.DatabaseInstance, error)) *MockDatabaseInterface_FailoverDatabaseInstance_Call { + _c.Call.Return(run) + return _c +} + // FindDatabaseInstanceByUid provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) FindDatabaseInstanceByUid(ctx context.Context, request database.FindDatabaseInstanceByUidRequest) (*database.DatabaseInstance, error) { ret := _m.Called(ctx, request) @@ -1499,6 +1558,173 @@ func (_c *MockDatabaseInterface_GetSyncedDatabaseTableByName_Call) RunAndReturn( return _c } +// ListDatabaseCatalogs provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseCatalogs(ctx context.Context, request database.ListDatabaseCatalogsRequest) listing.Iterator[database.DatabaseCatalog] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseCatalogs") + } + + var r0 listing.Iterator[database.DatabaseCatalog] + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseCatalogsRequest) listing.Iterator[database.DatabaseCatalog]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[database.DatabaseCatalog]) + } + } + + return r0 +} + +// MockDatabaseInterface_ListDatabaseCatalogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseCatalogs' +type MockDatabaseInterface_ListDatabaseCatalogs_Call struct { + *mock.Call +} + +// ListDatabaseCatalogs is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListDatabaseCatalogsRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseCatalogs(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseCatalogs_Call { + return &MockDatabaseInterface_ListDatabaseCatalogs_Call{Call: _e.mock.On("ListDatabaseCatalogs", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogs_Call) Run(run func(ctx context.Context, request database.ListDatabaseCatalogsRequest)) *MockDatabaseInterface_ListDatabaseCatalogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListDatabaseCatalogsRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogs_Call) Return(_a0 listing.Iterator[database.DatabaseCatalog]) *MockDatabaseInterface_ListDatabaseCatalogs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogs_Call) RunAndReturn(run func(context.Context, database.ListDatabaseCatalogsRequest) listing.Iterator[database.DatabaseCatalog]) *MockDatabaseInterface_ListDatabaseCatalogs_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseCatalogsAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListDatabaseCatalogsAll(ctx context.Context, request database.ListDatabaseCatalogsRequest) ([]database.DatabaseCatalog, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseCatalogsAll") + } + + var r0 []database.DatabaseCatalog + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseCatalogsRequest) ([]database.DatabaseCatalog, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.ListDatabaseCatalogsRequest) []database.DatabaseCatalog); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]database.DatabaseCatalog) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.ListDatabaseCatalogsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListDatabaseCatalogsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseCatalogsAll' +type MockDatabaseInterface_ListDatabaseCatalogsAll_Call struct { + *mock.Call +} + +// ListDatabaseCatalogsAll is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListDatabaseCatalogsRequest +func (_e *MockDatabaseInterface_Expecter) ListDatabaseCatalogsAll(ctx interface{}, request interface{}) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + return &MockDatabaseInterface_ListDatabaseCatalogsAll_Call{Call: _e.mock.On("ListDatabaseCatalogsAll", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsAll_Call) Run(run func(ctx context.Context, request database.ListDatabaseCatalogsRequest)) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListDatabaseCatalogsRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsAll_Call) Return(_a0 []database.DatabaseCatalog, _a1 error) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsAll_Call) RunAndReturn(run func(context.Context, database.ListDatabaseCatalogsRequest) ([]database.DatabaseCatalog, error)) *MockDatabaseInterface_ListDatabaseCatalogsAll_Call { + _c.Call.Return(run) + return _c +} + +// ListDatabaseCatalogsByInstanceName provides a mock function with given fields: ctx, instanceName +func (_m *MockDatabaseInterface) ListDatabaseCatalogsByInstanceName(ctx context.Context, instanceName string) (*database.ListDatabaseCatalogsResponse, error) { + ret := _m.Called(ctx, instanceName) + + if len(ret) == 0 { + panic("no return value specified for ListDatabaseCatalogsByInstanceName") + } + + var r0 *database.ListDatabaseCatalogsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*database.ListDatabaseCatalogsResponse, error)); ok { + return rf(ctx, instanceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *database.ListDatabaseCatalogsResponse); ok { + r0 = rf(ctx, instanceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.ListDatabaseCatalogsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, instanceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDatabaseCatalogsByInstanceName' +type MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call struct { + *mock.Call +} + +// ListDatabaseCatalogsByInstanceName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *MockDatabaseInterface_Expecter) ListDatabaseCatalogsByInstanceName(ctx interface{}, instanceName interface{}) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + return &MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call{Call: _e.mock.On("ListDatabaseCatalogsByInstanceName", ctx, instanceName)} +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call) Run(run func(ctx context.Context, instanceName string)) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call) Return(_a0 *database.ListDatabaseCatalogsResponse, _a1 error) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call) RunAndReturn(run func(context.Context, string) (*database.ListDatabaseCatalogsResponse, error)) *MockDatabaseInterface_ListDatabaseCatalogsByInstanceName_Call { + _c.Call.Return(run) + return _c +} + // ListDatabaseInstanceRoles provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) ListDatabaseInstanceRoles(ctx context.Context, request database.ListDatabaseInstanceRolesRequest) listing.Iterator[database.DatabaseInstanceRole] { ret := _m.Called(ctx, request) @@ -1774,6 +2000,232 @@ func (_c *MockDatabaseInterface_ListDatabaseInstancesAll_Call) RunAndReturn(run return _c } +// ListSyncedDatabaseTables provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListSyncedDatabaseTables(ctx context.Context, request database.ListSyncedDatabaseTablesRequest) listing.Iterator[database.SyncedDatabaseTable] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSyncedDatabaseTables") + } + + var r0 listing.Iterator[database.SyncedDatabaseTable] + if rf, ok := ret.Get(0).(func(context.Context, database.ListSyncedDatabaseTablesRequest) listing.Iterator[database.SyncedDatabaseTable]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[database.SyncedDatabaseTable]) + } + } + + return r0 +} + +// MockDatabaseInterface_ListSyncedDatabaseTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSyncedDatabaseTables' +type MockDatabaseInterface_ListSyncedDatabaseTables_Call struct { + *mock.Call +} + +// ListSyncedDatabaseTables is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListSyncedDatabaseTablesRequest +func (_e *MockDatabaseInterface_Expecter) ListSyncedDatabaseTables(ctx interface{}, request interface{}) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + return &MockDatabaseInterface_ListSyncedDatabaseTables_Call{Call: _e.mock.On("ListSyncedDatabaseTables", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTables_Call) Run(run func(ctx context.Context, request database.ListSyncedDatabaseTablesRequest)) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListSyncedDatabaseTablesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTables_Call) Return(_a0 listing.Iterator[database.SyncedDatabaseTable]) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTables_Call) RunAndReturn(run func(context.Context, database.ListSyncedDatabaseTablesRequest) listing.Iterator[database.SyncedDatabaseTable]) *MockDatabaseInterface_ListSyncedDatabaseTables_Call { + _c.Call.Return(run) + return _c +} + +// ListSyncedDatabaseTablesAll provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) ListSyncedDatabaseTablesAll(ctx context.Context, request database.ListSyncedDatabaseTablesRequest) ([]database.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSyncedDatabaseTablesAll") + } + + var r0 []database.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.ListSyncedDatabaseTablesRequest) ([]database.SyncedDatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.ListSyncedDatabaseTablesRequest) []database.SyncedDatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]database.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.ListSyncedDatabaseTablesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSyncedDatabaseTablesAll' +type MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call struct { + *mock.Call +} + +// ListSyncedDatabaseTablesAll is a helper method to define mock.On call +// - ctx context.Context +// - request database.ListSyncedDatabaseTablesRequest +func (_e *MockDatabaseInterface_Expecter) ListSyncedDatabaseTablesAll(ctx interface{}, request interface{}) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + return &MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call{Call: _e.mock.On("ListSyncedDatabaseTablesAll", ctx, request)} +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call) Run(run func(ctx context.Context, request database.ListSyncedDatabaseTablesRequest)) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.ListSyncedDatabaseTablesRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call) Return(_a0 []database.SyncedDatabaseTable, _a1 error) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call) RunAndReturn(run func(context.Context, database.ListSyncedDatabaseTablesRequest) ([]database.SyncedDatabaseTable, error)) *MockDatabaseInterface_ListSyncedDatabaseTablesAll_Call { + _c.Call.Return(run) + return _c +} + +// ListSyncedDatabaseTablesByInstanceName provides a mock function with given fields: ctx, instanceName +func (_m *MockDatabaseInterface) ListSyncedDatabaseTablesByInstanceName(ctx context.Context, instanceName string) (*database.ListSyncedDatabaseTablesResponse, error) { + ret := _m.Called(ctx, instanceName) + + if len(ret) == 0 { + panic("no return value specified for ListSyncedDatabaseTablesByInstanceName") + } + + var r0 *database.ListSyncedDatabaseTablesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*database.ListSyncedDatabaseTablesResponse, error)); ok { + return rf(ctx, instanceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *database.ListSyncedDatabaseTablesResponse); ok { + r0 = rf(ctx, instanceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.ListSyncedDatabaseTablesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, instanceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSyncedDatabaseTablesByInstanceName' +type MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call struct { + *mock.Call +} + +// ListSyncedDatabaseTablesByInstanceName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *MockDatabaseInterface_Expecter) ListSyncedDatabaseTablesByInstanceName(ctx interface{}, instanceName interface{}) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + return &MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call{Call: _e.mock.On("ListSyncedDatabaseTablesByInstanceName", ctx, instanceName)} +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call) Run(run func(ctx context.Context, instanceName string)) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call) Return(_a0 *database.ListSyncedDatabaseTablesResponse, _a1 error) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call) RunAndReturn(run func(context.Context, string) (*database.ListSyncedDatabaseTablesResponse, error)) *MockDatabaseInterface_ListSyncedDatabaseTablesByInstanceName_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDatabaseCatalog provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) UpdateDatabaseCatalog(ctx context.Context, request database.UpdateDatabaseCatalogRequest) (*database.DatabaseCatalog, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateDatabaseCatalog") + } + + var r0 *database.DatabaseCatalog + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateDatabaseCatalogRequest) (*database.DatabaseCatalog, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateDatabaseCatalogRequest) *database.DatabaseCatalog); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.DatabaseCatalog) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.UpdateDatabaseCatalogRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_UpdateDatabaseCatalog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDatabaseCatalog' +type MockDatabaseInterface_UpdateDatabaseCatalog_Call struct { + *mock.Call +} + +// UpdateDatabaseCatalog is a helper method to define mock.On call +// - ctx context.Context +// - request database.UpdateDatabaseCatalogRequest +func (_e *MockDatabaseInterface_Expecter) UpdateDatabaseCatalog(ctx interface{}, request interface{}) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + return &MockDatabaseInterface_UpdateDatabaseCatalog_Call{Call: _e.mock.On("UpdateDatabaseCatalog", ctx, request)} +} + +func (_c *MockDatabaseInterface_UpdateDatabaseCatalog_Call) Run(run func(ctx context.Context, request database.UpdateDatabaseCatalogRequest)) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.UpdateDatabaseCatalogRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_UpdateDatabaseCatalog_Call) Return(_a0 *database.DatabaseCatalog, _a1 error) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_UpdateDatabaseCatalog_Call) RunAndReturn(run func(context.Context, database.UpdateDatabaseCatalogRequest) (*database.DatabaseCatalog, error)) *MockDatabaseInterface_UpdateDatabaseCatalog_Call { + _c.Call.Return(run) + return _c +} + // UpdateDatabaseInstance provides a mock function with given fields: ctx, request func (_m *MockDatabaseInterface) UpdateDatabaseInstance(ctx context.Context, request database.UpdateDatabaseInstanceRequest) (*database.DatabaseInstance, error) { ret := _m.Called(ctx, request) @@ -1833,6 +2285,65 @@ func (_c *MockDatabaseInterface_UpdateDatabaseInstance_Call) RunAndReturn(run fu return _c } +// UpdateSyncedDatabaseTable provides a mock function with given fields: ctx, request +func (_m *MockDatabaseInterface) UpdateSyncedDatabaseTable(ctx context.Context, request database.UpdateSyncedDatabaseTableRequest) (*database.SyncedDatabaseTable, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateSyncedDatabaseTable") + } + + var r0 *database.SyncedDatabaseTable + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateSyncedDatabaseTableRequest) (*database.SyncedDatabaseTable, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, database.UpdateSyncedDatabaseTableRequest) *database.SyncedDatabaseTable); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*database.SyncedDatabaseTable) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, database.UpdateSyncedDatabaseTableRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockDatabaseInterface_UpdateSyncedDatabaseTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSyncedDatabaseTable' +type MockDatabaseInterface_UpdateSyncedDatabaseTable_Call struct { + *mock.Call +} + +// UpdateSyncedDatabaseTable is a helper method to define mock.On call +// - ctx context.Context +// - request database.UpdateSyncedDatabaseTableRequest +func (_e *MockDatabaseInterface_Expecter) UpdateSyncedDatabaseTable(ctx interface{}, request interface{}) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + return &MockDatabaseInterface_UpdateSyncedDatabaseTable_Call{Call: _e.mock.On("UpdateSyncedDatabaseTable", ctx, request)} +} + +func (_c *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call) Run(run func(ctx context.Context, request database.UpdateSyncedDatabaseTableRequest)) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(database.UpdateSyncedDatabaseTableRequest)) + }) + return _c +} + +func (_c *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call) Return(_a0 *database.SyncedDatabaseTable, _a1 error) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call) RunAndReturn(run func(context.Context, database.UpdateSyncedDatabaseTableRequest) (*database.SyncedDatabaseTable, error)) *MockDatabaseInterface_UpdateSyncedDatabaseTable_Call { + _c.Call.Return(run) + return _c +} + // NewMockDatabaseInterface creates a new instance of MockDatabaseInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockDatabaseInterface(t interface { diff --git a/experimental/mocks/service/ml/mock_experiments_interface.go b/experimental/mocks/service/ml/mock_experiments_interface.go index 20e4fce27..89a70eefa 100644 --- a/experimental/mocks/service/ml/mock_experiments_interface.go +++ b/experimental/mocks/service/ml/mock_experiments_interface.go @@ -993,6 +993,65 @@ func (_c *MockExperimentsInterface_GetLoggedModelByModelId_Call) RunAndReturn(ru return _c } +// GetLoggedModels provides a mock function with given fields: ctx, request +func (_m *MockExperimentsInterface) GetLoggedModels(ctx context.Context, request ml.GetLoggedModelsRequest) (*ml.GetLoggedModelsRequestResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetLoggedModels") + } + + var r0 *ml.GetLoggedModelsRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ml.GetLoggedModelsRequest) (*ml.GetLoggedModelsRequestResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, ml.GetLoggedModelsRequest) *ml.GetLoggedModelsRequestResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ml.GetLoggedModelsRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, ml.GetLoggedModelsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockExperimentsInterface_GetLoggedModels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLoggedModels' +type MockExperimentsInterface_GetLoggedModels_Call struct { + *mock.Call +} + +// GetLoggedModels is a helper method to define mock.On call +// - ctx context.Context +// - request ml.GetLoggedModelsRequest +func (_e *MockExperimentsInterface_Expecter) GetLoggedModels(ctx interface{}, request interface{}) *MockExperimentsInterface_GetLoggedModels_Call { + return &MockExperimentsInterface_GetLoggedModels_Call{Call: _e.mock.On("GetLoggedModels", ctx, request)} +} + +func (_c *MockExperimentsInterface_GetLoggedModels_Call) Run(run func(ctx context.Context, request ml.GetLoggedModelsRequest)) *MockExperimentsInterface_GetLoggedModels_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(ml.GetLoggedModelsRequest)) + }) + return _c +} + +func (_c *MockExperimentsInterface_GetLoggedModels_Call) Return(_a0 *ml.GetLoggedModelsRequestResponse, _a1 error) *MockExperimentsInterface_GetLoggedModels_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockExperimentsInterface_GetLoggedModels_Call) RunAndReturn(run func(context.Context, ml.GetLoggedModelsRequest) (*ml.GetLoggedModelsRequestResponse, error)) *MockExperimentsInterface_GetLoggedModels_Call { + _c.Call.Return(run) + return _c +} + // GetPermissionLevels provides a mock function with given fields: ctx, request func (_m *MockExperimentsInterface) GetPermissionLevels(ctx context.Context, request ml.GetExperimentPermissionLevelsRequest) (*ml.GetExperimentPermissionLevelsResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/pipelines/mock_pipelines_interface.go b/experimental/mocks/service/pipelines/mock_pipelines_interface.go index 0ac64dd7a..b392a6200 100644 --- a/experimental/mocks/service/pipelines/mock_pipelines_interface.go +++ b/experimental/mocks/service/pipelines/mock_pipelines_interface.go @@ -1165,6 +1165,65 @@ func (_c *MockPipelinesInterface_PipelineStateInfoNameToPipelineIdMap_Call) RunA return _c } +// RestorePipeline provides a mock function with given fields: ctx, request +func (_m *MockPipelinesInterface) RestorePipeline(ctx context.Context, request pipelines.RestorePipelineRequest) (*pipelines.RestorePipelineRequestResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for RestorePipeline") + } + + var r0 *pipelines.RestorePipelineRequestResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pipelines.RestorePipelineRequest) (*pipelines.RestorePipelineRequestResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, pipelines.RestorePipelineRequest) *pipelines.RestorePipelineRequestResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pipelines.RestorePipelineRequestResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, pipelines.RestorePipelineRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPipelinesInterface_RestorePipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestorePipeline' +type MockPipelinesInterface_RestorePipeline_Call struct { + *mock.Call +} + +// RestorePipeline is a helper method to define mock.On call +// - ctx context.Context +// - request pipelines.RestorePipelineRequest +func (_e *MockPipelinesInterface_Expecter) RestorePipeline(ctx interface{}, request interface{}) *MockPipelinesInterface_RestorePipeline_Call { + return &MockPipelinesInterface_RestorePipeline_Call{Call: _e.mock.On("RestorePipeline", ctx, request)} +} + +func (_c *MockPipelinesInterface_RestorePipeline_Call) Run(run func(ctx context.Context, request pipelines.RestorePipelineRequest)) *MockPipelinesInterface_RestorePipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(pipelines.RestorePipelineRequest)) + }) + return _c +} + +func (_c *MockPipelinesInterface_RestorePipeline_Call) Return(_a0 *pipelines.RestorePipelineRequestResponse, _a1 error) *MockPipelinesInterface_RestorePipeline_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPipelinesInterface_RestorePipeline_Call) RunAndReturn(run func(context.Context, pipelines.RestorePipelineRequest) (*pipelines.RestorePipelineRequestResponse, error)) *MockPipelinesInterface_RestorePipeline_Call { + _c.Call.Return(run) + return _c +} + // SetPermissions provides a mock function with given fields: ctx, request func (_m *MockPipelinesInterface) SetPermissions(ctx context.Context, request pipelines.PipelinePermissionsRequest) (*pipelines.PipelinePermissions, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/settingsv2/mock_account_settings_v2_interface.go b/experimental/mocks/service/settingsv2/mock_account_settings_v2_interface.go new file mode 100644 index 000000000..129b4ffc0 --- /dev/null +++ b/experimental/mocks/service/settingsv2/mock_account_settings_v2_interface.go @@ -0,0 +1,155 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package settingsv2 + +import ( + context "context" + + settingsv2 "github.com/databricks/databricks-sdk-go/service/settingsv2" + mock "github.com/stretchr/testify/mock" +) + +// MockAccountSettingsV2Interface is an autogenerated mock type for the AccountSettingsV2Interface type +type MockAccountSettingsV2Interface struct { + mock.Mock +} + +type MockAccountSettingsV2Interface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAccountSettingsV2Interface) EXPECT() *MockAccountSettingsV2Interface_Expecter { + return &MockAccountSettingsV2Interface_Expecter{mock: &_m.Mock} +} + +// GetPublicAccountSetting provides a mock function with given fields: ctx, request +func (_m *MockAccountSettingsV2Interface) GetPublicAccountSetting(ctx context.Context, request settingsv2.GetPublicAccountSettingRequest) (*settingsv2.Setting, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetPublicAccountSetting") + } + + var r0 *settingsv2.Setting + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.GetPublicAccountSettingRequest) (*settingsv2.Setting, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.GetPublicAccountSettingRequest) *settingsv2.Setting); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settingsv2.Setting) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settingsv2.GetPublicAccountSettingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAccountSettingsV2Interface_GetPublicAccountSetting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublicAccountSetting' +type MockAccountSettingsV2Interface_GetPublicAccountSetting_Call struct { + *mock.Call +} + +// GetPublicAccountSetting is a helper method to define mock.On call +// - ctx context.Context +// - request settingsv2.GetPublicAccountSettingRequest +func (_e *MockAccountSettingsV2Interface_Expecter) GetPublicAccountSetting(ctx interface{}, request interface{}) *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call { + return &MockAccountSettingsV2Interface_GetPublicAccountSetting_Call{Call: _e.mock.On("GetPublicAccountSetting", ctx, request)} +} + +func (_c *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call) Run(run func(ctx context.Context, request settingsv2.GetPublicAccountSettingRequest)) *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settingsv2.GetPublicAccountSettingRequest)) + }) + return _c +} + +func (_c *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call) Return(_a0 *settingsv2.Setting, _a1 error) *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call) RunAndReturn(run func(context.Context, settingsv2.GetPublicAccountSettingRequest) (*settingsv2.Setting, error)) *MockAccountSettingsV2Interface_GetPublicAccountSetting_Call { + _c.Call.Return(run) + return _c +} + +// PatchPublicAccountSetting provides a mock function with given fields: ctx, request +func (_m *MockAccountSettingsV2Interface) PatchPublicAccountSetting(ctx context.Context, request settingsv2.PatchPublicAccountSettingRequest) (*settingsv2.Setting, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for PatchPublicAccountSetting") + } + + var r0 *settingsv2.Setting + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.PatchPublicAccountSettingRequest) (*settingsv2.Setting, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.PatchPublicAccountSettingRequest) *settingsv2.Setting); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settingsv2.Setting) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settingsv2.PatchPublicAccountSettingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PatchPublicAccountSetting' +type MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call struct { + *mock.Call +} + +// PatchPublicAccountSetting is a helper method to define mock.On call +// - ctx context.Context +// - request settingsv2.PatchPublicAccountSettingRequest +func (_e *MockAccountSettingsV2Interface_Expecter) PatchPublicAccountSetting(ctx interface{}, request interface{}) *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call { + return &MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call{Call: _e.mock.On("PatchPublicAccountSetting", ctx, request)} +} + +func (_c *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call) Run(run func(ctx context.Context, request settingsv2.PatchPublicAccountSettingRequest)) *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settingsv2.PatchPublicAccountSettingRequest)) + }) + return _c +} + +func (_c *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call) Return(_a0 *settingsv2.Setting, _a1 error) *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call) RunAndReturn(run func(context.Context, settingsv2.PatchPublicAccountSettingRequest) (*settingsv2.Setting, error)) *MockAccountSettingsV2Interface_PatchPublicAccountSetting_Call { + _c.Call.Return(run) + return _c +} + +// NewMockAccountSettingsV2Interface creates a new instance of MockAccountSettingsV2Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockAccountSettingsV2Interface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAccountSettingsV2Interface { + mock := &MockAccountSettingsV2Interface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/settingsv2/mock_workspace_settings_v2_interface.go b/experimental/mocks/service/settingsv2/mock_workspace_settings_v2_interface.go new file mode 100644 index 000000000..52db1f354 --- /dev/null +++ b/experimental/mocks/service/settingsv2/mock_workspace_settings_v2_interface.go @@ -0,0 +1,155 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package settingsv2 + +import ( + context "context" + + settingsv2 "github.com/databricks/databricks-sdk-go/service/settingsv2" + mock "github.com/stretchr/testify/mock" +) + +// MockWorkspaceSettingsV2Interface is an autogenerated mock type for the WorkspaceSettingsV2Interface type +type MockWorkspaceSettingsV2Interface struct { + mock.Mock +} + +type MockWorkspaceSettingsV2Interface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockWorkspaceSettingsV2Interface) EXPECT() *MockWorkspaceSettingsV2Interface_Expecter { + return &MockWorkspaceSettingsV2Interface_Expecter{mock: &_m.Mock} +} + +// GetPublicWorkspaceSetting provides a mock function with given fields: ctx, request +func (_m *MockWorkspaceSettingsV2Interface) GetPublicWorkspaceSetting(ctx context.Context, request settingsv2.GetPublicWorkspaceSettingRequest) (*settingsv2.Setting, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetPublicWorkspaceSetting") + } + + var r0 *settingsv2.Setting + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.GetPublicWorkspaceSettingRequest) (*settingsv2.Setting, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.GetPublicWorkspaceSettingRequest) *settingsv2.Setting); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settingsv2.Setting) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settingsv2.GetPublicWorkspaceSettingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublicWorkspaceSetting' +type MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call struct { + *mock.Call +} + +// GetPublicWorkspaceSetting is a helper method to define mock.On call +// - ctx context.Context +// - request settingsv2.GetPublicWorkspaceSettingRequest +func (_e *MockWorkspaceSettingsV2Interface_Expecter) GetPublicWorkspaceSetting(ctx interface{}, request interface{}) *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call { + return &MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call{Call: _e.mock.On("GetPublicWorkspaceSetting", ctx, request)} +} + +func (_c *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call) Run(run func(ctx context.Context, request settingsv2.GetPublicWorkspaceSettingRequest)) *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settingsv2.GetPublicWorkspaceSettingRequest)) + }) + return _c +} + +func (_c *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call) Return(_a0 *settingsv2.Setting, _a1 error) *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call) RunAndReturn(run func(context.Context, settingsv2.GetPublicWorkspaceSettingRequest) (*settingsv2.Setting, error)) *MockWorkspaceSettingsV2Interface_GetPublicWorkspaceSetting_Call { + _c.Call.Return(run) + return _c +} + +// PatchPublicWorkspaceSetting provides a mock function with given fields: ctx, request +func (_m *MockWorkspaceSettingsV2Interface) PatchPublicWorkspaceSetting(ctx context.Context, request settingsv2.PatchPublicWorkspaceSettingRequest) (*settingsv2.Setting, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for PatchPublicWorkspaceSetting") + } + + var r0 *settingsv2.Setting + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.PatchPublicWorkspaceSettingRequest) (*settingsv2.Setting, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settingsv2.PatchPublicWorkspaceSettingRequest) *settingsv2.Setting); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settingsv2.Setting) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settingsv2.PatchPublicWorkspaceSettingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PatchPublicWorkspaceSetting' +type MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call struct { + *mock.Call +} + +// PatchPublicWorkspaceSetting is a helper method to define mock.On call +// - ctx context.Context +// - request settingsv2.PatchPublicWorkspaceSettingRequest +func (_e *MockWorkspaceSettingsV2Interface_Expecter) PatchPublicWorkspaceSetting(ctx interface{}, request interface{}) *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call { + return &MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call{Call: _e.mock.On("PatchPublicWorkspaceSetting", ctx, request)} +} + +func (_c *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call) Run(run func(ctx context.Context, request settingsv2.PatchPublicWorkspaceSettingRequest)) *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settingsv2.PatchPublicWorkspaceSettingRequest)) + }) + return _c +} + +func (_c *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call) Return(_a0 *settingsv2.Setting, _a1 error) *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call) RunAndReturn(run func(context.Context, settingsv2.PatchPublicWorkspaceSettingRequest) (*settingsv2.Setting, error)) *MockWorkspaceSettingsV2Interface_PatchPublicWorkspaceSetting_Call { + _c.Call.Return(run) + return _c +} + +// NewMockWorkspaceSettingsV2Interface creates a new instance of MockWorkspaceSettingsV2Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockWorkspaceSettingsV2Interface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockWorkspaceSettingsV2Interface { + mock := &MockWorkspaceSettingsV2Interface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/testspecs/service/basicv2/api.go b/internal/testspecs/service/basicv2/api.go new file mode 100755 index 000000000..957fa38d7 --- /dev/null +++ b/internal/testspecs/service/basicv2/api.go @@ -0,0 +1,42 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// Lorem Ipsum +package basicv2 + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" +) + +type BasicV2Interface interface { + CreateBasic(ctx context.Context, request CreateBasicRequest) (*Basic, error) + + DeleteBasic(ctx context.Context, request DeleteBasicRequest) error + + GetBasic(ctx context.Context, request GetBasicRequest) (*Basic, error) + + // + // This method is generated by Databricks SDK Code Generator. + ListBasics(ctx context.Context, request ListBasicsRequest) listing.Iterator[Basic] + + // + // This method is generated by Databricks SDK Code Generator. + ListBasicsAll(ctx context.Context, request ListBasicsRequest) ([]Basic, error) + + UpdateBasic(ctx context.Context, request UpdateBasicRequest) (*Basic, error) +} + +func NewBasicV2(client *client.DatabricksClient) *BasicV2API { + return &BasicV2API{ + basicV2Impl: basicV2Impl{ + client: client, + }, + } +} + +// Lorem Ipsum +type BasicV2API struct { + basicV2Impl +} diff --git a/internal/testspecs/service/basicv2/impl.go b/internal/testspecs/service/basicv2/impl.go new file mode 100755 index 000000000..3b14c303a --- /dev/null +++ b/internal/testspecs/service/basicv2/impl.go @@ -0,0 +1,102 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package basicv2 + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" + "golang.org/x/exp/slices" +) + +// unexported type that holds implementations of just BasicV2 API methods +type basicV2Impl struct { + client *client.DatabricksClient +} + +func (a *basicV2Impl) CreateBasic(ctx context.Context, request CreateBasicRequest) (*Basic, error) { + var basic Basic + path := "/api/2.0/basic" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Basic, &basic) + return &basic, err +} + +func (a *basicV2Impl) DeleteBasic(ctx context.Context, request DeleteBasicRequest) error { + path := fmt.Sprintf("/api/2.0/basic/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + +func (a *basicV2Impl) GetBasic(ctx context.Context, request GetBasicRequest) (*Basic, error) { + var basic Basic + path := fmt.Sprintf("/api/2.0/basic/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &basic) + return &basic, err +} + +func (a *basicV2Impl) ListBasics(ctx context.Context, request ListBasicsRequest) listing.Iterator[Basic] { + + getNextPage := func(ctx context.Context, req ListBasicsRequest) (*ListBasicsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListBasics(ctx, req) + } + getItems := func(resp *ListBasicsResponse) []Basic { + return resp.Basics + } + getNextReq := func(resp *ListBasicsResponse) *ListBasicsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +func (a *basicV2Impl) ListBasicsAll(ctx context.Context, request ListBasicsRequest) ([]Basic, error) { + iterator := a.ListBasics(ctx, request) + return listing.ToSlice[Basic](ctx, iterator) +} + +func (a *basicV2Impl) internalListBasics(ctx context.Context, request ListBasicsRequest) (*ListBasicsResponse, error) { + var listBasicsResponse ListBasicsResponse + path := "/api/2.0/basics" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listBasicsResponse) + return &listBasicsResponse, err +} + +func (a *basicV2Impl) UpdateBasic(ctx context.Context, request UpdateBasicRequest) (*Basic, error) { + var basic Basic + path := fmt.Sprintf("/api/2.0/basic/%v", request.Name) + queryParams := make(map[string]any) + if request.UpdateMask != "" || slices.Contains(request.ForceSendFields, "UpdateMask") { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Basic, &basic) + return &basic, err +} diff --git a/internal/testspecs/service/basicv2/model.go b/internal/testspecs/service/basicv2/model.go new file mode 100755 index 000000000..ba1f17016 --- /dev/null +++ b/internal/testspecs/service/basicv2/model.go @@ -0,0 +1,88 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package basicv2 + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +type Basic struct { + // Name of the Resource. Must contain only: - alphanumeric characters - + // underscores - hyphens + // + // Note: The name must be unique within the scope of the resource. + Name string `json:"name"` +} + +type CreateBasicRequest struct { + // Basic information about the resource + Basic Basic `json:"basic"` +} + +type DeleteBasicRequest struct { + // The name of the resource + Name string `json:"-" url:"-"` +} + +type GetBasicRequest struct { + // The name of the resource + Name string `json:"-" url:"-"` +} + +type ListBasicsRequest struct { + // Page size for pagination + PageSize int `json:"-" url:"page_size,omitempty"` + // Page token for pagination + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListBasicsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListBasicsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListBasicsResponse struct { + // List of resources + Basics []Basic `json:"basics,omitempty"` + // The next page token for pagination + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListBasicsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListBasicsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type UpdateBasicRequest struct { + // Basic information about the resource + Basic Basic `json:"basic"` + // The name of the resource + Name string `json:"-" url:"-"` + // The field mask must be a single string, with multiple fields separated by + // commas (no spaces). The field path is relative to the resource object, + // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). + // Specification of elements in sequence or map fields is not allowed, as + // only the entire collection field can be specified. Field names must + // exactly match the resource field names. + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *UpdateBasicRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateBasicRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} diff --git a/service/catalog/api.go b/service/catalog/api.go index 6f954a76f..a16504a14 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Artifact Allowlists, Catalogs, Connections, Credentials, External Lineage, External Locations, External Metadata, Functions, Grants, Metastores, Model Versions, Online Tables, Quality Monitors, Registered Models, Resource Quotas, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Temporary Table Credentials, Volumes, Workspace Bindings, etc. +// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Artifact Allowlists, Catalogs, Connections, Credentials, External Lineage, External Locations, External Metadata, Functions, Grants, Metastores, Model Versions, Online Tables, Quality Monitors, Registered Models, Request For Access, Resource Quotas, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Temporary Table Credentials, Volumes, Workspace Bindings, etc. package catalog import ( @@ -2046,6 +2046,44 @@ func (a *RegisteredModelsAPI) GetByName(ctx context.Context, name string) (*Regi return &alternatives[0], nil } +type RequestForAccessInterface interface { + + // Creates an access request for a Unity Catalog permissions for a specified + // principal on a securable object. This Batch API can take in multiple + // principals, securable objects, and permissions as the input and returns the + // access request destinations for each. + BatchCreateAccessRequests(ctx context.Context, request BatchCreateAccessRequestsRequest) (*BatchCreateAccessRequestsResponse, error) + + // Gets an array of access request destinations for the specified securable. Any + // caller can see URL destinations or the destinations on the metastore. + // Otherwise, only those with **BROWSE** permissions on the securable can see + // destinations. + GetAccessRequestDestinations(ctx context.Context, request GetAccessRequestDestinationsRequest) (*AccessRequestDestinations, error) + + // Updates the access request destinations for the given securable. The caller + // must be a metastore admin, the owner of the securable, or a user that has the + // **MANAGE** privilege on the securable in order to assign destinations. + UpdateAccessRequestDestinations(ctx context.Context, request UpdateAccessRequestDestinationsRequest) (*AccessRequestDestinations, error) +} + +func NewRequestForAccess(client *client.DatabricksClient) *RequestForAccessAPI { + return &RequestForAccessAPI{ + requestForAccessImpl: requestForAccessImpl{ + client: client, + }, + } +} + +// Request for Access enables customers to request access to and manage access +// request destinations for Unity Catalog securables. +// +// These APIs provide a standardized way to update, get, and request to access +// request destinations. Fine-grained authorization ensures that only users with +// appropriate permissions can manage access request destinations. +type RequestForAccessAPI struct { + requestForAccessImpl +} + type ResourceQuotasInterface interface { // The GetQuota API returns usage information for a single resource quota, diff --git a/service/catalog/impl.go b/service/catalog/impl.go index e6ebc68f0..74c11228c 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -1500,6 +1500,46 @@ func (a *registeredModelsImpl) Update(ctx context.Context, request UpdateRegiste return ®isteredModelInfo, err } +// unexported type that holds implementations of just RequestForAccess API methods +type requestForAccessImpl struct { + client *client.DatabricksClient +} + +func (a *requestForAccessImpl) BatchCreateAccessRequests(ctx context.Context, request BatchCreateAccessRequestsRequest) (*BatchCreateAccessRequestsResponse, error) { + var batchCreateAccessRequestsResponse BatchCreateAccessRequestsResponse + path := "/api/3.0/rfa/requests" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &batchCreateAccessRequestsResponse) + return &batchCreateAccessRequestsResponse, err +} + +func (a *requestForAccessImpl) GetAccessRequestDestinations(ctx context.Context, request GetAccessRequestDestinationsRequest) (*AccessRequestDestinations, error) { + var accessRequestDestinations AccessRequestDestinations + path := fmt.Sprintf("/api/3.0/rfa/destinations/%v/%v", request.SecurableType, request.FullName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accessRequestDestinations) + return &accessRequestDestinations, err +} + +func (a *requestForAccessImpl) UpdateAccessRequestDestinations(ctx context.Context, request UpdateAccessRequestDestinationsRequest) (*AccessRequestDestinations, error) { + var accessRequestDestinations AccessRequestDestinations + path := "/api/3.0/rfa/destinations" + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.AccessRequestDestinations, &accessRequestDestinations) + return &accessRequestDestinations, err +} + // unexported type that holds implementations of just ResourceQuotas API methods type resourceQuotasImpl struct { client *client.DatabricksClient diff --git a/service/catalog/interface.go b/service/catalog/interface.go index 762cf70bc..245fc7edc 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -841,6 +841,35 @@ type RegisteredModelsService interface { Update(ctx context.Context, request UpdateRegisteredModelRequest) (*RegisteredModelInfo, error) } +// Request for Access enables customers to request access to and manage access +// request destinations for Unity Catalog securables. +// +// These APIs provide a standardized way to update, get, and request to access +// request destinations. Fine-grained authorization ensures that only users with +// appropriate permissions can manage access request destinations. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type RequestForAccessService interface { + + // Creates an access request for a Unity Catalog permissions for a specified + // principal on a securable object. This Batch API can take in multiple + // principals, securable objects, and permissions as the input and returns + // the access request destinations for each. + BatchCreateAccessRequests(ctx context.Context, request BatchCreateAccessRequestsRequest) (*BatchCreateAccessRequestsResponse, error) + + // Gets an array of access request destinations for the specified securable. + // Any caller can see URL destinations or the destinations on the metastore. + // Otherwise, only those with **BROWSE** permissions on the securable can + // see destinations. + GetAccessRequestDestinations(ctx context.Context, request GetAccessRequestDestinationsRequest) (*AccessRequestDestinations, error) + + // Updates the access request destinations for the given securable. The + // caller must be a metastore admin, the owner of the securable, or a user + // that has the **MANAGE** privilege on the securable in order to assign + // destinations. + UpdateAccessRequestDestinations(ctx context.Context, request UpdateAccessRequestDestinationsRequest) (*AccessRequestDestinations, error) +} + // Unity Catalog enforces resource quotas on all securable objects, which limits // the number of resources that can be created. Quotas are expressed in terms of // a resource type and a parent (for example, tables per metastore or schemas diff --git a/service/catalog/model.go b/service/catalog/model.go index 3b1b27878..00fbc3cf4 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -8,6 +8,28 @@ import ( "github.com/databricks/databricks-sdk-go/marshal" ) +type AccessRequestDestinations struct { + // Indicates whether any destinations are hidden from the caller due to a + // lack of permissions. This value is true if the caller does not have + // permission to see all destinations. + AreAnyDestinationsHidden bool `json:"are_any_destinations_hidden,omitempty"` + // The access request destinations for the securable. + Destinations []NotificationDestination `json:"destinations"` + // The securable for which the access request destinations are being + // retrieved. + Securable Securable `json:"securable"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *AccessRequestDestinations) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s AccessRequestDestinations) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type AccountsCreateMetastore struct { MetastoreInfo *CreateMetastore `json:"metastore_info,omitempty"` } @@ -383,6 +405,19 @@ func (s AzureUserDelegationSas) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type BatchCreateAccessRequestsRequest struct { + // A list of individual access requests, where each request corresponds to a + // set of permissions being requested on a list of securables for a + // specified principal. + Requests []CreateAccessRequest `json:"requests,omitempty"` +} + +type BatchCreateAccessRequestsResponse struct { + // The access request destinations for each securable object the principal + // requested. + Responses []CreateAccessRequestResponse `json:"responses,omitempty"` +} + type CancelRefreshRequest struct { // ID of the refresh. RefreshId string `json:"-" url:"-"` @@ -916,6 +951,48 @@ func (s ContinuousUpdateStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateAccessRequest struct { + // Optional. The principal this request is for. Empty `behalf_of` defaults + // to the requester's identity. + BehalfOf *Principal `json:"behalf_of,omitempty"` + // Optional. Comment associated with the request. + Comment string `json:"comment,omitempty"` + // List of securables and their corresponding requested UC privileges. + SecurablePermissions []SecurablePermissions `json:"securable_permissions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateAccessRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateAccessRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateAccessRequestResponse struct { + // Indicates whether any destinations are hidden from the caller due to a + // lack of permissions. This value is true if the caller does not have + // permission to see all destinations. + AreAnyDestinationsHidden bool `json:"are_any_destinations_hidden,omitempty"` + // The principal the request was made on behalf of. + BehalfOf *Principal `json:"behalf_of,omitempty"` + // The access request destinations for all the securables the principal + // requested. + Destinations []SecurableNotificationDestinations `json:"destinations,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateAccessRequestResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateAccessRequestResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type CreateCatalog struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` @@ -2166,6 +2243,52 @@ type DependencyList struct { Dependencies []Dependency `json:"dependencies,omitempty"` } +type DestinationType string + +const DestinationTypeEmail DestinationType = `EMAIL` + +const DestinationTypeGenericWebhook DestinationType = `GENERIC_WEBHOOK` + +const DestinationTypeMicrosoftTeams DestinationType = `MICROSOFT_TEAMS` + +const DestinationTypeSlack DestinationType = `SLACK` + +const DestinationTypeUrl DestinationType = `URL` + +// String representation for [fmt.Print] +func (f *DestinationType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DestinationType) Set(v string) error { + switch v { + case `EMAIL`, `GENERIC_WEBHOOK`, `MICROSOFT_TEAMS`, `SLACK`, `URL`: + *f = DestinationType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "EMAIL", "GENERIC_WEBHOOK", "MICROSOFT_TEAMS", "SLACK", "URL"`, v) + } +} + +// Values returns all possible values for DestinationType. +// +// There is no guarantee on the order of the values in the slice. +func (f *DestinationType) Values() []DestinationType { + return []DestinationType{ + DestinationTypeEmail, + DestinationTypeGenericWebhook, + DestinationTypeMicrosoftTeams, + DestinationTypeSlack, + DestinationTypeUrl, + } +} + +// Type always returns DestinationType to satisfy [pflag.Value] interface +func (f *DestinationType) Type() string { + return "DestinationType" +} + type DisableRequest struct { // The metastore ID under which the system schema lives. MetastoreId string `json:"-" url:"-"` @@ -3215,6 +3338,12 @@ func (s GenerateTemporaryTableCredentialResponse) MarshalJSON() ([]byte, error) return marshal.Marshal(s) } +type GetAccessRequestDestinationsRequest struct { + FullName string `json:"-" url:"-"` + + SecurableType string `json:"-" url:"-"` +} + type GetAccountMetastoreAssignmentRequest struct { // Workspace ID. WorkspaceId int64 `json:"-" url:"-"` @@ -3396,6 +3525,9 @@ func (s GetFunctionRequest) MarshalJSON() ([]byte, error) { type GetGrantRequest struct { // Full name of securable. FullName string `json:"-" url:"-"` + // Optional. If true, also return privilege assignments whose principals + // have been deleted. + IncludeDeletedPrincipals bool `json:"-" url:"include_deleted_principals,omitempty"` // Specifies the maximum number of privileges to return (page length). Every // PrivilegeAssignment present in a single page response is guaranteed to // contain all the privileges granted on the requested Securable for the @@ -5233,6 +5365,26 @@ type NamedTableConstraint struct { Name string `json:"name"` } +type NotificationDestination struct { + // The unique identifier for the destination. + DestinationId string `json:"destination_id,omitempty"` + // The type of the destination. + DestinationType DestinationType `json:"destination_type,omitempty"` + // This field is used to denote whether the destination is the email of the + // owner of the securable object. + SpecialDestination SpecialDestination `json:"special_destination,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *NotificationDestination) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s NotificationDestination) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Online Table information. type OnlineTable struct { // Full three-part (catalog, schema, table) name of the table. @@ -5551,6 +5703,16 @@ type PermissionsChange struct { // The principal whose privileges we are changing. Only one of principal or // principal_id should be specified, never both at the same time. Principal string `json:"principal,omitempty"` + // An opaque internal ID that identifies the principal whose privileges + // should be removed. + // + // This field is intended for removing privileges associated with a deleted + // user. When set, only the entries specified in the remove field are + // processed; any entries in the add field will be rejected. + // + // Only one of principal or principal_id should be specified, never both at + // the same time. + PrincipalId int64 `json:"principal_id,omitempty"` // The set of privileges to remove. Remove []Privilege `json:"remove,omitempty"` @@ -5612,6 +5774,63 @@ func (s PrimaryKeyConstraint) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type Principal struct { + // Databricks user, group or service principal ID. + Id string `json:"id,omitempty"` + + PrincipalType PrincipalType `json:"principal_type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Principal) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Principal) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type PrincipalType string + +const PrincipalTypeGroupPrincipal PrincipalType = `GROUP_PRINCIPAL` + +const PrincipalTypeServicePrincipal PrincipalType = `SERVICE_PRINCIPAL` + +const PrincipalTypeUserPrincipal PrincipalType = `USER_PRINCIPAL` + +// String representation for [fmt.Print] +func (f *PrincipalType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *PrincipalType) Set(v string) error { + switch v { + case `GROUP_PRINCIPAL`, `SERVICE_PRINCIPAL`, `USER_PRINCIPAL`: + *f = PrincipalType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "GROUP_PRINCIPAL", "SERVICE_PRINCIPAL", "USER_PRINCIPAL"`, v) + } +} + +// Values returns all possible values for PrincipalType. +// +// There is no guarantee on the order of the values in the slice. +func (f *PrincipalType) Values() []PrincipalType { + return []PrincipalType{ + PrincipalTypeGroupPrincipal, + PrincipalTypeServicePrincipal, + PrincipalTypeUserPrincipal, + } +} + +// Type always returns PrincipalType to satisfy [pflag.Value] interface +func (f *PrincipalType) Type() string { + return "PrincipalType" +} + type Privilege string const PrivilegeAccess Privilege = `ACCESS` @@ -5794,6 +6013,9 @@ type PrivilegeAssignment struct { // The principal (user email address or group name). For deleted principals, // `principal` is empty while `principal_id` is populated. Principal string `json:"principal,omitempty"` + // Unique identifier of the principal. For active principals, both + // `principal` and `principal_id` are present. + PrincipalId int64 `json:"principal_id,omitempty"` // The privileges assigned to the principal. Privileges []Privilege `json:"privileges,omitempty"` @@ -6093,6 +6315,30 @@ func (s SchemaInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Generic definition of a securable, which is uniquely defined in a metastore +// by its type and full name. +type Securable struct { + // Required. The full name of the catalog/schema/table. Optional if + // resource_name is present. + FullName string `json:"full_name,omitempty"` + // Optional. The name of the Share object that contains the securable when + // the securable is getting shared in D2D Delta Sharing.s + ProviderShare string `json:"provider_share,omitempty"` + // Required. The type of securable (catalog/schema/table). Optional if + // resource_name is present. + Type SecurableType `json:"type,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Securable) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Securable) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type SecurableKind string const SecurableKindTableDbStorage SecurableKind = `TABLE_DB_STORAGE` @@ -6318,6 +6564,22 @@ type SecurableKindManifest struct { SecurableType SecurableType `json:"securable_type,omitempty"` } +type SecurableNotificationDestinations struct { + // The access request destinations for the securable. + NotificationDestinations *NotificationDestination `json:"notification_destinations,omitempty"` + // The securable for which the access request destinations are being + // retrieved. + Securable *Securable `json:"securable,omitempty"` +} + +type SecurablePermissions struct { + // List of requested Unity Catalog permissions. + Permission []string `json:"permission,omitempty"` + // The securable for which the access request destinations are being + // requested. + Securable *Securable `json:"securable,omitempty"` +} + // The type of Unity Catalog securable. type SecurableType string @@ -6433,6 +6695,52 @@ type SetRegisteredModelAliasRequest struct { VersionNum int `json:"version_num"` } +type SpecialDestination string + +const SpecialDestinationSpecialDestinationCatalogOwner SpecialDestination = `SPECIAL_DESTINATION_CATALOG_OWNER` + +const SpecialDestinationSpecialDestinationConnectionOwner SpecialDestination = `SPECIAL_DESTINATION_CONNECTION_OWNER` + +const SpecialDestinationSpecialDestinationCredentialOwner SpecialDestination = `SPECIAL_DESTINATION_CREDENTIAL_OWNER` + +const SpecialDestinationSpecialDestinationExternalLocationOwner SpecialDestination = `SPECIAL_DESTINATION_EXTERNAL_LOCATION_OWNER` + +const SpecialDestinationSpecialDestinationMetastoreOwner SpecialDestination = `SPECIAL_DESTINATION_METASTORE_OWNER` + +// String representation for [fmt.Print] +func (f *SpecialDestination) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SpecialDestination) Set(v string) error { + switch v { + case `SPECIAL_DESTINATION_CATALOG_OWNER`, `SPECIAL_DESTINATION_CONNECTION_OWNER`, `SPECIAL_DESTINATION_CREDENTIAL_OWNER`, `SPECIAL_DESTINATION_EXTERNAL_LOCATION_OWNER`, `SPECIAL_DESTINATION_METASTORE_OWNER`: + *f = SpecialDestination(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "SPECIAL_DESTINATION_CATALOG_OWNER", "SPECIAL_DESTINATION_CONNECTION_OWNER", "SPECIAL_DESTINATION_CREDENTIAL_OWNER", "SPECIAL_DESTINATION_EXTERNAL_LOCATION_OWNER", "SPECIAL_DESTINATION_METASTORE_OWNER"`, v) + } +} + +// Values returns all possible values for SpecialDestination. +// +// There is no guarantee on the order of the values in the slice. +func (f *SpecialDestination) Values() []SpecialDestination { + return []SpecialDestination{ + SpecialDestinationSpecialDestinationCatalogOwner, + SpecialDestinationSpecialDestinationConnectionOwner, + SpecialDestinationSpecialDestinationCredentialOwner, + SpecialDestinationSpecialDestinationExternalLocationOwner, + SpecialDestinationSpecialDestinationMetastoreOwner, + } +} + +// Type always returns SpecialDestination to satisfy [pflag.Value] interface +func (f *SpecialDestination) Type() string { + return "SpecialDestination" +} + // Server-Side Encryption properties for clients communicating with AWS s3. type SseEncryptionDetails struct { // Sets the value of the 'x-amz-server-side-encryption' header in S3 @@ -6967,6 +7275,26 @@ type UnassignRequest struct { WorkspaceId int64 `json:"-" url:"-"` } +type UpdateAccessRequestDestinationsRequest struct { + // For each destination, if **special_destination** is defined, then a + // **destination_id** is not required. Futhermore, the **destination_type** + // of a **special_destination** is always **EMAIL**. Otherwise, a + // **destination_id** and **destination_type** must be defined. + AccessRequestDestinations AccessRequestDestinations `json:"access_request_destinations"` + // The field mask must be a single string, with multiple fields separated by + // commas (no spaces). The field path is relative to the resource object, + // using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`). + // Specification of elements in sequence or map fields is not allowed, as + // only the entire collection field can be specified. Field names must + // exactly match the resource field names. + // + // A field mask of `*` indicates full replacement. It’s recommended to + // always explicitly list the fields being updated and avoid using `*` + // wildcards, as it can lead to unintended results if the API changes in the + // future. + UpdateMask string `json:"-" url:"update_mask"` +} + type UpdateCatalog struct { // User-provided free-form text description. Comment string `json:"comment,omitempty"` diff --git a/service/compute/api.go b/service/compute/api.go index ec56e450a..bc6c88c82 100755 --- a/service/compute/api.go +++ b/service/compute/api.go @@ -1999,14 +1999,57 @@ type LibrariesInterface interface { // particular order, are returned last. ClusterStatusByClusterId(ctx context.Context, clusterId string) (*ClusterLibraryStatuses, error) + // Create a default base environment within workspaces to define the environment + // version and a list of dependencies to be used in serverless notebooks and + // jobs. This process will asynchronously generate a cache to optimize + // dependency resolution. + CreateDefaultBaseEnvironment(ctx context.Context, request CreateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) + + // Delete the default base environment given an ID. The default base environment + // may be used by downstream workloads. Please ensure that the deletion is + // intentional. + DeleteDefaultBaseEnvironment(ctx context.Context, request DeleteDefaultBaseEnvironmentRequest) error + + // Delete the default base environment given an ID. The default base environment + // may be used by downstream workloads. Please ensure that the deletion is + // intentional. + DeleteDefaultBaseEnvironmentById(ctx context.Context, id string) error + // Add libraries to install on a cluster. The installation is asynchronous; it // happens in the background after the completion of this request. Install(ctx context.Context, request InstallLibraries) error + // List default base environments defined in the workspaces for the requested + // user. + // + // This method is generated by Databricks SDK Code Generator. + ListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) listing.Iterator[DefaultBaseEnvironment] + + // List default base environments defined in the workspaces for the requested + // user. + // + // This method is generated by Databricks SDK Code Generator. + ListDefaultBaseEnvironmentsAll(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) ([]DefaultBaseEnvironment, error) + + // Refresh the cached default base environments for the given IDs. This process + // will asynchronously regenerate the caches. The existing caches remains + // available until it expires. + RefreshDefaultBaseEnvironments(ctx context.Context, request RefreshDefaultBaseEnvironmentsRequest) error + + // Refresh the cached default base environments for the given IDs. This process + // will asynchronously regenerate the caches. The existing caches remains + // available until it expires. + RefreshDefaultBaseEnvironmentsByIds(ctx context.Context, ids []string) error + // Set libraries to uninstall from a cluster. The libraries won't be uninstalled // until the cluster is restarted. A request to uninstall a library that is not // currently installed is ignored. Uninstall(ctx context.Context, request UninstallLibraries) error + + // Update the default base environment for the given ID. This process will + // asynchronously regenerate the cache. The existing cache remains available + // until it expires. + UpdateDefaultBaseEnvironment(ctx context.Context, request UpdateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) } func NewLibraries(client *client.DatabricksClient) *LibrariesAPI { @@ -2050,6 +2093,24 @@ func (a *LibrariesAPI) ClusterStatusByClusterId(ctx context.Context, clusterId s }) } +// Delete the default base environment given an ID. The default base environment +// may be used by downstream workloads. Please ensure that the deletion is +// intentional. +func (a *LibrariesAPI) DeleteDefaultBaseEnvironmentById(ctx context.Context, id string) error { + return a.librariesImpl.DeleteDefaultBaseEnvironment(ctx, DeleteDefaultBaseEnvironmentRequest{ + Id: id, + }) +} + +// Refresh the cached default base environments for the given IDs. This process +// will asynchronously regenerate the caches. The existing caches remains +// available until it expires. +func (a *LibrariesAPI) RefreshDefaultBaseEnvironmentsByIds(ctx context.Context, ids []string) error { + return a.librariesImpl.RefreshDefaultBaseEnvironments(ctx, RefreshDefaultBaseEnvironmentsRequest{ + Ids: ids, + }) +} + type PolicyComplianceForClustersInterface interface { // Updates a cluster to be compliant with the current version of its policy. A diff --git a/service/compute/impl.go b/service/compute/impl.go index d41f7f64c..c51e0b4b1 100755 --- a/service/compute/impl.go +++ b/service/compute/impl.go @@ -869,6 +869,26 @@ func (a *librariesImpl) internalClusterStatus(ctx context.Context, request Clust return &clusterLibraryStatuses, err } +func (a *librariesImpl) CreateDefaultBaseEnvironment(ctx context.Context, request CreateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) { + var defaultBaseEnvironment DefaultBaseEnvironment + path := "/api/2.0/default-base-environments" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &defaultBaseEnvironment) + return &defaultBaseEnvironment, err +} + +func (a *librariesImpl) DeleteDefaultBaseEnvironment(ctx context.Context, request DeleteDefaultBaseEnvironmentRequest) error { + path := fmt.Sprintf("/api/2.0/default-base-environments/%v", request.Id) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) + return err +} + func (a *librariesImpl) Install(ctx context.Context, request InstallLibraries) error { path := "/api/2.0/libraries/install" queryParams := make(map[string]any) @@ -879,6 +899,59 @@ func (a *librariesImpl) Install(ctx context.Context, request InstallLibraries) e return err } +// List default base environments defined in the workspaces for the requested +// user. +func (a *librariesImpl) ListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) listing.Iterator[DefaultBaseEnvironment] { + + getNextPage := func(ctx context.Context, req ListDefaultBaseEnvironmentsRequest) (*ListDefaultBaseEnvironmentsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDefaultBaseEnvironments(ctx, req) + } + getItems := func(resp *ListDefaultBaseEnvironmentsResponse) []DefaultBaseEnvironment { + return resp.DefaultBaseEnvironments + } + getNextReq := func(resp *ListDefaultBaseEnvironmentsResponse) *ListDefaultBaseEnvironmentsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List default base environments defined in the workspaces for the requested +// user. +func (a *librariesImpl) ListDefaultBaseEnvironmentsAll(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) ([]DefaultBaseEnvironment, error) { + iterator := a.ListDefaultBaseEnvironments(ctx, request) + return listing.ToSlice[DefaultBaseEnvironment](ctx, iterator) +} + +func (a *librariesImpl) internalListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) (*ListDefaultBaseEnvironmentsResponse, error) { + var listDefaultBaseEnvironmentsResponse ListDefaultBaseEnvironmentsResponse + path := "/api/2.0/default-base-environments" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDefaultBaseEnvironmentsResponse) + return &listDefaultBaseEnvironmentsResponse, err +} + +func (a *librariesImpl) RefreshDefaultBaseEnvironments(ctx context.Context, request RefreshDefaultBaseEnvironmentsRequest) error { + path := "/api/2.0/default-base-environments/refresh" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) + return err +} + func (a *librariesImpl) Uninstall(ctx context.Context, request UninstallLibraries) error { path := "/api/2.0/libraries/uninstall" queryParams := make(map[string]any) @@ -889,6 +962,17 @@ func (a *librariesImpl) Uninstall(ctx context.Context, request UninstallLibrarie return err } +func (a *librariesImpl) UpdateDefaultBaseEnvironment(ctx context.Context, request UpdateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) { + var defaultBaseEnvironment DefaultBaseEnvironment + path := fmt.Sprintf("/api/2.0/default-base-environments/%v", request.Id) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &defaultBaseEnvironment) + return &defaultBaseEnvironment, err +} + // unexported type that holds implementations of just PolicyComplianceForClusters API methods type policyComplianceForClustersImpl struct { client *client.DatabricksClient diff --git a/service/compute/interface.go b/service/compute/interface.go index 71a8405b4..a3ba706b5 100755 --- a/service/compute/interface.go +++ b/service/compute/interface.go @@ -442,14 +442,39 @@ type LibrariesService interface { // removal, in no particular order, are returned last. ClusterStatus(ctx context.Context, request ClusterStatus) (*ClusterLibraryStatuses, error) + // Create a default base environment within workspaces to define the + // environment version and a list of dependencies to be used in serverless + // notebooks and jobs. This process will asynchronously generate a cache to + // optimize dependency resolution. + CreateDefaultBaseEnvironment(ctx context.Context, request CreateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) + + // Delete the default base environment given an ID. The default base + // environment may be used by downstream workloads. Please ensure that the + // deletion is intentional. + DeleteDefaultBaseEnvironment(ctx context.Context, request DeleteDefaultBaseEnvironmentRequest) error + // Add libraries to install on a cluster. The installation is asynchronous; // it happens in the background after the completion of this request. Install(ctx context.Context, request InstallLibraries) error + // List default base environments defined in the workspaces for the + // requested user. + ListDefaultBaseEnvironments(ctx context.Context, request ListDefaultBaseEnvironmentsRequest) (*ListDefaultBaseEnvironmentsResponse, error) + + // Refresh the cached default base environments for the given IDs. This + // process will asynchronously regenerate the caches. The existing caches + // remains available until it expires. + RefreshDefaultBaseEnvironments(ctx context.Context, request RefreshDefaultBaseEnvironmentsRequest) error + // Set libraries to uninstall from a cluster. The libraries won't be // uninstalled until the cluster is restarted. A request to uninstall a // library that is not currently installed is ignored. Uninstall(ctx context.Context, request UninstallLibraries) error + + // Update the default base environment for the given ID. This process will + // asynchronously regenerate the cache. The existing cache remains available + // until it expires. + UpdateDefaultBaseEnvironment(ctx context.Context, request UpdateDefaultBaseEnvironmentRequest) (*DefaultBaseEnvironment, error) } // The policy compliance APIs allow you to view and manage the policy compliance diff --git a/service/compute/model.go b/service/compute/model.go index 063ecdc1e..642e0d894 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -1762,6 +1762,23 @@ func (s CreateContext) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateDefaultBaseEnvironmentRequest struct { + DefaultBaseEnvironment DefaultBaseEnvironment `json:"default_base_environment"` + // A unique identifier for this request. A random UUID is recommended. This + // request is only idempotent if a `request_id` is provided. + RequestId string `json:"request_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *CreateDefaultBaseEnvironmentRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateDefaultBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type CreateInstancePool struct { // Attributes related to instance pools running on Amazon Web Services. If // not specified at pool creation, a set of default values will be used. @@ -1778,6 +1795,10 @@ type CreateInstancePool struct { // Defines the specification of the disks that will be attached to all spark // containers. DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS @@ -1804,6 +1825,11 @@ type CreateInstancePool struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -2131,11 +2157,121 @@ type DbfsStorageInfo struct { Destination string `json:"destination"` } +type DefaultBaseEnvironment struct { + BaseEnvironmentCache []DefaultBaseEnvironmentCache `json:"base_environment_cache,omitempty"` + + CreatedTimestamp int64 `json:"created_timestamp,omitempty"` + + CreatorUserId int64 `json:"creator_user_id,omitempty"` + // Note: we made `environment` non-internal because we need to expose its + // `client` field. All other fields should be treated as internal. + Environment *Environment `json:"environment,omitempty"` + + Filepath string `json:"filepath,omitempty"` + + Id string `json:"id,omitempty"` + + IsDefault bool `json:"is_default,omitempty"` + + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + LastUpdatedUserId int64 `json:"last_updated_user_id,omitempty"` + + Message string `json:"message,omitempty"` + + Name string `json:"name,omitempty"` + + PrincipalIds []int64 `json:"principal_ids,omitempty"` + + Status DefaultBaseEnvironmentCacheStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DefaultBaseEnvironment) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DefaultBaseEnvironment) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DefaultBaseEnvironmentCache struct { + MaterializedEnvironment *MaterializedEnvironment `json:"materialized_environment,omitempty"` + + Message string `json:"message,omitempty"` + + Status DefaultBaseEnvironmentCacheStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *DefaultBaseEnvironmentCache) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DefaultBaseEnvironmentCache) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DefaultBaseEnvironmentCacheStatus string + +const DefaultBaseEnvironmentCacheStatusCreated DefaultBaseEnvironmentCacheStatus = `CREATED` + +const DefaultBaseEnvironmentCacheStatusExpired DefaultBaseEnvironmentCacheStatus = `EXPIRED` + +const DefaultBaseEnvironmentCacheStatusFailed DefaultBaseEnvironmentCacheStatus = `FAILED` + +const DefaultBaseEnvironmentCacheStatusInvalid DefaultBaseEnvironmentCacheStatus = `INVALID` + +const DefaultBaseEnvironmentCacheStatusPending DefaultBaseEnvironmentCacheStatus = `PENDING` + +const DefaultBaseEnvironmentCacheStatusRefreshing DefaultBaseEnvironmentCacheStatus = `REFRESHING` + +// String representation for [fmt.Print] +func (f *DefaultBaseEnvironmentCacheStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DefaultBaseEnvironmentCacheStatus) Set(v string) error { + switch v { + case `CREATED`, `EXPIRED`, `FAILED`, `INVALID`, `PENDING`, `REFRESHING`: + *f = DefaultBaseEnvironmentCacheStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CREATED", "EXPIRED", "FAILED", "INVALID", "PENDING", "REFRESHING"`, v) + } +} + +// Values returns all possible values for DefaultBaseEnvironmentCacheStatus. +// +// There is no guarantee on the order of the values in the slice. +func (f *DefaultBaseEnvironmentCacheStatus) Values() []DefaultBaseEnvironmentCacheStatus { + return []DefaultBaseEnvironmentCacheStatus{ + DefaultBaseEnvironmentCacheStatusCreated, + DefaultBaseEnvironmentCacheStatusExpired, + DefaultBaseEnvironmentCacheStatusFailed, + DefaultBaseEnvironmentCacheStatusInvalid, + DefaultBaseEnvironmentCacheStatusPending, + DefaultBaseEnvironmentCacheStatusRefreshing, + } +} + +// Type always returns DefaultBaseEnvironmentCacheStatus to satisfy [pflag.Value] interface +func (f *DefaultBaseEnvironmentCacheStatus) Type() string { + return "DefaultBaseEnvironmentCacheStatus" +} + type DeleteCluster struct { // The cluster to be terminated. ClusterId string `json:"cluster_id"` } +type DeleteDefaultBaseEnvironmentRequest struct { + Id string `json:"-" url:"-"` +} + type DeleteGlobalInitScriptRequest struct { // The ID of the global init script. ScriptId string `json:"-" url:"-"` @@ -2541,6 +2677,10 @@ type EditInstancePool struct { // // - Currently, Databricks allows at most 45 custom tags CustomTags map[string]string `json:"custom_tags,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Automatically terminates the extra instances in the pool cache after they // are inactive for this time in minutes if min_idle_instances requirement // is already met. If not set, the extra pool instances will be @@ -2560,6 +2700,11 @@ type EditInstancePool struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -3237,6 +3382,10 @@ type GetInstancePool struct { // Defines the specification of the disks that will be attached to all spark // containers. DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS @@ -3265,6 +3414,11 @@ type GetInstancePool struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -3704,6 +3858,10 @@ type InstancePoolAndStats struct { // Defines the specification of the disks that will be attached to all spark // containers. DiskSpec *DiskSpec `json:"disk_spec,omitempty"` + // For pools with node type flexibility (Fleet-V2), whether auto generated + // alternate node type ids are enabled. This field should not be true if + // node_type_flexibility is set. + EnableAutoAlternateNodeTypes bool `json:"enable_auto_alternate_node_types,omitempty"` // Autoscaling Local Storage: when enabled, this instances in this pool will // dynamically acquire additional disk space when its Spark workers are // running low on disk space. In AWS, this feature requires specific AWS @@ -3732,6 +3890,11 @@ type InstancePoolAndStats struct { MaxCapacity int `json:"max_capacity,omitempty"` // Minimum number of idle instances to keep in the instance pool MinIdleInstances int `json:"min_idle_instances,omitempty"` + // For pools with node type flexibility (Fleet-V2), this object contains the + // information about the alternate node type ids to use when attempting to + // launch a cluster if the node type id is not available. This field should + // not be set if enable_auto_alternate_node_types is true. + NodeTypeFlexibility *NodeTypeFlexibility `json:"node_type_flexibility,omitempty"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -4593,6 +4756,38 @@ func (f *ListClustersSortByField) Type() string { return "ListClustersSortByField" } +type ListDefaultBaseEnvironmentsRequest struct { + PageSize int `json:"-" url:"page_size,omitempty"` + + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDefaultBaseEnvironmentsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDefaultBaseEnvironmentsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDefaultBaseEnvironmentsResponse struct { + DefaultBaseEnvironments []DefaultBaseEnvironment `json:"default_base_environments,omitempty"` + + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDefaultBaseEnvironmentsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDefaultBaseEnvironmentsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListGlobalInitScriptsResponse struct { Scripts []GlobalInitScriptDetails `json:"scripts,omitempty"` } @@ -4768,6 +4963,36 @@ func (s LogSyncStatus) MarshalJSON() ([]byte, error) { type MapAny map[string]any +// Materialized Environment information enables environment sharing and reuse +// via Environment Caching during library installations. Currently this feature +// is only supported for Python libraries. +// +// - If the env cache entry in LMv2 DB doesn't exist or invalid, library +// installations and environment materialization will occur. A new Materialized +// Environment metadata will be sent from DP upon successful library +// installations and env materialization, and is persisted into database by +// LMv2. - If the env cache entry in LMv2 DB is valid, the Materialized +// Environment will be sent to DP by LMv2, and DP will restore the cached +// environment from a store instead of reinstalling libraries from scratch. +// +// If changed, also update +// estore/namespaces/defaultbaseenvironments/latest.proto with new version +type MaterializedEnvironment struct { + // The timestamp (in epoch milliseconds) when the materialized env is + // updated. + LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *MaterializedEnvironment) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s MaterializedEnvironment) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type MavenLibrary struct { // Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". Coordinates string `json:"coordinates"` @@ -4884,6 +5109,12 @@ func (s NodeType) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// For Fleet-V2 using classic clusters, this object contains the information +// about the alternate node type ids to use when attempting to launch a cluster. +// It can be used with both the driver and worker node types. +type NodeTypeFlexibility struct { +} + // Error message of a failed pending instances type PendingInstanceError struct { InstanceId string `json:"instance_id,omitempty"` @@ -5031,6 +5262,10 @@ func (s RCranLibrary) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type RefreshDefaultBaseEnvironmentsRequest struct { + Ids []string `json:"ids"` +} + type RemoveInstanceProfile struct { // The ARN of the instance profile to remove. This field is required. InstanceProfileArn string `json:"instance_profile_arn"` @@ -6188,6 +6423,12 @@ func (s UpdateClusterResource) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type UpdateDefaultBaseEnvironmentRequest struct { + DefaultBaseEnvironment *DefaultBaseEnvironment `json:"default_base_environment,omitempty"` + + Id string `json:"-" url:"-"` +} + // A storage location back by UC Volumes. type VolumesStorageInfo struct { // UC Volumes destination, e.g. diff --git a/service/dashboards/api.go b/service/dashboards/api.go index ba977b176..255a6f0dc 100755 --- a/service/dashboards/api.go +++ b/service/dashboards/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Genie, Lakeview, Lakeview Embedded, etc. +// These APIs allow you to manage Genie, Lakeview, Lakeview Embedded, Query Execution, etc. package dashboards import ( @@ -46,6 +46,39 @@ type GenieInterface interface { // Execute the SQL query in the message. ExecuteMessageQuery(ctx context.Context, request GenieExecuteMessageQueryRequest) (*GenieGetMessageQueryResultResponse, error) + // Initiates a new SQL execution and returns a `download_id` that you can use to + // track the progress of the download. The query result is stored in an external + // link and can be retrieved using the [Get Download Full Query + // Result](:method:genie/getdownloadfullqueryresult) API. Warning: Databricks + // strongly recommends that you protect the URLs that are returned by the + // `EXTERNAL_LINKS` disposition. See [Execute + // Statement](:method:statementexecution/executestatement) for more details. + GenerateDownloadFullQueryResult(ctx context.Context, request GenieGenerateDownloadFullQueryResultRequest) (*GenieGenerateDownloadFullQueryResultResponse, error) + + // After [Generating a Full Query Result + // Download](:method:genie/getdownloadfullqueryresult) and successfully + // receiving a `download_id`, use this API to poll the download progress. When + // the download is complete, the API returns one or more external links to the + // query result files. Warning: Databricks strongly recommends that you protect + // the URLs that are returned by the `EXTERNAL_LINKS` disposition. You must not + // set an Authorization header in download requests. When using the + // `EXTERNAL_LINKS` disposition, Databricks returns presigned URLs that grant + // temporary access to data. See [Execute + // Statement](:method:statementexecution/executestatement) for more details. + GetDownloadFullQueryResult(ctx context.Context, request GenieGetDownloadFullQueryResultRequest) (*GenieGetDownloadFullQueryResultResponse, error) + + // After [Generating a Full Query Result + // Download](:method:genie/getdownloadfullqueryresult) and successfully + // receiving a `download_id`, use this API to poll the download progress. When + // the download is complete, the API returns one or more external links to the + // query result files. Warning: Databricks strongly recommends that you protect + // the URLs that are returned by the `EXTERNAL_LINKS` disposition. You must not + // set an Authorization header in download requests. When using the + // `EXTERNAL_LINKS` disposition, Databricks returns presigned URLs that grant + // temporary access to data. See [Execute + // Statement](:method:statementexecution/executestatement) for more details. + GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId(ctx context.Context, spaceId string, conversationId string, messageId string, attachmentId string, downloadId string) (*GenieGetDownloadFullQueryResultResponse, error) + // Get message from conversation. GetMessage(ctx context.Context, request GenieGetConversationMessageRequest) (*GenieMessage, error) @@ -246,6 +279,26 @@ func (a *GenieAPI) DeleteConversationBySpaceIdAndConversationId(ctx context.Cont }) } +// After [Generating a Full Query Result +// Download](:method:genie/getdownloadfullqueryresult) and successfully +// receiving a `download_id`, use this API to poll the download progress. When +// the download is complete, the API returns one or more external links to the +// query result files. Warning: Databricks strongly recommends that you protect +// the URLs that are returned by the `EXTERNAL_LINKS` disposition. You must not +// set an Authorization header in download requests. When using the +// `EXTERNAL_LINKS` disposition, Databricks returns presigned URLs that grant +// temporary access to data. See [Execute +// Statement](:method:statementexecution/executestatement) for more details. +func (a *GenieAPI) GetDownloadFullQueryResultBySpaceIdAndConversationIdAndMessageIdAndAttachmentIdAndDownloadId(ctx context.Context, spaceId string, conversationId string, messageId string, attachmentId string, downloadId string) (*GenieGetDownloadFullQueryResultResponse, error) { + return a.genieImpl.GetDownloadFullQueryResult(ctx, GenieGetDownloadFullQueryResultRequest{ + SpaceId: spaceId, + ConversationId: conversationId, + MessageId: messageId, + AttachmentId: attachmentId, + DownloadId: downloadId, + }) +} + // Get message from conversation. func (a *GenieAPI) GetMessageBySpaceIdAndConversationIdAndMessageId(ctx context.Context, spaceId string, conversationId string, messageId string) (*GenieMessage, error) { return a.genieImpl.GetMessage(ctx, GenieGetConversationMessageRequest{ @@ -559,6 +612,12 @@ func (a *LakeviewAPI) UnpublishByDashboardId(ctx context.Context, dashboardId st type LakeviewEmbeddedInterface interface { + // Get the current published dashboard within an embedded context. + GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error + + // Get the current published dashboard within an embedded context. + GetPublishedDashboardEmbeddedByDashboardId(ctx context.Context, dashboardId string) error + // Get a required authorization details and scopes of a published dashboard to // mint an OAuth token. GetPublishedDashboardTokenInfo(ctx context.Context, request GetPublishedDashboardTokenInfoRequest) (*GetPublishedDashboardTokenInfoResponse, error) @@ -581,6 +640,13 @@ type LakeviewEmbeddedAPI struct { lakeviewEmbeddedImpl } +// Get the current published dashboard within an embedded context. +func (a *LakeviewEmbeddedAPI) GetPublishedDashboardEmbeddedByDashboardId(ctx context.Context, dashboardId string) error { + return a.lakeviewEmbeddedImpl.GetPublishedDashboardEmbedded(ctx, GetPublishedDashboardEmbeddedRequest{ + DashboardId: dashboardId, + }) +} + // Get a required authorization details and scopes of a published dashboard to // mint an OAuth token. func (a *LakeviewEmbeddedAPI) GetPublishedDashboardTokenInfoByDashboardId(ctx context.Context, dashboardId string) (*GetPublishedDashboardTokenInfoResponse, error) { @@ -588,3 +654,28 @@ func (a *LakeviewEmbeddedAPI) GetPublishedDashboardTokenInfoByDashboardId(ctx co DashboardId: dashboardId, }) } + +type QueryExecutionInterface interface { + + // Cancel the results for the a query for a published, embedded dashboard. + CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) + + // Execute a query for a published dashboard. + ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error + + // Poll the results for the a query for a published, embedded dashboard. + PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) +} + +func NewQueryExecution(client *client.DatabricksClient) *QueryExecutionAPI { + return &QueryExecutionAPI{ + queryExecutionImpl: queryExecutionImpl{ + client: client, + }, + } +} + +// Query execution APIs for AI / BI Dashboards +type QueryExecutionAPI struct { + queryExecutionImpl +} diff --git a/service/dashboards/impl.go b/service/dashboards/impl.go index 06e76e49e..8e3ed64d3 100755 --- a/service/dashboards/impl.go +++ b/service/dashboards/impl.go @@ -57,6 +57,26 @@ func (a *genieImpl) ExecuteMessageQuery(ctx context.Context, request GenieExecut return &genieGetMessageQueryResultResponse, err } +func (a *genieImpl) GenerateDownloadFullQueryResult(ctx context.Context, request GenieGenerateDownloadFullQueryResultRequest) (*GenieGenerateDownloadFullQueryResultResponse, error) { + var genieGenerateDownloadFullQueryResultResponse GenieGenerateDownloadFullQueryResultResponse + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/downloads", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &genieGenerateDownloadFullQueryResultResponse) + return &genieGenerateDownloadFullQueryResultResponse, err +} + +func (a *genieImpl) GetDownloadFullQueryResult(ctx context.Context, request GenieGetDownloadFullQueryResultRequest) (*GenieGetDownloadFullQueryResultResponse, error) { + var genieGetDownloadFullQueryResultResponse GenieGetDownloadFullQueryResultResponse + path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/attachments/%v/downloads/%v", request.SpaceId, request.ConversationId, request.MessageId, request.AttachmentId, request.DownloadId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieGetDownloadFullQueryResultResponse) + return &genieGetDownloadFullQueryResultResponse, err +} + func (a *genieImpl) GetMessage(ctx context.Context, request GenieGetConversationMessageRequest) (*GenieMessage, error) { var genieMessage GenieMessage path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v", request.SpaceId, request.ConversationId, request.MessageId) @@ -433,6 +453,15 @@ type lakeviewEmbeddedImpl struct { client *client.DatabricksClient } +func (a *lakeviewEmbeddedImpl) GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error { + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/embedded", request.DashboardId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, nil) + return err +} + func (a *lakeviewEmbeddedImpl) GetPublishedDashboardTokenInfo(ctx context.Context, request GetPublishedDashboardTokenInfoRequest) (*GetPublishedDashboardTokenInfoResponse, error) { var getPublishedDashboardTokenInfoResponse GetPublishedDashboardTokenInfoResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published/tokeninfo", request.DashboardId) @@ -442,3 +471,38 @@ func (a *lakeviewEmbeddedImpl) GetPublishedDashboardTokenInfo(ctx context.Contex err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedDashboardTokenInfoResponse) return &getPublishedDashboardTokenInfoResponse, err } + +// unexported type that holds implementations of just QueryExecution API methods +type queryExecutionImpl struct { + client *client.DatabricksClient +} + +func (a *queryExecutionImpl) CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) { + var cancelQueryExecutionResponse CancelQueryExecutionResponse + path := "/api/2.0/lakeview-query/query/published" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &cancelQueryExecutionResponse) + return &cancelQueryExecutionResponse, err +} + +func (a *queryExecutionImpl) ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error { + path := "/api/2.0/lakeview-query/query/published" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, nil) + return err +} + +func (a *queryExecutionImpl) PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) { + var pollQueryStatusResponse PollQueryStatusResponse + path := "/api/2.0/lakeview-query/query/published" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &pollQueryStatusResponse) + return &pollQueryStatusResponse, err +} diff --git a/service/dashboards/interface.go b/service/dashboards/interface.go index 8abc6f1e0..3aa3b0597 100755 --- a/service/dashboards/interface.go +++ b/service/dashboards/interface.go @@ -30,6 +30,27 @@ type GenieService interface { // Execute the SQL query in the message. ExecuteMessageQuery(ctx context.Context, request GenieExecuteMessageQueryRequest) (*GenieGetMessageQueryResultResponse, error) + // Initiates a new SQL execution and returns a `download_id` that you can + // use to track the progress of the download. The query result is stored in + // an external link and can be retrieved using the [Get Download Full Query + // Result](:method:genie/getdownloadfullqueryresult) API. Warning: + // Databricks strongly recommends that you protect the URLs that are + // returned by the `EXTERNAL_LINKS` disposition. See [Execute + // Statement](:method:statementexecution/executestatement) for more details. + GenerateDownloadFullQueryResult(ctx context.Context, request GenieGenerateDownloadFullQueryResultRequest) (*GenieGenerateDownloadFullQueryResultResponse, error) + + // After [Generating a Full Query Result + // Download](:method:genie/getdownloadfullqueryresult) and successfully + // receiving a `download_id`, use this API to poll the download progress. + // When the download is complete, the API returns one or more external links + // to the query result files. Warning: Databricks strongly recommends that + // you protect the URLs that are returned by the `EXTERNAL_LINKS` + // disposition. You must not set an Authorization header in download + // requests. When using the `EXTERNAL_LINKS` disposition, Databricks returns + // presigned URLs that grant temporary access to data. See [Execute + // Statement](:method:statementexecution/executestatement) for more details. + GetDownloadFullQueryResult(ctx context.Context, request GenieGetDownloadFullQueryResultRequest) (*GenieGetDownloadFullQueryResultResponse, error) + // Get message from conversation. GetMessage(ctx context.Context, request GenieGetConversationMessageRequest) (*GenieMessage, error) @@ -131,7 +152,25 @@ type LakeviewService interface { // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type LakeviewEmbeddedService interface { + // Get the current published dashboard within an embedded context. + GetPublishedDashboardEmbedded(ctx context.Context, request GetPublishedDashboardEmbeddedRequest) error + // Get a required authorization details and scopes of a published dashboard // to mint an OAuth token. GetPublishedDashboardTokenInfo(ctx context.Context, request GetPublishedDashboardTokenInfoRequest) (*GetPublishedDashboardTokenInfoResponse, error) } + +// Query execution APIs for AI / BI Dashboards +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type QueryExecutionService interface { + + // Cancel the results for the a query for a published, embedded dashboard. + CancelPublishedQueryExecution(ctx context.Context, request CancelPublishedQueryExecutionRequest) (*CancelQueryExecutionResponse, error) + + // Execute a query for a published dashboard. + ExecutePublishedDashboardQuery(ctx context.Context, request ExecutePublishedDashboardQueryRequest) error + + // Poll the results for the a query for a published, embedded dashboard. + PollPublishedQueryStatus(ctx context.Context, request PollPublishedQueryStatusRequest) (*PollQueryStatusResponse, error) +} diff --git a/service/dashboards/model.go b/service/dashboards/model.go index 898d59b0d..60c51a505 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -51,6 +51,29 @@ func (s AuthorizationDetailsGrantRule) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CancelPublishedQueryExecutionRequest struct { + DashboardName string `json:"-" url:"dashboard_name"` + + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + // Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + Tokens []string `json:"-" url:"tokens,omitempty"` +} + +type CancelQueryExecutionResponse struct { + Status []CancelQueryExecutionResponseStatus `json:"status,omitempty"` +} + +type CancelQueryExecutionResponseStatus struct { + // The token to poll for result asynchronously Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + DataToken string `json:"data_token"` + + Pending *Empty `json:"pending,omitempty"` + + Success *Empty `json:"success,omitempty"` +} + type CreateDashboardRequest struct { Dashboard Dashboard `json:"dashboard"` } @@ -206,6 +229,37 @@ func (s DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Represents an empty message, similar to google.protobuf.Empty, which is not +// available in the firm right now. +type Empty struct { +} + +// Execute query request for published Dashboards. Since published dashboards +// have the option of running as the publisher, the datasets, warehouse_id are +// excluded from the request and instead read from the source (lakeview-config) +// via the additional parameters (dashboardName and dashboardRevisionId) +type ExecutePublishedDashboardQueryRequest struct { + // Dashboard name and revision_id is required to retrieve + // PublishedDatasetDataModel which contains the list of datasets, + // warehouse_id, and embedded_credentials + DashboardName string `json:"dashboard_name"` + + DashboardRevisionId string `json:"dashboard_revision_id"` + // A dashboard schedule can override the warehouse used as compute for + // processing the published dashboard queries + OverrideWarehouseId string `json:"override_warehouse_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ExecutePublishedDashboardQueryRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ExecutePublishedDashboardQueryRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Genie AI Response type GenieAttachment struct { // Attachment ID @@ -297,6 +351,33 @@ type GenieExecuteMessageQueryRequest struct { SpaceId string `json:"-" url:"-"` } +type GenieGenerateDownloadFullQueryResultRequest struct { + // Attachment ID + AttachmentId string `json:"-" url:"-"` + // Conversation ID + ConversationId string `json:"-" url:"-"` + // Message ID + MessageId string `json:"-" url:"-"` + // Genie space ID + SpaceId string `json:"-" url:"-"` +} + +type GenieGenerateDownloadFullQueryResultResponse struct { + // Download ID. Use this ID to track the download request in subsequent + // polling calls + DownloadId string `json:"download_id,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GenieGenerateDownloadFullQueryResultResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GenieGenerateDownloadFullQueryResultResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type GenieGetConversationMessageRequest struct { // The ID associated with the target conversation. ConversationId string `json:"-" url:"-"` @@ -308,6 +389,26 @@ type GenieGetConversationMessageRequest struct { SpaceId string `json:"-" url:"-"` } +type GenieGetDownloadFullQueryResultRequest struct { + // Attachment ID + AttachmentId string `json:"-" url:"-"` + // Conversation ID + ConversationId string `json:"-" url:"-"` + // Download ID. This ID is provided by the [Generate Download + // endpoint](:method:genie/generateDownloadFullQueryResult) + DownloadId string `json:"-" url:"-"` + // Message ID + MessageId string `json:"-" url:"-"` + // Genie space ID + SpaceId string `json:"-" url:"-"` +} + +type GenieGetDownloadFullQueryResultResponse struct { + // SQL Statement Execution response. See [Get status, manifest, and result + // first chunk](:method:statementexecution/getstatement) for more details. + StatementResponse *sql.StatementResponse `json:"statement_response,omitempty"` +} + type GenieGetMessageAttachmentQueryResultRequest struct { // Attachment ID AttachmentId string `json:"-" url:"-"` @@ -552,6 +653,11 @@ type GetDashboardRequest struct { DashboardId string `json:"-" url:"-"` } +type GetPublishedDashboardEmbeddedRequest struct { + // UUID identifying the published dashboard. + DashboardId string `json:"-" url:"-"` +} + type GetPublishedDashboardRequest struct { // UUID identifying the published dashboard. DashboardId string `json:"-" url:"-"` @@ -1097,6 +1203,29 @@ func (s MigrateDashboardRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type PendingStatus struct { + // The token to poll for result asynchronously Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + DataToken string `json:"data_token"` +} + +type PollPublishedQueryStatusRequest struct { + DashboardName string `json:"-" url:"dashboard_name"` + + DashboardRevisionId string `json:"-" url:"dashboard_revision_id"` + // Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + Tokens []string `json:"-" url:"tokens,omitempty"` +} + +type PollQueryStatusResponse struct { + Data []PollQueryStatusResponseData `json:"data,omitempty"` +} + +type PollQueryStatusResponseData struct { + Status QueryResponseStatus `json:"status"` +} + type PublishRequest struct { // UUID identifying the dashboard to be published. DashboardId string `json:"-" url:"-"` @@ -1140,6 +1269,31 @@ func (s PublishedDashboard) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type QueryResponseStatus struct { + Canceled *Empty `json:"canceled,omitempty"` + + Closed *Empty `json:"closed,omitempty"` + + Pending *PendingStatus `json:"pending,omitempty"` + // The statement id in format(01eef5da-c56e-1f36-bafa-21906587d6ba) The + // statement_id should be identical to data_token in SuccessStatus and + // PendingStatus. This field is created for audit logging purpose to record + // the statement_id of all QueryResponseStatus. + StatementId string `json:"statement_id,omitempty"` + + Success *SuccessStatus `json:"success,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *QueryResponseStatus) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s QueryResponseStatus) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type Result struct { // If result is truncated IsTruncated bool `json:"is_truncated,omitempty"` @@ -1285,6 +1439,24 @@ type SubscriptionSubscriberUser struct { UserId int64 `json:"user_id"` } +type SuccessStatus struct { + // The token to poll for result asynchronously Example: + // EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ + DataToken string `json:"data_token"` + // Whether the query result is truncated (either by byte limit or row limit) + Truncated bool `json:"truncated,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SuccessStatus) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SuccessStatus) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type TextAttachment struct { // AI generated message Content string `json:"content,omitempty"` diff --git a/service/database/api.go b/service/database/api.go index e8ebed831..555e5fa36 100755 --- a/service/database/api.go +++ b/service/database/api.go @@ -59,6 +59,9 @@ type DatabaseInterface interface { // Delete a Synced Database Table. DeleteSyncedDatabaseTableByName(ctx context.Context, name string) error + // Failover the primary node of a Database Instance to a secondary. + FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) + // Find a Database Instance by uid. FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) @@ -95,6 +98,19 @@ type DatabaseInterface interface { // Get a Synced Database Table. GetSyncedDatabaseTableByName(ctx context.Context, name string) (*SyncedDatabaseTable, error) + // List all Database Catalogs within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) listing.Iterator[DatabaseCatalog] + + // List all Database Catalogs within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListDatabaseCatalogsAll(ctx context.Context, request ListDatabaseCatalogsRequest) ([]DatabaseCatalog, error) + + // List all Database Catalogs within a Database Instance. + ListDatabaseCatalogsByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseCatalogsResponse, error) + // START OF PG ROLE APIs Section // // This method is generated by Databricks SDK Code Generator. @@ -118,8 +134,27 @@ type DatabaseInterface interface { // This method is generated by Databricks SDK Code Generator. ListDatabaseInstancesAll(ctx context.Context, request ListDatabaseInstancesRequest) ([]DatabaseInstance, error) + // List all Synced Database Tables within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) listing.Iterator[SyncedDatabaseTable] + + // List all Synced Database Tables within a Database Instance. + // + // This method is generated by Databricks SDK Code Generator. + ListSyncedDatabaseTablesAll(ctx context.Context, request ListSyncedDatabaseTablesRequest) ([]SyncedDatabaseTable, error) + + // List all Synced Database Tables within a Database Instance. + ListSyncedDatabaseTablesByInstanceName(ctx context.Context, instanceName string) (*ListSyncedDatabaseTablesResponse, error) + + // Updated a Database Catalog. + UpdateDatabaseCatalog(ctx context.Context, request UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) + // Update a Database Instance. UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Update a Synced Database Table. + UpdateSyncedDatabaseTable(ctx context.Context, request UpdateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) } func NewDatabase(client *client.DatabricksClient) *DatabaseAPI { @@ -207,9 +242,23 @@ func (a *DatabaseAPI) GetSyncedDatabaseTableByName(ctx context.Context, name str }) } +// List all Database Catalogs within a Database Instance. +func (a *DatabaseAPI) ListDatabaseCatalogsByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseCatalogsResponse, error) { + return a.databaseImpl.internalListDatabaseCatalogs(ctx, ListDatabaseCatalogsRequest{ + InstanceName: instanceName, + }) +} + // START OF PG ROLE APIs Section func (a *DatabaseAPI) ListDatabaseInstanceRolesByInstanceName(ctx context.Context, instanceName string) (*ListDatabaseInstanceRolesResponse, error) { return a.databaseImpl.internalListDatabaseInstanceRoles(ctx, ListDatabaseInstanceRolesRequest{ InstanceName: instanceName, }) } + +// List all Synced Database Tables within a Database Instance. +func (a *DatabaseAPI) ListSyncedDatabaseTablesByInstanceName(ctx context.Context, instanceName string) (*ListSyncedDatabaseTablesResponse, error) { + return a.databaseImpl.internalListSyncedDatabaseTables(ctx, ListSyncedDatabaseTablesRequest{ + InstanceName: instanceName, + }) +} diff --git a/service/database/impl.go b/service/database/impl.go index 020532f44..a8fc87e92 100755 --- a/service/database/impl.go +++ b/service/database/impl.go @@ -117,6 +117,17 @@ func (a *databaseImpl) DeleteSyncedDatabaseTable(ctx context.Context, request De return err } +func (a *databaseImpl) FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) { + var databaseInstance DatabaseInstance + path := fmt.Sprintf("/api/2.0/database/instances/%v/failover", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &databaseInstance) + return &databaseInstance, err +} + func (a *databaseImpl) FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) { var databaseInstance DatabaseInstance path := "/api/2.0/database/instances:findByUid" @@ -188,6 +199,47 @@ func (a *databaseImpl) GetSyncedDatabaseTable(ctx context.Context, request GetSy return &syncedDatabaseTable, err } +// List all Database Catalogs within a Database Instance. +func (a *databaseImpl) ListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) listing.Iterator[DatabaseCatalog] { + + getNextPage := func(ctx context.Context, req ListDatabaseCatalogsRequest) (*ListDatabaseCatalogsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListDatabaseCatalogs(ctx, req) + } + getItems := func(resp *ListDatabaseCatalogsResponse) []DatabaseCatalog { + return resp.DatabaseCatalogs + } + getNextReq := func(resp *ListDatabaseCatalogsResponse) *ListDatabaseCatalogsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all Database Catalogs within a Database Instance. +func (a *databaseImpl) ListDatabaseCatalogsAll(ctx context.Context, request ListDatabaseCatalogsRequest) ([]DatabaseCatalog, error) { + iterator := a.ListDatabaseCatalogs(ctx, request) + return listing.ToSlice[DatabaseCatalog](ctx, iterator) +} + +func (a *databaseImpl) internalListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) (*ListDatabaseCatalogsResponse, error) { + var listDatabaseCatalogsResponse ListDatabaseCatalogsResponse + path := fmt.Sprintf("/api/2.0/database/instances/%v/catalogs", request.InstanceName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDatabaseCatalogsResponse) + return &listDatabaseCatalogsResponse, err +} + // START OF PG ROLE APIs Section func (a *databaseImpl) ListDatabaseInstanceRoles(ctx context.Context, request ListDatabaseInstanceRolesRequest) listing.Iterator[DatabaseInstanceRole] { @@ -270,6 +322,61 @@ func (a *databaseImpl) internalListDatabaseInstances(ctx context.Context, reques return &listDatabaseInstancesResponse, err } +// List all Synced Database Tables within a Database Instance. +func (a *databaseImpl) ListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) listing.Iterator[SyncedDatabaseTable] { + + getNextPage := func(ctx context.Context, req ListSyncedDatabaseTablesRequest) (*ListSyncedDatabaseTablesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalListSyncedDatabaseTables(ctx, req) + } + getItems := func(resp *ListSyncedDatabaseTablesResponse) []SyncedDatabaseTable { + return resp.SyncedTables + } + getNextReq := func(resp *ListSyncedDatabaseTablesResponse) *ListSyncedDatabaseTablesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all Synced Database Tables within a Database Instance. +func (a *databaseImpl) ListSyncedDatabaseTablesAll(ctx context.Context, request ListSyncedDatabaseTablesRequest) ([]SyncedDatabaseTable, error) { + iterator := a.ListSyncedDatabaseTables(ctx, request) + return listing.ToSlice[SyncedDatabaseTable](ctx, iterator) +} + +func (a *databaseImpl) internalListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) (*ListSyncedDatabaseTablesResponse, error) { + var listSyncedDatabaseTablesResponse ListSyncedDatabaseTablesResponse + path := fmt.Sprintf("/api/2.0/database/instances/%v/synced_tables", request.InstanceName) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSyncedDatabaseTablesResponse) + return &listSyncedDatabaseTablesResponse, err +} + +func (a *databaseImpl) UpdateDatabaseCatalog(ctx context.Context, request UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) { + var databaseCatalog DatabaseCatalog + path := fmt.Sprintf("/api/2.0/database/catalogs/%v", request.Name) + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.DatabaseCatalog, &databaseCatalog) + return &databaseCatalog, err +} + func (a *databaseImpl) UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) { var databaseInstance DatabaseInstance path := fmt.Sprintf("/api/2.0/database/instances/%v", request.Name) @@ -283,3 +390,17 @@ func (a *databaseImpl) UpdateDatabaseInstance(ctx context.Context, request Updat err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.DatabaseInstance, &databaseInstance) return &databaseInstance, err } + +func (a *databaseImpl) UpdateSyncedDatabaseTable(ctx context.Context, request UpdateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) { + var syncedDatabaseTable SyncedDatabaseTable + path := fmt.Sprintf("/api/2.0/database/synced_tables/%v", request.Name) + queryParams := make(map[string]any) + if request.UpdateMask != "" { + queryParams["update_mask"] = request.UpdateMask + } + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.SyncedTable, &syncedDatabaseTable) + return &syncedDatabaseTable, err +} diff --git a/service/database/interface.go b/service/database/interface.go index f53a50176..7202343b3 100755 --- a/service/database/interface.go +++ b/service/database/interface.go @@ -43,6 +43,9 @@ type DatabaseService interface { // Delete a Synced Database Table. DeleteSyncedDatabaseTable(ctx context.Context, request DeleteSyncedDatabaseTableRequest) error + // Failover the primary node of a Database Instance to a secondary. + FailoverDatabaseInstance(ctx context.Context, request FailoverDatabaseInstanceRequest) (*DatabaseInstance, error) + // Find a Database Instance by uid. FindDatabaseInstanceByUid(ctx context.Context, request FindDatabaseInstanceByUidRequest) (*DatabaseInstance, error) @@ -64,12 +67,24 @@ type DatabaseService interface { // Get a Synced Database Table. GetSyncedDatabaseTable(ctx context.Context, request GetSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) + // List all Database Catalogs within a Database Instance. + ListDatabaseCatalogs(ctx context.Context, request ListDatabaseCatalogsRequest) (*ListDatabaseCatalogsResponse, error) + // START OF PG ROLE APIs Section ListDatabaseInstanceRoles(ctx context.Context, request ListDatabaseInstanceRolesRequest) (*ListDatabaseInstanceRolesResponse, error) // List Database Instances. ListDatabaseInstances(ctx context.Context, request ListDatabaseInstancesRequest) (*ListDatabaseInstancesResponse, error) + // List all Synced Database Tables within a Database Instance. + ListSyncedDatabaseTables(ctx context.Context, request ListSyncedDatabaseTablesRequest) (*ListSyncedDatabaseTablesResponse, error) + + // Updated a Database Catalog. + UpdateDatabaseCatalog(ctx context.Context, request UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) + // Update a Database Instance. UpdateDatabaseInstance(ctx context.Context, request UpdateDatabaseInstanceRequest) (*DatabaseInstance, error) + + // Update a Synced Database Table. + UpdateSyncedDatabaseTable(ctx context.Context, request UpdateSyncedDatabaseTableRequest) (*SyncedDatabaseTable, error) } diff --git a/service/database/model.go b/service/database/model.go index c8b774215..7e12ae84d 100755 --- a/service/database/model.go +++ b/service/database/model.go @@ -72,6 +72,11 @@ func (s DatabaseCredential) MarshalJSON() ([]byte, error) { // A DatabaseInstance represents a logical Postgres instance, comprised of both // compute and storage. type DatabaseInstance struct { + // The desired budget policy to associate with the instance. This field is + // only returned on create/update responses, and represents the customer + // provided budget policy. See effective_budget_policy_id for the policy + // that is actually applied to the instance. + BudgetPolicyId string `json:"budget_policy_id,omitempty"` // The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". Capacity string `json:"capacity,omitempty"` // The refs of the child instances. This is only available if the instance @@ -81,6 +86,15 @@ type DatabaseInstance struct { CreationTime string `json:"creation_time,omitempty"` // The email of the creator of the instance. Creator string `json:"creator,omitempty"` + // The policy that is applied to the instance. + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` + // xref AIP-129. `enable_pg_native_login` is owned by the client, while + // `effective_enable_pg_native_login` is owned by the server. + // `enable_pg_native_login` will only be set in Create/Update response + // messages if and only if the user provides the field via the request. + // `effective_enable_pg_native_login` on the other hand will always bet set + // in all response messages (Create/Update/Get/List). + EffectiveEnablePgNativeLogin bool `json:"effective_enable_pg_native_login,omitempty"` // xref AIP-129. `enable_readable_secondaries` is owned by the client, while // `effective_enable_readable_secondaries` is owned by the server. // `enable_readable_secondaries` will only be set in Create/Update response @@ -107,6 +121,9 @@ type DatabaseInstance struct { // request. `effective_stopped` on the other hand will always bet set in all // response messages (Create/Update/Get/List). EffectiveStopped bool `json:"effective_stopped,omitempty"` + // Whether the instance has PG native password login enabled. Defaults to + // true. + EnablePgNativeLogin bool `json:"enable_pg_native_login,omitempty"` // Whether to enable secondaries to serve read-only traffic. Defaults to // false. EnableReadableSecondaries bool `json:"enable_readable_secondaries,omitempty"` @@ -392,6 +409,8 @@ type DatabaseTable struct { LogicalDatabaseName string `json:"logical_database_name,omitempty"` // Full three-part (catalog, schema, table) name of the table. Name string `json:"name"` + // Data serving REST API URL for this table + TableServingUrl string `json:"table_serving_url,omitempty"` ForceSendFields []string `json:"-" url:"-"` } @@ -485,6 +504,22 @@ func (s DeltaTableSyncInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type FailoverDatabaseInstanceRequest struct { + FailoverTargetDatabaseInstanceName string `json:"failover_target_database_instance_name,omitempty"` + // Name of the instance to failover. + Name string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *FailoverDatabaseInstanceRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s FailoverDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type FindDatabaseInstanceByUidRequest struct { // UID of the cluster to get. Uid string `json:"-" url:"uid,omitempty"` @@ -545,6 +580,42 @@ type GetSyncedDatabaseTableRequest struct { Name string `json:"-" url:"-"` } +type ListDatabaseCatalogsRequest struct { + // Name of the instance to get database catalogs for. + InstanceName string `json:"-" url:"-"` + // Upper bound for items returned. + PageSize int `json:"-" url:"page_size,omitempty"` + // Pagination token to go to the next page of synced database tables. + // Requests first page if absent. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseCatalogsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseCatalogsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListDatabaseCatalogsResponse struct { + DatabaseCatalogs []DatabaseCatalog `json:"database_catalogs,omitempty"` + // Pagination token to request the next page of database catalogs. + NextPageToken string `json:"next_page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListDatabaseCatalogsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListDatabaseCatalogsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListDatabaseInstanceRolesRequest struct { InstanceName string `json:"-" url:"-"` // Upper bound for items returned. @@ -616,10 +687,49 @@ func (s ListDatabaseInstancesResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ListSyncedDatabaseTablesRequest struct { + // Name of the instance to get synced tables for. + InstanceName string `json:"-" url:"-"` + // Upper bound for items returned. + PageSize int `json:"-" url:"page_size,omitempty"` + // Pagination token to go to the next page of synced database tables. + // Requests first page if absent. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSyncedDatabaseTablesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSyncedDatabaseTablesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSyncedDatabaseTablesResponse struct { + // Pagination token to request the next page of synced tables. + NextPageToken string `json:"next_page_token,omitempty"` + + SyncedTables []SyncedDatabaseTable `json:"synced_tables,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListSyncedDatabaseTablesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSyncedDatabaseTablesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Custom fields that user can set for pipeline while creating // SyncedDatabaseTable. Note that other fields of pipeline are still inferred by // table def internally type NewPipelineSpec struct { + // Budget policy of this pipeline. + BudgetPolicyId string `json:"budget_policy_id,omitempty"` // This field needs to be specified if the destination catalog is a managed // postgres catalog. // @@ -780,6 +890,8 @@ type SyncedDatabaseTable struct { Name string `json:"name"` Spec *SyncedTableSpec `json:"spec,omitempty"` + // Data serving REST API URL for this table + TableServingUrl string `json:"table_serving_url,omitempty"` // The provisioning state of the synced 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 @@ -1118,6 +1230,15 @@ func (s SyncedTableTriggeredUpdateStatus) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type UpdateDatabaseCatalogRequest struct { + // Note that updating a database catalog is not yet supported. + DatabaseCatalog DatabaseCatalog `json:"database_catalog"` + // The name of the catalog in UC. + Name string `json:"-" url:"-"` + // The list of fields to update. Setting this field is not yet supported. + UpdateMask string `json:"-" url:"update_mask"` +} + type UpdateDatabaseInstanceRequest struct { DatabaseInstance DatabaseInstance `json:"database_instance"` // The name of the instance. This is the unique identifier for the instance. @@ -1125,3 +1246,12 @@ type UpdateDatabaseInstanceRequest struct { // The list of fields to update. UpdateMask string `json:"-" url:"update_mask"` } + +type UpdateSyncedDatabaseTableRequest struct { + // Full three-part (catalog, schema, table) name of the table. + Name string `json:"-" url:"-"` + // Note that updating a synced database table is not yet supported. + SyncedTable SyncedDatabaseTable `json:"synced_table"` + // The list of fields to update. Setting this field is not yet supported. + UpdateMask string `json:"-" url:"update_mask"` +} diff --git a/service/jobs/model.go b/service/jobs/model.go index a08a7a918..41b6a9fa3 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -628,6 +628,9 @@ type Continuous struct { // Indicate whether the continuous execution of the job is paused or not. // Defaults to UNPAUSED. PauseStatus PauseStatus `json:"pause_status,omitempty"` + // Indicate whether the continuous job is applying task level retries or + // not. Defaults to NEVER. + TaskRetryMode TaskRetryMode `json:"task_retry_mode,omitempty"` } type CreateJob struct { @@ -2519,6 +2522,77 @@ func (s ListRunsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ModelTriggerConfiguration struct { + // Aliases of the model versions to monitor. Can only be used in conjunction + // with condition MODEL_ALIAS_SET. + Aliases []string `json:"aliases,omitempty"` + // The condition based on which to trigger a job run. + Condition ModelTriggerConfigurationCondition `json:"condition"` + // If set, the trigger starts a run only after the specified amount of time + // has passed since the last time the trigger fired. The minimum allowed + // value is 60 seconds. + MinTimeBetweenTriggersSeconds int `json:"min_time_between_triggers_seconds,omitempty"` + // Name of the securable to monitor ("mycatalog.myschema.mymodel" in the + // case of model-level triggers, "mycatalog.myschema" in the case of + // schema-level triggers) or empty in the case of metastore-level triggers. + SecurableName string `json:"securable_name,omitempty"` + // If set, the trigger starts a run only after no model updates have + // occurred for the specified time and can be used to wait for a series of + // model updates before triggering a run. The minimum allowed value is 60 + // seconds. + WaitAfterLastChangeSeconds int `json:"wait_after_last_change_seconds,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ModelTriggerConfiguration) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ModelTriggerConfiguration) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ModelTriggerConfigurationCondition string + +const ModelTriggerConfigurationConditionModelAliasSet ModelTriggerConfigurationCondition = `MODEL_ALIAS_SET` + +const ModelTriggerConfigurationConditionModelCreated ModelTriggerConfigurationCondition = `MODEL_CREATED` + +const ModelTriggerConfigurationConditionModelVersionReady ModelTriggerConfigurationCondition = `MODEL_VERSION_READY` + +// String representation for [fmt.Print] +func (f *ModelTriggerConfigurationCondition) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ModelTriggerConfigurationCondition) Set(v string) error { + switch v { + case `MODEL_ALIAS_SET`, `MODEL_CREATED`, `MODEL_VERSION_READY`: + *f = ModelTriggerConfigurationCondition(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"`, v) + } +} + +// Values returns all possible values for ModelTriggerConfigurationCondition. +// +// There is no guarantee on the order of the values in the slice. +func (f *ModelTriggerConfigurationCondition) Values() []ModelTriggerConfigurationCondition { + return []ModelTriggerConfigurationCondition{ + ModelTriggerConfigurationConditionModelAliasSet, + ModelTriggerConfigurationConditionModelCreated, + ModelTriggerConfigurationConditionModelVersionReady, + } +} + +// Type always returns ModelTriggerConfigurationCondition to satisfy [pflag.Value] interface +func (f *ModelTriggerConfigurationCondition) Type() string { + return "ModelTriggerConfigurationCondition" +} + type NotebookOutput struct { // The value passed to // [dbutils.notebook.exit()](/notebooks/notebook-workflows.html#notebook-workflows-exit). @@ -5406,6 +5480,48 @@ func (s TaskNotificationSettings) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// task retry mode of the continuous job * NEVER: The failed task will not be +// retried. * ON_FAILURE: Retry a failed task if at least one other task in the +// job is still running its first attempt. When this condition is no longer met +// or the retry limit is reached, the job run is cancelled and a new run is +// started. +type TaskRetryMode string + +const TaskRetryModeNever TaskRetryMode = `NEVER` + +const TaskRetryModeOnFailure TaskRetryMode = `ON_FAILURE` + +// String representation for [fmt.Print] +func (f *TaskRetryMode) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *TaskRetryMode) Set(v string) error { + switch v { + case `NEVER`, `ON_FAILURE`: + *f = TaskRetryMode(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "NEVER", "ON_FAILURE"`, v) + } +} + +// Values returns all possible values for TaskRetryMode. +// +// There is no guarantee on the order of the values in the slice. +func (f *TaskRetryMode) Values() []TaskRetryMode { + return []TaskRetryMode{ + TaskRetryModeNever, + TaskRetryModeOnFailure, + } +} + +// Type always returns TaskRetryMode to satisfy [pflag.Value] interface +func (f *TaskRetryMode) Type() string { + return "TaskRetryMode" +} + // The code indicates why the run was terminated. Additional codes might be // introduced in future releases. * `SUCCESS`: The run was completed // successfully. * `SUCCESS_WITH_FAILURES`: The run was completed successfully @@ -5702,6 +5818,8 @@ func (s TriggerInfo) MarshalJSON() ([]byte, error) { type TriggerSettings struct { // File arrival trigger settings. FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` + + Model *ModelTriggerConfiguration `json:"model,omitempty"` // Whether this trigger is paused or not. PauseStatus PauseStatus `json:"pause_status,omitempty"` // Periodic trigger settings. diff --git a/service/ml/api.go b/service/ml/api.go index d74d7d91e..4c36a6935 100755 --- a/service/ml/api.go +++ b/service/ml/api.go @@ -95,6 +95,9 @@ type ExperimentsInterface interface { // Get a logged model. GetLoggedModelByModelId(ctx context.Context, modelId string) (*GetLoggedModelResponse, error) + // Batch endpoint for getting logged models from a list of model IDs + GetLoggedModels(ctx context.Context, request GetLoggedModelsRequest) (*GetLoggedModelsRequestResponse, error) + // Gets the permission levels that a user can have on an object. GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) diff --git a/service/ml/impl.go b/service/ml/impl.go index 83cfb3423..5c70f36c2 100755 --- a/service/ml/impl.go +++ b/service/ml/impl.go @@ -192,6 +192,16 @@ func (a *experimentsImpl) GetLoggedModel(ctx context.Context, request GetLoggedM return &getLoggedModelResponse, err } +func (a *experimentsImpl) GetLoggedModels(ctx context.Context, request GetLoggedModelsRequest) (*GetLoggedModelsRequestResponse, error) { + var getLoggedModelsRequestResponse GetLoggedModelsRequestResponse + path := "/api/2.0/mlflow/logged-models:batchGet" + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getLoggedModelsRequestResponse) + return &getLoggedModelsRequestResponse, err +} + func (a *experimentsImpl) GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) { var getExperimentPermissionLevelsResponse GetExperimentPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/experiments/%v/permissionLevels", request.ExperimentId) diff --git a/service/ml/interface.go b/service/ml/interface.go index 4a1df9dcb..80795bbc3 100755 --- a/service/ml/interface.go +++ b/service/ml/interface.go @@ -85,6 +85,9 @@ type ExperimentsService interface { // Get a logged model. GetLoggedModel(ctx context.Context, request GetLoggedModelRequest) (*GetLoggedModelResponse, error) + // Batch endpoint for getting logged models from a list of model IDs + GetLoggedModels(ctx context.Context, request GetLoggedModelsRequest) (*GetLoggedModelsRequestResponse, error) + // Gets the permission levels that a user can have on an object. GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) diff --git a/service/ml/model.go b/service/ml/model.go index 012796f58..708b354fe 100755 --- a/service/ml/model.go +++ b/service/ml/model.go @@ -1405,6 +1405,16 @@ type GetLoggedModelResponse struct { Model *LoggedModel `json:"model,omitempty"` } +type GetLoggedModelsRequest struct { + // The IDs of the logged models to retrieve. Max threshold is 100. + ModelIds []string `json:"-" url:"model_ids,omitempty"` +} + +type GetLoggedModelsRequestResponse struct { + // The retrieved logged models. + Models []LoggedModel `json:"models,omitempty"` +} + type GetMetricHistoryResponse struct { // All logged values for this metric if `max_results` is not specified in // the request or if the total count of metrics returned is less than the diff --git a/service/pipelines/api.go b/service/pipelines/api.go index d843e562a..06649eae8 100755 --- a/service/pipelines/api.go +++ b/service/pipelines/api.go @@ -118,6 +118,10 @@ type PipelinesInterface interface { // List updates for an active pipeline. ListUpdatesByPipelineId(ctx context.Context, pipelineId string) (*ListUpdatesResponse, error) + // * Restores a pipeline that was previously deleted, if within the restoration + // window. All tables deleted at pipeline deletion will be undropped as well. + RestorePipeline(ctx context.Context, request RestorePipelineRequest) (*RestorePipelineRequestResponse, error) + // Sets permissions on an object, replacing existing permissions if they exist. // Deletes all direct permissions if none are specified. Objects can inherit // permissions from their root object. diff --git a/service/pipelines/impl.go b/service/pipelines/impl.go index 1147be7b8..33ac4b610 100755 --- a/service/pipelines/impl.go +++ b/service/pipelines/impl.go @@ -169,6 +169,16 @@ func (a *pipelinesImpl) ListUpdates(ctx context.Context, request ListUpdatesRequ return &listUpdatesResponse, err } +func (a *pipelinesImpl) RestorePipeline(ctx context.Context, request RestorePipelineRequest) (*RestorePipelineRequestResponse, error) { + var restorePipelineRequestResponse RestorePipelineRequestResponse + path := fmt.Sprintf("/api/2.0/pipelines/%v/restore", request.PipelineId) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restorePipelineRequestResponse) + return &restorePipelineRequestResponse, err +} + func (a *pipelinesImpl) SetPermissions(ctx context.Context, request PipelinePermissionsRequest) (*PipelinePermissions, error) { var pipelinePermissions PipelinePermissions path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) diff --git a/service/pipelines/interface.go b/service/pipelines/interface.go index 31816b10d..c61d09d06 100755 --- a/service/pipelines/interface.go +++ b/service/pipelines/interface.go @@ -55,6 +55,11 @@ type PipelinesService interface { // List updates for an active pipeline. ListUpdates(ctx context.Context, request ListUpdatesRequest) (*ListUpdatesResponse, error) + // * Restores a pipeline that was previously deleted, if within the + // restoration window. All tables deleted at pipeline deletion will be + // undropped as well. + RestorePipeline(ctx context.Context, request RestorePipelineRequest) (*RestorePipelineRequestResponse, error) + // Sets permissions on an object, replacing existing permissions if they // exist. Deletes all direct permissions if none are specified. Objects can // inherit permissions from their root object. diff --git a/service/pipelines/model.go b/service/pipelines/model.go index bb737ccc3..93c8ee246 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -592,6 +592,12 @@ type IngestionPipelineDefinition struct { // to communicate with the source. This is used with connectors for // applications like Salesforce, Workday, and so on. ConnectionName string `json:"connection_name,omitempty"` + // Immutable. If set to true, the pipeline will ingest tables from the UC + // foreign catalogs directly without the need to specify a UC connection or + // ingestion gateway. The `source_catalog` fields in objects of + // IngestionConfig are interpreted as the UC foreign catalogs to ingest + // from. + IngestFromUcForeignCatalog bool `json:"ingest_from_uc_foreign_catalog,omitempty"` // Immutable. Identifier for the gateway that is used by this ingestion // pipeline to communicate with the source database. This is used with // connectors to databases like SQL Server. @@ -1684,6 +1690,14 @@ func (s RestartWindow) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type RestorePipelineRequest struct { + // The ID of the pipeline to restore + PipelineId string `json:"-" url:"-"` +} + +type RestorePipelineRequestResponse struct { +} + // Write-only setting, available only in Create/Update calls. Specifies the user // or service principal that the pipeline runs as. If not specified, the // pipeline runs as the user who created the pipeline. @@ -1944,6 +1958,10 @@ type TableSpecificConfig struct { PrimaryKeys []string `json:"primary_keys,omitempty"` QueryBasedConnectorConfig *IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig `json:"query_based_connector_config,omitempty"` + // (Optional, Immutable) The row filter condition to be applied to the + // table. It must not contain the WHERE keyword, only the actual filter + // condition. It must be in DBSQL format. + RowFilter string `json:"row_filter,omitempty"` // If true, formula fields defined in the table are included in the // ingestion. This setting is only valid for the Salesforce connector SalesforceIncludeFormulaFields bool `json:"salesforce_include_formula_fields,omitempty"` diff --git a/service/pkg.go b/service/pkg.go index 3fc4eafbb..0c3a15b4e 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -58,10 +58,10 @@ // // - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. // -// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. -// // - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. // +// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. +// // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. // // - [settings.CspEnablementAccountAPI]: The compliance security profile settings at the account level control whether to enable it for new workspaces. @@ -228,6 +228,8 @@ // // - [sql.QueriesLegacyAPI]: These endpoints are used for CRUD operations on query definitions. // +// - [dashboards.QueryExecutionAPI]: Query execution APIs for AI / BI Dashboards. +// // - [sql.QueryHistoryAPI]: A service responsible for storing and retrieving the list of queries run against SQL endpoints and serverless compute. // // - [sql.QueryVisualizationsAPI]: This is an evolving API that facilitates the addition and removal of visualizations from existing queries in the Databricks Workspace. @@ -246,6 +248,8 @@ // // - [workspace.ReposAPI]: The Repos API allows users to manage their git repos. // +// - [catalog.RequestForAccessAPI]: Request for Access enables customers to request access to and manage access request destinations for Unity Catalog securables. +// // - [catalog.ResourceQuotasAPI]: Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that can be created. // // - [settings.RestrictWorkspaceAdminsAPI]: The Restrict Workspace Admins setting lets you control the capabilities of workspace admins. @@ -272,6 +276,8 @@ // // - [settings.AccountSettingsAPI]: Accounts Settings API allows users to manage settings at the account level. // +// - [settingsv2.AccountSettingsV2API]: APIs to manage account level settings. +// // - [sharing.SharesAPI]: A share is a container instantiated with :method:shares/create. // // - [settings.SqlResultsDownloadAPI]: Controls whether users within the workspace are allowed to download results from the SQL Editor and AI/BI Dashboards UIs. @@ -322,6 +328,8 @@ // // - [settings.WorkspaceNetworkConfigurationAPI]: These APIs allow configuration of network settings for Databricks workspaces by selecting which network policy to associate with the workspace. // +// - [settingsv2.WorkspaceSettingsV2API]: APIs to manage workspace level settings. +// // - [provisioning.WorkspacesAPI]: These APIs manage workspaces for this account. package service @@ -345,6 +353,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/qualitymonitorv2" "github.com/databricks/databricks-sdk-go/service/serving" "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/databricks/databricks-sdk-go/service/settingsv2" "github.com/databricks/databricks-sdk-go/service/sharing" "github.com/databricks/databricks-sdk-go/service/sql" "github.com/databricks/databricks-sdk-go/service/vectorsearch" @@ -385,8 +394,8 @@ var ( _ *marketplace.ConsumerListingsAPI = nil _ *marketplace.ConsumerPersonalizationRequestsAPI = nil _ *marketplace.ConsumerProvidersAPI = nil - _ *provisioning.CredentialsAPI = nil _ *catalog.CredentialsAPI = nil + _ *provisioning.CredentialsAPI = nil _ *settings.CredentialsManagerAPI = nil _ *settings.CspEnablementAccountAPI = nil _ *iam.CurrentUserAPI = nil @@ -470,6 +479,7 @@ var ( _ *catalog.QualityMonitorsAPI = nil _ *sql.QueriesAPI = nil _ *sql.QueriesLegacyAPI = nil + _ *dashboards.QueryExecutionAPI = nil _ *sql.QueryHistoryAPI = nil _ *sql.QueryVisualizationsAPI = nil _ *sql.QueryVisualizationsLegacyAPI = nil @@ -479,6 +489,7 @@ var ( _ *sql.RedashConfigAPI = nil _ *catalog.RegisteredModelsAPI = nil _ *workspace.ReposAPI = nil + _ *catalog.RequestForAccessAPI = nil _ *catalog.ResourceQuotasAPI = nil _ *settings.RestrictWorkspaceAdminsAPI = nil _ *catalog.SchemasAPI = nil @@ -492,6 +503,7 @@ var ( _ *serving.ServingEndpointsDataPlaneAPI = nil _ *settings.SettingsAPI = nil _ *settings.AccountSettingsAPI = nil + _ *settingsv2.AccountSettingsV2API = nil _ *sharing.SharesAPI = nil _ *settings.SqlResultsDownloadAPI = nil _ *sql.StatementExecutionAPI = nil @@ -517,5 +529,6 @@ var ( _ *catalog.WorkspaceBindingsAPI = nil _ *settings.WorkspaceConfAPI = nil _ *settings.WorkspaceNetworkConfigurationAPI = nil + _ *settingsv2.WorkspaceSettingsV2API = nil _ *provisioning.WorkspacesAPI = nil ) diff --git a/service/qualitymonitorv2/model.go b/service/qualitymonitorv2/model.go index b7a13ee2f..091dd0c82 100755 --- a/service/qualitymonitorv2/model.go +++ b/service/qualitymonitorv2/model.go @@ -9,6 +9,8 @@ import ( ) type AnomalyDetectionConfig struct { + // The type of the last run of the workflow. + JobType AnomalyDetectionJobType `json:"job_type,omitempty"` // Run id of the last run of the workflow LastRunId string `json:"last_run_id,omitempty"` // The status of the last run of the workflow. @@ -25,6 +27,43 @@ func (s AnomalyDetectionConfig) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type AnomalyDetectionJobType string + +const AnomalyDetectionJobTypeAnomalyDetectionJobTypeInternalHidden AnomalyDetectionJobType = `ANOMALY_DETECTION_JOB_TYPE_INTERNAL_HIDDEN` + +const AnomalyDetectionJobTypeAnomalyDetectionJobTypeNormal AnomalyDetectionJobType = `ANOMALY_DETECTION_JOB_TYPE_NORMAL` + +// String representation for [fmt.Print] +func (f *AnomalyDetectionJobType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *AnomalyDetectionJobType) Set(v string) error { + switch v { + case `ANOMALY_DETECTION_JOB_TYPE_INTERNAL_HIDDEN`, `ANOMALY_DETECTION_JOB_TYPE_NORMAL`: + *f = AnomalyDetectionJobType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ANOMALY_DETECTION_JOB_TYPE_INTERNAL_HIDDEN", "ANOMALY_DETECTION_JOB_TYPE_NORMAL"`, v) + } +} + +// Values returns all possible values for AnomalyDetectionJobType. +// +// There is no guarantee on the order of the values in the slice. +func (f *AnomalyDetectionJobType) Values() []AnomalyDetectionJobType { + return []AnomalyDetectionJobType{ + AnomalyDetectionJobTypeAnomalyDetectionJobTypeInternalHidden, + AnomalyDetectionJobTypeAnomalyDetectionJobTypeNormal, + } +} + +// Type always returns AnomalyDetectionJobType to satisfy [pflag.Value] interface +func (f *AnomalyDetectionJobType) Type() string { + return "AnomalyDetectionJobType" +} + // Status of Anomaly Detection Job Run type AnomalyDetectionRunStatus string diff --git a/service/serving/model.go b/service/serving/model.go index 93e3a1a1d..bbd96022f 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -165,6 +165,9 @@ type AiGatewayRateLimit struct { // Renewal period field for a rate limit. Currently, only 'minute' is // supported. RenewalPeriod AiGatewayRateLimitRenewalPeriod `json:"renewal_period"` + // Used to specify how many tokens are allowed for a key within the + // renewal_period. + Tokens int64 `json:"tokens,omitempty"` ForceSendFields []string `json:"-" url:"-"` } diff --git a/service/settings/model.go b/service/settings/model.go index 0f1a255b0..dbd6430cc 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -40,7 +40,7 @@ type AccountNetworkPolicy struct { // The associated account ID for this Network Policy object. AccountId string `json:"account_id,omitempty"` // The network policies applying for egress traffic. - Egress *NetworkPolicyEgress `json:"egress,omitempty"` + Egress NetworkPolicyEgress `json:"egress"` // The unique identifier for the network policy. NetworkPolicyId string `json:"network_policy_id,omitempty"` @@ -3549,7 +3549,7 @@ func (s NetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { // https://docs.google.com/document/d/1DKWO_FpZMCY4cF2O62LpwII1lx8gsnDGG-qgE3t3TOA/ type NetworkPolicyEgress struct { // The access policy enforced for egress traffic to the internet. - NetworkAccess *EgressNetworkPolicyNetworkAccessPolicy `json:"network_access,omitempty"` + NetworkAccess EgressNetworkPolicyNetworkAccessPolicy `json:"network_access"` } type NotificationDestination struct { diff --git a/service/settingsv2/api.go b/service/settingsv2/api.go new file mode 100755 index 000000000..e88fac39b --- /dev/null +++ b/service/settingsv2/api.go @@ -0,0 +1,54 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +// These APIs allow you to manage Account Settings V2, Workspace Settings V2, etc. +package settingsv2 + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" +) + +type AccountSettingsV2Interface interface { + + // Get a setting value at account level + GetPublicAccountSetting(ctx context.Context, request GetPublicAccountSettingRequest) (*Setting, error) + + // Patch a setting value at account level + PatchPublicAccountSetting(ctx context.Context, request PatchPublicAccountSettingRequest) (*Setting, error) +} + +func NewAccountSettingsV2(client *client.DatabricksClient) *AccountSettingsV2API { + return &AccountSettingsV2API{ + accountSettingsV2Impl: accountSettingsV2Impl{ + client: client, + }, + } +} + +// APIs to manage account level settings +type AccountSettingsV2API struct { + accountSettingsV2Impl +} + +type WorkspaceSettingsV2Interface interface { + + // Get a setting value at workspace level + GetPublicWorkspaceSetting(ctx context.Context, request GetPublicWorkspaceSettingRequest) (*Setting, error) + + // Patch a setting value at workspace level + PatchPublicWorkspaceSetting(ctx context.Context, request PatchPublicWorkspaceSettingRequest) (*Setting, error) +} + +func NewWorkspaceSettingsV2(client *client.DatabricksClient) *WorkspaceSettingsV2API { + return &WorkspaceSettingsV2API{ + workspaceSettingsV2Impl: workspaceSettingsV2Impl{ + client: client, + }, + } +} + +// APIs to manage workspace level settings +type WorkspaceSettingsV2API struct { + workspaceSettingsV2Impl +} diff --git a/service/settingsv2/impl.go b/service/settingsv2/impl.go new file mode 100755 index 000000000..05f78d357 --- /dev/null +++ b/service/settingsv2/impl.go @@ -0,0 +1,63 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package settingsv2 + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sdk-go/client" +) + +// unexported type that holds implementations of just AccountSettingsV2 API methods +type accountSettingsV2Impl struct { + client *client.DatabricksClient +} + +func (a *accountSettingsV2Impl) GetPublicAccountSetting(ctx context.Context, request GetPublicAccountSettingRequest) (*Setting, error) { + var setting Setting + path := fmt.Sprintf("/api/2.1/accounts/%v/settings/%v", a.client.ConfiguredAccountID(), request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &setting) + return &setting, err +} + +func (a *accountSettingsV2Impl) PatchPublicAccountSetting(ctx context.Context, request PatchPublicAccountSettingRequest) (*Setting, error) { + var setting Setting + path := fmt.Sprintf("/api/2.1/accounts/%v/settings/%v", a.client.ConfiguredAccountID(), request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Setting, &setting) + return &setting, err +} + +// unexported type that holds implementations of just WorkspaceSettingsV2 API methods +type workspaceSettingsV2Impl struct { + client *client.DatabricksClient +} + +func (a *workspaceSettingsV2Impl) GetPublicWorkspaceSetting(ctx context.Context, request GetPublicWorkspaceSettingRequest) (*Setting, error) { + var setting Setting + path := fmt.Sprintf("/api/2.1/settings/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &setting) + return &setting, err +} + +func (a *workspaceSettingsV2Impl) PatchPublicWorkspaceSetting(ctx context.Context, request PatchPublicWorkspaceSettingRequest) (*Setting, error) { + var setting Setting + path := fmt.Sprintf("/api/2.1/settings/%v", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Setting, &setting) + return &setting, err +} diff --git a/service/settingsv2/interface.go b/service/settingsv2/interface.go new file mode 100755 index 000000000..904f57b5d --- /dev/null +++ b/service/settingsv2/interface.go @@ -0,0 +1,31 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package settingsv2 + +import ( + "context" +) + +// APIs to manage account level settings +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type AccountSettingsV2Service interface { + + // Get a setting value at account level + GetPublicAccountSetting(ctx context.Context, request GetPublicAccountSettingRequest) (*Setting, error) + + // Patch a setting value at account level + PatchPublicAccountSetting(ctx context.Context, request PatchPublicAccountSettingRequest) (*Setting, error) +} + +// APIs to manage workspace level settings +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type WorkspaceSettingsV2Service interface { + + // Get a setting value at workspace level + GetPublicWorkspaceSetting(ctx context.Context, request GetPublicWorkspaceSettingRequest) (*Setting, error) + + // Patch a setting value at workspace level + PatchPublicWorkspaceSetting(ctx context.Context, request PatchPublicWorkspaceSettingRequest) (*Setting, error) +} diff --git a/service/settingsv2/model.go b/service/settingsv2/model.go new file mode 100755 index 000000000..35089b49e --- /dev/null +++ b/service/settingsv2/model.go @@ -0,0 +1,96 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package settingsv2 + +import ( + "github.com/databricks/databricks-sdk-go/marshal" +) + +type BooleanMessage struct { + Value bool `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *BooleanMessage) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s BooleanMessage) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type GetPublicAccountSettingRequest struct { + Name string `json:"-" url:"-"` +} + +type GetPublicWorkspaceSettingRequest struct { + Name string `json:"-" url:"-"` +} + +type IntegerMessage struct { + Value int `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *IntegerMessage) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s IntegerMessage) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type PatchPublicAccountSettingRequest struct { + Name string `json:"-" url:"-"` + + Setting Setting `json:"setting"` +} + +type PatchPublicWorkspaceSettingRequest struct { + Name string `json:"-" url:"-"` + + Setting Setting `json:"setting"` +} + +type Setting struct { + BooleanVal *BooleanMessage `json:"boolean_val,omitempty"` + + EffectiveBooleanVal *BooleanMessage `json:"effective_boolean_val,omitempty"` + + EffectiveIntegerVal *IntegerMessage `json:"effective_integer_val,omitempty"` + + EffectiveStringVal *StringMessage `json:"effective_string_val,omitempty"` + + IntegerVal *IntegerMessage `json:"integer_val,omitempty"` + // Name of the setting. + Name string `json:"name,omitempty"` + + StringVal *StringMessage `json:"string_val,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *Setting) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Setting) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type StringMessage struct { + // Represents a generic string value. + Value string `json:"value,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *StringMessage) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s StringMessage) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} diff --git a/service/sharing/model.go b/service/sharing/model.go index 01f994f31..7a183a034 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -948,6 +948,16 @@ type PermissionsChange struct { // The principal whose privileges we are changing. Only one of principal or // principal_id should be specified, never both at the same time. Principal string `json:"principal,omitempty"` + // An opaque internal ID that identifies the principal whose privileges + // should be removed. + // + // This field is intended for removing privileges associated with a deleted + // user. When set, only the entries specified in the remove field are + // processed; any entries in the add field will be rejected. + // + // Only one of principal or principal_id should be specified, never both at + // the same time. + PrincipalId int64 `json:"principal_id,omitempty"` // The set of privileges to remove. Remove []string `json:"remove,omitempty"` @@ -1132,6 +1142,9 @@ type PrivilegeAssignment struct { // The principal (user email address or group name). For deleted principals, // `principal` is empty while `principal_id` is populated. Principal string `json:"principal,omitempty"` + // Unique identifier of the principal. For active principals, both + // `principal` and `principal_id` are present. + PrincipalId int64 `json:"principal_id,omitempty"` // The privileges assigned to the principal. Privileges []Privilege `json:"privileges,omitempty"` diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index 727e80175..d5f40af60 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -164,6 +164,8 @@ type DeltaSyncVectorIndexSpecRequest struct { // index. The primary key column and embedding source column or embedding // vector column are always synced. ColumnsToSync []string `json:"columns_to_sync,omitempty"` + // The budget policy id applied to the vector search index + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` // The columns that contain the embedding source. EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` // The columns that contain the embedding vectors. @@ -194,6 +196,8 @@ func (s DeltaSyncVectorIndexSpecRequest) MarshalJSON() ([]byte, error) { } type DeltaSyncVectorIndexSpecResponse struct { + // The budget policy id applied to the vector search index + EffectiveBudgetPolicyId string `json:"effective_budget_policy_id,omitempty"` // The columns that contain the embedding source. EmbeddingSourceColumns []EmbeddingSourceColumn `json:"embedding_source_columns,omitempty"` // The columns that contain the embedding vectors. @@ -417,8 +421,24 @@ type GetEndpointRequest struct { } type GetIndexRequest struct { + // If true, the URL returned for the index is guaranteed to be compatible + // with the reranker. Currently this means we return the CP URL regardless + // of how the index is being accessed. If not set or set to false, the URL + // may still be compatible with the reranker depending on what URL we + // return. + EnsureRerankerCompatible bool `json:"-" url:"ensure_reranker_compatible,omitempty"` // Name of the index IndexName string `json:"-" url:"-"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *GetIndexRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s GetIndexRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type ListEndpointResponse struct { @@ -652,6 +672,8 @@ type QueryVectorIndexRequest struct { // Query vector. Required for Direct Vector Access Index and Delta Sync // Index using self-managed vectors. QueryVector []float64 `json:"query_vector,omitempty"` + + Reranker *RerankerConfig `json:"reranker,omitempty"` // Threshold for the approximate nearest neighbor search. Defaults to 0.0. ScoreThreshold float64 `json:"score_threshold,omitempty"` @@ -688,6 +710,26 @@ func (s QueryVectorIndexResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type RerankerConfig struct { + Model string `json:"model,omitempty"` + + Parameters *RerankerConfigRerankerParameters `json:"parameters,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *RerankerConfig) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s RerankerConfig) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type RerankerConfigRerankerParameters struct { + ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` +} + // Data returned in the query result. type ResultData struct { // Data rows returned in the query. diff --git a/workspace_client.go b/workspace_client.go index 75224d652..1560ccdad 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -26,6 +26,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/qualitymonitorv2" "github.com/databricks/databricks-sdk-go/service/serving" "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/databricks/databricks-sdk-go/service/settingsv2" "github.com/databricks/databricks-sdk-go/service/sharing" "github.com/databricks/databricks-sdk-go/service/sql" "github.com/databricks/databricks-sdk-go/service/vectorsearch" @@ -725,6 +726,9 @@ type WorkspaceClient struct { // [Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html QueriesLegacy sql.QueriesLegacyInterface + // Query execution APIs for AI / BI Dashboards + QueryExecution dashboards.QueryExecutionInterface + // A service responsible for storing and retrieving the list of queries run // against SQL endpoints and serverless compute. QueryHistory sql.QueryHistoryInterface @@ -853,6 +857,15 @@ type WorkspaceClient struct { // for version control, collaboration, and CI/CD. Repos workspace.ReposInterface + // Request for Access enables customers to request access to and manage + // access request destinations for Unity Catalog securables. + // + // These APIs provide a standardized way to update, get, and request to + // access request destinations. Fine-grained authorization ensures that only + // users with appropriate permissions can manage access request + // destinations. + RequestForAccess catalog.RequestForAccessInterface + // Unity Catalog enforces resource quotas on all securable objects, which // limits the number of resources that can be created. Quotas are expressed // in terms of a resource type and a parent (for example, tables per @@ -1209,6 +1222,9 @@ type WorkspaceClient struct { // This API allows updating known workspace settings for advanced users. WorkspaceConf settings.WorkspaceConfInterface + + // APIs to manage workspace level settings + WorkspaceSettingsV2 settingsv2.WorkspaceSettingsV2Interface } var ErrNotWorkspaceClient = errors.New("invalid Databricks Workspace configuration") @@ -1319,6 +1335,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { QualityMonitors: catalog.NewQualityMonitors(databricksClient), Queries: sql.NewQueries(databricksClient), QueriesLegacy: sql.NewQueriesLegacy(databricksClient), + QueryExecution: dashboards.NewQueryExecution(databricksClient), QueryHistory: sql.NewQueryHistory(databricksClient), QueryVisualizations: sql.NewQueryVisualizations(databricksClient), QueryVisualizationsLegacy: sql.NewQueryVisualizationsLegacy(databricksClient), @@ -1328,6 +1345,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { RedashConfig: sql.NewRedashConfig(databricksClient), RegisteredModels: catalog.NewRegisteredModels(databricksClient), Repos: workspace.NewRepos(databricksClient), + RequestForAccess: catalog.NewRequestForAccess(databricksClient), ResourceQuotas: catalog.NewResourceQuotas(databricksClient), Schemas: catalog.NewSchemas(databricksClient), Secrets: workspace.NewSecrets(databricksClient), @@ -1353,5 +1371,6 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Workspace: workspace.NewWorkspace(databricksClient), WorkspaceBindings: catalog.NewWorkspaceBindings(databricksClient), WorkspaceConf: settings.NewWorkspaceConf(databricksClient), + WorkspaceSettingsV2: settingsv2.NewWorkspaceSettingsV2(databricksClient), }, nil }