diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 62eb1dbba..56fe6bbca 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -69902d1abe35bd9e78e0231927bf14d11b383a16 \ No newline at end of file +f1b0d17cb8fad93072f563ccad39f9d2dabb7c29 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 0ca0850a8..9822bcda3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -167,14 +167,17 @@ experimental/mocks/service/workspace/mock_git_credentials_interface.go linguist- experimental/mocks/service/workspace/mock_repos_interface.go linguist-generated=true experimental/mocks/service/workspace/mock_secrets_interface.go linguist-generated=true experimental/mocks/service/workspace/mock_workspace_interface.go linguist-generated=true -service/aibuilder/api.go linguist-generated=true -service/aibuilder/impl.go linguist-generated=true -service/aibuilder/interface.go linguist-generated=true -service/aibuilder/model.go linguist-generated=true +service/agentbricks/api.go linguist-generated=true +service/agentbricks/impl.go linguist-generated=true +service/agentbricks/interface.go linguist-generated=true +service/agentbricks/model.go linguist-generated=true 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 diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 3aa4fe04d..39bd2dddf 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -16,3 +16,34 @@ ### Internal Changes ### API Changes +* Added [agentbricks](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/agentbricks) package. +* Added [w.CleanRoomAssetRevisions](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetRevisionsAPI) workspace-level service and [w.CleanRoomAutoApprovalRules](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAutoApprovalRulesAPI) workspace-level service. +* Added `CreateCleanRoomAssetReview` method for [w.CleanRoomAssets](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetsAPI) workspace-level service. +* Added `LatestMonitorFailureMsg` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor). +* Added `LatestMonitorFailureMsg` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). +* Added `ProvisioningPhase` field for [database.SyncedTablePipelineProgress](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/database#SyncedTablePipelineProgress). +* Added `Unspecified` enum value for [catalog.MonitorCronSchedulePauseStatus](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedulePauseStatus). +* Added `Unknown` enum value for [catalog.MonitorRefreshInfoState](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfoState). +* Added `UnknownTrigger` enum value for [catalog.MonitorRefreshInfoTrigger](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfoTrigger). +* Added `Redshift` and `Sqldw` enum values for [pipelines.IngestionSourceType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#IngestionSourceType). +* Added `GermanyC5` enum value for [settings.ComplianceStandard](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/settings#ComplianceStandard). +* [Breaking] Changed `CancelRefresh` method for [w.QualityMonitors](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI) workspace-level service to start returning [catalog.CancelRefreshResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CancelRefreshResponse). +* [Breaking] Changed `Create` method for [w.QualityMonitors](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI) workspace-level service with new required argument order. +* [Breaking] Changed `Delete` method for [w.QualityMonitors](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#QualityMonitorsAPI) workspace-level service to start returning [catalog.DeleteMonitorResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#DeleteMonitorResponse). +* [Breaking] Changed `RefreshId` field for [catalog.CancelRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CancelRefreshRequest) to type `int64`. +* [Breaking] Changed `RefreshId` field for [catalog.GetRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetRefreshRequest) to type `int64`. +* [Breaking] Changed `MonitorVersion` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to type `int64`. +* Changed `OutputSchemaName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. +* [Breaking] Changed `AssetType` and `Name` fields for [cleanrooms.CleanRoomAsset](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAsset) to be required. +* Changed `AssetType` and `Name` fields for [cleanrooms.CleanRoomAsset](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAsset) to be required. +* [Breaking] Changed `LocalName` field for [cleanrooms.CleanRoomAssetForeignTableLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetForeignTableLocalDetails) to be required. +* Changed `LocalName` field for [cleanrooms.CleanRoomAssetForeignTableLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetForeignTableLocalDetails) to be required. +* [Breaking] Changed `NotebookContent` field for [cleanrooms.CleanRoomAssetNotebook](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetNotebook) to be required. +* Changed `NotebookContent` field for [cleanrooms.CleanRoomAssetNotebook](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetNotebook) to be required. +* [Breaking] Changed `LocalName` field for [cleanrooms.CleanRoomAssetTableLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetTableLocalDetails) to be required. +* Changed `LocalName` field for [cleanrooms.CleanRoomAssetTableLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetTableLocalDetails) to be required. +* [Breaking] Changed `LocalName` field for [cleanrooms.CleanRoomAssetViewLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetViewLocalDetails) to be required. +* Changed `LocalName` field for [cleanrooms.CleanRoomAssetViewLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetViewLocalDetails) to be required. +* [Breaking] Changed `LocalName` field for [cleanrooms.CleanRoomAssetVolumeLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetVolumeLocalDetails) to be required. +* Changed `LocalName` field for [cleanrooms.CleanRoomAssetVolumeLocalDetails](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetVolumeLocalDetails) to be required. +* [Breaking] Removed [aibuilder](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/aibuilder) package. \ No newline at end of file diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index eb808452e..cf58e348b 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -8,7 +8,7 @@ import ( "github.com/databricks/databricks-sdk-go" "github.com/stretchr/testify/mock" - "github.com/databricks/databricks-sdk-go/experimental/mocks/service/aibuilder" + "github.com/databricks/databricks-sdk-go/experimental/mocks/service/agentbricks" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/apps" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/catalog" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/cleanrooms" @@ -47,14 +47,16 @@ func NewMockWorkspaceClient(t interface { AccessControl: iam.NewMockAccessControlInterface(t), AccountAccessControlProxy: iam.NewMockAccountAccessControlProxyInterface(t), - AiBuilder: aibuilder.NewMockAiBuilderInterface(t), + AgentBricks: agentbricks.NewMockAgentBricksInterface(t), Alerts: sql.NewMockAlertsInterface(t), AlertsLegacy: sql.NewMockAlertsLegacyInterface(t), AlertsV2: sql.NewMockAlertsV2Interface(t), Apps: apps.NewMockAppsInterface(t), ArtifactAllowlists: catalog.NewMockArtifactAllowlistsInterface(t), Catalogs: catalog.NewMockCatalogsInterface(t), + CleanRoomAssetRevisions: cleanrooms.NewMockCleanRoomAssetRevisionsInterface(t), CleanRoomAssets: cleanrooms.NewMockCleanRoomAssetsInterface(t), + CleanRoomAutoApprovalRules: cleanrooms.NewMockCleanRoomAutoApprovalRulesInterface(t), CleanRoomTaskRuns: cleanrooms.NewMockCleanRoomTaskRunsInterface(t), CleanRooms: cleanrooms.NewMockCleanRoomsInterface(t), ClusterPolicies: compute.NewMockClusterPoliciesInterface(t), @@ -353,10 +355,10 @@ func (m *MockWorkspaceClient) GetMockAccountAccessControlProxyAPI() *iam.MockAcc return api } -func (m *MockWorkspaceClient) GetMockAiBuilderAPI() *aibuilder.MockAiBuilderInterface { - api, ok := m.WorkspaceClient.AiBuilder.(*aibuilder.MockAiBuilderInterface) +func (m *MockWorkspaceClient) GetMockAgentBricksAPI() *agentbricks.MockAgentBricksInterface { + api, ok := m.WorkspaceClient.AgentBricks.(*agentbricks.MockAgentBricksInterface) if !ok { - panic(fmt.Sprintf("expected AiBuilder to be *aibuilder.MockAiBuilderInterface, actual was %T", m.WorkspaceClient.AiBuilder)) + panic(fmt.Sprintf("expected AgentBricks to be *agentbricks.MockAgentBricksInterface, actual was %T", m.WorkspaceClient.AgentBricks)) } return api } @@ -409,6 +411,14 @@ func (m *MockWorkspaceClient) GetMockCatalogsAPI() *catalog.MockCatalogsInterfac return api } +func (m *MockWorkspaceClient) GetMockCleanRoomAssetRevisionsAPI() *cleanrooms.MockCleanRoomAssetRevisionsInterface { + api, ok := m.WorkspaceClient.CleanRoomAssetRevisions.(*cleanrooms.MockCleanRoomAssetRevisionsInterface) + if !ok { + panic(fmt.Sprintf("expected CleanRoomAssetRevisions to be *cleanrooms.MockCleanRoomAssetRevisionsInterface, actual was %T", m.WorkspaceClient.CleanRoomAssetRevisions)) + } + return api +} + func (m *MockWorkspaceClient) GetMockCleanRoomAssetsAPI() *cleanrooms.MockCleanRoomAssetsInterface { api, ok := m.WorkspaceClient.CleanRoomAssets.(*cleanrooms.MockCleanRoomAssetsInterface) if !ok { @@ -417,6 +427,14 @@ func (m *MockWorkspaceClient) GetMockCleanRoomAssetsAPI() *cleanrooms.MockCleanR return api } +func (m *MockWorkspaceClient) GetMockCleanRoomAutoApprovalRulesAPI() *cleanrooms.MockCleanRoomAutoApprovalRulesInterface { + api, ok := m.WorkspaceClient.CleanRoomAutoApprovalRules.(*cleanrooms.MockCleanRoomAutoApprovalRulesInterface) + if !ok { + panic(fmt.Sprintf("expected CleanRoomAutoApprovalRules to be *cleanrooms.MockCleanRoomAutoApprovalRulesInterface, actual was %T", m.WorkspaceClient.CleanRoomAutoApprovalRules)) + } + return api +} + func (m *MockWorkspaceClient) GetMockCleanRoomTaskRunsAPI() *cleanrooms.MockCleanRoomTaskRunsInterface { api, ok := m.WorkspaceClient.CleanRoomTaskRuns.(*cleanrooms.MockCleanRoomTaskRunsInterface) if !ok { diff --git a/experimental/mocks/service/agentbricks/mock_agent_bricks_interface.go b/experimental/mocks/service/agentbricks/mock_agent_bricks_interface.go new file mode 100644 index 000000000..29592002c --- /dev/null +++ b/experimental/mocks/service/agentbricks/mock_agent_bricks_interface.go @@ -0,0 +1,368 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package agentbricks + +import ( + context "context" + + agentbricks "github.com/databricks/databricks-sdk-go/service/agentbricks" + + mock "github.com/stretchr/testify/mock" +) + +// MockAgentBricksInterface is an autogenerated mock type for the AgentBricksInterface type +type MockAgentBricksInterface struct { + mock.Mock +} + +type MockAgentBricksInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAgentBricksInterface) EXPECT() *MockAgentBricksInterface_Expecter { + return &MockAgentBricksInterface_Expecter{mock: &_m.Mock} +} + +// CancelOptimize provides a mock function with given fields: ctx, request +func (_m *MockAgentBricksInterface) CancelOptimize(ctx context.Context, request agentbricks.CancelCustomLlmOptimizationRunRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CancelOptimize") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.CancelCustomLlmOptimizationRunRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAgentBricksInterface_CancelOptimize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelOptimize' +type MockAgentBricksInterface_CancelOptimize_Call struct { + *mock.Call +} + +// CancelOptimize is a helper method to define mock.On call +// - ctx context.Context +// - request agentbricks.CancelCustomLlmOptimizationRunRequest +func (_e *MockAgentBricksInterface_Expecter) CancelOptimize(ctx interface{}, request interface{}) *MockAgentBricksInterface_CancelOptimize_Call { + return &MockAgentBricksInterface_CancelOptimize_Call{Call: _e.mock.On("CancelOptimize", ctx, request)} +} + +func (_c *MockAgentBricksInterface_CancelOptimize_Call) Run(run func(ctx context.Context, request agentbricks.CancelCustomLlmOptimizationRunRequest)) *MockAgentBricksInterface_CancelOptimize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(agentbricks.CancelCustomLlmOptimizationRunRequest)) + }) + return _c +} + +func (_c *MockAgentBricksInterface_CancelOptimize_Call) Return(_a0 error) *MockAgentBricksInterface_CancelOptimize_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAgentBricksInterface_CancelOptimize_Call) RunAndReturn(run func(context.Context, agentbricks.CancelCustomLlmOptimizationRunRequest) error) *MockAgentBricksInterface_CancelOptimize_Call { + _c.Call.Return(run) + return _c +} + +// CreateCustomLlm provides a mock function with given fields: ctx, request +func (_m *MockAgentBricksInterface) CreateCustomLlm(ctx context.Context, request agentbricks.CreateCustomLlmRequest) (*agentbricks.CustomLlm, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateCustomLlm") + } + + var r0 *agentbricks.CustomLlm + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.CreateCustomLlmRequest) (*agentbricks.CustomLlm, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.CreateCustomLlmRequest) *agentbricks.CustomLlm); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*agentbricks.CustomLlm) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, agentbricks.CreateCustomLlmRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAgentBricksInterface_CreateCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCustomLlm' +type MockAgentBricksInterface_CreateCustomLlm_Call struct { + *mock.Call +} + +// CreateCustomLlm is a helper method to define mock.On call +// - ctx context.Context +// - request agentbricks.CreateCustomLlmRequest +func (_e *MockAgentBricksInterface_Expecter) CreateCustomLlm(ctx interface{}, request interface{}) *MockAgentBricksInterface_CreateCustomLlm_Call { + return &MockAgentBricksInterface_CreateCustomLlm_Call{Call: _e.mock.On("CreateCustomLlm", ctx, request)} +} + +func (_c *MockAgentBricksInterface_CreateCustomLlm_Call) Run(run func(ctx context.Context, request agentbricks.CreateCustomLlmRequest)) *MockAgentBricksInterface_CreateCustomLlm_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(agentbricks.CreateCustomLlmRequest)) + }) + return _c +} + +func (_c *MockAgentBricksInterface_CreateCustomLlm_Call) Return(_a0 *agentbricks.CustomLlm, _a1 error) *MockAgentBricksInterface_CreateCustomLlm_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAgentBricksInterface_CreateCustomLlm_Call) RunAndReturn(run func(context.Context, agentbricks.CreateCustomLlmRequest) (*agentbricks.CustomLlm, error)) *MockAgentBricksInterface_CreateCustomLlm_Call { + _c.Call.Return(run) + return _c +} + +// DeleteCustomLlm provides a mock function with given fields: ctx, request +func (_m *MockAgentBricksInterface) DeleteCustomLlm(ctx context.Context, request agentbricks.DeleteCustomLlmRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteCustomLlm") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.DeleteCustomLlmRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAgentBricksInterface_DeleteCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCustomLlm' +type MockAgentBricksInterface_DeleteCustomLlm_Call struct { + *mock.Call +} + +// DeleteCustomLlm is a helper method to define mock.On call +// - ctx context.Context +// - request agentbricks.DeleteCustomLlmRequest +func (_e *MockAgentBricksInterface_Expecter) DeleteCustomLlm(ctx interface{}, request interface{}) *MockAgentBricksInterface_DeleteCustomLlm_Call { + return &MockAgentBricksInterface_DeleteCustomLlm_Call{Call: _e.mock.On("DeleteCustomLlm", ctx, request)} +} + +func (_c *MockAgentBricksInterface_DeleteCustomLlm_Call) Run(run func(ctx context.Context, request agentbricks.DeleteCustomLlmRequest)) *MockAgentBricksInterface_DeleteCustomLlm_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(agentbricks.DeleteCustomLlmRequest)) + }) + return _c +} + +func (_c *MockAgentBricksInterface_DeleteCustomLlm_Call) Return(_a0 error) *MockAgentBricksInterface_DeleteCustomLlm_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAgentBricksInterface_DeleteCustomLlm_Call) RunAndReturn(run func(context.Context, agentbricks.DeleteCustomLlmRequest) error) *MockAgentBricksInterface_DeleteCustomLlm_Call { + _c.Call.Return(run) + return _c +} + +// GetCustomLlm provides a mock function with given fields: ctx, request +func (_m *MockAgentBricksInterface) GetCustomLlm(ctx context.Context, request agentbricks.GetCustomLlmRequest) (*agentbricks.CustomLlm, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetCustomLlm") + } + + var r0 *agentbricks.CustomLlm + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.GetCustomLlmRequest) (*agentbricks.CustomLlm, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.GetCustomLlmRequest) *agentbricks.CustomLlm); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*agentbricks.CustomLlm) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, agentbricks.GetCustomLlmRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAgentBricksInterface_GetCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCustomLlm' +type MockAgentBricksInterface_GetCustomLlm_Call struct { + *mock.Call +} + +// GetCustomLlm is a helper method to define mock.On call +// - ctx context.Context +// - request agentbricks.GetCustomLlmRequest +func (_e *MockAgentBricksInterface_Expecter) GetCustomLlm(ctx interface{}, request interface{}) *MockAgentBricksInterface_GetCustomLlm_Call { + return &MockAgentBricksInterface_GetCustomLlm_Call{Call: _e.mock.On("GetCustomLlm", ctx, request)} +} + +func (_c *MockAgentBricksInterface_GetCustomLlm_Call) Run(run func(ctx context.Context, request agentbricks.GetCustomLlmRequest)) *MockAgentBricksInterface_GetCustomLlm_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(agentbricks.GetCustomLlmRequest)) + }) + return _c +} + +func (_c *MockAgentBricksInterface_GetCustomLlm_Call) Return(_a0 *agentbricks.CustomLlm, _a1 error) *MockAgentBricksInterface_GetCustomLlm_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAgentBricksInterface_GetCustomLlm_Call) RunAndReturn(run func(context.Context, agentbricks.GetCustomLlmRequest) (*agentbricks.CustomLlm, error)) *MockAgentBricksInterface_GetCustomLlm_Call { + _c.Call.Return(run) + return _c +} + +// StartOptimize provides a mock function with given fields: ctx, request +func (_m *MockAgentBricksInterface) StartOptimize(ctx context.Context, request agentbricks.StartCustomLlmOptimizationRunRequest) (*agentbricks.CustomLlm, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for StartOptimize") + } + + var r0 *agentbricks.CustomLlm + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.StartCustomLlmOptimizationRunRequest) (*agentbricks.CustomLlm, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.StartCustomLlmOptimizationRunRequest) *agentbricks.CustomLlm); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*agentbricks.CustomLlm) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, agentbricks.StartCustomLlmOptimizationRunRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAgentBricksInterface_StartOptimize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartOptimize' +type MockAgentBricksInterface_StartOptimize_Call struct { + *mock.Call +} + +// StartOptimize is a helper method to define mock.On call +// - ctx context.Context +// - request agentbricks.StartCustomLlmOptimizationRunRequest +func (_e *MockAgentBricksInterface_Expecter) StartOptimize(ctx interface{}, request interface{}) *MockAgentBricksInterface_StartOptimize_Call { + return &MockAgentBricksInterface_StartOptimize_Call{Call: _e.mock.On("StartOptimize", ctx, request)} +} + +func (_c *MockAgentBricksInterface_StartOptimize_Call) Run(run func(ctx context.Context, request agentbricks.StartCustomLlmOptimizationRunRequest)) *MockAgentBricksInterface_StartOptimize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(agentbricks.StartCustomLlmOptimizationRunRequest)) + }) + return _c +} + +func (_c *MockAgentBricksInterface_StartOptimize_Call) Return(_a0 *agentbricks.CustomLlm, _a1 error) *MockAgentBricksInterface_StartOptimize_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAgentBricksInterface_StartOptimize_Call) RunAndReturn(run func(context.Context, agentbricks.StartCustomLlmOptimizationRunRequest) (*agentbricks.CustomLlm, error)) *MockAgentBricksInterface_StartOptimize_Call { + _c.Call.Return(run) + return _c +} + +// UpdateCustomLlm provides a mock function with given fields: ctx, request +func (_m *MockAgentBricksInterface) UpdateCustomLlm(ctx context.Context, request agentbricks.UpdateCustomLlmRequest) (*agentbricks.CustomLlm, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateCustomLlm") + } + + var r0 *agentbricks.CustomLlm + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.UpdateCustomLlmRequest) (*agentbricks.CustomLlm, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, agentbricks.UpdateCustomLlmRequest) *agentbricks.CustomLlm); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*agentbricks.CustomLlm) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, agentbricks.UpdateCustomLlmRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAgentBricksInterface_UpdateCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateCustomLlm' +type MockAgentBricksInterface_UpdateCustomLlm_Call struct { + *mock.Call +} + +// UpdateCustomLlm is a helper method to define mock.On call +// - ctx context.Context +// - request agentbricks.UpdateCustomLlmRequest +func (_e *MockAgentBricksInterface_Expecter) UpdateCustomLlm(ctx interface{}, request interface{}) *MockAgentBricksInterface_UpdateCustomLlm_Call { + return &MockAgentBricksInterface_UpdateCustomLlm_Call{Call: _e.mock.On("UpdateCustomLlm", ctx, request)} +} + +func (_c *MockAgentBricksInterface_UpdateCustomLlm_Call) Run(run func(ctx context.Context, request agentbricks.UpdateCustomLlmRequest)) *MockAgentBricksInterface_UpdateCustomLlm_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(agentbricks.UpdateCustomLlmRequest)) + }) + return _c +} + +func (_c *MockAgentBricksInterface_UpdateCustomLlm_Call) Return(_a0 *agentbricks.CustomLlm, _a1 error) *MockAgentBricksInterface_UpdateCustomLlm_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAgentBricksInterface_UpdateCustomLlm_Call) RunAndReturn(run func(context.Context, agentbricks.UpdateCustomLlmRequest) (*agentbricks.CustomLlm, error)) *MockAgentBricksInterface_UpdateCustomLlm_Call { + _c.Call.Return(run) + return _c +} + +// NewMockAgentBricksInterface creates a new instance of MockAgentBricksInterface. 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 NewMockAgentBricksInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAgentBricksInterface { + mock := &MockAgentBricksInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/aibuilder/mock_ai_builder_interface.go b/experimental/mocks/service/aibuilder/mock_ai_builder_interface.go deleted file mode 100644 index e8027b21a..000000000 --- a/experimental/mocks/service/aibuilder/mock_ai_builder_interface.go +++ /dev/null @@ -1,474 +0,0 @@ -// Code generated by mockery v2.53.2. DO NOT EDIT. - -package aibuilder - -import ( - context "context" - - aibuilder "github.com/databricks/databricks-sdk-go/service/aibuilder" - - mock "github.com/stretchr/testify/mock" -) - -// MockAiBuilderInterface is an autogenerated mock type for the AiBuilderInterface type -type MockAiBuilderInterface struct { - mock.Mock -} - -type MockAiBuilderInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *MockAiBuilderInterface) EXPECT() *MockAiBuilderInterface_Expecter { - return &MockAiBuilderInterface_Expecter{mock: &_m.Mock} -} - -// CancelOptimize provides a mock function with given fields: ctx, request -func (_m *MockAiBuilderInterface) CancelOptimize(ctx context.Context, request aibuilder.CancelCustomLlmOptimizationRunRequest) error { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for CancelOptimize") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.CancelCustomLlmOptimizationRunRequest) error); ok { - r0 = rf(ctx, request) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAiBuilderInterface_CancelOptimize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelOptimize' -type MockAiBuilderInterface_CancelOptimize_Call struct { - *mock.Call -} - -// CancelOptimize is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.CancelCustomLlmOptimizationRunRequest -func (_e *MockAiBuilderInterface_Expecter) CancelOptimize(ctx interface{}, request interface{}) *MockAiBuilderInterface_CancelOptimize_Call { - return &MockAiBuilderInterface_CancelOptimize_Call{Call: _e.mock.On("CancelOptimize", ctx, request)} -} - -func (_c *MockAiBuilderInterface_CancelOptimize_Call) Run(run func(ctx context.Context, request aibuilder.CancelCustomLlmOptimizationRunRequest)) *MockAiBuilderInterface_CancelOptimize_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.CancelCustomLlmOptimizationRunRequest)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_CancelOptimize_Call) Return(_a0 error) *MockAiBuilderInterface_CancelOptimize_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAiBuilderInterface_CancelOptimize_Call) RunAndReturn(run func(context.Context, aibuilder.CancelCustomLlmOptimizationRunRequest) error) *MockAiBuilderInterface_CancelOptimize_Call { - _c.Call.Return(run) - return _c -} - -// CreateCustomLlm provides a mock function with given fields: ctx, request -func (_m *MockAiBuilderInterface) CreateCustomLlm(ctx context.Context, request aibuilder.CreateCustomLlmRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for CreateCustomLlm") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.CreateCustomLlmRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.CreateCustomLlmRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.CreateCustomLlmRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAiBuilderInterface_CreateCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCustomLlm' -type MockAiBuilderInterface_CreateCustomLlm_Call struct { - *mock.Call -} - -// CreateCustomLlm is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.CreateCustomLlmRequest -func (_e *MockAiBuilderInterface_Expecter) CreateCustomLlm(ctx interface{}, request interface{}) *MockAiBuilderInterface_CreateCustomLlm_Call { - return &MockAiBuilderInterface_CreateCustomLlm_Call{Call: _e.mock.On("CreateCustomLlm", ctx, request)} -} - -func (_c *MockAiBuilderInterface_CreateCustomLlm_Call) Run(run func(ctx context.Context, request aibuilder.CreateCustomLlmRequest)) *MockAiBuilderInterface_CreateCustomLlm_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.CreateCustomLlmRequest)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_CreateCustomLlm_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockAiBuilderInterface_CreateCustomLlm_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAiBuilderInterface_CreateCustomLlm_Call) RunAndReturn(run func(context.Context, aibuilder.CreateCustomLlmRequest) (*aibuilder.CustomLlm, error)) *MockAiBuilderInterface_CreateCustomLlm_Call { - _c.Call.Return(run) - return _c -} - -// DeleteCustomLlm provides a mock function with given fields: ctx, request -func (_m *MockAiBuilderInterface) DeleteCustomLlm(ctx context.Context, request aibuilder.DeleteCustomLlmRequest) error { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for DeleteCustomLlm") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.DeleteCustomLlmRequest) error); ok { - r0 = rf(ctx, request) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAiBuilderInterface_DeleteCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCustomLlm' -type MockAiBuilderInterface_DeleteCustomLlm_Call struct { - *mock.Call -} - -// DeleteCustomLlm is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.DeleteCustomLlmRequest -func (_e *MockAiBuilderInterface_Expecter) DeleteCustomLlm(ctx interface{}, request interface{}) *MockAiBuilderInterface_DeleteCustomLlm_Call { - return &MockAiBuilderInterface_DeleteCustomLlm_Call{Call: _e.mock.On("DeleteCustomLlm", ctx, request)} -} - -func (_c *MockAiBuilderInterface_DeleteCustomLlm_Call) Run(run func(ctx context.Context, request aibuilder.DeleteCustomLlmRequest)) *MockAiBuilderInterface_DeleteCustomLlm_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.DeleteCustomLlmRequest)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_DeleteCustomLlm_Call) Return(_a0 error) *MockAiBuilderInterface_DeleteCustomLlm_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAiBuilderInterface_DeleteCustomLlm_Call) RunAndReturn(run func(context.Context, aibuilder.DeleteCustomLlmRequest) error) *MockAiBuilderInterface_DeleteCustomLlm_Call { - _c.Call.Return(run) - return _c -} - -// DeleteCustomLlmById provides a mock function with given fields: ctx, id -func (_m *MockAiBuilderInterface) DeleteCustomLlmById(ctx context.Context, id string) error { - ret := _m.Called(ctx, id) - - if len(ret) == 0 { - panic("no return value specified for DeleteCustomLlmById") - } - - 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 -} - -// MockAiBuilderInterface_DeleteCustomLlmById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCustomLlmById' -type MockAiBuilderInterface_DeleteCustomLlmById_Call struct { - *mock.Call -} - -// DeleteCustomLlmById is a helper method to define mock.On call -// - ctx context.Context -// - id string -func (_e *MockAiBuilderInterface_Expecter) DeleteCustomLlmById(ctx interface{}, id interface{}) *MockAiBuilderInterface_DeleteCustomLlmById_Call { - return &MockAiBuilderInterface_DeleteCustomLlmById_Call{Call: _e.mock.On("DeleteCustomLlmById", ctx, id)} -} - -func (_c *MockAiBuilderInterface_DeleteCustomLlmById_Call) Run(run func(ctx context.Context, id string)) *MockAiBuilderInterface_DeleteCustomLlmById_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_DeleteCustomLlmById_Call) Return(_a0 error) *MockAiBuilderInterface_DeleteCustomLlmById_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAiBuilderInterface_DeleteCustomLlmById_Call) RunAndReturn(run func(context.Context, string) error) *MockAiBuilderInterface_DeleteCustomLlmById_Call { - _c.Call.Return(run) - return _c -} - -// GetCustomLlm provides a mock function with given fields: ctx, request -func (_m *MockAiBuilderInterface) GetCustomLlm(ctx context.Context, request aibuilder.GetCustomLlmRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for GetCustomLlm") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.GetCustomLlmRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.GetCustomLlmRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.GetCustomLlmRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAiBuilderInterface_GetCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCustomLlm' -type MockAiBuilderInterface_GetCustomLlm_Call struct { - *mock.Call -} - -// GetCustomLlm is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.GetCustomLlmRequest -func (_e *MockAiBuilderInterface_Expecter) GetCustomLlm(ctx interface{}, request interface{}) *MockAiBuilderInterface_GetCustomLlm_Call { - return &MockAiBuilderInterface_GetCustomLlm_Call{Call: _e.mock.On("GetCustomLlm", ctx, request)} -} - -func (_c *MockAiBuilderInterface_GetCustomLlm_Call) Run(run func(ctx context.Context, request aibuilder.GetCustomLlmRequest)) *MockAiBuilderInterface_GetCustomLlm_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.GetCustomLlmRequest)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_GetCustomLlm_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockAiBuilderInterface_GetCustomLlm_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAiBuilderInterface_GetCustomLlm_Call) RunAndReturn(run func(context.Context, aibuilder.GetCustomLlmRequest) (*aibuilder.CustomLlm, error)) *MockAiBuilderInterface_GetCustomLlm_Call { - _c.Call.Return(run) - return _c -} - -// GetCustomLlmById provides a mock function with given fields: ctx, id -func (_m *MockAiBuilderInterface) GetCustomLlmById(ctx context.Context, id string) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, id) - - if len(ret) == 0 { - panic("no return value specified for GetCustomLlmById") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, id) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, id) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, id) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAiBuilderInterface_GetCustomLlmById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCustomLlmById' -type MockAiBuilderInterface_GetCustomLlmById_Call struct { - *mock.Call -} - -// GetCustomLlmById is a helper method to define mock.On call -// - ctx context.Context -// - id string -func (_e *MockAiBuilderInterface_Expecter) GetCustomLlmById(ctx interface{}, id interface{}) *MockAiBuilderInterface_GetCustomLlmById_Call { - return &MockAiBuilderInterface_GetCustomLlmById_Call{Call: _e.mock.On("GetCustomLlmById", ctx, id)} -} - -func (_c *MockAiBuilderInterface_GetCustomLlmById_Call) Run(run func(ctx context.Context, id string)) *MockAiBuilderInterface_GetCustomLlmById_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_GetCustomLlmById_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockAiBuilderInterface_GetCustomLlmById_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAiBuilderInterface_GetCustomLlmById_Call) RunAndReturn(run func(context.Context, string) (*aibuilder.CustomLlm, error)) *MockAiBuilderInterface_GetCustomLlmById_Call { - _c.Call.Return(run) - return _c -} - -// StartOptimize provides a mock function with given fields: ctx, request -func (_m *MockAiBuilderInterface) StartOptimize(ctx context.Context, request aibuilder.StartCustomLlmOptimizationRunRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for StartOptimize") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAiBuilderInterface_StartOptimize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartOptimize' -type MockAiBuilderInterface_StartOptimize_Call struct { - *mock.Call -} - -// StartOptimize is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.StartCustomLlmOptimizationRunRequest -func (_e *MockAiBuilderInterface_Expecter) StartOptimize(ctx interface{}, request interface{}) *MockAiBuilderInterface_StartOptimize_Call { - return &MockAiBuilderInterface_StartOptimize_Call{Call: _e.mock.On("StartOptimize", ctx, request)} -} - -func (_c *MockAiBuilderInterface_StartOptimize_Call) Run(run func(ctx context.Context, request aibuilder.StartCustomLlmOptimizationRunRequest)) *MockAiBuilderInterface_StartOptimize_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.StartCustomLlmOptimizationRunRequest)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_StartOptimize_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockAiBuilderInterface_StartOptimize_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAiBuilderInterface_StartOptimize_Call) RunAndReturn(run func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) (*aibuilder.CustomLlm, error)) *MockAiBuilderInterface_StartOptimize_Call { - _c.Call.Return(run) - return _c -} - -// UpdateCustomLlm provides a mock function with given fields: ctx, request -func (_m *MockAiBuilderInterface) UpdateCustomLlm(ctx context.Context, request aibuilder.UpdateCustomLlmRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for UpdateCustomLlm") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.UpdateCustomLlmRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.UpdateCustomLlmRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.UpdateCustomLlmRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAiBuilderInterface_UpdateCustomLlm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateCustomLlm' -type MockAiBuilderInterface_UpdateCustomLlm_Call struct { - *mock.Call -} - -// UpdateCustomLlm is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.UpdateCustomLlmRequest -func (_e *MockAiBuilderInterface_Expecter) UpdateCustomLlm(ctx interface{}, request interface{}) *MockAiBuilderInterface_UpdateCustomLlm_Call { - return &MockAiBuilderInterface_UpdateCustomLlm_Call{Call: _e.mock.On("UpdateCustomLlm", ctx, request)} -} - -func (_c *MockAiBuilderInterface_UpdateCustomLlm_Call) Run(run func(ctx context.Context, request aibuilder.UpdateCustomLlmRequest)) *MockAiBuilderInterface_UpdateCustomLlm_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.UpdateCustomLlmRequest)) - }) - return _c -} - -func (_c *MockAiBuilderInterface_UpdateCustomLlm_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockAiBuilderInterface_UpdateCustomLlm_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAiBuilderInterface_UpdateCustomLlm_Call) RunAndReturn(run func(context.Context, aibuilder.UpdateCustomLlmRequest) (*aibuilder.CustomLlm, error)) *MockAiBuilderInterface_UpdateCustomLlm_Call { - _c.Call.Return(run) - return _c -} - -// NewMockAiBuilderInterface creates a new instance of MockAiBuilderInterface. 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 NewMockAiBuilderInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MockAiBuilderInterface { - mock := &MockAiBuilderInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/experimental/mocks/service/aibuilder/mock_custom_llms_interface.go b/experimental/mocks/service/aibuilder/mock_custom_llms_interface.go deleted file mode 100644 index a8ea6dc84..000000000 --- a/experimental/mocks/service/aibuilder/mock_custom_llms_interface.go +++ /dev/null @@ -1,321 +0,0 @@ -// Code generated by mockery v2.53.2. DO NOT EDIT. - -package aibuilder - -import ( - context "context" - - aibuilder "github.com/databricks/databricks-sdk-go/service/aibuilder" - - mock "github.com/stretchr/testify/mock" -) - -// MockCustomLlmsInterface is an autogenerated mock type for the CustomLlmsInterface type -type MockCustomLlmsInterface struct { - mock.Mock -} - -type MockCustomLlmsInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCustomLlmsInterface) EXPECT() *MockCustomLlmsInterface_Expecter { - return &MockCustomLlmsInterface_Expecter{mock: &_m.Mock} -} - -// Cancel provides a mock function with given fields: ctx, request -func (_m *MockCustomLlmsInterface) Cancel(ctx context.Context, request aibuilder.CancelCustomLlmOptimizationRunRequest) error { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for Cancel") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.CancelCustomLlmOptimizationRunRequest) error); ok { - r0 = rf(ctx, request) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockCustomLlmsInterface_Cancel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cancel' -type MockCustomLlmsInterface_Cancel_Call struct { - *mock.Call -} - -// Cancel is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.CancelCustomLlmOptimizationRunRequest -func (_e *MockCustomLlmsInterface_Expecter) Cancel(ctx interface{}, request interface{}) *MockCustomLlmsInterface_Cancel_Call { - return &MockCustomLlmsInterface_Cancel_Call{Call: _e.mock.On("Cancel", ctx, request)} -} - -func (_c *MockCustomLlmsInterface_Cancel_Call) Run(run func(ctx context.Context, request aibuilder.CancelCustomLlmOptimizationRunRequest)) *MockCustomLlmsInterface_Cancel_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.CancelCustomLlmOptimizationRunRequest)) - }) - return _c -} - -func (_c *MockCustomLlmsInterface_Cancel_Call) Return(_a0 error) *MockCustomLlmsInterface_Cancel_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockCustomLlmsInterface_Cancel_Call) RunAndReturn(run func(context.Context, aibuilder.CancelCustomLlmOptimizationRunRequest) error) *MockCustomLlmsInterface_Cancel_Call { - _c.Call.Return(run) - return _c -} - -// Create provides a mock function with given fields: ctx, request -func (_m *MockCustomLlmsInterface) Create(ctx context.Context, request aibuilder.StartCustomLlmOptimizationRunRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCustomLlmsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type MockCustomLlmsInterface_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.StartCustomLlmOptimizationRunRequest -func (_e *MockCustomLlmsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockCustomLlmsInterface_Create_Call { - return &MockCustomLlmsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} -} - -func (_c *MockCustomLlmsInterface_Create_Call) Run(run func(ctx context.Context, request aibuilder.StartCustomLlmOptimizationRunRequest)) *MockCustomLlmsInterface_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.StartCustomLlmOptimizationRunRequest)) - }) - return _c -} - -func (_c *MockCustomLlmsInterface_Create_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockCustomLlmsInterface_Create_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCustomLlmsInterface_Create_Call) RunAndReturn(run func(context.Context, aibuilder.StartCustomLlmOptimizationRunRequest) (*aibuilder.CustomLlm, error)) *MockCustomLlmsInterface_Create_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function with given fields: ctx, request -func (_m *MockCustomLlmsInterface) Get(ctx context.Context, request aibuilder.GetCustomLlmRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.GetCustomLlmRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.GetCustomLlmRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.GetCustomLlmRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCustomLlmsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type MockCustomLlmsInterface_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.GetCustomLlmRequest -func (_e *MockCustomLlmsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockCustomLlmsInterface_Get_Call { - return &MockCustomLlmsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} -} - -func (_c *MockCustomLlmsInterface_Get_Call) Run(run func(ctx context.Context, request aibuilder.GetCustomLlmRequest)) *MockCustomLlmsInterface_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.GetCustomLlmRequest)) - }) - return _c -} - -func (_c *MockCustomLlmsInterface_Get_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockCustomLlmsInterface_Get_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCustomLlmsInterface_Get_Call) RunAndReturn(run func(context.Context, aibuilder.GetCustomLlmRequest) (*aibuilder.CustomLlm, error)) *MockCustomLlmsInterface_Get_Call { - _c.Call.Return(run) - return _c -} - -// GetById provides a mock function with given fields: ctx, id -func (_m *MockCustomLlmsInterface) GetById(ctx context.Context, id string) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, id) - - if len(ret) == 0 { - panic("no return value specified for GetById") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, id) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, id) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, id) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCustomLlmsInterface_GetById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetById' -type MockCustomLlmsInterface_GetById_Call struct { - *mock.Call -} - -// GetById is a helper method to define mock.On call -// - ctx context.Context -// - id string -func (_e *MockCustomLlmsInterface_Expecter) GetById(ctx interface{}, id interface{}) *MockCustomLlmsInterface_GetById_Call { - return &MockCustomLlmsInterface_GetById_Call{Call: _e.mock.On("GetById", ctx, id)} -} - -func (_c *MockCustomLlmsInterface_GetById_Call) Run(run func(ctx context.Context, id string)) *MockCustomLlmsInterface_GetById_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockCustomLlmsInterface_GetById_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockCustomLlmsInterface_GetById_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCustomLlmsInterface_GetById_Call) RunAndReturn(run func(context.Context, string) (*aibuilder.CustomLlm, error)) *MockCustomLlmsInterface_GetById_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function with given fields: ctx, request -func (_m *MockCustomLlmsInterface) Update(ctx context.Context, request aibuilder.UpdateCustomLlmRequest) (*aibuilder.CustomLlm, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *aibuilder.CustomLlm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.UpdateCustomLlmRequest) (*aibuilder.CustomLlm, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, aibuilder.UpdateCustomLlmRequest) *aibuilder.CustomLlm); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*aibuilder.CustomLlm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, aibuilder.UpdateCustomLlmRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCustomLlmsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type MockCustomLlmsInterface_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - ctx context.Context -// - request aibuilder.UpdateCustomLlmRequest -func (_e *MockCustomLlmsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockCustomLlmsInterface_Update_Call { - return &MockCustomLlmsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} -} - -func (_c *MockCustomLlmsInterface_Update_Call) Run(run func(ctx context.Context, request aibuilder.UpdateCustomLlmRequest)) *MockCustomLlmsInterface_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(aibuilder.UpdateCustomLlmRequest)) - }) - return _c -} - -func (_c *MockCustomLlmsInterface_Update_Call) Return(_a0 *aibuilder.CustomLlm, _a1 error) *MockCustomLlmsInterface_Update_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCustomLlmsInterface_Update_Call) RunAndReturn(run func(context.Context, aibuilder.UpdateCustomLlmRequest) (*aibuilder.CustomLlm, error)) *MockCustomLlmsInterface_Update_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCustomLlmsInterface creates a new instance of MockCustomLlmsInterface. 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 NewMockCustomLlmsInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCustomLlmsInterface { - mock := &MockCustomLlmsInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/experimental/mocks/service/catalog/mock_quality_monitors_interface.go b/experimental/mocks/service/catalog/mock_quality_monitors_interface.go index b17784933..a4134c043 100644 --- a/experimental/mocks/service/catalog/mock_quality_monitors_interface.go +++ b/experimental/mocks/service/catalog/mock_quality_monitors_interface.go @@ -130,21 +130,33 @@ func (_c *MockQualityMonitorsInterface_Create_Call) RunAndReturn(run func(contex } // Delete provides a mock function with given fields: ctx, request -func (_m *MockQualityMonitorsInterface) Delete(ctx context.Context, request catalog.DeleteQualityMonitorRequest) error { +func (_m *MockQualityMonitorsInterface) Delete(ctx context.Context, request catalog.DeleteQualityMonitorRequest) (*catalog.DeleteMonitorResponse, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { panic("no return value specified for Delete") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteQualityMonitorRequest) error); ok { + var r0 *catalog.DeleteMonitorResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteQualityMonitorRequest) (*catalog.DeleteMonitorResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteQualityMonitorRequest) *catalog.DeleteMonitorResponse); ok { r0 = rf(ctx, request) } else { - r0 = ret.Error(0) + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DeleteMonitorResponse) + } } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, catalog.DeleteQualityMonitorRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // MockQualityMonitorsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' @@ -166,59 +178,12 @@ func (_c *MockQualityMonitorsInterface_Delete_Call) Run(run func(ctx context.Con return _c } -func (_c *MockQualityMonitorsInterface_Delete_Call) Return(_a0 error) *MockQualityMonitorsInterface_Delete_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockQualityMonitorsInterface_Delete_Call) RunAndReturn(run func(context.Context, catalog.DeleteQualityMonitorRequest) error) *MockQualityMonitorsInterface_Delete_Call { - _c.Call.Return(run) - return _c -} - -// DeleteByTableName provides a mock function with given fields: ctx, tableName -func (_m *MockQualityMonitorsInterface) DeleteByTableName(ctx context.Context, tableName string) error { - ret := _m.Called(ctx, tableName) - - if len(ret) == 0 { - panic("no return value specified for DeleteByTableName") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, tableName) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockQualityMonitorsInterface_DeleteByTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByTableName' -type MockQualityMonitorsInterface_DeleteByTableName_Call struct { - *mock.Call -} - -// DeleteByTableName is a helper method to define mock.On call -// - ctx context.Context -// - tableName string -func (_e *MockQualityMonitorsInterface_Expecter) DeleteByTableName(ctx interface{}, tableName interface{}) *MockQualityMonitorsInterface_DeleteByTableName_Call { - return &MockQualityMonitorsInterface_DeleteByTableName_Call{Call: _e.mock.On("DeleteByTableName", ctx, tableName)} -} - -func (_c *MockQualityMonitorsInterface_DeleteByTableName_Call) Run(run func(ctx context.Context, tableName string)) *MockQualityMonitorsInterface_DeleteByTableName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockQualityMonitorsInterface_DeleteByTableName_Call) Return(_a0 error) *MockQualityMonitorsInterface_DeleteByTableName_Call { - _c.Call.Return(_a0) +func (_c *MockQualityMonitorsInterface_Delete_Call) Return(_a0 *catalog.DeleteMonitorResponse, _a1 error) *MockQualityMonitorsInterface_Delete_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MockQualityMonitorsInterface_DeleteByTableName_Call) RunAndReturn(run func(context.Context, string) error) *MockQualityMonitorsInterface_DeleteByTableName_Call { +func (_c *MockQualityMonitorsInterface_Delete_Call) RunAndReturn(run func(context.Context, catalog.DeleteQualityMonitorRequest) (*catalog.DeleteMonitorResponse, error)) *MockQualityMonitorsInterface_Delete_Call { _c.Call.Return(run) return _c } @@ -282,65 +247,6 @@ func (_c *MockQualityMonitorsInterface_Get_Call) RunAndReturn(run func(context.C return _c } -// GetByTableName provides a mock function with given fields: ctx, tableName -func (_m *MockQualityMonitorsInterface) GetByTableName(ctx context.Context, tableName string) (*catalog.MonitorInfo, error) { - ret := _m.Called(ctx, tableName) - - if len(ret) == 0 { - panic("no return value specified for GetByTableName") - } - - var r0 *catalog.MonitorInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.MonitorInfo, error)); ok { - return rf(ctx, tableName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.MonitorInfo); ok { - r0 = rf(ctx, tableName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*catalog.MonitorInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, tableName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockQualityMonitorsInterface_GetByTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByTableName' -type MockQualityMonitorsInterface_GetByTableName_Call struct { - *mock.Call -} - -// GetByTableName is a helper method to define mock.On call -// - ctx context.Context -// - tableName string -func (_e *MockQualityMonitorsInterface_Expecter) GetByTableName(ctx interface{}, tableName interface{}) *MockQualityMonitorsInterface_GetByTableName_Call { - return &MockQualityMonitorsInterface_GetByTableName_Call{Call: _e.mock.On("GetByTableName", ctx, tableName)} -} - -func (_c *MockQualityMonitorsInterface_GetByTableName_Call) Run(run func(ctx context.Context, tableName string)) *MockQualityMonitorsInterface_GetByTableName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockQualityMonitorsInterface_GetByTableName_Call) Return(_a0 *catalog.MonitorInfo, _a1 error) *MockQualityMonitorsInterface_GetByTableName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockQualityMonitorsInterface_GetByTableName_Call) RunAndReturn(run func(context.Context, string) (*catalog.MonitorInfo, error)) *MockQualityMonitorsInterface_GetByTableName_Call { - _c.Call.Return(run) - return _c -} - // GetRefresh provides a mock function with given fields: ctx, request func (_m *MockQualityMonitorsInterface) GetRefresh(ctx context.Context, request catalog.GetRefreshRequest) (*catalog.MonitorRefreshInfo, error) { ret := _m.Called(ctx, request) @@ -400,66 +306,6 @@ func (_c *MockQualityMonitorsInterface_GetRefresh_Call) RunAndReturn(run func(co return _c } -// GetRefreshByTableNameAndRefreshId provides a mock function with given fields: ctx, tableName, refreshId -func (_m *MockQualityMonitorsInterface) GetRefreshByTableNameAndRefreshId(ctx context.Context, tableName string, refreshId string) (*catalog.MonitorRefreshInfo, error) { - ret := _m.Called(ctx, tableName, refreshId) - - if len(ret) == 0 { - panic("no return value specified for GetRefreshByTableNameAndRefreshId") - } - - var r0 *catalog.MonitorRefreshInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*catalog.MonitorRefreshInfo, error)); ok { - return rf(ctx, tableName, refreshId) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *catalog.MonitorRefreshInfo); ok { - r0 = rf(ctx, tableName, refreshId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*catalog.MonitorRefreshInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, tableName, refreshId) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRefreshByTableNameAndRefreshId' -type MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call struct { - *mock.Call -} - -// GetRefreshByTableNameAndRefreshId is a helper method to define mock.On call -// - ctx context.Context -// - tableName string -// - refreshId string -func (_e *MockQualityMonitorsInterface_Expecter) GetRefreshByTableNameAndRefreshId(ctx interface{}, tableName interface{}, refreshId interface{}) *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { - return &MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call{Call: _e.mock.On("GetRefreshByTableNameAndRefreshId", ctx, tableName, refreshId)} -} - -func (_c *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call) Run(run func(ctx context.Context, tableName string, refreshId string)) *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) - }) - return _c -} - -func (_c *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call) Return(_a0 *catalog.MonitorRefreshInfo, _a1 error) *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call) RunAndReturn(run func(context.Context, string, string) (*catalog.MonitorRefreshInfo, error)) *MockQualityMonitorsInterface_GetRefreshByTableNameAndRefreshId_Call { - _c.Call.Return(run) - return _c -} - // ListRefreshes provides a mock function with given fields: ctx, request func (_m *MockQualityMonitorsInterface) ListRefreshes(ctx context.Context, request catalog.ListRefreshesRequest) (*catalog.MonitorRefreshListResponse, error) { ret := _m.Called(ctx, request) @@ -519,65 +365,6 @@ func (_c *MockQualityMonitorsInterface_ListRefreshes_Call) RunAndReturn(run func return _c } -// ListRefreshesByTableName provides a mock function with given fields: ctx, tableName -func (_m *MockQualityMonitorsInterface) ListRefreshesByTableName(ctx context.Context, tableName string) (*catalog.MonitorRefreshListResponse, error) { - ret := _m.Called(ctx, tableName) - - if len(ret) == 0 { - panic("no return value specified for ListRefreshesByTableName") - } - - var r0 *catalog.MonitorRefreshListResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.MonitorRefreshListResponse, error)); ok { - return rf(ctx, tableName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.MonitorRefreshListResponse); ok { - r0 = rf(ctx, tableName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*catalog.MonitorRefreshListResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, tableName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockQualityMonitorsInterface_ListRefreshesByTableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefreshesByTableName' -type MockQualityMonitorsInterface_ListRefreshesByTableName_Call struct { - *mock.Call -} - -// ListRefreshesByTableName is a helper method to define mock.On call -// - ctx context.Context -// - tableName string -func (_e *MockQualityMonitorsInterface_Expecter) ListRefreshesByTableName(ctx interface{}, tableName interface{}) *MockQualityMonitorsInterface_ListRefreshesByTableName_Call { - return &MockQualityMonitorsInterface_ListRefreshesByTableName_Call{Call: _e.mock.On("ListRefreshesByTableName", ctx, tableName)} -} - -func (_c *MockQualityMonitorsInterface_ListRefreshesByTableName_Call) Run(run func(ctx context.Context, tableName string)) *MockQualityMonitorsInterface_ListRefreshesByTableName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockQualityMonitorsInterface_ListRefreshesByTableName_Call) Return(_a0 *catalog.MonitorRefreshListResponse, _a1 error) *MockQualityMonitorsInterface_ListRefreshesByTableName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockQualityMonitorsInterface_ListRefreshesByTableName_Call) RunAndReturn(run func(context.Context, string) (*catalog.MonitorRefreshListResponse, error)) *MockQualityMonitorsInterface_ListRefreshesByTableName_Call { - _c.Call.Return(run) - return _c -} - // RegenerateDashboard provides a mock function with given fields: ctx, request func (_m *MockQualityMonitorsInterface) RegenerateDashboard(ctx context.Context, request catalog.RegenerateDashboardRequest) (*catalog.RegenerateDashboardResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/catalog/mock_resource_quotas_interface.go b/experimental/mocks/service/catalog/mock_resource_quotas_interface.go index b0a82cf30..803fbcc61 100644 --- a/experimental/mocks/service/catalog/mock_resource_quotas_interface.go +++ b/experimental/mocks/service/catalog/mock_resource_quotas_interface.go @@ -84,67 +84,6 @@ func (_c *MockResourceQuotasInterface_GetQuota_Call) RunAndReturn(run func(conte return _c } -// GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName provides a mock function with given fields: ctx, parentSecurableType, parentFullName, quotaName -func (_m *MockResourceQuotasInterface) GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName(ctx context.Context, parentSecurableType string, parentFullName string, quotaName string) (*catalog.GetQuotaResponse, error) { - ret := _m.Called(ctx, parentSecurableType, parentFullName, quotaName) - - if len(ret) == 0 { - panic("no return value specified for GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName") - } - - var r0 *catalog.GetQuotaResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*catalog.GetQuotaResponse, error)); ok { - return rf(ctx, parentSecurableType, parentFullName, quotaName) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *catalog.GetQuotaResponse); ok { - r0 = rf(ctx, parentSecurableType, parentFullName, quotaName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*catalog.GetQuotaResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { - r1 = rf(ctx, parentSecurableType, parentFullName, quotaName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName' -type MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call struct { - *mock.Call -} - -// GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName is a helper method to define mock.On call -// - ctx context.Context -// - parentSecurableType string -// - parentFullName string -// - quotaName string -func (_e *MockResourceQuotasInterface_Expecter) GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName(ctx interface{}, parentSecurableType interface{}, parentFullName interface{}, quotaName interface{}) *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call { - return &MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call{Call: _e.mock.On("GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName", ctx, parentSecurableType, parentFullName, quotaName)} -} - -func (_c *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call) Run(run func(ctx context.Context, parentSecurableType string, parentFullName string, quotaName string)) *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) - }) - return _c -} - -func (_c *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call) Return(_a0 *catalog.GetQuotaResponse, _a1 error) *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call) RunAndReturn(run func(context.Context, string, string, string) (*catalog.GetQuotaResponse, error)) *MockResourceQuotasInterface_GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName_Call { - _c.Call.Return(run) - return _c -} - // ListQuotas provides a mock function with given fields: ctx, request func (_m *MockResourceQuotasInterface) ListQuotas(ctx context.Context, request catalog.ListQuotasRequest) listing.Iterator[catalog.QuotaInfo] { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/cleanrooms/mock_clean_room_asset_revisions_interface.go b/experimental/mocks/service/cleanrooms/mock_clean_room_asset_revisions_interface.go new file mode 100644 index 000000000..458fce9dd --- /dev/null +++ b/experimental/mocks/service/cleanrooms/mock_clean_room_asset_revisions_interface.go @@ -0,0 +1,207 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package cleanrooms + +import ( + context "context" + + cleanrooms "github.com/databricks/databricks-sdk-go/service/cleanrooms" + + listing "github.com/databricks/databricks-sdk-go/listing" + + mock "github.com/stretchr/testify/mock" +) + +// MockCleanRoomAssetRevisionsInterface is an autogenerated mock type for the CleanRoomAssetRevisionsInterface type +type MockCleanRoomAssetRevisionsInterface struct { + mock.Mock +} + +type MockCleanRoomAssetRevisionsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockCleanRoomAssetRevisionsInterface) EXPECT() *MockCleanRoomAssetRevisionsInterface_Expecter { + return &MockCleanRoomAssetRevisionsInterface_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetRevisionsInterface) Get(ctx context.Context, request cleanrooms.GetCleanRoomAssetRevisionRequest) (*cleanrooms.CleanRoomAsset, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *cleanrooms.CleanRoomAsset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomAssetRevisionRequest) (*cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomAssetRevisionRequest) *cleanrooms.CleanRoomAsset); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoomAsset) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.GetCleanRoomAssetRevisionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetRevisionsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockCleanRoomAssetRevisionsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.GetCleanRoomAssetRevisionRequest +func (_e *MockCleanRoomAssetRevisionsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockCleanRoomAssetRevisionsInterface_Get_Call { + return &MockCleanRoomAssetRevisionsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockCleanRoomAssetRevisionsInterface_Get_Call) Run(run func(ctx context.Context, request cleanrooms.GetCleanRoomAssetRevisionRequest)) *MockCleanRoomAssetRevisionsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.GetCleanRoomAssetRevisionRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetRevisionsInterface_Get_Call) Return(_a0 *cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetRevisionsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetRevisionsInterface_Get_Call) RunAndReturn(run func(context.Context, cleanrooms.GetCleanRoomAssetRevisionRequest) (*cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetRevisionsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetRevisionsInterface) List(ctx context.Context, request cleanrooms.ListCleanRoomAssetRevisionsRequest) listing.Iterator[cleanrooms.CleanRoomAsset] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[cleanrooms.CleanRoomAsset] + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAssetRevisionsRequest) listing.Iterator[cleanrooms.CleanRoomAsset]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[cleanrooms.CleanRoomAsset]) + } + } + + return r0 +} + +// MockCleanRoomAssetRevisionsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockCleanRoomAssetRevisionsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomAssetRevisionsRequest +func (_e *MockCleanRoomAssetRevisionsInterface_Expecter) List(ctx interface{}, request interface{}) *MockCleanRoomAssetRevisionsInterface_List_Call { + return &MockCleanRoomAssetRevisionsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockCleanRoomAssetRevisionsInterface_List_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomAssetRevisionsRequest)) *MockCleanRoomAssetRevisionsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomAssetRevisionsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetRevisionsInterface_List_Call) Return(_a0 listing.Iterator[cleanrooms.CleanRoomAsset]) *MockCleanRoomAssetRevisionsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomAssetRevisionsInterface_List_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomAssetRevisionsRequest) listing.Iterator[cleanrooms.CleanRoomAsset]) *MockCleanRoomAssetRevisionsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetRevisionsInterface) ListAll(ctx context.Context, request cleanrooms.ListCleanRoomAssetRevisionsRequest) ([]cleanrooms.CleanRoomAsset, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []cleanrooms.CleanRoomAsset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAssetRevisionsRequest) ([]cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAssetRevisionsRequest) []cleanrooms.CleanRoomAsset); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]cleanrooms.CleanRoomAsset) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.ListCleanRoomAssetRevisionsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetRevisionsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockCleanRoomAssetRevisionsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomAssetRevisionsRequest +func (_e *MockCleanRoomAssetRevisionsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockCleanRoomAssetRevisionsInterface_ListAll_Call { + return &MockCleanRoomAssetRevisionsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockCleanRoomAssetRevisionsInterface_ListAll_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomAssetRevisionsRequest)) *MockCleanRoomAssetRevisionsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomAssetRevisionsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetRevisionsInterface_ListAll_Call) Return(_a0 []cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetRevisionsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetRevisionsInterface_ListAll_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomAssetRevisionsRequest) ([]cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetRevisionsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// NewMockCleanRoomAssetRevisionsInterface creates a new instance of MockCleanRoomAssetRevisionsInterface. 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 NewMockCleanRoomAssetRevisionsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockCleanRoomAssetRevisionsInterface { + mock := &MockCleanRoomAssetRevisionsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go b/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go index f1f29ce55..bd9f6071f 100644 --- a/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go +++ b/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go @@ -84,6 +84,65 @@ func (_c *MockCleanRoomAssetsInterface_Create_Call) RunAndReturn(run func(contex return _c } +// CreateCleanRoomAssetReview provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetsInterface) CreateCleanRoomAssetReview(ctx context.Context, request cleanrooms.CreateCleanRoomAssetReviewRequest) (*cleanrooms.CreateCleanRoomAssetReviewResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateCleanRoomAssetReview") + } + + var r0 *cleanrooms.CreateCleanRoomAssetReviewResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomAssetReviewRequest) (*cleanrooms.CreateCleanRoomAssetReviewResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomAssetReviewRequest) *cleanrooms.CreateCleanRoomAssetReviewResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CreateCleanRoomAssetReviewResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.CreateCleanRoomAssetReviewRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCleanRoomAssetReview' +type MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call struct { + *mock.Call +} + +// CreateCleanRoomAssetReview is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.CreateCleanRoomAssetReviewRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) CreateCleanRoomAssetReview(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call { + return &MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call{Call: _e.mock.On("CreateCleanRoomAssetReview", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call) Run(run func(ctx context.Context, request cleanrooms.CreateCleanRoomAssetReviewRequest)) *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.CreateCleanRoomAssetReviewRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call) Return(_a0 *cleanrooms.CreateCleanRoomAssetReviewResponse, _a1 error) *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call) RunAndReturn(run func(context.Context, cleanrooms.CreateCleanRoomAssetReviewRequest) (*cleanrooms.CreateCleanRoomAssetReviewResponse, error)) *MockCleanRoomAssetsInterface_CreateCleanRoomAssetReview_Call { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: ctx, request func (_m *MockCleanRoomAssetsInterface) Delete(ctx context.Context, request cleanrooms.DeleteCleanRoomAssetRequest) error { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/cleanrooms/mock_clean_room_auto_approval_rules_interface.go b/experimental/mocks/service/cleanrooms/mock_clean_room_auto_approval_rules_interface.go new file mode 100644 index 000000000..9580d45c0 --- /dev/null +++ b/experimental/mocks/service/cleanrooms/mock_clean_room_auto_approval_rules_interface.go @@ -0,0 +1,372 @@ +// Code generated by mockery v2.53.2. DO NOT EDIT. + +package cleanrooms + +import ( + context "context" + + cleanrooms "github.com/databricks/databricks-sdk-go/service/cleanrooms" + + listing "github.com/databricks/databricks-sdk-go/listing" + + mock "github.com/stretchr/testify/mock" +) + +// MockCleanRoomAutoApprovalRulesInterface is an autogenerated mock type for the CleanRoomAutoApprovalRulesInterface type +type MockCleanRoomAutoApprovalRulesInterface struct { + mock.Mock +} + +type MockCleanRoomAutoApprovalRulesInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockCleanRoomAutoApprovalRulesInterface) EXPECT() *MockCleanRoomAutoApprovalRulesInterface_Expecter { + return &MockCleanRoomAutoApprovalRulesInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAutoApprovalRulesInterface) Create(ctx context.Context, request cleanrooms.CreateCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *cleanrooms.CleanRoomAutoApprovalRule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomAutoApprovalRuleRequest) *cleanrooms.CleanRoomAutoApprovalRule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoomAutoApprovalRule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.CreateCleanRoomAutoApprovalRuleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAutoApprovalRulesInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockCleanRoomAutoApprovalRulesInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.CreateCleanRoomAutoApprovalRuleRequest +func (_e *MockCleanRoomAutoApprovalRulesInterface_Expecter) Create(ctx interface{}, request interface{}) *MockCleanRoomAutoApprovalRulesInterface_Create_Call { + return &MockCleanRoomAutoApprovalRulesInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Create_Call) Run(run func(ctx context.Context, request cleanrooms.CreateCleanRoomAutoApprovalRuleRequest)) *MockCleanRoomAutoApprovalRulesInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.CreateCleanRoomAutoApprovalRuleRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Create_Call) Return(_a0 *cleanrooms.CleanRoomAutoApprovalRule, _a1 error) *MockCleanRoomAutoApprovalRulesInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Create_Call) RunAndReturn(run func(context.Context, cleanrooms.CreateCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error)) *MockCleanRoomAutoApprovalRulesInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAutoApprovalRulesInterface) Delete(ctx context.Context, request cleanrooms.DeleteCleanRoomAutoApprovalRuleRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.DeleteCleanRoomAutoApprovalRuleRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockCleanRoomAutoApprovalRulesInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockCleanRoomAutoApprovalRulesInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.DeleteCleanRoomAutoApprovalRuleRequest +func (_e *MockCleanRoomAutoApprovalRulesInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockCleanRoomAutoApprovalRulesInterface_Delete_Call { + return &MockCleanRoomAutoApprovalRulesInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Delete_Call) Run(run func(ctx context.Context, request cleanrooms.DeleteCleanRoomAutoApprovalRuleRequest)) *MockCleanRoomAutoApprovalRulesInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.DeleteCleanRoomAutoApprovalRuleRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Delete_Call) Return(_a0 error) *MockCleanRoomAutoApprovalRulesInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Delete_Call) RunAndReturn(run func(context.Context, cleanrooms.DeleteCleanRoomAutoApprovalRuleRequest) error) *MockCleanRoomAutoApprovalRulesInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAutoApprovalRulesInterface) Get(ctx context.Context, request cleanrooms.GetCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *cleanrooms.CleanRoomAutoApprovalRule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomAutoApprovalRuleRequest) *cleanrooms.CleanRoomAutoApprovalRule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoomAutoApprovalRule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.GetCleanRoomAutoApprovalRuleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAutoApprovalRulesInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockCleanRoomAutoApprovalRulesInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.GetCleanRoomAutoApprovalRuleRequest +func (_e *MockCleanRoomAutoApprovalRulesInterface_Expecter) Get(ctx interface{}, request interface{}) *MockCleanRoomAutoApprovalRulesInterface_Get_Call { + return &MockCleanRoomAutoApprovalRulesInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Get_Call) Run(run func(ctx context.Context, request cleanrooms.GetCleanRoomAutoApprovalRuleRequest)) *MockCleanRoomAutoApprovalRulesInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.GetCleanRoomAutoApprovalRuleRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Get_Call) Return(_a0 *cleanrooms.CleanRoomAutoApprovalRule, _a1 error) *MockCleanRoomAutoApprovalRulesInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Get_Call) RunAndReturn(run func(context.Context, cleanrooms.GetCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error)) *MockCleanRoomAutoApprovalRulesInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAutoApprovalRulesInterface) List(ctx context.Context, request cleanrooms.ListCleanRoomAutoApprovalRulesRequest) listing.Iterator[cleanrooms.CleanRoomAutoApprovalRule] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[cleanrooms.CleanRoomAutoApprovalRule] + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAutoApprovalRulesRequest) listing.Iterator[cleanrooms.CleanRoomAutoApprovalRule]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[cleanrooms.CleanRoomAutoApprovalRule]) + } + } + + return r0 +} + +// MockCleanRoomAutoApprovalRulesInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockCleanRoomAutoApprovalRulesInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomAutoApprovalRulesRequest +func (_e *MockCleanRoomAutoApprovalRulesInterface_Expecter) List(ctx interface{}, request interface{}) *MockCleanRoomAutoApprovalRulesInterface_List_Call { + return &MockCleanRoomAutoApprovalRulesInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_List_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomAutoApprovalRulesRequest)) *MockCleanRoomAutoApprovalRulesInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomAutoApprovalRulesRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_List_Call) Return(_a0 listing.Iterator[cleanrooms.CleanRoomAutoApprovalRule]) *MockCleanRoomAutoApprovalRulesInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_List_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomAutoApprovalRulesRequest) listing.Iterator[cleanrooms.CleanRoomAutoApprovalRule]) *MockCleanRoomAutoApprovalRulesInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAutoApprovalRulesInterface) ListAll(ctx context.Context, request cleanrooms.ListCleanRoomAutoApprovalRulesRequest) ([]cleanrooms.CleanRoomAutoApprovalRule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []cleanrooms.CleanRoomAutoApprovalRule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAutoApprovalRulesRequest) ([]cleanrooms.CleanRoomAutoApprovalRule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAutoApprovalRulesRequest) []cleanrooms.CleanRoomAutoApprovalRule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]cleanrooms.CleanRoomAutoApprovalRule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.ListCleanRoomAutoApprovalRulesRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAutoApprovalRulesInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockCleanRoomAutoApprovalRulesInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomAutoApprovalRulesRequest +func (_e *MockCleanRoomAutoApprovalRulesInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call { + return &MockCleanRoomAutoApprovalRulesInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomAutoApprovalRulesRequest)) *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomAutoApprovalRulesRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call) Return(_a0 []cleanrooms.CleanRoomAutoApprovalRule, _a1 error) *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomAutoApprovalRulesRequest) ([]cleanrooms.CleanRoomAutoApprovalRule, error)) *MockCleanRoomAutoApprovalRulesInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAutoApprovalRulesInterface) Update(ctx context.Context, request cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *cleanrooms.CleanRoomAutoApprovalRule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest) *cleanrooms.CleanRoomAutoApprovalRule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoomAutoApprovalRule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAutoApprovalRulesInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockCleanRoomAutoApprovalRulesInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest +func (_e *MockCleanRoomAutoApprovalRulesInterface_Expecter) Update(ctx interface{}, request interface{}) *MockCleanRoomAutoApprovalRulesInterface_Update_Call { + return &MockCleanRoomAutoApprovalRulesInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Update_Call) Run(run func(ctx context.Context, request cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest)) *MockCleanRoomAutoApprovalRulesInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Update_Call) Return(_a0 *cleanrooms.CleanRoomAutoApprovalRule, _a1 error) *MockCleanRoomAutoApprovalRulesInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAutoApprovalRulesInterface_Update_Call) RunAndReturn(run func(context.Context, cleanrooms.UpdateCleanRoomAutoApprovalRuleRequest) (*cleanrooms.CleanRoomAutoApprovalRule, error)) *MockCleanRoomAutoApprovalRulesInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewMockCleanRoomAutoApprovalRulesInterface creates a new instance of MockCleanRoomAutoApprovalRulesInterface. 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 NewMockCleanRoomAutoApprovalRulesInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockCleanRoomAutoApprovalRulesInterface { + mock := &MockCleanRoomAutoApprovalRulesInterface{} + 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/aibuilder/api.go b/service/agentbricks/api.go similarity index 58% rename from service/aibuilder/api.go rename to service/agentbricks/api.go index 403da2347..425197c49 100755 --- a/service/aibuilder/api.go +++ b/service/agentbricks/api.go @@ -2,7 +2,7 @@ // The Custom LLMs service manages state and powers the UI for the Custom LLM // product. -package aibuilder +package agentbricks import ( "context" @@ -10,7 +10,7 @@ import ( "github.com/databricks/databricks-sdk-go/client" ) -type AiBuilderInterface interface { +type AgentBricksInterface interface { // Cancel a Custom LLM Optimization Run. CancelOptimize(ctx context.Context, request CancelCustomLlmOptimizationRunRequest) error @@ -21,15 +21,9 @@ type AiBuilderInterface interface { // Delete a Custom LLM. DeleteCustomLlm(ctx context.Context, request DeleteCustomLlmRequest) error - // Delete a Custom LLM. - DeleteCustomLlmById(ctx context.Context, id string) error - // Get a Custom LLM. GetCustomLlm(ctx context.Context, request GetCustomLlmRequest) (*CustomLlm, error) - // Get a Custom LLM. - GetCustomLlmById(ctx context.Context, id string) (*CustomLlm, error) - // Start a Custom LLM Optimization Run. StartOptimize(ctx context.Context, request StartCustomLlmOptimizationRunRequest) (*CustomLlm, error) @@ -37,9 +31,9 @@ type AiBuilderInterface interface { UpdateCustomLlm(ctx context.Context, request UpdateCustomLlmRequest) (*CustomLlm, error) } -func NewAiBuilder(client *client.DatabricksClient) *AiBuilderAPI { - return &AiBuilderAPI{ - aiBuilderImpl: aiBuilderImpl{ +func NewAgentBricks(client *client.DatabricksClient) *AgentBricksAPI { + return &AgentBricksAPI{ + agentBricksImpl: agentBricksImpl{ client: client, }, } @@ -47,20 +41,6 @@ func NewAiBuilder(client *client.DatabricksClient) *AiBuilderAPI { // The Custom LLMs service manages state and powers the UI for the Custom LLM // product. -type AiBuilderAPI struct { - aiBuilderImpl -} - -// Delete a Custom LLM. -func (a *AiBuilderAPI) DeleteCustomLlmById(ctx context.Context, id string) error { - return a.aiBuilderImpl.DeleteCustomLlm(ctx, DeleteCustomLlmRequest{ - Id: id, - }) -} - -// Get a Custom LLM. -func (a *AiBuilderAPI) GetCustomLlmById(ctx context.Context, id string) (*CustomLlm, error) { - return a.aiBuilderImpl.GetCustomLlm(ctx, GetCustomLlmRequest{ - Id: id, - }) +type AgentBricksAPI struct { + agentBricksImpl } diff --git a/service/aibuilder/impl.go b/service/agentbricks/impl.go similarity index 70% rename from service/aibuilder/impl.go rename to service/agentbricks/impl.go index e1d1b51a0..55c4ea706 100755 --- a/service/aibuilder/impl.go +++ b/service/agentbricks/impl.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -package aibuilder +package agentbricks import ( "context" @@ -10,12 +10,12 @@ import ( "github.com/databricks/databricks-sdk-go/client" ) -// unexported type that holds implementations of just AiBuilder API methods -type aiBuilderImpl struct { +// unexported type that holds implementations of just AgentBricks API methods +type agentBricksImpl struct { client *client.DatabricksClient } -func (a *aiBuilderImpl) CancelOptimize(ctx context.Context, request CancelCustomLlmOptimizationRunRequest) error { +func (a *agentBricksImpl) CancelOptimize(ctx context.Context, request CancelCustomLlmOptimizationRunRequest) error { path := fmt.Sprintf("/api/2.0/custom-llms/%v/optimize/cancel", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) @@ -25,7 +25,7 @@ func (a *aiBuilderImpl) CancelOptimize(ctx context.Context, request CancelCustom return err } -func (a *aiBuilderImpl) CreateCustomLlm(ctx context.Context, request CreateCustomLlmRequest) (*CustomLlm, error) { +func (a *agentBricksImpl) CreateCustomLlm(ctx context.Context, request CreateCustomLlmRequest) (*CustomLlm, error) { var customLlm CustomLlm path := "/api/2.0/custom-llms" queryParams := make(map[string]any) @@ -36,8 +36,8 @@ func (a *aiBuilderImpl) CreateCustomLlm(ctx context.Context, request CreateCusto return &customLlm, err } -func (a *aiBuilderImpl) DeleteCustomLlm(ctx context.Context, request DeleteCustomLlmRequest) error { - path := fmt.Sprintf("/api/2.0/custom-lms/%v", request.Id) +func (a *agentBricksImpl) DeleteCustomLlm(ctx context.Context, request DeleteCustomLlmRequest) error { + path := fmt.Sprintf("/api/2.0/custom-llms/%v", request.Id) queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" @@ -45,7 +45,7 @@ func (a *aiBuilderImpl) DeleteCustomLlm(ctx context.Context, request DeleteCusto return err } -func (a *aiBuilderImpl) GetCustomLlm(ctx context.Context, request GetCustomLlmRequest) (*CustomLlm, error) { +func (a *agentBricksImpl) GetCustomLlm(ctx context.Context, request GetCustomLlmRequest) (*CustomLlm, error) { var customLlm CustomLlm path := fmt.Sprintf("/api/2.0/custom-llms/%v", request.Id) queryParams := make(map[string]any) @@ -55,7 +55,7 @@ func (a *aiBuilderImpl) GetCustomLlm(ctx context.Context, request GetCustomLlmRe return &customLlm, err } -func (a *aiBuilderImpl) StartOptimize(ctx context.Context, request StartCustomLlmOptimizationRunRequest) (*CustomLlm, error) { +func (a *agentBricksImpl) StartOptimize(ctx context.Context, request StartCustomLlmOptimizationRunRequest) (*CustomLlm, error) { var customLlm CustomLlm path := fmt.Sprintf("/api/2.0/custom-llms/%v/optimize", request.Id) queryParams := make(map[string]any) @@ -66,7 +66,7 @@ func (a *aiBuilderImpl) StartOptimize(ctx context.Context, request StartCustomLl return &customLlm, err } -func (a *aiBuilderImpl) UpdateCustomLlm(ctx context.Context, request UpdateCustomLlmRequest) (*CustomLlm, error) { +func (a *agentBricksImpl) UpdateCustomLlm(ctx context.Context, request UpdateCustomLlmRequest) (*CustomLlm, error) { var customLlm CustomLlm path := fmt.Sprintf("/api/2.0/custom-llms/%v", request.Id) queryParams := make(map[string]any) diff --git a/service/aibuilder/interface.go b/service/agentbricks/interface.go similarity index 94% rename from service/aibuilder/interface.go rename to service/agentbricks/interface.go index eab476ec0..0c4031966 100755 --- a/service/aibuilder/interface.go +++ b/service/agentbricks/interface.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -package aibuilder +package agentbricks import ( "context" @@ -10,7 +10,7 @@ import ( // product. // // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. -type AiBuilderService interface { +type AgentBricksService interface { // Cancel a Custom LLM Optimization Run. CancelOptimize(ctx context.Context, request CancelCustomLlmOptimizationRunRequest) error diff --git a/service/aibuilder/model.go b/service/agentbricks/model.go similarity index 98% rename from service/aibuilder/model.go rename to service/agentbricks/model.go index 37568bad4..e6898b6de 100755 --- a/service/aibuilder/model.go +++ b/service/agentbricks/model.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -package aibuilder +package agentbricks import ( "fmt" @@ -57,7 +57,7 @@ type CustomLlm struct { // Name of the custom LLM Name string `json:"name"` // If optimization is kicked off, tracks the state of the custom LLM - OptimizationState State `json:"optimization_state"` + OptimizationState State `json:"optimization_state,omitempty"` ForceSendFields []string `json:"-" url:"-"` } diff --git a/service/catalog/api.go b/service/catalog/api.go index 6f954a76f..24e60132c 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -1511,16 +1511,7 @@ func (a *OnlineTablesAPI) GetByName(ctx context.Context, name string) (*OnlineTa type QualityMonitorsInterface interface { - // Cancel an active monitor refresh for the given refresh ID. - // - // The caller must either: 1. be an owner of the table's parent catalog 2. have - // **USE_CATALOG** on the table's parent catalog and be an owner of the table's - // parent schema 3. have the following permissions: - **USE_CATALOG** on the - // table's parent catalog - **USE_SCHEMA** on the table's parent schema - be an - // owner of the table - // - // Additionally, the call must be made from the workspace where the monitor was - // created. + // Cancels an already-initiated refresh job. CancelRefresh(ctx context.Context, request CancelRefreshRequest) error // Creates a new monitor for the specified table. @@ -1550,22 +1541,7 @@ type QualityMonitorsInterface interface { // // Note that the metric tables and dashboard will not be deleted as part of this // call; those assets must be manually cleaned up (if desired). - Delete(ctx context.Context, request DeleteQualityMonitorRequest) error - - // Deletes a monitor for the specified table. - // - // The caller must either: 1. be an owner of the table's parent catalog 2. have - // **USE_CATALOG** on the table's parent catalog and be an owner of the table's - // parent schema 3. have the following permissions: - **USE_CATALOG** on the - // table's parent catalog - **USE_SCHEMA** on the table's parent schema - be an - // owner of the table. - // - // Additionally, the call must be made from the workspace where the monitor was - // created. - // - // Note that the metric tables and dashboard will not be deleted as part of this - // call; those assets must be manually cleaned up (if desired). - DeleteByTableName(ctx context.Context, tableName string) error + Delete(ctx context.Context, request DeleteQualityMonitorRequest) (*DeleteMonitorResponse, error) // Gets a monitor for the specified table. // @@ -1581,20 +1557,6 @@ type QualityMonitorsInterface interface { // where the monitor was created. Get(ctx context.Context, request GetQualityMonitorRequest) (*MonitorInfo, error) - // Gets a monitor for the specified table. - // - // The caller must either: 1. be an owner of the table's parent catalog 2. have - // **USE_CATALOG** on the table's parent catalog and be an owner of the table's - // parent schema. 3. have the following permissions: - **USE_CATALOG** on the - // table's parent catalog - **USE_SCHEMA** on the table's parent schema - - // **SELECT** privilege on the table. - // - // The returned information includes configuration values, as well as - // information on assets created by the monitor. Some information (e.g., - // dashboard) may be filtered out if the caller is in a different workspace than - // where the monitor was created. - GetByTableName(ctx context.Context, tableName string) (*MonitorInfo, error) - // Gets info about a specific monitor refresh using the given refresh ID. // // The caller must either: 1. be an owner of the table's parent catalog 2. have @@ -1607,18 +1569,6 @@ type QualityMonitorsInterface interface { // created. GetRefresh(ctx context.Context, request GetRefreshRequest) (*MonitorRefreshInfo, error) - // Gets info about a specific monitor refresh using the given refresh ID. - // - // The caller must either: 1. be an owner of the table's parent catalog 2. have - // **USE_CATALOG** on the table's parent catalog and be an owner of the table's - // parent schema 3. have the following permissions: - **USE_CATALOG** on the - // table's parent catalog - **USE_SCHEMA** on the table's parent schema - - // **SELECT** privilege on the table. - // - // Additionally, the call must be made from the workspace where the monitor was - // created. - GetRefreshByTableNameAndRefreshId(ctx context.Context, tableName string, refreshId string) (*MonitorRefreshInfo, error) - // Gets an array containing the history of the most recent refreshes (up to 25) // for this table. // @@ -1632,19 +1582,6 @@ type QualityMonitorsInterface interface { // created. ListRefreshes(ctx context.Context, request ListRefreshesRequest) (*MonitorRefreshListResponse, error) - // Gets an array containing the history of the most recent refreshes (up to 25) - // for this table. - // - // The caller must either: 1. be an owner of the table's parent catalog 2. have - // **USE_CATALOG** on the table's parent catalog and be an owner of the table's - // parent schema 3. have the following permissions: - **USE_CATALOG** on the - // table's parent catalog - **USE_SCHEMA** on the table's parent schema - - // **SELECT** privilege on the table. - // - // Additionally, the call must be made from the workspace where the monitor was - // created. - ListRefreshesByTableName(ctx context.Context, tableName string) (*MonitorRefreshListResponse, error) - // Regenerates the monitoring dashboard for the specified table. // // The caller must either: 1. be an owner of the table's parent catalog 2. have @@ -1697,87 +1634,15 @@ func NewQualityMonitors(client *client.DatabricksClient) *QualityMonitorsAPI { // A monitor computes and monitors data or model quality metrics for a table // over time. It generates metrics tables and a dashboard that you can use to -// monitor table health and set alerts. -// -// Most write operations require the user to be the owner of the table (or its -// parent schema or parent catalog). Viewing the dashboard, computed metrics, or -// monitor configuration only requires the user to have **SELECT** privileges on -// the table (along with **USE_SCHEMA** and **USE_CATALOG**). +// monitor table health and set alerts. Most write operations require the user +// to be the owner of the table (or its parent schema or parent catalog). +// Viewing the dashboard, computed metrics, or monitor configuration only +// requires the user to have **SELECT** privileges on the table (along with +// **USE_SCHEMA** and **USE_CATALOG**). type QualityMonitorsAPI struct { qualityMonitorsImpl } -// Deletes a monitor for the specified table. -// -// The caller must either: 1. be an owner of the table's parent catalog 2. have -// **USE_CATALOG** on the table's parent catalog and be an owner of the table's -// parent schema 3. have the following permissions: - **USE_CATALOG** on the -// table's parent catalog - **USE_SCHEMA** on the table's parent schema - be an -// owner of the table. -// -// Additionally, the call must be made from the workspace where the monitor was -// created. -// -// Note that the metric tables and dashboard will not be deleted as part of this -// call; those assets must be manually cleaned up (if desired). -func (a *QualityMonitorsAPI) DeleteByTableName(ctx context.Context, tableName string) error { - return a.qualityMonitorsImpl.Delete(ctx, DeleteQualityMonitorRequest{ - TableName: tableName, - }) -} - -// Gets a monitor for the specified table. -// -// The caller must either: 1. be an owner of the table's parent catalog 2. have -// **USE_CATALOG** on the table's parent catalog and be an owner of the table's -// parent schema. 3. have the following permissions: - **USE_CATALOG** on the -// table's parent catalog - **USE_SCHEMA** on the table's parent schema - -// **SELECT** privilege on the table. -// -// The returned information includes configuration values, as well as -// information on assets created by the monitor. Some information (e.g., -// dashboard) may be filtered out if the caller is in a different workspace than -// where the monitor was created. -func (a *QualityMonitorsAPI) GetByTableName(ctx context.Context, tableName string) (*MonitorInfo, error) { - return a.qualityMonitorsImpl.Get(ctx, GetQualityMonitorRequest{ - TableName: tableName, - }) -} - -// Gets info about a specific monitor refresh using the given refresh ID. -// -// The caller must either: 1. be an owner of the table's parent catalog 2. have -// **USE_CATALOG** on the table's parent catalog and be an owner of the table's -// parent schema 3. have the following permissions: - **USE_CATALOG** on the -// table's parent catalog - **USE_SCHEMA** on the table's parent schema - -// **SELECT** privilege on the table. -// -// Additionally, the call must be made from the workspace where the monitor was -// created. -func (a *QualityMonitorsAPI) GetRefreshByTableNameAndRefreshId(ctx context.Context, tableName string, refreshId string) (*MonitorRefreshInfo, error) { - return a.qualityMonitorsImpl.GetRefresh(ctx, GetRefreshRequest{ - TableName: tableName, - RefreshId: refreshId, - }) -} - -// Gets an array containing the history of the most recent refreshes (up to 25) -// for this table. -// -// The caller must either: 1. be an owner of the table's parent catalog 2. have -// **USE_CATALOG** on the table's parent catalog and be an owner of the table's -// parent schema 3. have the following permissions: - **USE_CATALOG** on the -// table's parent catalog - **USE_SCHEMA** on the table's parent schema - -// **SELECT** privilege on the table. -// -// Additionally, the call must be made from the workspace where the monitor was -// created. -func (a *QualityMonitorsAPI) ListRefreshesByTableName(ctx context.Context, tableName string) (*MonitorRefreshListResponse, error) { - return a.qualityMonitorsImpl.ListRefreshes(ctx, ListRefreshesRequest{ - TableName: tableName, - }) -} - type RegisteredModelsInterface interface { // Creates a new registered model in Unity Catalog. @@ -2054,12 +1919,6 @@ type ResourceQuotasInterface interface { // might not be returned in the first call. GetQuota(ctx context.Context, request GetQuotaRequest) (*GetQuotaResponse, error) - // The GetQuota API returns usage information for a single resource quota, - // defined as a child-parent pair. This API also refreshes the quota count if it - // is out of date. Refreshes are triggered asynchronously. The updated count - // might not be returned in the first call. - GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName(ctx context.Context, parentSecurableType string, parentFullName string, quotaName string) (*GetQuotaResponse, error) - // ListQuotas returns all quota values under the metastore. There are no SLAs on // the freshness of the counts returned. This API does not trigger a refresh of // quota counts. @@ -2095,18 +1954,6 @@ type ResourceQuotasAPI struct { resourceQuotasImpl } -// The GetQuota API returns usage information for a single resource quota, -// defined as a child-parent pair. This API also refreshes the quota count if it -// is out of date. Refreshes are triggered asynchronously. The updated count -// might not be returned in the first call. -func (a *ResourceQuotasAPI) GetQuotaByParentSecurableTypeAndParentFullNameAndQuotaName(ctx context.Context, parentSecurableType string, parentFullName string, quotaName string) (*GetQuotaResponse, error) { - return a.resourceQuotasImpl.GetQuota(ctx, GetQuotaRequest{ - ParentSecurableType: parentSecurableType, - ParentFullName: parentFullName, - QuotaName: quotaName, - }) -} - type SchemasInterface interface { // Creates a new schema for catalog in the Metatastore. The caller must be a diff --git a/service/catalog/impl.go b/service/catalog/impl.go index e6ebc68f0..dd8496e68 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -1288,6 +1288,7 @@ func (a *qualityMonitorsImpl) CancelRefresh(ctx context.Context, request CancelR path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", request.TableName, request.RefreshId) 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, nil) return err } @@ -1303,12 +1304,14 @@ func (a *qualityMonitorsImpl) Create(ctx context.Context, request CreateMonitor) return &monitorInfo, err } -func (a *qualityMonitorsImpl) Delete(ctx context.Context, request DeleteQualityMonitorRequest) error { +func (a *qualityMonitorsImpl) Delete(ctx context.Context, request DeleteQualityMonitorRequest) (*DeleteMonitorResponse, error) { + var deleteMonitorResponse DeleteMonitorResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, nil) - return err + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteMonitorResponse) + return &deleteMonitorResponse, err } func (a *qualityMonitorsImpl) Get(ctx context.Context, request GetQualityMonitorRequest) (*MonitorInfo, error) { diff --git a/service/catalog/interface.go b/service/catalog/interface.go index 762cf70bc..c6ed412d9 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -602,26 +602,16 @@ type OnlineTablesService interface { // A monitor computes and monitors data or model quality metrics for a table // over time. It generates metrics tables and a dashboard that you can use to -// monitor table health and set alerts. -// -// Most write operations require the user to be the owner of the table (or its -// parent schema or parent catalog). Viewing the dashboard, computed metrics, or -// monitor configuration only requires the user to have **SELECT** privileges on -// the table (along with **USE_SCHEMA** and **USE_CATALOG**). +// monitor table health and set alerts. Most write operations require the user +// to be the owner of the table (or its parent schema or parent catalog). +// Viewing the dashboard, computed metrics, or monitor configuration only +// requires the user to have **SELECT** privileges on the table (along with +// **USE_SCHEMA** and **USE_CATALOG**). // // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type QualityMonitorsService interface { - // Cancel an active monitor refresh for the given refresh ID. - // - // The caller must either: 1. be an owner of the table's parent catalog 2. - // have **USE_CATALOG** on the table's parent catalog and be an owner of the - // table's parent schema 3. have the following permissions: - - // **USE_CATALOG** on the table's parent catalog - **USE_SCHEMA** on the - // table's parent schema - be an owner of the table - // - // Additionally, the call must be made from the workspace where the monitor - // was created. + // Cancels an already-initiated refresh job. CancelRefresh(ctx context.Context, request CancelRefreshRequest) error // Creates a new monitor for the specified table. @@ -651,7 +641,7 @@ type QualityMonitorsService interface { // // Note that the metric tables and dashboard will not be deleted as part of // this call; those assets must be manually cleaned up (if desired). - Delete(ctx context.Context, request DeleteQualityMonitorRequest) error + Delete(ctx context.Context, request DeleteQualityMonitorRequest) (*DeleteMonitorResponse, error) // Gets a monitor for the specified table. // diff --git a/service/catalog/model.go b/service/catalog/model.go index 3b1b27878..c6e24cca3 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -384,9 +384,9 @@ func (s AzureUserDelegationSas) MarshalJSON() ([]byte, error) { } type CancelRefreshRequest struct { - // ID of the refresh. - RefreshId string `json:"-" url:"-"` - // Full name of the table. + RefreshId int64 `json:"-" url:"-"` + // UC table name in format `catalog.schema.table_name`. table_name is case + // insensitive and spaces are disallowed. TableName string `json:"-" url:"-"` } @@ -1301,38 +1301,44 @@ type CreateMetastoreAssignment struct { } type CreateMonitor struct { - // The directory to store monitoring assets (e.g. dashboard, metric tables). + // [Create:REQ Update:IGN] Field for specifying the absolute path to a + // custom directory to store data-monitoring assets. Normally prepopulated + // to a default user location via UI and Python APIs. AssetsDir string `json:"assets_dir"` - // Name of the baseline table from which drift metrics are computed from. - // Columns in the monitored table should also be present in the baseline - // table. + // [Create:OPT Update:OPT] Baseline table name. Baseline data is used to + // compute drift from the data in the monitored `table_name`. The baseline + // table and the monitored table shall have the same schema. BaselineTableName string `json:"baseline_table_name,omitempty"` - // Custom metrics to compute on the monitored table. These can be aggregate - // metrics, derived metrics (from already computed aggregate metrics), or - // drift metrics (comparing metrics across time windows). + // [Create:OPT Update:OPT] Custom metrics. CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` - // The data classification config for the monitor. + // [Create:OPT Update:OPT] Data classification related config. DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - // Configuration for monitoring inference logs. + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` - // The notification settings for the monitor. + // [Create:ERR Update:IGN] The latest error message for a monitor failure. + LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + // [Create:OPT Update:OPT] Field for specifying notification settings. Notifications *MonitorNotifications `json:"notifications,omitempty"` - // Schema where output metric tables are created. + // [Create:REQ Update:REQ] Schema where output tables are created. Needs to + // be in 2-level format {catalog}.{schema} OutputSchemaName string `json:"output_schema_name"` - // The schedule for automatically updating and refreshing metric tables. + // [Create:OPT Update:OPT] The monitor schedule. Schedule *MonitorCronSchedule `json:"schedule,omitempty"` // Whether to skip creating a default dashboard summarizing data quality // metrics. SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` - // List of column expressions to slice data with for targeted analysis. The - // data is grouped by each expression independently, resulting in a separate - // slice for each predicate and its complements. For high-cardinality - // columns, only the top 100 unique values by frequency will generate - // slices. + // [Create:OPT Update:OPT] List of column expressions to slice data with for + // targeted analysis. The data is grouped by each expression independently, + // resulting in a separate slice for each predicate and its complements. For + // example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the + // following slices: two slices for `col_2 > 10` (True and False), and one + // slice per unique value in `col1`. For high-cardinality columns, only the + // top 100 unique values by frequency will generate slices. SlicingExprs []string `json:"slicing_exprs,omitempty"` // Configuration for monitoring snapshot tables. Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. This field + // corresponds to the {full_table_name_arg} arg in the endpoint path. TableName string `json:"-" url:"-"` // Configuration for monitoring time series tables. TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` @@ -2012,13 +2018,17 @@ type DeleteModelVersionRequest struct { Version int `json:"-" url:"-"` } +type DeleteMonitorResponse struct { +} + type DeleteOnlineTableRequest struct { // Full three-part (catalog, schema, table) name of the table. Name string `json:"-" url:"-"` } type DeleteQualityMonitorRequest struct { - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. This field + // corresponds to the {full_table_name_arg} arg in the endpoint path. TableName string `json:"-" url:"-"` } @@ -3536,7 +3546,8 @@ func (s GetPermissionsResponse) MarshalJSON() ([]byte, error) { } type GetQualityMonitorRequest struct { - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. This field + // corresponds to the {full_table_name_arg} arg in the endpoint path. TableName string `json:"-" url:"-"` } @@ -3558,7 +3569,7 @@ type GetQuotaResponse struct { type GetRefreshRequest struct { // ID of the refresh. - RefreshId string `json:"-" url:"-"` + RefreshId int64 `json:"-" url:"-"` // Full name of the table. TableName string `json:"-" url:"-"` } @@ -4171,7 +4182,8 @@ func (s ListQuotasResponse) MarshalJSON() ([]byte, error) { } type ListRefreshesRequest struct { - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. table_name is case + // insensitive and spaces are disallowed. TableName string `json:"-" url:"-"` } @@ -4754,18 +4766,22 @@ type MonitorCronSchedule struct { // // [examples]: https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html QuartzCronExpression string `json:"quartz_cron_expression"` - // The timezone id (e.g., ``"PST"``) in which to evaluate the quartz + // The timezone id (e.g., ``PST``) in which to evaluate the quartz // expression. TimezoneId string `json:"timezone_id"` } -// Read only field that indicates whether a schedule is paused or not. +// Source link: +// https://src.dev.databricks.com/databricks/universe/-/blob/elastic-spark-common/api/messages/schedule.proto +// Monitoring workflow schedule pause status. type MonitorCronSchedulePauseStatus string const MonitorCronSchedulePauseStatusPaused MonitorCronSchedulePauseStatus = `PAUSED` const MonitorCronSchedulePauseStatusUnpaused MonitorCronSchedulePauseStatus = `UNPAUSED` +const MonitorCronSchedulePauseStatusUnspecified MonitorCronSchedulePauseStatus = `UNSPECIFIED` + // String representation for [fmt.Print] func (f *MonitorCronSchedulePauseStatus) String() string { return string(*f) @@ -4774,11 +4790,11 @@ func (f *MonitorCronSchedulePauseStatus) String() string { // Set raw string value and validate it against allowed values func (f *MonitorCronSchedulePauseStatus) Set(v string) error { switch v { - case `PAUSED`, `UNPAUSED`: + case `PAUSED`, `UNPAUSED`, `UNSPECIFIED`: *f = MonitorCronSchedulePauseStatus(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "PAUSED", "UNPAUSED"`, v) + return fmt.Errorf(`value "%s" is not one of "PAUSED", "UNPAUSED", "UNSPECIFIED"`, v) } } @@ -4789,6 +4805,7 @@ func (f *MonitorCronSchedulePauseStatus) Values() []MonitorCronSchedulePauseStat return []MonitorCronSchedulePauseStatus{ MonitorCronSchedulePauseStatusPaused, MonitorCronSchedulePauseStatusUnpaused, + MonitorCronSchedulePauseStatusUnspecified, } } @@ -4797,8 +4814,9 @@ func (f *MonitorCronSchedulePauseStatus) Type() string { return "MonitorCronSchedulePauseStatus" } +// Data classification related configuration. type MonitorDataClassificationConfig struct { - // Whether data classification is enabled. + // Whether to enable data classification. Enabled bool `json:"enabled,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -4819,33 +4837,20 @@ type MonitorDestination struct { } type MonitorInferenceLog struct { - // Granularities for aggregating data into time windows based on their - // timestamp. Currently the following static granularities are supported: - // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" - // week(s)"``, ``"1 month"``, ``"1 year"``}. + // List of granularities to use when aggregating data into time windows + // based on their timestamp. Granularities []string `json:"granularities"` - // Optional column that contains the ground truth for the prediction. + // Column for the label. LabelCol string `json:"label_col,omitempty"` - // Column that contains the id of the model generating the predictions. - // Metrics will be computed per model id by default, and also across all - // model ids. + // Column for the model identifier. ModelIdCol string `json:"model_id_col"` - // Column that contains the output/prediction from the model. + // Column for the prediction. PredictionCol string `json:"prediction_col"` - // Optional column that contains the prediction probabilities for each class - // in a classification problem type. The values in this column should be a - // map, mapping each class label to the prediction probability for a given - // sample. The map should be of PySpark MapType(). + // Column for prediction probabilities PredictionProbaCol string `json:"prediction_proba_col,omitempty"` - // Problem type the model aims to solve. Determines the type of - // model-quality metrics that will be computed. + // Problem type the model aims to solve. ProblemType MonitorInferenceLogProblemType `json:"problem_type"` - // Column that contains the timestamps of requests. The column must be one - // of the following: - A ``TimestampType`` column - A column whose values - // can be converted to timestamps through the pyspark ``to_timestamp`` - // [function]. - // - // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html + // Column for the timestamp. TimestampCol string `json:"timestamp_col"` ForceSendFields []string `json:"-" url:"-"` @@ -4859,8 +4864,6 @@ func (s MonitorInferenceLog) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Problem type the model aims to solve. Determines the type of model-quality -// metrics that will be computed. type MonitorInferenceLogProblemType string const MonitorInferenceLogProblemTypeProblemTypeClassification MonitorInferenceLogProblemType = `PROBLEM_TYPE_CLASSIFICATION` @@ -4899,52 +4902,57 @@ func (f *MonitorInferenceLogProblemType) Type() string { } type MonitorInfo struct { - // The directory to store monitoring assets (e.g. dashboard, metric tables). + // [Create:REQ Update:IGN] Field for specifying the absolute path to a + // custom directory to store data-monitoring assets. Normally prepopulated + // to a default user location via UI and Python APIs. AssetsDir string `json:"assets_dir,omitempty"` - // Name of the baseline table from which drift metrics are computed from. - // Columns in the monitored table should also be present in the baseline - // table. + // [Create:OPT Update:OPT] Baseline table name. Baseline data is used to + // compute drift from the data in the monitored `table_name`. The baseline + // table and the monitored table shall have the same schema. BaselineTableName string `json:"baseline_table_name,omitempty"` - // Custom metrics to compute on the monitored table. These can be aggregate - // metrics, derived metrics (from already computed aggregate metrics), or - // drift metrics (comparing metrics across time windows). + // [Create:OPT Update:OPT] Custom metrics. CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` - // Id of dashboard that visualizes the computed metrics. This can be empty - // if the monitor is in PENDING state. + // [Create:ERR Update:OPT] Id of dashboard that visualizes the computed + // metrics. This can be empty if the monitor is in PENDING state. DashboardId string `json:"dashboard_id,omitempty"` - // The data classification config for the monitor. + // [Create:OPT Update:OPT] Data classification related config. DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - // The full name of the drift metrics table. Format: - // __catalog_name__.__schema_name__.__table_name__. + // [Create:ERR Update:IGN] Table that stores drift metrics data. Format: + // `catalog.schema.table_name`. DriftMetricsTableName string `json:"drift_metrics_table_name"` - // Configuration for monitoring inference logs. + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` - // The latest failure message of the monitor (if any). + // [Create:ERR Update:IGN] The latest error message for a monitor failure. LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` - // The version of the monitor config (e.g. 1,2,3). If negative, the monitor - // may be corrupted. - MonitorVersion string `json:"monitor_version"` - // The notification settings for the monitor. + // [Create:ERR Update:IGN] Represents the current monitor configuration + // version in use. The version will be represented in a numeric fashion + // (1,2,3...). The field has flexibility to take on negative values, which + // can indicate corrupted monitor_version numbers. + MonitorVersion int64 `json:"monitor_version"` + // [Create:OPT Update:OPT] Field for specifying notification settings. Notifications *MonitorNotifications `json:"notifications,omitempty"` - // Schema where output metric tables are created. - OutputSchemaName string `json:"output_schema_name,omitempty"` - // The full name of the profile metrics table. Format: - // __catalog_name__.__schema_name__.__table_name__. + // [Create:REQ Update:REQ] Schema where output tables are created. Needs to + // be in 2-level format {catalog}.{schema} + OutputSchemaName string `json:"output_schema_name"` + // [Create:ERR Update:IGN] Table that stores profile metrics data. Format: + // `catalog.schema.table_name`. ProfileMetricsTableName string `json:"profile_metrics_table_name"` - // The schedule for automatically updating and refreshing metric tables. + // [Create:OPT Update:OPT] The monitor schedule. Schedule *MonitorCronSchedule `json:"schedule,omitempty"` - // List of column expressions to slice data with for targeted analysis. The - // data is grouped by each expression independently, resulting in a separate - // slice for each predicate and its complements. For high-cardinality - // columns, only the top 100 unique values by frequency will generate - // slices. + // [Create:OPT Update:OPT] List of column expressions to slice data with for + // targeted analysis. The data is grouped by each expression independently, + // resulting in a separate slice for each predicate and its complements. For + // example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the + // following slices: two slices for `col_2 > 10` (True and False), and one + // slice per unique value in `col1`. For high-cardinality columns, only the + // top 100 unique values by frequency will generate slices. SlicingExprs []string `json:"slicing_exprs,omitempty"` // Configuration for monitoring snapshot tables. Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` - + // [Create:ERR Update:IGN] The monitor status. Status MonitorInfoStatus `json:"status"` - // The full name of the table to monitor. Format: - // __catalog_name__.__schema_name__.__table_name__. + // [Create:ERR Update:IGN] UC table to monitor. Format: + // `catalog.schema.table_name` TableName string `json:"table_name"` // Configuration for monitoring time series tables. TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` @@ -4960,7 +4968,6 @@ func (s MonitorInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// The status of the monitor. type MonitorInfoStatus string const MonitorInfoStatusMonitorStatusActive MonitorInfoStatus = `MONITOR_STATUS_ACTIVE` @@ -5007,6 +5014,7 @@ func (f *MonitorInfoStatus) Type() string { return "MonitorInfoStatus" } +// Custom metric definition. type MonitorMetric struct { // Jinja template for a SQL expression that specifies how to compute the // metric. See [create metric definition]. @@ -5034,11 +5042,11 @@ type MonitorMetric struct { Type MonitorMetricType `json:"type"` } -// Can only be one of “"CUSTOM_METRIC_TYPE_AGGREGATE"“, -// “"CUSTOM_METRIC_TYPE_DERIVED"“, or “"CUSTOM_METRIC_TYPE_DRIFT"“. The -// “"CUSTOM_METRIC_TYPE_AGGREGATE"“ and “"CUSTOM_METRIC_TYPE_DERIVED"“ +// Can only be one of “\"CUSTOM_METRIC_TYPE_AGGREGATE\"“, +// “\"CUSTOM_METRIC_TYPE_DERIVED\"“, or “\"CUSTOM_METRIC_TYPE_DRIFT\"“. The +// “\"CUSTOM_METRIC_TYPE_AGGREGATE\"“ and “\"CUSTOM_METRIC_TYPE_DERIVED\"“ // metrics are computed on a single table, whereas the -// “"CUSTOM_METRIC_TYPE_DRIFT"“ compare metrics across baseline and input +// “\"CUSTOM_METRIC_TYPE_DRIFT\"“ compare metrics across baseline and input // table, or across the two consecutive time windows. - // CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your // table - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate @@ -5085,10 +5093,9 @@ func (f *MonitorMetricType) Type() string { } type MonitorNotifications struct { - // Who to send notifications to on monitor failure. + // Destinations to send notifications on failure/timeout. OnFailure *MonitorDestination `json:"on_failure,omitempty"` - // Who to send notifications to when new data classification tags are - // detected. + // Destinations to send notifications on new classification tag detected. OnNewClassificationTagDetected *MonitorDestination `json:"on_new_classification_tag_detected,omitempty"` } @@ -5133,6 +5140,8 @@ const MonitorRefreshInfoStateRunning MonitorRefreshInfoState = `RUNNING` const MonitorRefreshInfoStateSuccess MonitorRefreshInfoState = `SUCCESS` +const MonitorRefreshInfoStateUnknown MonitorRefreshInfoState = `UNKNOWN` + // String representation for [fmt.Print] func (f *MonitorRefreshInfoState) String() string { return string(*f) @@ -5141,11 +5150,11 @@ func (f *MonitorRefreshInfoState) String() string { // Set raw string value and validate it against allowed values func (f *MonitorRefreshInfoState) Set(v string) error { switch v { - case `CANCELED`, `FAILED`, `PENDING`, `RUNNING`, `SUCCESS`: + case `CANCELED`, `FAILED`, `PENDING`, `RUNNING`, `SUCCESS`, `UNKNOWN`: *f = MonitorRefreshInfoState(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CANCELED", "FAILED", "PENDING", "RUNNING", "SUCCESS"`, v) + return fmt.Errorf(`value "%s" is not one of "CANCELED", "FAILED", "PENDING", "RUNNING", "SUCCESS", "UNKNOWN"`, v) } } @@ -5159,6 +5168,7 @@ func (f *MonitorRefreshInfoState) Values() []MonitorRefreshInfoState { MonitorRefreshInfoStatePending, MonitorRefreshInfoStateRunning, MonitorRefreshInfoStateSuccess, + MonitorRefreshInfoStateUnknown, } } @@ -5167,13 +5177,14 @@ func (f *MonitorRefreshInfoState) Type() string { return "MonitorRefreshInfoState" } -// The method by which the refresh was triggered. type MonitorRefreshInfoTrigger string const MonitorRefreshInfoTriggerManual MonitorRefreshInfoTrigger = `MANUAL` const MonitorRefreshInfoTriggerSchedule MonitorRefreshInfoTrigger = `SCHEDULE` +const MonitorRefreshInfoTriggerUnknownTrigger MonitorRefreshInfoTrigger = `UNKNOWN_TRIGGER` + // String representation for [fmt.Print] func (f *MonitorRefreshInfoTrigger) String() string { return string(*f) @@ -5182,11 +5193,11 @@ func (f *MonitorRefreshInfoTrigger) String() string { // Set raw string value and validate it against allowed values func (f *MonitorRefreshInfoTrigger) Set(v string) error { switch v { - case `MANUAL`, `SCHEDULE`: + case `MANUAL`, `SCHEDULE`, `UNKNOWN_TRIGGER`: *f = MonitorRefreshInfoTrigger(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "MANUAL", "SCHEDULE"`, v) + return fmt.Errorf(`value "%s" is not one of "MANUAL", "SCHEDULE", "UNKNOWN_TRIGGER"`, v) } } @@ -5197,6 +5208,7 @@ func (f *MonitorRefreshInfoTrigger) Values() []MonitorRefreshInfoTrigger { return []MonitorRefreshInfoTrigger{ MonitorRefreshInfoTriggerManual, MonitorRefreshInfoTriggerSchedule, + MonitorRefreshInfoTriggerUnknownTrigger, } } @@ -5210,21 +5222,18 @@ type MonitorRefreshListResponse struct { Refreshes []MonitorRefreshInfo `json:"refreshes,omitempty"` } +// Snapshot analysis configuration type MonitorSnapshot struct { } +// Time series analysis configuration. type MonitorTimeSeries struct { // Granularities for aggregating data into time windows based on their // timestamp. Currently the following static granularities are supported: - // {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" - // week(s)"``, ``"1 month"``, ``"1 year"``}. + // {``\"5 minutes\"``, ``\"30 minutes\"``, ``\"1 hour\"``, ``\"1 day\"``, + // ``\"\u003cn\u003e week(s)\"``, ``\"1 month\"``, ``\"1 year\"``}. Granularities []string `json:"granularities"` - // Column that contains the timestamps of requests. The column must be one - // of the following: - A ``TimestampType`` column - A column whose values - // can be converted to timestamps through the pyspark ``to_timestamp`` - // [function]. - // - // [function]: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html + // Column for the timestamp. TimestampCol string `json:"timestamp_col"` } @@ -5937,7 +5946,8 @@ func (s ReadVolumeRequest) MarshalJSON() ([]byte, error) { } type RegenerateDashboardRequest struct { - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. This field + // corresponds to the {full_table_name_arg} arg in the endpoint path. TableName string `json:"-" url:"-"` // Optional argument to specify the warehouse for dashboard regeneration. If // not specified, the first running warehouse will be used. @@ -5955,9 +5965,8 @@ func (s RegenerateDashboardRequest) MarshalJSON() ([]byte, error) { } type RegenerateDashboardResponse struct { - // Id of the regenerated monitoring dashboard. DashboardId string `json:"dashboard_id,omitempty"` - // The directory where the regenerated dashboard is stored. + // Parent folder is equivalent to {assets_dir}/{tableName} ParentFolder string `json:"parent_folder,omitempty"` ForceSendFields []string `json:"-" url:"-"` @@ -6036,7 +6045,8 @@ func (s RegisteredModelInfo) MarshalJSON() ([]byte, error) { } type RunRefreshRequest struct { - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. table_name is case + // insensitive and spaces are disallowed. TableName string `json:"-" url:"-"` } @@ -6093,6 +6103,7 @@ func (s SchemaInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Latest kind: CONNECTION_SQLSERVER_OAUTH_M2M = 254; Next id:255 type SecurableKind string const SecurableKindTableDbStorage SecurableKind = `TABLE_DB_STORAGE` @@ -7238,36 +7249,40 @@ func (s UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { } type UpdateMonitor struct { - // Name of the baseline table from which drift metrics are computed from. - // Columns in the monitored table should also be present in the baseline - // table. + // [Create:OPT Update:OPT] Baseline table name. Baseline data is used to + // compute drift from the data in the monitored `table_name`. The baseline + // table and the monitored table shall have the same schema. BaselineTableName string `json:"baseline_table_name,omitempty"` - // Custom metrics to compute on the monitored table. These can be aggregate - // metrics, derived metrics (from already computed aggregate metrics), or - // drift metrics (comparing metrics across time windows). + // [Create:OPT Update:OPT] Custom metrics. CustomMetrics []MonitorMetric `json:"custom_metrics,omitempty"` - // Id of dashboard that visualizes the computed metrics. This can be empty - // if the monitor is in PENDING state. + // [Create:ERR Update:OPT] Id of dashboard that visualizes the computed + // metrics. This can be empty if the monitor is in PENDING state. DashboardId string `json:"dashboard_id,omitempty"` - // The data classification config for the monitor. + // [Create:OPT Update:OPT] Data classification related config. DataClassificationConfig *MonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - // Configuration for monitoring inference logs. + InferenceLog *MonitorInferenceLog `json:"inference_log,omitempty"` - // The notification settings for the monitor. + // [Create:ERR Update:IGN] The latest error message for a monitor failure. + LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + // [Create:OPT Update:OPT] Field for specifying notification settings. Notifications *MonitorNotifications `json:"notifications,omitempty"` - // Schema where output metric tables are created. + // [Create:REQ Update:REQ] Schema where output tables are created. Needs to + // be in 2-level format {catalog}.{schema} OutputSchemaName string `json:"output_schema_name"` - // The schedule for automatically updating and refreshing metric tables. + // [Create:OPT Update:OPT] The monitor schedule. Schedule *MonitorCronSchedule `json:"schedule,omitempty"` - // List of column expressions to slice data with for targeted analysis. The - // data is grouped by each expression independently, resulting in a separate - // slice for each predicate and its complements. For high-cardinality - // columns, only the top 100 unique values by frequency will generate - // slices. + // [Create:OPT Update:OPT] List of column expressions to slice data with for + // targeted analysis. The data is grouped by each expression independently, + // resulting in a separate slice for each predicate and its complements. For + // example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the + // following slices: two slices for `col_2 > 10` (True and False), and one + // slice per unique value in `col1`. For high-cardinality columns, only the + // top 100 unique values by frequency will generate slices. SlicingExprs []string `json:"slicing_exprs,omitempty"` // Configuration for monitoring snapshot tables. Snapshot *MonitorSnapshot `json:"snapshot,omitempty"` - // Full name of the table. + // UC table name in format `catalog.schema.table_name`. This field + // corresponds to the {full_table_name_arg} arg in the endpoint path. TableName string `json:"-" url:"-"` // Configuration for monitoring time series tables. TimeSeries *MonitorTimeSeries `json:"time_series,omitempty"` diff --git a/service/cleanrooms/api.go b/service/cleanrooms/api.go index 1c9b1e080..475b484a6 100755 --- a/service/cleanrooms/api.go +++ b/service/cleanrooms/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Clean Room Assets, Clean Room Task Runs, Clean Rooms, etc. +// These APIs allow you to manage Clean Room Asset Revisions, Clean Room Assets, Clean Room Auto Approval Rules, Clean Room Task Runs, Clean Rooms, etc. package cleanrooms import ( @@ -10,6 +10,36 @@ import ( "github.com/databricks/databricks-sdk-go/listing" ) +type CleanRoomAssetRevisionsInterface interface { + + // Get a specific revision of an asset + Get(ctx context.Context, request GetCleanRoomAssetRevisionRequest) (*CleanRoomAsset, error) + + // List revisions for an asset + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListCleanRoomAssetRevisionsRequest) listing.Iterator[CleanRoomAsset] + + // List revisions for an asset + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListCleanRoomAssetRevisionsRequest) ([]CleanRoomAsset, error) +} + +func NewCleanRoomAssetRevisions(client *client.DatabricksClient) *CleanRoomAssetRevisionsAPI { + return &CleanRoomAssetRevisionsAPI{ + cleanRoomAssetRevisionsImpl: cleanRoomAssetRevisionsImpl{ + client: client, + }, + } +} + +// Clean Room Asset Revisions denote new versions of uploaded assets (e.g. +// notebooks) in the clean room. +type CleanRoomAssetRevisionsAPI struct { + cleanRoomAssetRevisionsImpl +} + type CleanRoomAssetsInterface interface { // Create a clean room asset —share an asset like a notebook or table into the @@ -19,6 +49,9 @@ type CleanRoomAssetsInterface interface { // access the asset. Typically, you should use a group as the clean room owner. Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) + // submit an asset review + CreateCleanRoomAssetReview(ctx context.Context, request CreateCleanRoomAssetReviewRequest) (*CreateCleanRoomAssetReviewResponse, error) + // Delete a clean room asset - unshare/remove the asset from the clean room Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error @@ -88,6 +121,46 @@ func (a *CleanRoomAssetsAPI) ListByCleanRoomName(ctx context.Context, cleanRoomN }) } +type CleanRoomAutoApprovalRulesInterface interface { + + // Create an auto-approval rule + Create(ctx context.Context, request CreateCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) + + // Delete a auto-approval rule by rule ID + Delete(ctx context.Context, request DeleteCleanRoomAutoApprovalRuleRequest) error + + // Get a auto-approval rule by rule ID + Get(ctx context.Context, request GetCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) + + // List all auto-approval rules for the caller + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListCleanRoomAutoApprovalRulesRequest) listing.Iterator[CleanRoomAutoApprovalRule] + + // List all auto-approval rules for the caller + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListCleanRoomAutoApprovalRulesRequest) ([]CleanRoomAutoApprovalRule, error) + + // Update a auto-approval rule by rule ID + Update(ctx context.Context, request UpdateCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) +} + +func NewCleanRoomAutoApprovalRules(client *client.DatabricksClient) *CleanRoomAutoApprovalRulesAPI { + return &CleanRoomAutoApprovalRulesAPI{ + cleanRoomAutoApprovalRulesImpl: cleanRoomAutoApprovalRulesImpl{ + client: client, + }, + } +} + +// Clean room auto-approval rules automatically create an approval on your +// behalf when an asset (e.g. notebook) meeting specific criteria is shared in a +// clean room. +type CleanRoomAutoApprovalRulesAPI struct { + cleanRoomAutoApprovalRulesImpl +} + type CleanRoomTaskRunsInterface interface { // List all the historical notebook task runs in a clean room. diff --git a/service/cleanrooms/impl.go b/service/cleanrooms/impl.go index 10da080cf..ea3d198ab 100755 --- a/service/cleanrooms/impl.go +++ b/service/cleanrooms/impl.go @@ -12,6 +12,62 @@ import ( "github.com/databricks/databricks-sdk-go/useragent" ) +// unexported type that holds implementations of just CleanRoomAssetRevisions API methods +type cleanRoomAssetRevisionsImpl struct { + client *client.DatabricksClient +} + +func (a *cleanRoomAssetRevisionsImpl) Get(ctx context.Context, request GetCleanRoomAssetRevisionRequest) (*CleanRoomAsset, error) { + var cleanRoomAsset CleanRoomAsset + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v/revisions/%v", request.CleanRoomName, request.AssetType, request.Name, request.Etag) + 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, &cleanRoomAsset) + return &cleanRoomAsset, err +} + +// List revisions for an asset +func (a *cleanRoomAssetRevisionsImpl) List(ctx context.Context, request ListCleanRoomAssetRevisionsRequest) listing.Iterator[CleanRoomAsset] { + + getNextPage := func(ctx context.Context, req ListCleanRoomAssetRevisionsRequest) (*ListCleanRoomAssetRevisionsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalList(ctx, req) + } + getItems := func(resp *ListCleanRoomAssetRevisionsResponse) []CleanRoomAsset { + return resp.Revisions + } + getNextReq := func(resp *ListCleanRoomAssetRevisionsResponse) *ListCleanRoomAssetRevisionsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List revisions for an asset +func (a *cleanRoomAssetRevisionsImpl) ListAll(ctx context.Context, request ListCleanRoomAssetRevisionsRequest) ([]CleanRoomAsset, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[CleanRoomAsset](ctx, iterator) +} + +func (a *cleanRoomAssetRevisionsImpl) internalList(ctx context.Context, request ListCleanRoomAssetRevisionsRequest) (*ListCleanRoomAssetRevisionsResponse, error) { + var listCleanRoomAssetRevisionsResponse ListCleanRoomAssetRevisionsResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v/revisions", request.CleanRoomName, request.AssetType, 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, &listCleanRoomAssetRevisionsResponse) + return &listCleanRoomAssetRevisionsResponse, err +} + // unexported type that holds implementations of just CleanRoomAssets API methods type cleanRoomAssetsImpl struct { client *client.DatabricksClient @@ -28,6 +84,17 @@ func (a *cleanRoomAssetsImpl) Create(ctx context.Context, request CreateCleanRoo return &cleanRoomAsset, err } +func (a *cleanRoomAssetsImpl) CreateCleanRoomAssetReview(ctx context.Context, request CreateCleanRoomAssetReviewRequest) (*CreateCleanRoomAssetReviewResponse, error) { + var createCleanRoomAssetReviewResponse CreateCleanRoomAssetReviewResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v/reviews", request.CleanRoomName, request.AssetType, 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, &createCleanRoomAssetReviewResponse) + return &createCleanRoomAssetReviewResponse, err +} + func (a *cleanRoomAssetsImpl) Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error { path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.Name) queryParams := make(map[string]any) @@ -99,6 +166,93 @@ func (a *cleanRoomAssetsImpl) Update(ctx context.Context, request UpdateCleanRoo return &cleanRoomAsset, err } +// unexported type that holds implementations of just CleanRoomAutoApprovalRules API methods +type cleanRoomAutoApprovalRulesImpl struct { + client *client.DatabricksClient +} + +func (a *cleanRoomAutoApprovalRulesImpl) Create(ctx context.Context, request CreateCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) { + var cleanRoomAutoApprovalRule CleanRoomAutoApprovalRule + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/auto-approval-rules", request.CleanRoomName) + 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, &cleanRoomAutoApprovalRule) + return &cleanRoomAutoApprovalRule, err +} + +func (a *cleanRoomAutoApprovalRulesImpl) Delete(ctx context.Context, request DeleteCleanRoomAutoApprovalRuleRequest) error { + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/auto-approval-rules/%v", request.CleanRoomName, request.RuleId) + 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 *cleanRoomAutoApprovalRulesImpl) Get(ctx context.Context, request GetCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) { + var cleanRoomAutoApprovalRule CleanRoomAutoApprovalRule + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/auto-approval-rules/%v", request.CleanRoomName, request.RuleId) + 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, &cleanRoomAutoApprovalRule) + return &cleanRoomAutoApprovalRule, err +} + +// List all auto-approval rules for the caller +func (a *cleanRoomAutoApprovalRulesImpl) List(ctx context.Context, request ListCleanRoomAutoApprovalRulesRequest) listing.Iterator[CleanRoomAutoApprovalRule] { + + getNextPage := func(ctx context.Context, req ListCleanRoomAutoApprovalRulesRequest) (*ListCleanRoomAutoApprovalRulesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.internalList(ctx, req) + } + getItems := func(resp *ListCleanRoomAutoApprovalRulesResponse) []CleanRoomAutoApprovalRule { + return resp.Rules + } + getNextReq := func(resp *ListCleanRoomAutoApprovalRulesResponse) *ListCleanRoomAutoApprovalRulesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List all auto-approval rules for the caller +func (a *cleanRoomAutoApprovalRulesImpl) ListAll(ctx context.Context, request ListCleanRoomAutoApprovalRulesRequest) ([]CleanRoomAutoApprovalRule, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[CleanRoomAutoApprovalRule](ctx, iterator) +} + +func (a *cleanRoomAutoApprovalRulesImpl) internalList(ctx context.Context, request ListCleanRoomAutoApprovalRulesRequest) (*ListCleanRoomAutoApprovalRulesResponse, error) { + var listCleanRoomAutoApprovalRulesResponse ListCleanRoomAutoApprovalRulesResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/auto-approval-rules", request.CleanRoomName) + 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, &listCleanRoomAutoApprovalRulesResponse) + return &listCleanRoomAutoApprovalRulesResponse, err +} + +func (a *cleanRoomAutoApprovalRulesImpl) Update(ctx context.Context, request UpdateCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) { + var cleanRoomAutoApprovalRule CleanRoomAutoApprovalRule + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/auto-approval-rules/%v", request.CleanRoomName, request.RuleId) + 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.AutoApprovalRule, &cleanRoomAutoApprovalRule) + return &cleanRoomAutoApprovalRule, err +} + // unexported type that holds implementations of just CleanRoomTaskRuns API methods type cleanRoomTaskRunsImpl struct { client *client.DatabricksClient diff --git a/service/cleanrooms/interface.go b/service/cleanrooms/interface.go index 571e5f8b7..f62a9220c 100755 --- a/service/cleanrooms/interface.go +++ b/service/cleanrooms/interface.go @@ -6,6 +6,19 @@ import ( "context" ) +// Clean Room Asset Revisions denote new versions of uploaded assets (e.g. +// notebooks) in the clean room. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type CleanRoomAssetRevisionsService interface { + + // Get a specific revision of an asset + Get(ctx context.Context, request GetCleanRoomAssetRevisionRequest) (*CleanRoomAsset, error) + + // List revisions for an asset + List(ctx context.Context, request ListCleanRoomAssetRevisionsRequest) (*ListCleanRoomAssetRevisionsResponse, error) +} + // Clean room assets are data and code objects — Tables, volumes, and // notebooks that are shared with the clean room. // @@ -20,6 +33,9 @@ type CleanRoomAssetsService interface { // clean room owner. Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) + // submit an asset review + CreateCleanRoomAssetReview(ctx context.Context, request CreateCleanRoomAssetReviewRequest) (*CreateCleanRoomAssetReviewResponse, error) + // Delete a clean room asset - unshare/remove the asset from the clean room Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error @@ -34,6 +50,29 @@ type CleanRoomAssetsService interface { Update(ctx context.Context, request UpdateCleanRoomAssetRequest) (*CleanRoomAsset, error) } +// Clean room auto-approval rules automatically create an approval on your +// behalf when an asset (e.g. notebook) meeting specific criteria is shared in a +// clean room. +// +// Deprecated: Do not use this interface, it will be removed in a future version of the SDK. +type CleanRoomAutoApprovalRulesService interface { + + // Create an auto-approval rule + Create(ctx context.Context, request CreateCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) + + // Delete a auto-approval rule by rule ID + Delete(ctx context.Context, request DeleteCleanRoomAutoApprovalRuleRequest) error + + // Get a auto-approval rule by rule ID + Get(ctx context.Context, request GetCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) + + // List all auto-approval rules for the caller + List(ctx context.Context, request ListCleanRoomAutoApprovalRulesRequest) (*ListCleanRoomAutoApprovalRulesResponse, error) + + // Update a auto-approval rule by rule ID + Update(ctx context.Context, request UpdateCleanRoomAutoApprovalRuleRequest) (*CleanRoomAutoApprovalRule, error) +} + // Clean room task runs are the executions of notebooks in a clean room. // // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go index 6eac2286c..c00cde831 100755 --- a/service/cleanrooms/model.go +++ b/service/cleanrooms/model.go @@ -97,9 +97,9 @@ type CleanRoomAsset struct { // When the asset is added to the clean room, in epoch milliseconds. AddedAt int64 `json:"added_at,omitempty"` // The type of the asset. - AssetType CleanRoomAssetAssetType `json:"asset_type,omitempty"` - // The name of the clean room this asset belongs to. This is an output-only - // field to ensure proper resource identification. + AssetType CleanRoomAssetAssetType `json:"asset_type"` + // The name of the clean room this asset belongs to. This field is required + // for create operations and populated by the server for responses. CleanRoomName string `json:"clean_room_name,omitempty"` // Foreign table details available to all collaborators of the clean room. // Present if and only if **asset_type** is **FOREIGN_TABLE** @@ -114,7 +114,7 @@ type CleanRoomAsset struct { // *shared_catalog*.*shared_schema*.*asset_name* // // For notebooks, the name is the notebook file name. - Name string `json:"name,omitempty"` + Name string `json:"name"` // Notebook details available to all collaborators of the clean room. // Present if and only if **asset_type** is **NOTEBOOK_FILE** Notebook *CleanRoomAssetNotebook `json:"notebook,omitempty"` @@ -203,17 +203,7 @@ type CleanRoomAssetForeignTable struct { type CleanRoomAssetForeignTableLocalDetails struct { // The fully qualified name of the foreign table in its owner's local // metastore, in the format of *catalog*.*schema*.*foreign_table_name* - LocalName string `json:"local_name,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} - -func (s *CleanRoomAssetForeignTableLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s CleanRoomAssetForeignTableLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) + LocalName string `json:"local_name"` } type CleanRoomAssetNotebook struct { @@ -221,7 +211,7 @@ type CleanRoomAssetNotebook struct { Etag string `json:"etag,omitempty"` // Base 64 representation of the notebook contents. This is the same format // as returned by :method:workspace/export with the format of **HTML**. - NotebookContent string `json:"notebook_content,omitempty"` + NotebookContent string `json:"notebook_content"` // top-level status derived from all reviews ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state,omitempty"` // All existing approvals or rejections @@ -288,19 +278,9 @@ type CleanRoomAssetTable struct { type CleanRoomAssetTableLocalDetails struct { // The fully qualified name of the table in its owner's local metastore, in // the format of *catalog*.*schema*.*table_name* - LocalName string `json:"local_name,omitempty"` + LocalName string `json:"local_name"` // Partition filtering specification for a shared table. Partitions []sharing.Partition `json:"partitions,omitempty"` - - ForceSendFields []string `json:"-" url:"-"` -} - -func (s *CleanRoomAssetTableLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s CleanRoomAssetTableLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) } type CleanRoomAssetView struct { @@ -311,33 +291,73 @@ type CleanRoomAssetView struct { type CleanRoomAssetViewLocalDetails struct { // The fully qualified name of the view in its owner's local metastore, in // the format of *catalog*.*schema*.*view_name* - LocalName string `json:"local_name,omitempty"` + LocalName string `json:"local_name"` +} + +type CleanRoomAssetVolumeLocalDetails struct { + // The fully qualified name of the volume in its owner's local metastore, in + // the format of *catalog*.*schema*.*volume_name* + LocalName string `json:"local_name"` +} + +type CleanRoomAutoApprovalRule struct { + AuthorCollaboratorAlias string `json:"author_collaborator_alias,omitempty"` + + AuthorScope CleanRoomAutoApprovalRuleAuthorScope `json:"author_scope,omitempty"` + // The name of the clean room this auto-approval rule belongs to. + CleanRoomName string `json:"clean_room_name,omitempty"` + // Timestamp of when the rule was created, in epoch milliseconds. + CreatedAt int64 `json:"created_at,omitempty"` + // A generated UUID identifying the rule. + RuleId string `json:"rule_id,omitempty"` + // The owner of the rule to whom the rule applies. + RuleOwnerCollaboratorAlias string `json:"rule_owner_collaborator_alias,omitempty"` + + RunnerCollaboratorAlias string `json:"runner_collaborator_alias,omitempty"` ForceSendFields []string `json:"-" url:"-"` } -func (s *CleanRoomAssetViewLocalDetails) UnmarshalJSON(b []byte) error { +func (s *CleanRoomAutoApprovalRule) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } -func (s CleanRoomAssetViewLocalDetails) MarshalJSON() ([]byte, error) { +func (s CleanRoomAutoApprovalRule) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type CleanRoomAssetVolumeLocalDetails struct { - // The fully qualified name of the volume in its owner's local metastore, in - // the format of *catalog*.*schema*.*volume_name* - LocalName string `json:"local_name,omitempty"` +type CleanRoomAutoApprovalRuleAuthorScope string - ForceSendFields []string `json:"-" url:"-"` +const CleanRoomAutoApprovalRuleAuthorScopeAnyAuthor CleanRoomAutoApprovalRuleAuthorScope = `ANY_AUTHOR` + +// String representation for [fmt.Print] +func (f *CleanRoomAutoApprovalRuleAuthorScope) String() string { + return string(*f) } -func (s *CleanRoomAssetVolumeLocalDetails) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) +// Set raw string value and validate it against allowed values +func (f *CleanRoomAutoApprovalRuleAuthorScope) Set(v string) error { + switch v { + case `ANY_AUTHOR`: + *f = CleanRoomAutoApprovalRuleAuthorScope(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ANY_AUTHOR"`, v) + } } -func (s CleanRoomAssetVolumeLocalDetails) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) +// Values returns all possible values for CleanRoomAutoApprovalRuleAuthorScope. +// +// There is no guarantee on the order of the values in the slice. +func (f *CleanRoomAutoApprovalRuleAuthorScope) Values() []CleanRoomAutoApprovalRuleAuthorScope { + return []CleanRoomAutoApprovalRuleAuthorScope{ + CleanRoomAutoApprovalRuleAuthorScopeAnyAuthor, + } +} + +// Type always returns CleanRoomAutoApprovalRuleAuthorScope to satisfy [pflag.Value] interface +func (f *CleanRoomAutoApprovalRuleAuthorScope) Type() string { + return "CleanRoomAutoApprovalRuleAuthorScope" } // Publicly visible clean room collaborator. @@ -703,8 +723,32 @@ func (s ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { type CreateCleanRoomAssetRequest struct { Asset CleanRoomAsset `json:"asset"` - // The name of the clean room this asset belongs to. This is an output-only - // field to ensure proper resource identification. + // The name of the clean room this asset belongs to. This field is required + // for create operations and populated by the server for responses. + CleanRoomName string `json:"-" url:"-"` +} + +type CreateCleanRoomAssetReviewRequest struct { + // can only be NOTEBOOK_FILE for now + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Name of the clean room + CleanRoomName string `json:"-" url:"-"` + // Name of the asset + Name string `json:"-" url:"-"` + + NotebookReview NotebookVersionReview `json:"notebook_review"` +} + +type CreateCleanRoomAssetReviewResponse struct { + // top-level status derived from all reviews + NotebookReviewState CleanRoomNotebookReviewNotebookReviewState `json:"notebook_review_state,omitempty"` + // All existing notebook approvals or rejections + NotebookReviews []CleanRoomNotebookReview `json:"notebook_reviews,omitempty"` +} + +type CreateCleanRoomAutoApprovalRuleRequest struct { + AutoApprovalRule CleanRoomAutoApprovalRule `json:"auto_approval_rule"` + // The name of the clean room this auto-approval rule belongs to. CleanRoomName string `json:"-" url:"-"` } @@ -733,6 +777,12 @@ type DeleteCleanRoomAssetRequest struct { Name string `json:"-" url:"-"` } +type DeleteCleanRoomAutoApprovalRuleRequest struct { + CleanRoomName string `json:"-" url:"-"` + + RuleId string `json:"-" url:"-"` +} + type DeleteCleanRoomRequest struct { // Name of the clean room. Name string `json:"-" url:"-"` @@ -748,10 +798,67 @@ type GetCleanRoomAssetRequest struct { Name string `json:"-" url:"-"` } +type GetCleanRoomAssetRevisionRequest struct { + // Asset type. Only NOTEBOOK_FILE is supported. + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` + // Revision etag to fetch. If not provided, the latest revision will be + // returned. + Etag string `json:"-" url:"-"` + // Name of the asset. + Name string `json:"-" url:"-"` +} + +type GetCleanRoomAutoApprovalRuleRequest struct { + CleanRoomName string `json:"-" url:"-"` + + RuleId string `json:"-" url:"-"` +} + type GetCleanRoomRequest struct { Name string `json:"-" url:"-"` } +type ListCleanRoomAssetRevisionsRequest struct { + // Asset type. Only NOTEBOOK_FILE is supported. + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` + // Name of the asset. + Name string `json:"-" url:"-"` + // Maximum number of asset revisions to return. Defaults to 10. + PageSize int `json:"-" url:"page_size,omitempty"` + // Opaque pagination token to go to next page based on the previous query. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListCleanRoomAssetRevisionsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomAssetRevisionsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListCleanRoomAssetRevisionsResponse struct { + NextPageToken string `json:"next_page_token,omitempty"` + + Revisions []CleanRoomAsset `json:"revisions,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListCleanRoomAssetRevisionsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomAssetRevisionsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListCleanRoomAssetsRequest struct { // Name of the clean room. CleanRoomName string `json:"-" url:"-"` @@ -788,6 +895,43 @@ func (s ListCleanRoomAssetsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ListCleanRoomAutoApprovalRulesRequest struct { + CleanRoomName string `json:"-" url:"-"` + // Maximum number of auto-approval rules to return. Defaults to 100. + PageSize int `json:"-" url:"page_size,omitempty"` + // Opaque pagination token to go to next page based on previous query. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListCleanRoomAutoApprovalRulesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomAutoApprovalRulesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListCleanRoomAutoApprovalRulesResponse struct { + // Opaque token to retrieve the next page of results. Absent if there are no + // more pages. page_token should be set to this value for the next request + // (for the next page of results). + NextPageToken string `json:"next_page_token,omitempty"` + + Rules []CleanRoomAutoApprovalRule `json:"rules,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ListCleanRoomAutoApprovalRulesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomAutoApprovalRulesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ListCleanRoomNotebookTaskRunsRequest struct { // Name of the clean room. CleanRoomName string `json:"-" url:"-"` @@ -865,6 +1009,25 @@ func (s ListCleanRoomsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type NotebookVersionReview struct { + // review comment + Comment string `json:"comment,omitempty"` + // etag that identifies the notebook version + Etag string `json:"etag"` + // review outcome + ReviewState CleanRoomNotebookReviewNotebookReviewState `json:"review_state"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *NotebookVersionReview) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s NotebookVersionReview) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type UpdateCleanRoomAssetRequest struct { // The asset to update. The asset's `name` and `asset_type` fields are used // to identify the asset to update. @@ -883,6 +1046,16 @@ type UpdateCleanRoomAssetRequest struct { Name string `json:"-" url:"-"` } +type UpdateCleanRoomAutoApprovalRuleRequest struct { + // The auto-approval rule to update. The rule_id field is used to identify + // the rule to update. + AutoApprovalRule CleanRoomAutoApprovalRule `json:"auto_approval_rule"` + // The name of the clean room this auto-approval rule belongs to. + CleanRoomName string `json:"-" url:"-"` + // A generated UUID identifying the rule. + RuleId string `json:"-" url:"-"` +} + type UpdateCleanRoomRequest struct { CleanRoom *CleanRoom `json:"clean_room,omitempty"` // Name of the clean room. diff --git a/service/database/model.go b/service/database/model.go index c8b774215..691c05968 100755 --- a/service/database/model.go +++ b/service/database/model.go @@ -695,6 +695,46 @@ func (f *ProvisioningInfoState) Type() string { return "ProvisioningInfoState" } +type ProvisioningPhase string + +const ProvisioningPhaseProvisioningPhaseIndexScan ProvisioningPhase = `PROVISIONING_PHASE_INDEX_SCAN` + +const ProvisioningPhaseProvisioningPhaseIndexSort ProvisioningPhase = `PROVISIONING_PHASE_INDEX_SORT` + +const ProvisioningPhaseProvisioningPhaseMain ProvisioningPhase = `PROVISIONING_PHASE_MAIN` + +// String representation for [fmt.Print] +func (f *ProvisioningPhase) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ProvisioningPhase) Set(v string) error { + switch v { + case `PROVISIONING_PHASE_INDEX_SCAN`, `PROVISIONING_PHASE_INDEX_SORT`, `PROVISIONING_PHASE_MAIN`: + *f = ProvisioningPhase(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"`, v) + } +} + +// Values returns all possible values for ProvisioningPhase. +// +// There is no guarantee on the order of the values in the slice. +func (f *ProvisioningPhase) Values() []ProvisioningPhase { + return []ProvisioningPhase{ + ProvisioningPhaseProvisioningPhaseIndexScan, + ProvisioningPhaseProvisioningPhaseIndexSort, + ProvisioningPhaseProvisioningPhaseMain, + } +} + +// Type always returns ProvisioningPhase to satisfy [pflag.Value] interface +func (f *ProvisioningPhase) Type() string { + return "ProvisioningPhase" +} + type RequestedClaims struct { PermissionSet RequestedClaimsPermissionSet `json:"permission_set,omitempty"` @@ -852,6 +892,8 @@ type SyncedTablePipelineProgress struct { // The source table Delta version that was last processed by the pipeline. // The pipeline may not have completely processed this version yet. LatestVersionCurrentlyProcessing int64 `json:"latest_version_currently_processing,omitempty"` + // The current phase of the data synchronization pipeline. + ProvisioningPhase ProvisioningPhase `json:"provisioning_phase,omitempty"` // The completion ratio of this update. This is a number between 0 and 1. SyncProgressCompletion float64 `json:"sync_progress_completion,omitempty"` // The number of rows that have been synced in this update. @@ -1122,6 +1164,7 @@ type UpdateDatabaseInstanceRequest struct { DatabaseInstance DatabaseInstance `json:"database_instance"` // The name of the instance. This is the unique identifier for the instance. Name string `json:"-" url:"-"` - // The list of fields to update. + // The list of fields to update. This field is not yet supported, and is + // ignored by the server. UpdateMask string `json:"-" url:"update_mask"` } diff --git a/service/pipelines/model.go b/service/pipelines/model.go index bb737ccc3..34b17d54c 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -679,12 +679,16 @@ const IngestionSourceTypeOracle IngestionSourceType = `ORACLE` const IngestionSourceTypePostgresql IngestionSourceType = `POSTGRESQL` +const IngestionSourceTypeRedshift IngestionSourceType = `REDSHIFT` + const IngestionSourceTypeSalesforce IngestionSourceType = `SALESFORCE` const IngestionSourceTypeServicenow IngestionSourceType = `SERVICENOW` const IngestionSourceTypeSharepoint IngestionSourceType = `SHAREPOINT` +const IngestionSourceTypeSqldw IngestionSourceType = `SQLDW` + const IngestionSourceTypeSqlserver IngestionSourceType = `SQLSERVER` const IngestionSourceTypeTeradata IngestionSourceType = `TERADATA` @@ -699,11 +703,11 @@ func (f *IngestionSourceType) String() string { // Set raw string value and validate it against allowed values func (f *IngestionSourceType) Set(v string) error { switch v { - case `BIGQUERY`, `CONFLUENCE`, `DYNAMICS365`, `GA4_RAW_DATA`, `MANAGED_POSTGRESQL`, `META_MARKETING`, `MYSQL`, `NETSUITE`, `ORACLE`, `POSTGRESQL`, `SALESFORCE`, `SERVICENOW`, `SHAREPOINT`, `SQLSERVER`, `TERADATA`, `WORKDAY_RAAS`: + case `BIGQUERY`, `CONFLUENCE`, `DYNAMICS365`, `GA4_RAW_DATA`, `MANAGED_POSTGRESQL`, `META_MARKETING`, `MYSQL`, `NETSUITE`, `ORACLE`, `POSTGRESQL`, `REDSHIFT`, `SALESFORCE`, `SERVICENOW`, `SHAREPOINT`, `SQLDW`, `SQLSERVER`, `TERADATA`, `WORKDAY_RAAS`: *f = IngestionSourceType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "BIGQUERY", "CONFLUENCE", "DYNAMICS365", "GA4_RAW_DATA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SQLSERVER", "TERADATA", "WORKDAY_RAAS"`, v) + return fmt.Errorf(`value "%s" is not one of "BIGQUERY", "CONFLUENCE", "DYNAMICS365", "GA4_RAW_DATA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "REDSHIFT", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SQLDW", "SQLSERVER", "TERADATA", "WORKDAY_RAAS"`, v) } } @@ -722,9 +726,11 @@ func (f *IngestionSourceType) Values() []IngestionSourceType { IngestionSourceTypeNetsuite, IngestionSourceTypeOracle, IngestionSourceTypePostgresql, + IngestionSourceTypeRedshift, IngestionSourceTypeSalesforce, IngestionSourceTypeServicenow, IngestionSourceTypeSharepoint, + IngestionSourceTypeSqldw, IngestionSourceTypeSqlserver, IngestionSourceTypeTeradata, IngestionSourceTypeWorkdayRaas, diff --git a/service/pkg.go b/service/pkg.go index 3fc4eafbb..1cac5b867 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -6,7 +6,7 @@ // // - [iam.AccountAccessControlProxyAPI]: These APIs manage access rules on resources in an account. // -// - [aibuilder.AiBuilderAPI]: The Custom LLMs service manages state and powers the UI for the Custom LLM product. +// - [agentbricks.AgentBricksAPI]: The Custom LLMs service manages state and powers the UI for the Custom LLM product. // // - [settings.AibiDashboardEmbeddingAccessPolicyAPI]: Controls whether AI/BI published dashboard embedding is enabled, conditionally enabled, or disabled at the workspace level. // @@ -32,8 +32,12 @@ // // - [catalog.CatalogsAPI]: A catalog is the first layer of Unity Catalog’s three-level namespace. // +// - [cleanrooms.CleanRoomAssetRevisionsAPI]: Clean Room Asset Revisions denote new versions of uploaded assets (e.g. +// // - [cleanrooms.CleanRoomAssetsAPI]: Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the clean room. // +// - [cleanrooms.CleanRoomAutoApprovalRulesAPI]: Clean room auto-approval rules automatically create an approval on your behalf when an asset (e.g. +// // - [cleanrooms.CleanRoomTaskRunsAPI]: Clean room task runs are the executions of notebooks in a clean room. // // - [cleanrooms.CleanRoomsAPI]: A clean room uses Delta Sharing and serverless compute to provide a secure and privacy-protecting environment where multiple parties can work together on sensitive enterprise data without direct access to each other's data. @@ -326,7 +330,7 @@ package service import ( - "github.com/databricks/databricks-sdk-go/service/aibuilder" + "github.com/databricks/databricks-sdk-go/service/agentbricks" "github.com/databricks/databricks-sdk-go/service/apps" "github.com/databricks/databricks-sdk-go/service/billing" "github.com/databricks/databricks-sdk-go/service/catalog" @@ -359,7 +363,7 @@ var ( _ *iam.AccessControlAPI = nil _ *iam.AccountAccessControlAPI = nil _ *iam.AccountAccessControlProxyAPI = nil - _ *aibuilder.AiBuilderAPI = nil + _ *agentbricks.AgentBricksAPI = nil _ *settings.AibiDashboardEmbeddingAccessPolicyAPI = nil _ *settings.AibiDashboardEmbeddingApprovedDomainsAPI = nil _ *sql.AlertsAPI = nil @@ -372,7 +376,9 @@ var ( _ *billing.BudgetPolicyAPI = nil _ *billing.BudgetsAPI = nil _ *catalog.CatalogsAPI = nil + _ *cleanrooms.CleanRoomAssetRevisionsAPI = nil _ *cleanrooms.CleanRoomAssetsAPI = nil + _ *cleanrooms.CleanRoomAutoApprovalRulesAPI = nil _ *cleanrooms.CleanRoomTaskRunsAPI = nil _ *cleanrooms.CleanRoomsAPI = nil _ *compute.ClusterPoliciesAPI = nil @@ -385,8 +391,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 diff --git a/service/settings/model.go b/service/settings/model.go index 0f1a255b0..470e5d0bd 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -440,6 +440,8 @@ const ComplianceStandardFedrampIl5 ComplianceStandard = `FEDRAMP_IL5` const ComplianceStandardFedrampModerate ComplianceStandard = `FEDRAMP_MODERATE` +const ComplianceStandardGermanyC5 ComplianceStandard = `GERMANY_C5` + const ComplianceStandardHipaa ComplianceStandard = `HIPAA` const ComplianceStandardHitrust ComplianceStandard = `HITRUST` @@ -464,11 +466,11 @@ func (f *ComplianceStandard) String() string { // Set raw string value and validate it against allowed values func (f *ComplianceStandard) Set(v string) error { switch v { - case `CANADA_PROTECTED_B`, `CYBER_ESSENTIAL_PLUS`, `FEDRAMP_HIGH`, `FEDRAMP_IL5`, `FEDRAMP_MODERATE`, `HIPAA`, `HITRUST`, `IRAP_PROTECTED`, `ISMAP`, `ITAR_EAR`, `K_FSI`, `NONE`, `PCI_DSS`: + case `CANADA_PROTECTED_B`, `CYBER_ESSENTIAL_PLUS`, `FEDRAMP_HIGH`, `FEDRAMP_IL5`, `FEDRAMP_MODERATE`, `GERMANY_C5`, `HIPAA`, `HITRUST`, `IRAP_PROTECTED`, `ISMAP`, `ITAR_EAR`, `K_FSI`, `NONE`, `PCI_DSS`: *f = ComplianceStandard(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CANADA_PROTECTED_B", "CYBER_ESSENTIAL_PLUS", "FEDRAMP_HIGH", "FEDRAMP_IL5", "FEDRAMP_MODERATE", "HIPAA", "HITRUST", "IRAP_PROTECTED", "ISMAP", "ITAR_EAR", "K_FSI", "NONE", "PCI_DSS"`, v) + return fmt.Errorf(`value "%s" is not one of "CANADA_PROTECTED_B", "CYBER_ESSENTIAL_PLUS", "FEDRAMP_HIGH", "FEDRAMP_IL5", "FEDRAMP_MODERATE", "GERMANY_C5", "HIPAA", "HITRUST", "IRAP_PROTECTED", "ISMAP", "ITAR_EAR", "K_FSI", "NONE", "PCI_DSS"`, v) } } @@ -482,6 +484,7 @@ func (f *ComplianceStandard) Values() []ComplianceStandard { ComplianceStandardFedrampHigh, ComplianceStandardFedrampIl5, ComplianceStandardFedrampModerate, + ComplianceStandardGermanyC5, ComplianceStandardHipaa, ComplianceStandardHitrust, ComplianceStandardIrapProtected, diff --git a/service/sharing/model.go b/service/sharing/model.go index 01f994f31..fcd042dfb 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -1648,7 +1648,8 @@ func (f *SharedDataObjectStatus) Type() string { type SharedDataObjectUpdate struct { // One of: **ADD**, **REMOVE**, **UPDATE**. Action SharedDataObjectUpdateAction `json:"action,omitempty"` - // The data object that is being added, removed, or updated. + // The data object that is being added, removed, or updated. The maximum + // number update data objects allowed is a 100. DataObject *SharedDataObject `json:"data_object,omitempty"` } diff --git a/workspace_client.go b/workspace_client.go index 75224d652..c46f2e6c8 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -9,7 +9,7 @@ import ( "github.com/databricks/databricks-sdk-go/config" "github.com/databricks/databricks-sdk-go/httpclient" - "github.com/databricks/databricks-sdk-go/service/aibuilder" + "github.com/databricks/databricks-sdk-go/service/agentbricks" "github.com/databricks/databricks-sdk-go/service/apps" "github.com/databricks/databricks-sdk-go/service/catalog" "github.com/databricks/databricks-sdk-go/service/cleanrooms" @@ -47,7 +47,7 @@ type WorkspaceClient struct { // The Custom LLMs service manages state and powers the UI for the Custom // LLM product. - AiBuilder aibuilder.AiBuilderInterface + AgentBricks agentbricks.AgentBricksInterface // The alerts API can be used to perform CRUD operations on alerts. An alert // is a Databricks SQL object that periodically runs a query, evaluates a @@ -93,10 +93,19 @@ type WorkspaceClient struct { // depending on privileges granted centrally in Unity Catalog. Catalogs catalog.CatalogsInterface + // Clean Room Asset Revisions denote new versions of uploaded assets (e.g. + // notebooks) in the clean room. + CleanRoomAssetRevisions cleanrooms.CleanRoomAssetRevisionsInterface + // Clean room assets are data and code objects — Tables, volumes, and // notebooks that are shared with the clean room. CleanRoomAssets cleanrooms.CleanRoomAssetsInterface + // Clean room auto-approval rules automatically create an approval on your + // behalf when an asset (e.g. notebook) meeting specific criteria is shared + // in a clean room. + CleanRoomAutoApprovalRules cleanrooms.CleanRoomAutoApprovalRulesInterface + // Clean room task runs are the executions of notebooks in a clean room. CleanRoomTaskRuns cleanrooms.CleanRoomTaskRunsInterface @@ -697,13 +706,11 @@ type WorkspaceClient struct { // A monitor computes and monitors data or model quality metrics for a table // over time. It generates metrics tables and a dashboard that you can use - // to monitor table health and set alerts. - // - // Most write operations require the user to be the owner of the table (or - // its parent schema or parent catalog). Viewing the dashboard, computed - // metrics, or monitor configuration only requires the user to have - // **SELECT** privileges on the table (along with **USE_SCHEMA** and - // **USE_CATALOG**). + // to monitor table health and set alerts. Most write operations require the + // user to be the owner of the table (or its parent schema or parent + // catalog). Viewing the dashboard, computed metrics, or monitor + // configuration only requires the user to have **SELECT** privileges on the + // table (along with **USE_SCHEMA** and **USE_CATALOG**). QualityMonitors catalog.QualityMonitorsInterface // The queries API can be used to perform CRUD operations on queries. A @@ -1247,14 +1254,16 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { AccessControl: iam.NewAccessControl(databricksClient), AccountAccessControlProxy: iam.NewAccountAccessControlProxy(databricksClient), - AiBuilder: aibuilder.NewAiBuilder(databricksClient), + AgentBricks: agentbricks.NewAgentBricks(databricksClient), Alerts: sql.NewAlerts(databricksClient), AlertsLegacy: sql.NewAlertsLegacy(databricksClient), AlertsV2: sql.NewAlertsV2(databricksClient), Apps: apps.NewApps(databricksClient), ArtifactAllowlists: catalog.NewArtifactAllowlists(databricksClient), Catalogs: catalog.NewCatalogs(databricksClient), + CleanRoomAssetRevisions: cleanrooms.NewCleanRoomAssetRevisions(databricksClient), CleanRoomAssets: cleanrooms.NewCleanRoomAssets(databricksClient), + CleanRoomAutoApprovalRules: cleanrooms.NewCleanRoomAutoApprovalRules(databricksClient), CleanRoomTaskRuns: cleanrooms.NewCleanRoomTaskRuns(databricksClient), CleanRooms: cleanrooms.NewCleanRooms(databricksClient), ClusterPolicies: compute.NewClusterPolicies(databricksClient),