From 011bd5dab8079592f8c1e0f17d3bab36e18f99c1 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Thu, 5 Dec 2024 17:30:11 +0100 Subject: [PATCH] [Internal] Update to latest OpenAPI spec (#1098) ## What changes are proposed in this pull request? Update the SDK to the latest OpenAPI spec ## How is this tested? N/A --- .codegen/_openapi_sha | 2 +- .gitattributes | 7 + experimental/mocks/mock_workspace_client.go | 28 + .../mock_clean_room_assets_interface.go | 541 +++++++++++++ .../mock_clean_room_task_runs_interface.go | 207 +++++ .../cleanrooms/mock_clean_rooms_interface.go | 537 +++++++++++++ ...board_embedding_access_policy_interface.go | 59 ++ ...rd_embedding_approved_domains_interface.go | 59 ++ service/catalog/api.go | 4 +- service/catalog/interface.go | 4 +- service/catalog/model.go | 92 ++- service/cleanrooms/api.go | 372 +++++++++ service/cleanrooms/impl.go | 139 ++++ service/cleanrooms/interface.go | 108 +++ service/cleanrooms/model.go | 735 ++++++++++++++++++ service/dashboards/model.go | 86 ++ service/files/api.go | 15 +- service/files/interface.go | 5 +- service/jobs/model.go | 117 ++- service/pkg.go | 16 +- service/settings/api.go | 12 + service/settings/impl.go | 18 + service/settings/interface.go | 12 + service/settings/model.go | 329 ++++++++ service/sharing/model.go | 14 +- workspace_client.go | 23 +- 26 files changed, 3476 insertions(+), 65 deletions(-) create mode 100644 experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go create mode 100644 experimental/mocks/service/cleanrooms/mock_clean_room_task_runs_interface.go create mode 100644 experimental/mocks/service/cleanrooms/mock_clean_rooms_interface.go create mode 100755 service/cleanrooms/api.go create mode 100755 service/cleanrooms/impl.go create mode 100755 service/cleanrooms/interface.go create mode 100755 service/cleanrooms/model.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index a2ba58aa5..68cd2f4be 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -f2385add116e3716c8a90a0b68e204deb40f996c \ No newline at end of file +7016dcbf2e011459416cf408ce21143bcc4b3a25 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 397a10f38..da818989a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,6 +33,9 @@ experimental/mocks/service/catalog/mock_tables_interface.go linguist-generated=t experimental/mocks/service/catalog/mock_temporary_table_credentials_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_volumes_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_workspace_bindings_interface.go linguist-generated=true +experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go linguist-generated=true +experimental/mocks/service/cleanrooms/mock_clean_room_task_runs_interface.go linguist-generated=true +experimental/mocks/service/cleanrooms/mock_clean_rooms_interface.go linguist-generated=true experimental/mocks/service/compute/mock_cluster_policies_interface.go linguist-generated=true experimental/mocks/service/compute/mock_clusters_interface.go linguist-generated=true experimental/mocks/service/compute/mock_command_execution_interface.go linguist-generated=true @@ -146,6 +149,10 @@ service/catalog/api.go linguist-generated=true service/catalog/impl.go linguist-generated=true service/catalog/interface.go linguist-generated=true service/catalog/model.go linguist-generated=true +service/cleanrooms/api.go linguist-generated=true +service/cleanrooms/impl.go linguist-generated=true +service/cleanrooms/interface.go linguist-generated=true +service/cleanrooms/model.go linguist-generated=true service/compute/api.go linguist-generated=true service/compute/impl.go linguist-generated=true service/compute/interface.go linguist-generated=true diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index 57719e7ef..20f8533c9 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -10,6 +10,7 @@ import ( "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" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/compute" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/dashboards" "github.com/databricks/databricks-sdk-go/experimental/mocks/service/files" @@ -46,6 +47,9 @@ func NewMockWorkspaceClient(t interface { Apps: apps.NewMockAppsInterface(t), ArtifactAllowlists: catalog.NewMockArtifactAllowlistsInterface(t), Catalogs: catalog.NewMockCatalogsInterface(t), + CleanRoomAssets: cleanrooms.NewMockCleanRoomAssetsInterface(t), + CleanRoomTaskRuns: cleanrooms.NewMockCleanRoomTaskRunsInterface(t), + CleanRooms: cleanrooms.NewMockCleanRoomsInterface(t), ClusterPolicies: compute.NewMockClusterPoliciesInterface(t), Clusters: compute.NewMockClustersInterface(t), CommandExecution: compute.NewMockCommandExecutionInterface(t), @@ -286,6 +290,30 @@ func (m *MockWorkspaceClient) GetMockCatalogsAPI() *catalog.MockCatalogsInterfac return api } +func (m *MockWorkspaceClient) GetMockCleanRoomAssetsAPI() *cleanrooms.MockCleanRoomAssetsInterface { + api, ok := m.WorkspaceClient.CleanRoomAssets.(*cleanrooms.MockCleanRoomAssetsInterface) + if !ok { + panic(fmt.Sprintf("expected CleanRoomAssets to be *cleanrooms.MockCleanRoomAssetsInterface, actual was %T", m.WorkspaceClient.CleanRoomAssets)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockCleanRoomTaskRunsAPI() *cleanrooms.MockCleanRoomTaskRunsInterface { + api, ok := m.WorkspaceClient.CleanRoomTaskRuns.(*cleanrooms.MockCleanRoomTaskRunsInterface) + if !ok { + panic(fmt.Sprintf("expected CleanRoomTaskRuns to be *cleanrooms.MockCleanRoomTaskRunsInterface, actual was %T", m.WorkspaceClient.CleanRoomTaskRuns)) + } + return api +} + +func (m *MockWorkspaceClient) GetMockCleanRoomsAPI() *cleanrooms.MockCleanRoomsInterface { + api, ok := m.WorkspaceClient.CleanRooms.(*cleanrooms.MockCleanRoomsInterface) + if !ok { + panic(fmt.Sprintf("expected CleanRooms to be *cleanrooms.MockCleanRoomsInterface, actual was %T", m.WorkspaceClient.CleanRooms)) + } + return api +} + func (m *MockWorkspaceClient) GetMockClusterPoliciesAPI() *compute.MockClusterPoliciesInterface { api, ok := m.WorkspaceClient.ClusterPolicies.(*compute.MockClusterPoliciesInterface) if !ok { diff --git a/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go b/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go new file mode 100644 index 000000000..05bbc25a7 --- /dev/null +++ b/experimental/mocks/service/cleanrooms/mock_clean_room_assets_interface.go @@ -0,0 +1,541 @@ +// Code generated by mockery v2.43.0. 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" +) + +// MockCleanRoomAssetsInterface is an autogenerated mock type for the CleanRoomAssetsInterface type +type MockCleanRoomAssetsInterface struct { + mock.Mock +} + +type MockCleanRoomAssetsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockCleanRoomAssetsInterface) EXPECT() *MockCleanRoomAssetsInterface_Expecter { + return &MockCleanRoomAssetsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetsInterface) Create(ctx context.Context, request cleanrooms.CreateCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *cleanrooms.CleanRoomAsset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomAssetRequest) *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.CreateCleanRoomAssetRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockCleanRoomAssetsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.CreateCleanRoomAssetRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_Create_Call { + return &MockCleanRoomAssetsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_Create_Call) Run(run func(ctx context.Context, request cleanrooms.CreateCleanRoomAssetRequest)) *MockCleanRoomAssetsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.CreateCleanRoomAssetRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Create_Call) Return(_a0 *cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Create_Call) RunAndReturn(run func(context.Context, cleanrooms.CreateCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetsInterface_Create_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) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.DeleteCleanRoomAssetRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockCleanRoomAssetsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockCleanRoomAssetsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.DeleteCleanRoomAssetRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_Delete_Call { + return &MockCleanRoomAssetsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_Delete_Call) Run(run func(ctx context.Context, request cleanrooms.DeleteCleanRoomAssetRequest)) *MockCleanRoomAssetsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.DeleteCleanRoomAssetRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Delete_Call) Return(_a0 error) *MockCleanRoomAssetsInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Delete_Call) RunAndReturn(run func(context.Context, cleanrooms.DeleteCleanRoomAssetRequest) error) *MockCleanRoomAssetsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteByCleanRoomNameAndAssetTypeAndAssetFullName provides a mock function with given fields: ctx, cleanRoomName, assetType, assetFullName +func (_m *MockCleanRoomAssetsInterface) DeleteByCleanRoomNameAndAssetTypeAndAssetFullName(ctx context.Context, cleanRoomName string, assetType cleanrooms.CleanRoomAssetAssetType, assetFullName string) error { + ret := _m.Called(ctx, cleanRoomName, assetType, assetFullName) + + if len(ret) == 0 { + panic("no return value specified for DeleteByCleanRoomNameAndAssetTypeAndAssetFullName") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, cleanrooms.CleanRoomAssetAssetType, string) error); ok { + r0 = rf(ctx, cleanRoomName, assetType, assetFullName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByCleanRoomNameAndAssetTypeAndAssetFullName' +type MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call struct { + *mock.Call +} + +// DeleteByCleanRoomNameAndAssetTypeAndAssetFullName is a helper method to define mock.On call +// - ctx context.Context +// - cleanRoomName string +// - assetType cleanrooms.CleanRoomAssetAssetType +// - assetFullName string +func (_e *MockCleanRoomAssetsInterface_Expecter) DeleteByCleanRoomNameAndAssetTypeAndAssetFullName(ctx interface{}, cleanRoomName interface{}, assetType interface{}, assetFullName interface{}) *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + return &MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call{Call: _e.mock.On("DeleteByCleanRoomNameAndAssetTypeAndAssetFullName", ctx, cleanRoomName, assetType, assetFullName)} +} + +func (_c *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call) Run(run func(ctx context.Context, cleanRoomName string, assetType cleanrooms.CleanRoomAssetAssetType, assetFullName string)) *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(cleanrooms.CleanRoomAssetAssetType), args[3].(string)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call) Return(_a0 error) *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call) RunAndReturn(run func(context.Context, string, cleanrooms.CleanRoomAssetAssetType, string) error) *MockCleanRoomAssetsInterface_DeleteByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetsInterface) Get(ctx context.Context, request cleanrooms.GetCleanRoomAssetRequest) (*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.GetCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomAssetRequest) *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.GetCleanRoomAssetRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockCleanRoomAssetsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.GetCleanRoomAssetRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_Get_Call { + return &MockCleanRoomAssetsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_Get_Call) Run(run func(ctx context.Context, request cleanrooms.GetCleanRoomAssetRequest)) *MockCleanRoomAssetsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.GetCleanRoomAssetRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Get_Call) Return(_a0 *cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Get_Call) RunAndReturn(run func(context.Context, cleanrooms.GetCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByCleanRoomNameAndAssetTypeAndAssetFullName provides a mock function with given fields: ctx, cleanRoomName, assetType, assetFullName +func (_m *MockCleanRoomAssetsInterface) GetByCleanRoomNameAndAssetTypeAndAssetFullName(ctx context.Context, cleanRoomName string, assetType cleanrooms.CleanRoomAssetAssetType, assetFullName string) (*cleanrooms.CleanRoomAsset, error) { + ret := _m.Called(ctx, cleanRoomName, assetType, assetFullName) + + if len(ret) == 0 { + panic("no return value specified for GetByCleanRoomNameAndAssetTypeAndAssetFullName") + } + + var r0 *cleanrooms.CleanRoomAsset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, cleanrooms.CleanRoomAssetAssetType, string) (*cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, cleanRoomName, assetType, assetFullName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, cleanrooms.CleanRoomAssetAssetType, string) *cleanrooms.CleanRoomAsset); ok { + r0 = rf(ctx, cleanRoomName, assetType, assetFullName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoomAsset) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, cleanrooms.CleanRoomAssetAssetType, string) error); ok { + r1 = rf(ctx, cleanRoomName, assetType, assetFullName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByCleanRoomNameAndAssetTypeAndAssetFullName' +type MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call struct { + *mock.Call +} + +// GetByCleanRoomNameAndAssetTypeAndAssetFullName is a helper method to define mock.On call +// - ctx context.Context +// - cleanRoomName string +// - assetType cleanrooms.CleanRoomAssetAssetType +// - assetFullName string +func (_e *MockCleanRoomAssetsInterface_Expecter) GetByCleanRoomNameAndAssetTypeAndAssetFullName(ctx interface{}, cleanRoomName interface{}, assetType interface{}, assetFullName interface{}) *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + return &MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call{Call: _e.mock.On("GetByCleanRoomNameAndAssetTypeAndAssetFullName", ctx, cleanRoomName, assetType, assetFullName)} +} + +func (_c *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call) Run(run func(ctx context.Context, cleanRoomName string, assetType cleanrooms.CleanRoomAssetAssetType, assetFullName string)) *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(cleanrooms.CleanRoomAssetAssetType), args[3].(string)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call) Return(_a0 *cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call) RunAndReturn(run func(context.Context, string, cleanrooms.CleanRoomAssetAssetType, string) (*cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetsInterface_GetByCleanRoomNameAndAssetTypeAndAssetFullName_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetsInterface) List(ctx context.Context, request cleanrooms.ListCleanRoomAssetsRequest) 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.ListCleanRoomAssetsRequest) 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 +} + +// MockCleanRoomAssetsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockCleanRoomAssetsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomAssetsRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) List(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_List_Call { + return &MockCleanRoomAssetsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_List_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomAssetsRequest)) *MockCleanRoomAssetsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomAssetsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_List_Call) Return(_a0 listing.Iterator[cleanrooms.CleanRoomAsset]) *MockCleanRoomAssetsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_List_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomAssetsRequest) listing.Iterator[cleanrooms.CleanRoomAsset]) *MockCleanRoomAssetsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetsInterface) ListAll(ctx context.Context, request cleanrooms.ListCleanRoomAssetsRequest) ([]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.ListCleanRoomAssetsRequest) ([]cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomAssetsRequest) []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.ListCleanRoomAssetsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockCleanRoomAssetsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomAssetsRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_ListAll_Call { + return &MockCleanRoomAssetsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_ListAll_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomAssetsRequest)) *MockCleanRoomAssetsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomAssetsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_ListAll_Call) Return(_a0 []cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_ListAll_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomAssetsRequest) ([]cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListByCleanRoomName provides a mock function with given fields: ctx, cleanRoomName +func (_m *MockCleanRoomAssetsInterface) ListByCleanRoomName(ctx context.Context, cleanRoomName string) (*cleanrooms.ListCleanRoomAssetsResponse, error) { + ret := _m.Called(ctx, cleanRoomName) + + if len(ret) == 0 { + panic("no return value specified for ListByCleanRoomName") + } + + var r0 *cleanrooms.ListCleanRoomAssetsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*cleanrooms.ListCleanRoomAssetsResponse, error)); ok { + return rf(ctx, cleanRoomName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *cleanrooms.ListCleanRoomAssetsResponse); ok { + r0 = rf(ctx, cleanRoomName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.ListCleanRoomAssetsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, cleanRoomName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_ListByCleanRoomName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListByCleanRoomName' +type MockCleanRoomAssetsInterface_ListByCleanRoomName_Call struct { + *mock.Call +} + +// ListByCleanRoomName is a helper method to define mock.On call +// - ctx context.Context +// - cleanRoomName string +func (_e *MockCleanRoomAssetsInterface_Expecter) ListByCleanRoomName(ctx interface{}, cleanRoomName interface{}) *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call { + return &MockCleanRoomAssetsInterface_ListByCleanRoomName_Call{Call: _e.mock.On("ListByCleanRoomName", ctx, cleanRoomName)} +} + +func (_c *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call) Run(run func(ctx context.Context, cleanRoomName string)) *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call) Return(_a0 *cleanrooms.ListCleanRoomAssetsResponse, _a1 error) *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call) RunAndReturn(run func(context.Context, string) (*cleanrooms.ListCleanRoomAssetsResponse, error)) *MockCleanRoomAssetsInterface_ListByCleanRoomName_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomAssetsInterface) Update(ctx context.Context, request cleanrooms.UpdateCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *cleanrooms.CleanRoomAsset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.UpdateCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.UpdateCleanRoomAssetRequest) *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.UpdateCleanRoomAssetRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomAssetsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockCleanRoomAssetsInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.UpdateCleanRoomAssetRequest +func (_e *MockCleanRoomAssetsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockCleanRoomAssetsInterface_Update_Call { + return &MockCleanRoomAssetsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockCleanRoomAssetsInterface_Update_Call) Run(run func(ctx context.Context, request cleanrooms.UpdateCleanRoomAssetRequest)) *MockCleanRoomAssetsInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.UpdateCleanRoomAssetRequest)) + }) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Update_Call) Return(_a0 *cleanrooms.CleanRoomAsset, _a1 error) *MockCleanRoomAssetsInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomAssetsInterface_Update_Call) RunAndReturn(run func(context.Context, cleanrooms.UpdateCleanRoomAssetRequest) (*cleanrooms.CleanRoomAsset, error)) *MockCleanRoomAssetsInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewMockCleanRoomAssetsInterface creates a new instance of MockCleanRoomAssetsInterface. 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 NewMockCleanRoomAssetsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockCleanRoomAssetsInterface { + mock := &MockCleanRoomAssetsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/cleanrooms/mock_clean_room_task_runs_interface.go b/experimental/mocks/service/cleanrooms/mock_clean_room_task_runs_interface.go new file mode 100644 index 000000000..1e052c3cd --- /dev/null +++ b/experimental/mocks/service/cleanrooms/mock_clean_room_task_runs_interface.go @@ -0,0 +1,207 @@ +// Code generated by mockery v2.43.0. 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" +) + +// MockCleanRoomTaskRunsInterface is an autogenerated mock type for the CleanRoomTaskRunsInterface type +type MockCleanRoomTaskRunsInterface struct { + mock.Mock +} + +type MockCleanRoomTaskRunsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockCleanRoomTaskRunsInterface) EXPECT() *MockCleanRoomTaskRunsInterface_Expecter { + return &MockCleanRoomTaskRunsInterface_Expecter{mock: &_m.Mock} +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomTaskRunsInterface) List(ctx context.Context, request cleanrooms.ListCleanRoomNotebookTaskRunsRequest) listing.Iterator[cleanrooms.CleanRoomNotebookTaskRun] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[cleanrooms.CleanRoomNotebookTaskRun] + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomNotebookTaskRunsRequest) listing.Iterator[cleanrooms.CleanRoomNotebookTaskRun]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[cleanrooms.CleanRoomNotebookTaskRun]) + } + } + + return r0 +} + +// MockCleanRoomTaskRunsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockCleanRoomTaskRunsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomNotebookTaskRunsRequest +func (_e *MockCleanRoomTaskRunsInterface_Expecter) List(ctx interface{}, request interface{}) *MockCleanRoomTaskRunsInterface_List_Call { + return &MockCleanRoomTaskRunsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockCleanRoomTaskRunsInterface_List_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomNotebookTaskRunsRequest)) *MockCleanRoomTaskRunsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomNotebookTaskRunsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomTaskRunsInterface_List_Call) Return(_a0 listing.Iterator[cleanrooms.CleanRoomNotebookTaskRun]) *MockCleanRoomTaskRunsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomTaskRunsInterface_List_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomNotebookTaskRunsRequest) listing.Iterator[cleanrooms.CleanRoomNotebookTaskRun]) *MockCleanRoomTaskRunsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomTaskRunsInterface) ListAll(ctx context.Context, request cleanrooms.ListCleanRoomNotebookTaskRunsRequest) ([]cleanrooms.CleanRoomNotebookTaskRun, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []cleanrooms.CleanRoomNotebookTaskRun + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomNotebookTaskRunsRequest) ([]cleanrooms.CleanRoomNotebookTaskRun, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomNotebookTaskRunsRequest) []cleanrooms.CleanRoomNotebookTaskRun); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]cleanrooms.CleanRoomNotebookTaskRun) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.ListCleanRoomNotebookTaskRunsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomTaskRunsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockCleanRoomTaskRunsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomNotebookTaskRunsRequest +func (_e *MockCleanRoomTaskRunsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockCleanRoomTaskRunsInterface_ListAll_Call { + return &MockCleanRoomTaskRunsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockCleanRoomTaskRunsInterface_ListAll_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomNotebookTaskRunsRequest)) *MockCleanRoomTaskRunsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomNotebookTaskRunsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomTaskRunsInterface_ListAll_Call) Return(_a0 []cleanrooms.CleanRoomNotebookTaskRun, _a1 error) *MockCleanRoomTaskRunsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomTaskRunsInterface_ListAll_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomNotebookTaskRunsRequest) ([]cleanrooms.CleanRoomNotebookTaskRun, error)) *MockCleanRoomTaskRunsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// ListByCleanRoomName provides a mock function with given fields: ctx, cleanRoomName +func (_m *MockCleanRoomTaskRunsInterface) ListByCleanRoomName(ctx context.Context, cleanRoomName string) (*cleanrooms.ListCleanRoomNotebookTaskRunsResponse, error) { + ret := _m.Called(ctx, cleanRoomName) + + if len(ret) == 0 { + panic("no return value specified for ListByCleanRoomName") + } + + var r0 *cleanrooms.ListCleanRoomNotebookTaskRunsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*cleanrooms.ListCleanRoomNotebookTaskRunsResponse, error)); ok { + return rf(ctx, cleanRoomName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *cleanrooms.ListCleanRoomNotebookTaskRunsResponse); ok { + r0 = rf(ctx, cleanRoomName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.ListCleanRoomNotebookTaskRunsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, cleanRoomName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListByCleanRoomName' +type MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call struct { + *mock.Call +} + +// ListByCleanRoomName is a helper method to define mock.On call +// - ctx context.Context +// - cleanRoomName string +func (_e *MockCleanRoomTaskRunsInterface_Expecter) ListByCleanRoomName(ctx interface{}, cleanRoomName interface{}) *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call { + return &MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call{Call: _e.mock.On("ListByCleanRoomName", ctx, cleanRoomName)} +} + +func (_c *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call) Run(run func(ctx context.Context, cleanRoomName string)) *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call) Return(_a0 *cleanrooms.ListCleanRoomNotebookTaskRunsResponse, _a1 error) *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call) RunAndReturn(run func(context.Context, string) (*cleanrooms.ListCleanRoomNotebookTaskRunsResponse, error)) *MockCleanRoomTaskRunsInterface_ListByCleanRoomName_Call { + _c.Call.Return(run) + return _c +} + +// NewMockCleanRoomTaskRunsInterface creates a new instance of MockCleanRoomTaskRunsInterface. 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 NewMockCleanRoomTaskRunsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockCleanRoomTaskRunsInterface { + mock := &MockCleanRoomTaskRunsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/cleanrooms/mock_clean_rooms_interface.go b/experimental/mocks/service/cleanrooms/mock_clean_rooms_interface.go new file mode 100644 index 000000000..0a7271e1b --- /dev/null +++ b/experimental/mocks/service/cleanrooms/mock_clean_rooms_interface.go @@ -0,0 +1,537 @@ +// Code generated by mockery v2.43.0. 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" +) + +// MockCleanRoomsInterface is an autogenerated mock type for the CleanRoomsInterface type +type MockCleanRoomsInterface struct { + mock.Mock +} + +type MockCleanRoomsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockCleanRoomsInterface) EXPECT() *MockCleanRoomsInterface_Expecter { + return &MockCleanRoomsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) Create(ctx context.Context, request cleanrooms.CreateCleanRoomRequest) (*cleanrooms.CleanRoom, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *cleanrooms.CleanRoom + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomRequest) (*cleanrooms.CleanRoom, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomRequest) *cleanrooms.CleanRoom); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoom) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.CreateCleanRoomRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockCleanRoomsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.CreateCleanRoomRequest +func (_e *MockCleanRoomsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockCleanRoomsInterface_Create_Call { + return &MockCleanRoomsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_Create_Call) Run(run func(ctx context.Context, request cleanrooms.CreateCleanRoomRequest)) *MockCleanRoomsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.CreateCleanRoomRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_Create_Call) Return(_a0 *cleanrooms.CleanRoom, _a1 error) *MockCleanRoomsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomsInterface_Create_Call) RunAndReturn(run func(context.Context, cleanrooms.CreateCleanRoomRequest) (*cleanrooms.CleanRoom, error)) *MockCleanRoomsInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// CreateOutputCatalog provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) CreateOutputCatalog(ctx context.Context, request cleanrooms.CreateCleanRoomOutputCatalogRequest) (*cleanrooms.CreateCleanRoomOutputCatalogResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateOutputCatalog") + } + + var r0 *cleanrooms.CreateCleanRoomOutputCatalogResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomOutputCatalogRequest) (*cleanrooms.CreateCleanRoomOutputCatalogResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.CreateCleanRoomOutputCatalogRequest) *cleanrooms.CreateCleanRoomOutputCatalogResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CreateCleanRoomOutputCatalogResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.CreateCleanRoomOutputCatalogRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomsInterface_CreateOutputCatalog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOutputCatalog' +type MockCleanRoomsInterface_CreateOutputCatalog_Call struct { + *mock.Call +} + +// CreateOutputCatalog is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.CreateCleanRoomOutputCatalogRequest +func (_e *MockCleanRoomsInterface_Expecter) CreateOutputCatalog(ctx interface{}, request interface{}) *MockCleanRoomsInterface_CreateOutputCatalog_Call { + return &MockCleanRoomsInterface_CreateOutputCatalog_Call{Call: _e.mock.On("CreateOutputCatalog", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_CreateOutputCatalog_Call) Run(run func(ctx context.Context, request cleanrooms.CreateCleanRoomOutputCatalogRequest)) *MockCleanRoomsInterface_CreateOutputCatalog_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.CreateCleanRoomOutputCatalogRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_CreateOutputCatalog_Call) Return(_a0 *cleanrooms.CreateCleanRoomOutputCatalogResponse, _a1 error) *MockCleanRoomsInterface_CreateOutputCatalog_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomsInterface_CreateOutputCatalog_Call) RunAndReturn(run func(context.Context, cleanrooms.CreateCleanRoomOutputCatalogRequest) (*cleanrooms.CreateCleanRoomOutputCatalogResponse, error)) *MockCleanRoomsInterface_CreateOutputCatalog_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) Delete(ctx context.Context, request cleanrooms.DeleteCleanRoomRequest) 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.DeleteCleanRoomRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockCleanRoomsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockCleanRoomsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.DeleteCleanRoomRequest +func (_e *MockCleanRoomsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockCleanRoomsInterface_Delete_Call { + return &MockCleanRoomsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_Delete_Call) Run(run func(ctx context.Context, request cleanrooms.DeleteCleanRoomRequest)) *MockCleanRoomsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.DeleteCleanRoomRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_Delete_Call) Return(_a0 error) *MockCleanRoomsInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomsInterface_Delete_Call) RunAndReturn(run func(context.Context, cleanrooms.DeleteCleanRoomRequest) error) *MockCleanRoomsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteByName provides a mock function with given fields: ctx, name +func (_m *MockCleanRoomsInterface) DeleteByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteByName") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockCleanRoomsInterface_DeleteByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByName' +type MockCleanRoomsInterface_DeleteByName_Call struct { + *mock.Call +} + +// DeleteByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockCleanRoomsInterface_Expecter) DeleteByName(ctx interface{}, name interface{}) *MockCleanRoomsInterface_DeleteByName_Call { + return &MockCleanRoomsInterface_DeleteByName_Call{Call: _e.mock.On("DeleteByName", ctx, name)} +} + +func (_c *MockCleanRoomsInterface_DeleteByName_Call) Run(run func(ctx context.Context, name string)) *MockCleanRoomsInterface_DeleteByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_DeleteByName_Call) Return(_a0 error) *MockCleanRoomsInterface_DeleteByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomsInterface_DeleteByName_Call) RunAndReturn(run func(context.Context, string) error) *MockCleanRoomsInterface_DeleteByName_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) Get(ctx context.Context, request cleanrooms.GetCleanRoomRequest) (*cleanrooms.CleanRoom, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *cleanrooms.CleanRoom + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomRequest) (*cleanrooms.CleanRoom, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.GetCleanRoomRequest) *cleanrooms.CleanRoom); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoom) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.GetCleanRoomRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockCleanRoomsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.GetCleanRoomRequest +func (_e *MockCleanRoomsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockCleanRoomsInterface_Get_Call { + return &MockCleanRoomsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_Get_Call) Run(run func(ctx context.Context, request cleanrooms.GetCleanRoomRequest)) *MockCleanRoomsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.GetCleanRoomRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_Get_Call) Return(_a0 *cleanrooms.CleanRoom, _a1 error) *MockCleanRoomsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomsInterface_Get_Call) RunAndReturn(run func(context.Context, cleanrooms.GetCleanRoomRequest) (*cleanrooms.CleanRoom, error)) *MockCleanRoomsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByName provides a mock function with given fields: ctx, name +func (_m *MockCleanRoomsInterface) GetByName(ctx context.Context, name string) (*cleanrooms.CleanRoom, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByName") + } + + var r0 *cleanrooms.CleanRoom + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*cleanrooms.CleanRoom, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *cleanrooms.CleanRoom); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoom) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomsInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' +type MockCleanRoomsInterface_GetByName_Call struct { + *mock.Call +} + +// GetByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockCleanRoomsInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockCleanRoomsInterface_GetByName_Call { + return &MockCleanRoomsInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} +} + +func (_c *MockCleanRoomsInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockCleanRoomsInterface_GetByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_GetByName_Call) Return(_a0 *cleanrooms.CleanRoom, _a1 error) *MockCleanRoomsInterface_GetByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomsInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*cleanrooms.CleanRoom, error)) *MockCleanRoomsInterface_GetByName_Call { + _c.Call.Return(run) + return _c +} + +// List provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) List(ctx context.Context, request cleanrooms.ListCleanRoomsRequest) listing.Iterator[cleanrooms.CleanRoom] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 listing.Iterator[cleanrooms.CleanRoom] + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomsRequest) listing.Iterator[cleanrooms.CleanRoom]); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[cleanrooms.CleanRoom]) + } + } + + return r0 +} + +// MockCleanRoomsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockCleanRoomsInterface_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomsRequest +func (_e *MockCleanRoomsInterface_Expecter) List(ctx interface{}, request interface{}) *MockCleanRoomsInterface_List_Call { + return &MockCleanRoomsInterface_List_Call{Call: _e.mock.On("List", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_List_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomsRequest)) *MockCleanRoomsInterface_List_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_List_Call) Return(_a0 listing.Iterator[cleanrooms.CleanRoom]) *MockCleanRoomsInterface_List_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCleanRoomsInterface_List_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomsRequest) listing.Iterator[cleanrooms.CleanRoom]) *MockCleanRoomsInterface_List_Call { + _c.Call.Return(run) + return _c +} + +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) ListAll(ctx context.Context, request cleanrooms.ListCleanRoomsRequest) ([]cleanrooms.CleanRoom, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListAll") + } + + var r0 []cleanrooms.CleanRoom + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomsRequest) ([]cleanrooms.CleanRoom, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.ListCleanRoomsRequest) []cleanrooms.CleanRoom); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]cleanrooms.CleanRoom) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.ListCleanRoomsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockCleanRoomsInterface_ListAll_Call struct { + *mock.Call +} + +// ListAll is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.ListCleanRoomsRequest +func (_e *MockCleanRoomsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockCleanRoomsInterface_ListAll_Call { + return &MockCleanRoomsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_ListAll_Call) Run(run func(ctx context.Context, request cleanrooms.ListCleanRoomsRequest)) *MockCleanRoomsInterface_ListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.ListCleanRoomsRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_ListAll_Call) Return(_a0 []cleanrooms.CleanRoom, _a1 error) *MockCleanRoomsInterface_ListAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomsInterface_ListAll_Call) RunAndReturn(run func(context.Context, cleanrooms.ListCleanRoomsRequest) ([]cleanrooms.CleanRoom, error)) *MockCleanRoomsInterface_ListAll_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: ctx, request +func (_m *MockCleanRoomsInterface) Update(ctx context.Context, request cleanrooms.UpdateCleanRoomRequest) (*cleanrooms.CleanRoom, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *cleanrooms.CleanRoom + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.UpdateCleanRoomRequest) (*cleanrooms.CleanRoom, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, cleanrooms.UpdateCleanRoomRequest) *cleanrooms.CleanRoom); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cleanrooms.CleanRoom) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, cleanrooms.UpdateCleanRoomRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockCleanRoomsInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockCleanRoomsInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - request cleanrooms.UpdateCleanRoomRequest +func (_e *MockCleanRoomsInterface_Expecter) Update(ctx interface{}, request interface{}) *MockCleanRoomsInterface_Update_Call { + return &MockCleanRoomsInterface_Update_Call{Call: _e.mock.On("Update", ctx, request)} +} + +func (_c *MockCleanRoomsInterface_Update_Call) Run(run func(ctx context.Context, request cleanrooms.UpdateCleanRoomRequest)) *MockCleanRoomsInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(cleanrooms.UpdateCleanRoomRequest)) + }) + return _c +} + +func (_c *MockCleanRoomsInterface_Update_Call) Return(_a0 *cleanrooms.CleanRoom, _a1 error) *MockCleanRoomsInterface_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockCleanRoomsInterface_Update_Call) RunAndReturn(run func(context.Context, cleanrooms.UpdateCleanRoomRequest) (*cleanrooms.CleanRoom, error)) *MockCleanRoomsInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewMockCleanRoomsInterface creates a new instance of MockCleanRoomsInterface. 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 NewMockCleanRoomsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockCleanRoomsInterface { + mock := &MockCleanRoomsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_access_policy_interface.go b/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_access_policy_interface.go index 15fb38ac1..1c7bdfb20 100644 --- a/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_access_policy_interface.go +++ b/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_access_policy_interface.go @@ -22,6 +22,65 @@ func (_m *MockAibiDashboardEmbeddingAccessPolicyInterface) EXPECT() *MockAibiDas return &MockAibiDashboardEmbeddingAccessPolicyInterface_Expecter{mock: &_m.Mock} } +// Delete provides a mock function with given fields: ctx, request +func (_m *MockAibiDashboardEmbeddingAccessPolicyInterface) Delete(ctx context.Context, request settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 *settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) *settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest +func (_e *MockAibiDashboardEmbeddingAccessPolicyInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call { + return &MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call) Run(run func(ctx context.Context, request settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest)) *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest)) + }) + return _c +} + +func (_c *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call) Return(_a0 *settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, _a1 error) *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call) RunAndReturn(run func(context.Context, settings.DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*settings.DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error)) *MockAibiDashboardEmbeddingAccessPolicyInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, request func (_m *MockAibiDashboardEmbeddingAccessPolicyInterface) Get(ctx context.Context, request settings.GetAibiDashboardEmbeddingAccessPolicySettingRequest) (*settings.AibiDashboardEmbeddingAccessPolicySetting, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_approved_domains_interface.go b/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_approved_domains_interface.go index aaeeeba9a..059be7623 100644 --- a/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_approved_domains_interface.go +++ b/experimental/mocks/service/settings/mock_aibi_dashboard_embedding_approved_domains_interface.go @@ -22,6 +22,65 @@ func (_m *MockAibiDashboardEmbeddingApprovedDomainsInterface) EXPECT() *MockAibi return &MockAibiDashboardEmbeddingApprovedDomainsInterface_Expecter{mock: &_m.Mock} } +// Delete provides a mock function with given fields: ctx, request +func (_m *MockAibiDashboardEmbeddingApprovedDomainsInterface) Delete(ctx context.Context, request settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 *settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) *settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest +func (_e *MockAibiDashboardEmbeddingApprovedDomainsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call { + return &MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call) Run(run func(ctx context.Context, request settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest)) *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest)) + }) + return _c +} + +func (_c *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call) Return(_a0 *settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, _a1 error) *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call) RunAndReturn(run func(context.Context, settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*settings.DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error)) *MockAibiDashboardEmbeddingApprovedDomainsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, request func (_m *MockAibiDashboardEmbeddingApprovedDomainsInterface) Get(ctx context.Context, request settings.GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*settings.AibiDashboardEmbeddingApprovedDomainsSetting, error) { ret := _m.Called(ctx, request) diff --git a/service/catalog/api.go b/service/catalog/api.go index 3e1e75eea..46d38dd3b 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -899,8 +899,8 @@ func NewCredentials(client *client.DatabricksClient) *CredentialsAPI { // access the credential. // // To create credentials, you must be a Databricks account admin or have the -// `CREATE SERVICE CREDENTIAL privilege. The user who creates the credential can -// delegate ownership to another user or group to manage permissions on it +// `CREATE SERVICE CREDENTIAL` privilege. The user who creates the credential +// can delegate ownership to another user or group to manage permissions on it. type CredentialsAPI struct { credentialsImpl } diff --git a/service/catalog/interface.go b/service/catalog/interface.go index 1c1bbe3cc..a6bd36d62 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -240,8 +240,8 @@ type ConnectionsService interface { // access the credential. // // To create credentials, you must be a Databricks account admin or have the -// `CREATE SERVICE CREDENTIAL privilege. The user who creates the credential can -// delegate ownership to another user or group to manage permissions on it +// `CREATE SERVICE CREDENTIAL` privilege. The user who creates the credential +// can delegate ownership to another user or group to manage permissions on it. type CredentialsService interface { // Create a credential. diff --git a/service/catalog/model.go b/service/catalog/model.go index 9d439492d..b26517e2c 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -295,7 +295,8 @@ func (s AzureManagedIdentityResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// The Azure service principal configuration. +// The Azure service principal configuration. Only applicable when purpose is +// **STORAGE**. type AzureServicePrincipal struct { // The application ID of the application registration within the referenced // AAD tenant. @@ -538,7 +539,7 @@ type ColumnInfo struct { TypeIntervalType string `json:"type_interval_type,omitempty"` // Full data type specification, JSON-serialized. TypeJson string `json:"type_json,omitempty"` - // Name of type (INT, STRUCT, MAP, etc.). + TypeName ColumnTypeName `json:"type_name,omitempty"` // Digits of precision; required for DecimalTypes. TypePrecision int `json:"type_precision,omitempty"` @@ -578,7 +579,6 @@ func (s ColumnMask) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Name of type (INT, STRUCT, MAP, etc.). type ColumnTypeName string const ColumnTypeNameArray ColumnTypeName = `ARRAY` @@ -881,12 +881,14 @@ type CreateCredentialRequest struct { AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - // The Azure service principal configuration. + // The Azure service principal configuration. Only applicable when purpose + // is **STORAGE**. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // Comment associated with the credential. Comment string `json:"comment,omitempty"` - - GcpServiceAccountKey *GcpServiceAccountKey `json:"gcp_service_account_key,omitempty"` + // GCP long-lived credential. Databricks-created Google Cloud Storage + // service account. + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` // The credential name. The name must be unique among storage and service // credentials within the metastore. Name string `json:"name"` @@ -1332,7 +1334,8 @@ type CredentialInfo struct { AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - // The Azure service principal configuration. + // The Azure service principal configuration. Only applicable when purpose + // is **STORAGE**. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // Comment associated with the credential. Comment string `json:"comment,omitempty"` @@ -1340,6 +1343,9 @@ type CredentialInfo struct { CreatedAt int64 `json:"created_at,omitempty"` // Username of credential creator. CreatedBy string `json:"created_by,omitempty"` + // GCP long-lived credential. Databricks-created Google Cloud Storage + // service account. + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` // The full name of the credential. FullName string `json:"full_name,omitempty"` // The unique identifier of the credential. @@ -1526,6 +1532,30 @@ func (f *DataSourceFormat) Type() string { return "DataSourceFormat" } +// GCP long-lived credential. Databricks-created Google Cloud Storage service +// account. +type DatabricksGcpServiceAccount struct { + // The Databricks internal ID that represents this managed identity. This + // field is only used to persist the credential_id once it is fetched from + // the credentials manager - as we only use the protobuf serializer to store + // credentials, this ID gets persisted to the database + CredentialId string `json:"credential_id,omitempty"` + // The email of the service account. + Email string `json:"email,omitempty"` + // The ID that represents the private key for this Service Account + PrivateKeyId string `json:"private_key_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *DatabricksGcpServiceAccount) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DatabricksGcpServiceAccount) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type DatabricksGcpServiceAccountRequest struct { } @@ -2287,7 +2317,7 @@ type FunctionParameterInfo struct { TypeIntervalType string `json:"type_interval_type,omitempty"` // Full data type spec, JSON-serialized. TypeJson string `json:"type_json,omitempty"` - // Name of type (INT, STRUCT, MAP, etc.). + TypeName ColumnTypeName `json:"type_name"` // Digits of precision; required on Create for DecimalTypes. TypePrecision int `json:"type_precision,omitempty"` @@ -2383,27 +2413,7 @@ func (s GcpOauthToken) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// GCP long-lived credential. GCP Service Account. -type GcpServiceAccountKey struct { - // The email of the service account. - Email string `json:"email,omitempty"` - // The service account's RSA private key. - PrivateKey string `json:"private_key,omitempty"` - // The ID of the service account's private key. - PrivateKeyId string `json:"private_key_id,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *GcpServiceAccountKey) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s GcpServiceAccountKey) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - -// Options to customize the requested temporary credential +// The Azure cloud options to customize the requested temporary credential type GenerateTemporaryServiceCredentialAzureOptions struct { // The resources to which the temporary Azure credential should apply. These // resources are the scopes that are passed to the token provider (see @@ -2411,12 +2421,22 @@ type GenerateTemporaryServiceCredentialAzureOptions struct { Resources []string `json:"resources,omitempty"` } +// The GCP cloud options to customize the requested temporary credential +type GenerateTemporaryServiceCredentialGcpOptions struct { + // The scopes to which the temporary GCP credential should apply. These + // resources are the scopes that are passed to the token provider (see + // https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.credentials.Credentials) + Scopes []string `json:"scopes,omitempty"` +} + type GenerateTemporaryServiceCredentialRequest struct { - // Options to customize the requested temporary credential + // The Azure cloud options to customize the requested temporary credential AzureOptions *GenerateTemporaryServiceCredentialAzureOptions `json:"azure_options,omitempty"` // The name of the service credential used to generate a temporary // credential CredentialName string `json:"credential_name"` + // The GCP cloud options to customize the requested temporary credential + GcpOptions *GenerateTemporaryServiceCredentialGcpOptions `json:"gcp_options,omitempty"` } type GenerateTemporaryTableCredentialRequest struct { @@ -4517,6 +4537,8 @@ const PrivilegeCreateExternalVolume Privilege = `CREATE_EXTERNAL_VOLUME` const PrivilegeCreateForeignCatalog Privilege = `CREATE_FOREIGN_CATALOG` +const PrivilegeCreateForeignSecurable Privilege = `CREATE_FOREIGN_SECURABLE` + const PrivilegeCreateFunction Privilege = `CREATE_FUNCTION` const PrivilegeCreateManagedStorage Privilege = `CREATE_MANAGED_STORAGE` @@ -4593,11 +4615,11 @@ func (f *Privilege) String() string { // Set raw string value and validate it against allowed values func (f *Privilege) Set(v string) error { switch v { - case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: + case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FOREIGN_SECURABLE`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: *f = Privilege(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) + return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) } } @@ -5481,10 +5503,14 @@ type UpdateCredentialRequest struct { AwsIamRole *AwsIamRole `json:"aws_iam_role,omitempty"` // The Azure managed identity configuration. AzureManagedIdentity *AzureManagedIdentity `json:"azure_managed_identity,omitempty"` - // The Azure service principal configuration. + // The Azure service principal configuration. Only applicable when purpose + // is **STORAGE**. AzureServicePrincipal *AzureServicePrincipal `json:"azure_service_principal,omitempty"` // Comment associated with the credential. Comment string `json:"comment,omitempty"` + // GCP long-lived credential. Databricks-created Google Cloud Storage + // service account. + DatabricksGcpServiceAccount *DatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` // Force an update even if there are dependent services (when purpose is // **SERVICE**) or dependent external locations and external tables (when // purpose is **STORAGE**). diff --git a/service/cleanrooms/api.go b/service/cleanrooms/api.go new file mode 100755 index 000000000..41fe43afd --- /dev/null +++ b/service/cleanrooms/api.go @@ -0,0 +1,372 @@ +// 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. +package cleanrooms + +import ( + "context" + + "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" +) + +type CleanRoomAssetsInterface interface { + + // Create an asset. + // + // Create a clean room asset —share an asset like a notebook or table into the + // clean room. For each UC asset that is added through this method, the clean + // room owner must also have enough privilege on the asset to consume it. The + // privilege must be maintained indefinitely for the clean room to be able to + // access the asset. Typically, you should use a group as the clean room owner. + Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) + + // Delete an asset. + // + // Delete a clean room asset - unshare/remove the asset from the clean room + Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error + + // Delete an asset. + // + // Delete a clean room asset - unshare/remove the asset from the clean room + DeleteByCleanRoomNameAndAssetTypeAndAssetFullName(ctx context.Context, cleanRoomName string, assetType CleanRoomAssetAssetType, assetFullName string) error + + // Get an asset. + // + // Get the details of a clean room asset by its type and full name. + Get(ctx context.Context, request GetCleanRoomAssetRequest) (*CleanRoomAsset, error) + + // Get an asset. + // + // Get the details of a clean room asset by its type and full name. + GetByCleanRoomNameAndAssetTypeAndAssetFullName(ctx context.Context, cleanRoomName string, assetType CleanRoomAssetAssetType, assetFullName string) (*CleanRoomAsset, error) + + // List assets. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListCleanRoomAssetsRequest) listing.Iterator[CleanRoomAsset] + + // List assets. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListCleanRoomAssetsRequest) ([]CleanRoomAsset, error) + + // List assets. + ListByCleanRoomName(ctx context.Context, cleanRoomName string) (*ListCleanRoomAssetsResponse, error) + + // Update an asset. + // + // Update a clean room asset. For example, updating the content of a notebook; + // changing the shared partitions of a table; etc. + Update(ctx context.Context, request UpdateCleanRoomAssetRequest) (*CleanRoomAsset, error) +} + +func NewCleanRoomAssets(client *client.DatabricksClient) *CleanRoomAssetsAPI { + return &CleanRoomAssetsAPI{ + cleanRoomAssetsImpl: cleanRoomAssetsImpl{ + client: client, + }, + } +} + +// Clean room assets are data and code objects — Tables, volumes, and +// notebooks that are shared with the clean room. +type CleanRoomAssetsAPI struct { + cleanRoomAssetsImpl +} + +// Delete an asset. +// +// Delete a clean room asset - unshare/remove the asset from the clean room +func (a *CleanRoomAssetsAPI) DeleteByCleanRoomNameAndAssetTypeAndAssetFullName(ctx context.Context, cleanRoomName string, assetType CleanRoomAssetAssetType, assetFullName string) error { + return a.cleanRoomAssetsImpl.Delete(ctx, DeleteCleanRoomAssetRequest{ + CleanRoomName: cleanRoomName, + AssetType: assetType, + AssetFullName: assetFullName, + }) +} + +// Get an asset. +// +// Get the details of a clean room asset by its type and full name. +func (a *CleanRoomAssetsAPI) GetByCleanRoomNameAndAssetTypeAndAssetFullName(ctx context.Context, cleanRoomName string, assetType CleanRoomAssetAssetType, assetFullName string) (*CleanRoomAsset, error) { + return a.cleanRoomAssetsImpl.Get(ctx, GetCleanRoomAssetRequest{ + CleanRoomName: cleanRoomName, + AssetType: assetType, + AssetFullName: assetFullName, + }) +} + +// List assets. +// +// This method is generated by Databricks SDK Code Generator. +func (a *CleanRoomAssetsAPI) List(ctx context.Context, request ListCleanRoomAssetsRequest) listing.Iterator[CleanRoomAsset] { + + getNextPage := func(ctx context.Context, req ListCleanRoomAssetsRequest) (*ListCleanRoomAssetsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.cleanRoomAssetsImpl.List(ctx, req) + } + getItems := func(resp *ListCleanRoomAssetsResponse) []CleanRoomAsset { + return resp.Assets + } + getNextReq := func(resp *ListCleanRoomAssetsResponse) *ListCleanRoomAssetsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List assets. +// +// This method is generated by Databricks SDK Code Generator. +func (a *CleanRoomAssetsAPI) ListAll(ctx context.Context, request ListCleanRoomAssetsRequest) ([]CleanRoomAsset, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[CleanRoomAsset](ctx, iterator) +} + +// List assets. +func (a *CleanRoomAssetsAPI) ListByCleanRoomName(ctx context.Context, cleanRoomName string) (*ListCleanRoomAssetsResponse, error) { + return a.cleanRoomAssetsImpl.List(ctx, ListCleanRoomAssetsRequest{ + CleanRoomName: cleanRoomName, + }) +} + +type CleanRoomTaskRunsInterface interface { + + // List notebook task runs. + // + // List all the historical notebook task runs in a clean room. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) listing.Iterator[CleanRoomNotebookTaskRun] + + // List notebook task runs. + // + // List all the historical notebook task runs in a clean room. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) ([]CleanRoomNotebookTaskRun, error) + + // List notebook task runs. + // + // List all the historical notebook task runs in a clean room. + ListByCleanRoomName(ctx context.Context, cleanRoomName string) (*ListCleanRoomNotebookTaskRunsResponse, error) +} + +func NewCleanRoomTaskRuns(client *client.DatabricksClient) *CleanRoomTaskRunsAPI { + return &CleanRoomTaskRunsAPI{ + cleanRoomTaskRunsImpl: cleanRoomTaskRunsImpl{ + client: client, + }, + } +} + +// Clean room task runs are the executions of notebooks in a clean room. +type CleanRoomTaskRunsAPI struct { + cleanRoomTaskRunsImpl +} + +// List notebook task runs. +// +// List all the historical notebook task runs in a clean room. +// +// This method is generated by Databricks SDK Code Generator. +func (a *CleanRoomTaskRunsAPI) List(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) listing.Iterator[CleanRoomNotebookTaskRun] { + + getNextPage := func(ctx context.Context, req ListCleanRoomNotebookTaskRunsRequest) (*ListCleanRoomNotebookTaskRunsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.cleanRoomTaskRunsImpl.List(ctx, req) + } + getItems := func(resp *ListCleanRoomNotebookTaskRunsResponse) []CleanRoomNotebookTaskRun { + return resp.Runs + } + getNextReq := func(resp *ListCleanRoomNotebookTaskRunsResponse) *ListCleanRoomNotebookTaskRunsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List notebook task runs. +// +// List all the historical notebook task runs in a clean room. +// +// This method is generated by Databricks SDK Code Generator. +func (a *CleanRoomTaskRunsAPI) ListAll(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) ([]CleanRoomNotebookTaskRun, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[CleanRoomNotebookTaskRun](ctx, iterator) +} + +// List notebook task runs. +// +// List all the historical notebook task runs in a clean room. +func (a *CleanRoomTaskRunsAPI) ListByCleanRoomName(ctx context.Context, cleanRoomName string) (*ListCleanRoomNotebookTaskRunsResponse, error) { + return a.cleanRoomTaskRunsImpl.List(ctx, ListCleanRoomNotebookTaskRunsRequest{ + CleanRoomName: cleanRoomName, + }) +} + +type CleanRoomsInterface interface { + + // Create a clean room. + // + // Create a new clean room with the specified collaborators. This method is + // asynchronous; the returned name field inside the clean_room field can be used + // to poll the clean room status, using the :method:cleanrooms/get method. When + // this method returns, the cluster will be in a PROVISIONING state. The cluster + // will be usable once it enters an ACTIVE state. + // + // The caller must be a metastore admin or have the **CREATE_CLEAN_ROOM** + // privilege on the metastore. + Create(ctx context.Context, request CreateCleanRoomRequest) (*CleanRoom, error) + + // Create an output catalog. + // + // Create the output catalog of the clean room. + CreateOutputCatalog(ctx context.Context, request CreateCleanRoomOutputCatalogRequest) (*CreateCleanRoomOutputCatalogResponse, error) + + // Delete a clean room. + // + // Delete a clean room. After deletion, the clean room will be removed from the + // metastore. If the other collaborators have not deleted the clean room, they + // will still have the clean room in their metastore, but it will be in a + // DELETED state and no operations other than deletion can be performed on it. + Delete(ctx context.Context, request DeleteCleanRoomRequest) error + + // Delete a clean room. + // + // Delete a clean room. After deletion, the clean room will be removed from the + // metastore. If the other collaborators have not deleted the clean room, they + // will still have the clean room in their metastore, but it will be in a + // DELETED state and no operations other than deletion can be performed on it. + DeleteByName(ctx context.Context, name string) error + + // Get a clean room. + // + // Get the details of a clean room given its name. + Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoom, error) + + // Get a clean room. + // + // Get the details of a clean room given its name. + GetByName(ctx context.Context, name string) (*CleanRoom, error) + + // List clean rooms. + // + // Get a list of all clean rooms of the metastore. Only clean rooms the caller + // has access to are returned. + // + // This method is generated by Databricks SDK Code Generator. + List(ctx context.Context, request ListCleanRoomsRequest) listing.Iterator[CleanRoom] + + // List clean rooms. + // + // Get a list of all clean rooms of the metastore. Only clean rooms the caller + // has access to are returned. + // + // This method is generated by Databricks SDK Code Generator. + ListAll(ctx context.Context, request ListCleanRoomsRequest) ([]CleanRoom, error) + + // Update a clean room. + // + // Update a clean room. The caller must be the owner of the clean room, have + // **MODIFY_CLEAN_ROOM** privilege, or be metastore admin. + // + // When the caller is a metastore admin, only the __owner__ field can be + // updated. + Update(ctx context.Context, request UpdateCleanRoomRequest) (*CleanRoom, error) +} + +func NewCleanRooms(client *client.DatabricksClient) *CleanRoomsAPI { + return &CleanRoomsAPI{ + cleanRoomsImpl: cleanRoomsImpl{ + client: client, + }, + } +} + +// 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. +type CleanRoomsAPI struct { + cleanRoomsImpl +} + +// Delete a clean room. +// +// Delete a clean room. After deletion, the clean room will be removed from the +// metastore. If the other collaborators have not deleted the clean room, they +// will still have the clean room in their metastore, but it will be in a +// DELETED state and no operations other than deletion can be performed on it. +func (a *CleanRoomsAPI) DeleteByName(ctx context.Context, name string) error { + return a.cleanRoomsImpl.Delete(ctx, DeleteCleanRoomRequest{ + Name: name, + }) +} + +// Get a clean room. +// +// Get the details of a clean room given its name. +func (a *CleanRoomsAPI) GetByName(ctx context.Context, name string) (*CleanRoom, error) { + return a.cleanRoomsImpl.Get(ctx, GetCleanRoomRequest{ + Name: name, + }) +} + +// List clean rooms. +// +// Get a list of all clean rooms of the metastore. Only clean rooms the caller +// has access to are returned. +// +// This method is generated by Databricks SDK Code Generator. +func (a *CleanRoomsAPI) List(ctx context.Context, request ListCleanRoomsRequest) listing.Iterator[CleanRoom] { + + getNextPage := func(ctx context.Context, req ListCleanRoomsRequest) (*ListCleanRoomsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.cleanRoomsImpl.List(ctx, req) + } + getItems := func(resp *ListCleanRoomsResponse) []CleanRoom { + return resp.CleanRooms + } + getNextReq := func(resp *ListCleanRoomsResponse) *ListCleanRoomsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List clean rooms. +// +// Get a list of all clean rooms of the metastore. Only clean rooms the caller +// has access to are returned. +// +// This method is generated by Databricks SDK Code Generator. +func (a *CleanRoomsAPI) ListAll(ctx context.Context, request ListCleanRoomsRequest) ([]CleanRoom, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[CleanRoom](ctx, iterator) +} diff --git a/service/cleanrooms/impl.go b/service/cleanrooms/impl.go new file mode 100755 index 000000000..50937ebf0 --- /dev/null +++ b/service/cleanrooms/impl.go @@ -0,0 +1,139 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package cleanrooms + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sdk-go/client" +) + +// unexported type that holds implementations of just CleanRoomAssets API methods +type cleanRoomAssetsImpl struct { + client *client.DatabricksClient +} + +func (a *cleanRoomAssetsImpl) Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) { + var cleanRoomAsset CleanRoomAsset + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", request.CleanRoomName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request.Asset, &cleanRoomAsset) + return &cleanRoomAsset, err +} + +func (a *cleanRoomAssetsImpl) Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error { + var deleteCleanRoomAssetResponse DeleteCleanRoomAssetResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.AssetFullName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteCleanRoomAssetResponse) + return err +} + +func (a *cleanRoomAssetsImpl) Get(ctx context.Context, request GetCleanRoomAssetRequest) (*CleanRoomAsset, error) { + var cleanRoomAsset CleanRoomAsset + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.AssetFullName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &cleanRoomAsset) + return &cleanRoomAsset, err +} + +func (a *cleanRoomAssetsImpl) List(ctx context.Context, request ListCleanRoomAssetsRequest) (*ListCleanRoomAssetsResponse, error) { + var listCleanRoomAssetsResponse ListCleanRoomAssetsResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", request.CleanRoomName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCleanRoomAssetsResponse) + return &listCleanRoomAssetsResponse, err +} + +func (a *cleanRoomAssetsImpl) Update(ctx context.Context, request UpdateCleanRoomAssetRequest) (*CleanRoomAsset, error) { + var cleanRoomAsset CleanRoomAsset + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.Name) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, request.Asset, &cleanRoomAsset) + return &cleanRoomAsset, err +} + +// unexported type that holds implementations of just CleanRoomTaskRuns API methods +type cleanRoomTaskRunsImpl struct { + client *client.DatabricksClient +} + +func (a *cleanRoomTaskRunsImpl) List(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) (*ListCleanRoomNotebookTaskRunsResponse, error) { + var listCleanRoomNotebookTaskRunsResponse ListCleanRoomNotebookTaskRunsResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/runs", request.CleanRoomName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCleanRoomNotebookTaskRunsResponse) + return &listCleanRoomNotebookTaskRunsResponse, err +} + +// unexported type that holds implementations of just CleanRooms API methods +type cleanRoomsImpl struct { + client *client.DatabricksClient +} + +func (a *cleanRoomsImpl) Create(ctx context.Context, request CreateCleanRoomRequest) (*CleanRoom, error) { + var cleanRoom CleanRoom + path := "/api/2.0/clean-rooms" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request.CleanRoom, &cleanRoom) + return &cleanRoom, err +} + +func (a *cleanRoomsImpl) CreateOutputCatalog(ctx context.Context, request CreateCleanRoomOutputCatalogRequest) (*CreateCleanRoomOutputCatalogResponse, error) { + var createCleanRoomOutputCatalogResponse CreateCleanRoomOutputCatalogResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v/output-catalogs", request.CleanRoomName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request.OutputCatalog, &createCleanRoomOutputCatalogResponse) + return &createCleanRoomOutputCatalogResponse, err +} + +func (a *cleanRoomsImpl) Delete(ctx context.Context, request DeleteCleanRoomRequest) error { + var deleteResponse DeleteResponse + path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + return err +} + +func (a *cleanRoomsImpl) Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoom, error) { + var cleanRoom CleanRoom + path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &cleanRoom) + return &cleanRoom, err +} + +func (a *cleanRoomsImpl) List(ctx context.Context, request ListCleanRoomsRequest) (*ListCleanRoomsResponse, error) { + var listCleanRoomsResponse ListCleanRoomsResponse + path := "/api/2.0/clean-rooms" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCleanRoomsResponse) + return &listCleanRoomsResponse, err +} + +func (a *cleanRoomsImpl) Update(ctx context.Context, request UpdateCleanRoomRequest) (*CleanRoom, error) { + var cleanRoom CleanRoom + path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &cleanRoom) + return &cleanRoom, err +} diff --git a/service/cleanrooms/interface.go b/service/cleanrooms/interface.go new file mode 100755 index 000000000..6165f4e97 --- /dev/null +++ b/service/cleanrooms/interface.go @@ -0,0 +1,108 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package cleanrooms + +import ( + "context" +) + +// Clean room assets are data and code objects — Tables, volumes, and +// notebooks that are shared with the clean room. +type CleanRoomAssetsService interface { + + // Create an asset. + // + // Create a clean room asset —share an asset like a notebook or table into + // the clean room. For each UC asset that is added through this method, the + // clean room owner must also have enough privilege on the asset to consume + // it. The privilege must be maintained indefinitely for the clean room to + // be able to access the asset. Typically, you should use a group as the + // clean room owner. + Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) + + // Delete an asset. + // + // Delete a clean room asset - unshare/remove the asset from the clean room + Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error + + // Get an asset. + // + // Get the details of a clean room asset by its type and full name. + Get(ctx context.Context, request GetCleanRoomAssetRequest) (*CleanRoomAsset, error) + + // List assets. + // + // Use ListAll() to get all CleanRoomAsset instances, which will iterate over every result page. + List(ctx context.Context, request ListCleanRoomAssetsRequest) (*ListCleanRoomAssetsResponse, error) + + // Update an asset. + // + // Update a clean room asset. For example, updating the content of a + // notebook; changing the shared partitions of a table; etc. + Update(ctx context.Context, request UpdateCleanRoomAssetRequest) (*CleanRoomAsset, error) +} + +// Clean room task runs are the executions of notebooks in a clean room. +type CleanRoomTaskRunsService interface { + + // List notebook task runs. + // + // List all the historical notebook task runs in a clean room. + // + // Use ListAll() to get all CleanRoomNotebookTaskRun instances, which will iterate over every result page. + List(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) (*ListCleanRoomNotebookTaskRunsResponse, error) +} + +// 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. +type CleanRoomsService interface { + + // Create a clean room. + // + // Create a new clean room with the specified collaborators. This method is + // asynchronous; the returned name field inside the clean_room field can be + // used to poll the clean room status, using the :method:cleanrooms/get + // method. When this method returns, the cluster will be in a PROVISIONING + // state. The cluster will be usable once it enters an ACTIVE state. + // + // The caller must be a metastore admin or have the **CREATE_CLEAN_ROOM** + // privilege on the metastore. + Create(ctx context.Context, request CreateCleanRoomRequest) (*CleanRoom, error) + + // Create an output catalog. + // + // Create the output catalog of the clean room. + CreateOutputCatalog(ctx context.Context, request CreateCleanRoomOutputCatalogRequest) (*CreateCleanRoomOutputCatalogResponse, error) + + // Delete a clean room. + // + // Delete a clean room. After deletion, the clean room will be removed from + // the metastore. If the other collaborators have not deleted the clean + // room, they will still have the clean room in their metastore, but it will + // be in a DELETED state and no operations other than deletion can be + // performed on it. + Delete(ctx context.Context, request DeleteCleanRoomRequest) error + + // Get a clean room. + // + // Get the details of a clean room given its name. + Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoom, error) + + // List clean rooms. + // + // Get a list of all clean rooms of the metastore. Only clean rooms the + // caller has access to are returned. + // + // Use ListAll() to get all CleanRoom instances, which will iterate over every result page. + List(ctx context.Context, request ListCleanRoomsRequest) (*ListCleanRoomsResponse, error) + + // Update a clean room. + // + // Update a clean room. The caller must be the owner of the clean room, have + // **MODIFY_CLEAN_ROOM** privilege, or be metastore admin. + // + // When the caller is a metastore admin, only the __owner__ field can be + // updated. + Update(ctx context.Context, request UpdateCleanRoomRequest) (*CleanRoom, error) +} diff --git a/service/cleanrooms/model.go b/service/cleanrooms/model.go new file mode 100755 index 000000000..61b7c4368 --- /dev/null +++ b/service/cleanrooms/model.go @@ -0,0 +1,735 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package cleanrooms + +import ( + "fmt" + + "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/catalog" + "github.com/databricks/databricks-sdk-go/service/jobs" + "github.com/databricks/databricks-sdk-go/service/settings" + "github.com/databricks/databricks-sdk-go/service/sharing" +) + +type CleanRoom struct { + // Whether clean room access is restricted due to [CSP] + // + // [CSP]: https://docs.databricks.com/en/security/privacy/security-profile.html + AccessRestricted CleanRoomAccessRestricted `json:"access_restricted,omitempty"` + + Comment string `json:"comment,omitempty"` + // When the clean room was created, in epoch milliseconds. + CreatedAt int64 `json:"created_at,omitempty"` + // The alias of the collaborator tied to the local clean room. + LocalCollaboratorAlias string `json:"local_collaborator_alias,omitempty"` + // The name of the clean room. It should follow [UC securable naming + // requirements]. + // + // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements + Name string `json:"name,omitempty"` + // Output catalog of the clean room. It is an output only field. Output + // catalog is manipulated using the separate CreateCleanRoomOutputCatalog + // API. + OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` + // This is Databricks username of the owner of the local clean room + // securable for permission management. + Owner string `json:"owner,omitempty"` + // Central clean room details. During creation, users need to specify + // cloud_vendor, region, and collaborators.global_metastore_id. This field + // will not be filled in the ListCleanRooms call. + RemoteDetailedInfo *CleanRoomRemoteDetail `json:"remote_detailed_info,omitempty"` + // Clean room status. + Status CleanRoomStatusEnum `json:"status,omitempty"` + // When the clean room was last updated, in epoch milliseconds. + UpdatedAt int64 `json:"updated_at,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoom) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoom) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomAccessRestricted string + +const CleanRoomAccessRestrictedCspMismatch CleanRoomAccessRestricted = `CSP_MISMATCH` + +const CleanRoomAccessRestrictedNoRestriction CleanRoomAccessRestricted = `NO_RESTRICTION` + +// String representation for [fmt.Print] +func (f *CleanRoomAccessRestricted) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomAccessRestricted) Set(v string) error { + switch v { + case `CSP_MISMATCH`, `NO_RESTRICTION`: + *f = CleanRoomAccessRestricted(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CSP_MISMATCH", "NO_RESTRICTION"`, v) + } +} + +// Type always returns CleanRoomAccessRestricted to satisfy [pflag.Value] interface +func (f *CleanRoomAccessRestricted) Type() string { + return "CleanRoomAccessRestricted" +} + +// Metadata of the clean room asset +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"` + // Foreign table details available to all collaborators of the clean room. + // Present if and only if **asset_type** is **FOREIGN_TABLE** + ForeignTable *CleanRoomAssetForeignTable `json:"foreign_table,omitempty"` + // Local details for a foreign that are only available to its owner. Present + // if and only if **asset_type** is **FOREIGN_TABLE** + ForeignTableLocalDetails *CleanRoomAssetForeignTableLocalDetails `json:"foreign_table_local_details,omitempty"` + // A fully qualified name that uniquely identifies the asset within the + // clean room. This is also the name displayed in the clean room UI. + // + // For UC securable assets (tables, volumes, etc.), the format is + // *shared_catalog*.*shared_schema*.*asset_name* + // + // For notebooks, the name is the notebook file name. + Name string `json:"name,omitempty"` + // 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"` + // The alias of the collaborator who owns this asset + OwnerCollaboratorAlias string `json:"owner_collaborator_alias,omitempty"` + // Status of the asset + Status CleanRoomAssetStatusEnum `json:"status,omitempty"` + // Table details available to all collaborators of the clean room. Present + // if and only if **asset_type** is **TABLE** + Table *CleanRoomAssetTable `json:"table,omitempty"` + // Local details for a table that are only available to its owner. Present + // if and only if **asset_type** is **TABLE** + TableLocalDetails *CleanRoomAssetTableLocalDetails `json:"table_local_details,omitempty"` + // View details available to all collaborators of the clean room. Present if + // and only if **asset_type** is **VIEW** + View *CleanRoomAssetView `json:"view,omitempty"` + // Local details for a view that are only available to its owner. Present if + // and only if **asset_type** is **VIEW** + ViewLocalDetails *CleanRoomAssetViewLocalDetails `json:"view_local_details,omitempty"` + // Local details for a volume that are only available to its owner. Present + // if and only if **asset_type** is **VOLUME** + VolumeLocalDetails *CleanRoomAssetVolumeLocalDetails `json:"volume_local_details,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomAsset) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomAsset) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomAssetAssetType string + +const CleanRoomAssetAssetTypeForeignTable CleanRoomAssetAssetType = `FOREIGN_TABLE` + +const CleanRoomAssetAssetTypeNotebookFile CleanRoomAssetAssetType = `NOTEBOOK_FILE` + +const CleanRoomAssetAssetTypeTable CleanRoomAssetAssetType = `TABLE` + +const CleanRoomAssetAssetTypeView CleanRoomAssetAssetType = `VIEW` + +const CleanRoomAssetAssetTypeVolume CleanRoomAssetAssetType = `VOLUME` + +// String representation for [fmt.Print] +func (f *CleanRoomAssetAssetType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomAssetAssetType) Set(v string) error { + switch v { + case `FOREIGN_TABLE`, `NOTEBOOK_FILE`, `TABLE`, `VIEW`, `VOLUME`: + *f = CleanRoomAssetAssetType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FOREIGN_TABLE", "NOTEBOOK_FILE", "TABLE", "VIEW", "VOLUME"`, v) + } +} + +// Type always returns CleanRoomAssetAssetType to satisfy [pflag.Value] interface +func (f *CleanRoomAssetAssetType) Type() string { + return "CleanRoomAssetAssetType" +} + +type CleanRoomAssetForeignTable struct { + // The metadata information of the columns in the foreign table + Columns []catalog.ColumnInfo `json:"columns,omitempty"` +} + +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:"-"` +} + +func (s *CleanRoomAssetForeignTableLocalDetails) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomAssetForeignTableLocalDetails) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomAssetNotebook struct { + // Server generated checksum that represents the notebook version. + 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"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomAssetNotebook) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomAssetNotebook) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomAssetStatusEnum string + +const CleanRoomAssetStatusEnumActive CleanRoomAssetStatusEnum = `ACTIVE` + +const CleanRoomAssetStatusEnumPermissionDenied CleanRoomAssetStatusEnum = `PERMISSION_DENIED` + +// String representation for [fmt.Print] +func (f *CleanRoomAssetStatusEnum) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomAssetStatusEnum) Set(v string) error { + switch v { + case `ACTIVE`, `PERMISSION_DENIED`: + *f = CleanRoomAssetStatusEnum(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ACTIVE", "PERMISSION_DENIED"`, v) + } +} + +// Type always returns CleanRoomAssetStatusEnum to satisfy [pflag.Value] interface +func (f *CleanRoomAssetStatusEnum) Type() string { + return "CleanRoomAssetStatusEnum" +} + +type CleanRoomAssetTable struct { + // The metadata information of the columns in the table + Columns []catalog.ColumnInfo `json:"columns,omitempty"` +} + +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"` + // Partition filtering specification for a shared table. + Partitions []sharing.PartitionSpecificationPartition `json:"partitions,omitempty"` + + ForceSendFields []string `json:"-"` +} + +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 { + // The metadata information of the columns in the view + Columns []catalog.ColumnInfo `json:"columns,omitempty"` +} + +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"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomAssetViewLocalDetails) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomAssetViewLocalDetails) 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"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomAssetVolumeLocalDetails) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomAssetVolumeLocalDetails) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Publicly visible clean room collaborator. +type CleanRoomCollaborator struct { + // Collaborator alias specified by the clean room creator. It is unique + // across all collaborators of this clean room, and used to derive multiple + // values internally such as catalog alias and clean room name for single + // metastore clean rooms. It should follow [UC securable naming + // requirements]. + // + // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements + CollaboratorAlias string `json:"collaborator_alias,omitempty"` + // Generated display name for the collaborator. In the case of a single + // metastore clean room, it is the clean room name. For x-metastore clean + // rooms, it is the organization name of the metastore. It is not restricted + // to these values and could change in the future + DisplayName string `json:"display_name,omitempty"` + // The global Unity Catalog metastore id of the collaborator. The identifier + // is of format cloud:region:metastore-uuid. + GlobalMetastoreId string `json:"global_metastore_id,omitempty"` + // Email of the user who is receiving the clean room "invitation". It should + // be empty for the creator of the clean room, and non-empty for the + // invitees of the clean room. It is only returned in the output when clean + // room creator calls GET + InviteRecipientEmail string `json:"invite_recipient_email,omitempty"` + // Workspace ID of the user who is receiving the clean room "invitation". + // Must be specified if invite_recipient_email is specified. It should be + // empty when the collaborator is the creator of the clean room. + InviteRecipientWorkspaceId int64 `json:"invite_recipient_workspace_id,omitempty"` + // [Organization + // name](:method:metastores/list#metastores-delta_sharing_organization_name) + // configured in the metastore + OrganizationName string `json:"organization_name,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomCollaborator) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomCollaborator) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Stores information about a single task run. +type CleanRoomNotebookTaskRun struct { + // Job run info of the task in the runner's local workspace. This field is + // only included in the LIST API. if the task was run within the same + // workspace the API is being called. If the task run was in a different + // workspace under the same metastore, only the workspace_id is included. + CollaboratorJobRunInfo *CollaboratorJobRunInfo `json:"collaborator_job_run_info,omitempty"` + // State of the task run. + NotebookJobRunState *jobs.CleanRoomTaskRunState `json:"notebook_job_run_state,omitempty"` + // Asset name of the notebook executed in this task run. + NotebookName string `json:"notebook_name,omitempty"` + // Expiration time of the output schema of the task run (if any), in epoch + // milliseconds. + OutputSchemaExpirationTime int64 `json:"output_schema_expiration_time,omitempty"` + // Name of the output schema associated with the clean rooms notebook task + // run. + OutputSchemaName string `json:"output_schema_name,omitempty"` + // Duration of the task run, in milliseconds. + RunDuration int64 `json:"run_duration,omitempty"` + // When the task run started, in epoch milliseconds. + StartTime int64 `json:"start_time,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomNotebookTaskRun) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomNotebookTaskRun) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomOutputCatalog struct { + // The name of the output catalog in UC. It should follow [UC securable + // naming requirements]. The field will always exist if status is CREATED. + // + // [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements + CatalogName string `json:"catalog_name,omitempty"` + + Status CleanRoomOutputCatalogOutputCatalogStatus `json:"status,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomOutputCatalog) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomOutputCatalog) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomOutputCatalogOutputCatalogStatus string + +const CleanRoomOutputCatalogOutputCatalogStatusCreated CleanRoomOutputCatalogOutputCatalogStatus = `CREATED` + +const CleanRoomOutputCatalogOutputCatalogStatusNotCreated CleanRoomOutputCatalogOutputCatalogStatus = `NOT_CREATED` + +const CleanRoomOutputCatalogOutputCatalogStatusNotEligible CleanRoomOutputCatalogOutputCatalogStatus = `NOT_ELIGIBLE` + +// String representation for [fmt.Print] +func (f *CleanRoomOutputCatalogOutputCatalogStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomOutputCatalogOutputCatalogStatus) Set(v string) error { + switch v { + case `CREATED`, `NOT_CREATED`, `NOT_ELIGIBLE`: + *f = CleanRoomOutputCatalogOutputCatalogStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CREATED", "NOT_CREATED", "NOT_ELIGIBLE"`, v) + } +} + +// Type always returns CleanRoomOutputCatalogOutputCatalogStatus to satisfy [pflag.Value] interface +func (f *CleanRoomOutputCatalogOutputCatalogStatus) Type() string { + return "CleanRoomOutputCatalogOutputCatalogStatus" +} + +// Publicly visible central clean room details. +type CleanRoomRemoteDetail struct { + // Central clean room ID. + CentralCleanRoomId string `json:"central_clean_room_id,omitempty"` + // Cloud vendor (aws,azure,gcp) of the central clean room. + CloudVendor string `json:"cloud_vendor,omitempty"` + // Collaborators in the central clean room. There should one and only one + // collaborator in the list that satisfies the owner condition: + // + // 1. It has the creator's global_metastore_id (determined by caller of + // CreateCleanRoom). + // + // 2. Its invite_recipient_email is empty. + Collaborators []CleanRoomCollaborator `json:"collaborators,omitempty"` + // The compliance security profile used to process regulated data following + // compliance standards. + ComplianceSecurityProfile *ComplianceSecurityProfile `json:"compliance_security_profile,omitempty"` + // Collaborator who creates the clean room. + Creator *CleanRoomCollaborator `json:"creator,omitempty"` + // Egress network policy to apply to the central clean room workspace. + EgressNetworkPolicy *settings.EgressNetworkPolicy `json:"egress_network_policy,omitempty"` + // Region of the central clean room. + Region string `json:"region,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CleanRoomRemoteDetail) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CleanRoomRemoteDetail) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CleanRoomStatusEnum string + +const CleanRoomStatusEnumActive CleanRoomStatusEnum = `ACTIVE` + +const CleanRoomStatusEnumDeleted CleanRoomStatusEnum = `DELETED` + +const CleanRoomStatusEnumFailed CleanRoomStatusEnum = `FAILED` + +const CleanRoomStatusEnumProvisioning CleanRoomStatusEnum = `PROVISIONING` + +// String representation for [fmt.Print] +func (f *CleanRoomStatusEnum) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomStatusEnum) Set(v string) error { + switch v { + case `ACTIVE`, `DELETED`, `FAILED`, `PROVISIONING`: + *f = CleanRoomStatusEnum(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ACTIVE", "DELETED", "FAILED", "PROVISIONING"`, v) + } +} + +// Type always returns CleanRoomStatusEnum to satisfy [pflag.Value] interface +func (f *CleanRoomStatusEnum) Type() string { + return "CleanRoomStatusEnum" +} + +type CollaboratorJobRunInfo struct { + // Alias of the collaborator that triggered the task run. + CollaboratorAlias string `json:"collaborator_alias,omitempty"` + // Job ID of the task run in the collaborator's workspace. + CollaboratorJobId int64 `json:"collaborator_job_id,omitempty"` + // Job run ID of the task run in the collaborator's workspace. + CollaboratorJobRunId int64 `json:"collaborator_job_run_id,omitempty"` + // Task run ID of the task run in the collaborator's workspace. + CollaboratorTaskRunId int64 `json:"collaborator_task_run_id,omitempty"` + // ID of the collaborator's workspace that triggered the task run. + CollaboratorWorkspaceId int64 `json:"collaborator_workspace_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CollaboratorJobRunInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CollaboratorJobRunInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// The compliance security profile used to process regulated data following +// compliance standards. +type ComplianceSecurityProfile struct { + // The list of compliance standards that the compliance security profile is + // configured to enforce. + ComplianceStandards []settings.ComplianceStandard `json:"compliance_standards,omitempty"` + // Whether the compliance security profile is enabled. + IsEnabled bool `json:"is_enabled,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ComplianceSecurityProfile) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Create an asset +type CreateCleanRoomAssetRequest struct { + // Metadata of the clean room asset + Asset *CleanRoomAsset `json:"asset,omitempty"` + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` +} + +// Create an output catalog +type CreateCleanRoomOutputCatalogRequest struct { + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` + + OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` +} + +type CreateCleanRoomOutputCatalogResponse struct { + OutputCatalog *CleanRoomOutputCatalog `json:"output_catalog,omitempty"` +} + +// Create a clean room +type CreateCleanRoomRequest struct { + CleanRoom *CleanRoom `json:"clean_room,omitempty"` +} + +// Delete an asset +type DeleteCleanRoomAssetRequest struct { + // The fully qualified name of the asset, it is same as the name field in + // CleanRoomAsset. + AssetFullName string `json:"-" url:"-"` + // The type of the asset. + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` +} + +// Response for delete clean room request. Using an empty message since the +// generic Empty proto does not externd UnshadedMessageMarker. +type DeleteCleanRoomAssetResponse struct { +} + +// Delete a clean room +type DeleteCleanRoomRequest struct { + // Name of the clean room. + Name string `json:"-" url:"-"` +} + +type DeleteResponse struct { +} + +// Get an asset +type GetCleanRoomAssetRequest struct { + // The fully qualified name of the asset, it is same as the name field in + // CleanRoomAsset. + AssetFullName string `json:"-" url:"-"` + // The type of the asset. + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` +} + +// Get a clean room +type GetCleanRoomRequest struct { + Name string `json:"-" url:"-"` +} + +// List assets +type ListCleanRoomAssetsRequest struct { + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` + // Opaque pagination token to go to next page based on previous query. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListCleanRoomAssetsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomAssetsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListCleanRoomAssetsResponse struct { + // Assets in the clean room. + Assets []CleanRoomAsset `json:"assets,omitempty"` + // 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"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListCleanRoomAssetsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomAssetsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List notebook task runs +type ListCleanRoomNotebookTaskRunsRequest struct { + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` + // Notebook name + NotebookName string `json:"-" url:"notebook_name,omitempty"` + // The maximum number of task runs to return + 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:"-"` +} + +func (s *ListCleanRoomNotebookTaskRunsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomNotebookTaskRunsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListCleanRoomNotebookTaskRunsResponse 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"` + // Name of the clean room. + Runs []CleanRoomNotebookTaskRun `json:"runs,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListCleanRoomNotebookTaskRunsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomNotebookTaskRunsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List clean rooms +type ListCleanRoomsRequest struct { + // Maximum number of clean rooms to return (i.e., the page length). 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:"-"` +} + +func (s *ListCleanRoomsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListCleanRoomsResponse struct { + CleanRooms []CleanRoom `json:"clean_rooms,omitempty"` + // 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"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListCleanRoomsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListCleanRoomsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// Update an asset +type UpdateCleanRoomAssetRequest struct { + // Metadata of the clean room asset + Asset *CleanRoomAsset `json:"asset,omitempty"` + // The type of the asset. + AssetType CleanRoomAssetAssetType `json:"-" url:"-"` + // Name of the clean room. + CleanRoomName string `json:"-" url:"-"` + // A fully qualified name that uniquely identifies the asset within the + // clean room. This is also the name displayed in the clean room UI. + // + // For UC securable assets (tables, volumes, etc.), the format is + // *shared_catalog*.*shared_schema*.*asset_name* + // + // For notebooks, the name is the notebook file name. + Name string `json:"-" url:"-"` +} + +type UpdateCleanRoomRequest struct { + CleanRoom *CleanRoom `json:"clean_room,omitempty"` + // Name of the clean room. + Name string `json:"-" url:"-"` +} diff --git a/service/dashboards/model.go b/service/dashboards/model.go index 139b2f6c8..1905f92b6 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -116,6 +116,63 @@ func (f *DashboardView) Type() string { return "DashboardView" } +type DataType string + +const DataTypeDataTypeArray DataType = `DATA_TYPE_ARRAY` + +const DataTypeDataTypeBigInt DataType = `DATA_TYPE_BIG_INT` + +const DataTypeDataTypeBinary DataType = `DATA_TYPE_BINARY` + +const DataTypeDataTypeBoolean DataType = `DATA_TYPE_BOOLEAN` + +const DataTypeDataTypeDate DataType = `DATA_TYPE_DATE` + +const DataTypeDataTypeDecimal DataType = `DATA_TYPE_DECIMAL` + +const DataTypeDataTypeDouble DataType = `DATA_TYPE_DOUBLE` + +const DataTypeDataTypeFloat DataType = `DATA_TYPE_FLOAT` + +const DataTypeDataTypeInt DataType = `DATA_TYPE_INT` + +const DataTypeDataTypeInterval DataType = `DATA_TYPE_INTERVAL` + +const DataTypeDataTypeMap DataType = `DATA_TYPE_MAP` + +const DataTypeDataTypeSmallInt DataType = `DATA_TYPE_SMALL_INT` + +const DataTypeDataTypeString DataType = `DATA_TYPE_STRING` + +const DataTypeDataTypeStruct DataType = `DATA_TYPE_STRUCT` + +const DataTypeDataTypeTimestamp DataType = `DATA_TYPE_TIMESTAMP` + +const DataTypeDataTypeTinyInt DataType = `DATA_TYPE_TINY_INT` + +const DataTypeDataTypeVoid DataType = `DATA_TYPE_VOID` + +// String representation for [fmt.Print] +func (f *DataType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DataType) Set(v string) error { + switch v { + case `DATA_TYPE_ARRAY`, `DATA_TYPE_BIG_INT`, `DATA_TYPE_BINARY`, `DATA_TYPE_BOOLEAN`, `DATA_TYPE_DATE`, `DATA_TYPE_DECIMAL`, `DATA_TYPE_DOUBLE`, `DATA_TYPE_FLOAT`, `DATA_TYPE_INT`, `DATA_TYPE_INTERVAL`, `DATA_TYPE_MAP`, `DATA_TYPE_SMALL_INT`, `DATA_TYPE_STRING`, `DATA_TYPE_STRUCT`, `DATA_TYPE_TIMESTAMP`, `DATA_TYPE_TINY_INT`, `DATA_TYPE_VOID`: + *f = DataType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DATA_TYPE_ARRAY", "DATA_TYPE_BIG_INT", "DATA_TYPE_BINARY", "DATA_TYPE_BOOLEAN", "DATA_TYPE_DATE", "DATA_TYPE_DECIMAL", "DATA_TYPE_DOUBLE", "DATA_TYPE_FLOAT", "DATA_TYPE_INT", "DATA_TYPE_INTERVAL", "DATA_TYPE_MAP", "DATA_TYPE_SMALL_INT", "DATA_TYPE_STRING", "DATA_TYPE_STRUCT", "DATA_TYPE_TIMESTAMP", "DATA_TYPE_TINY_INT", "DATA_TYPE_VOID"`, v) + } +} + +// Type always returns DataType to satisfy [pflag.Value] interface +func (f *DataType) Type() string { + return "DataType" +} + // Delete dashboard schedule type DeleteScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. @@ -748,6 +805,7 @@ func (s PublishedDashboard) MarshalJSON() ([]byte, error) { } type QueryAttachment struct { + CachedQuerySchema *QuerySchema `json:"cached_query_schema,omitempty"` // Description of the query Description string `json:"description,omitempty"` @@ -776,6 +834,34 @@ func (s QueryAttachment) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type QuerySchema struct { + Columns []QuerySchemaColumn `json:"columns,omitempty"` + // Used to determine if the stored query schema is compatible with the + // latest run. The service should always clear the schema when the query is + // re-executed. + StatementId string `json:"statement_id,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *QuerySchema) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s QuerySchema) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type QuerySchemaColumn struct { + // Populated from + // https://docs.databricks.com/sql/language-manual/sql-ref-datatypes.html + DataType DataType `json:"data_type"` + + Name string `json:"name"` + // Corresponds to type desc + TypeText string `json:"type_text"` +} + type Result struct { // If result is truncated IsTruncated bool `json:"is_truncated,omitempty"` diff --git a/service/files/api.go b/service/files/api.go index 92a7cf05d..c12a519dc 100755 --- a/service/files/api.go +++ b/service/files/api.go @@ -348,14 +348,16 @@ type FilesInterface interface { // Download a file. // - // Downloads a file of up to 5 GiB. The file contents are the response body. - // This is a standard HTTP file download, not a JSON RPC. + // Downloads a file. The file contents are the response body. This is a standard + // HTTP file download, not a JSON RPC. It supports the Range and + // If-Unmodified-Since HTTP headers. Download(ctx context.Context, request DownloadRequest) (*DownloadResponse, error) // Download a file. // - // Downloads a file of up to 5 GiB. The file contents are the response body. - // This is a standard HTTP file download, not a JSON RPC. + // Downloads a file. The file contents are the response body. This is a standard + // HTTP file download, not a JSON RPC. It supports the Range and + // If-Unmodified-Since HTTP headers. DownloadByFilePath(ctx context.Context, filePath string) (*DownloadResponse, error) // Get directory metadata. @@ -480,8 +482,9 @@ func (a *FilesAPI) DeleteDirectoryByDirectoryPath(ctx context.Context, directory // Download a file. // -// Downloads a file of up to 5 GiB. The file contents are the response body. -// This is a standard HTTP file download, not a JSON RPC. +// Downloads a file. The file contents are the response body. This is a standard +// HTTP file download, not a JSON RPC. It supports the Range and +// If-Unmodified-Since HTTP headers. func (a *FilesAPI) DownloadByFilePath(ctx context.Context, filePath string) (*DownloadResponse, error) { return a.filesImpl.Download(ctx, DownloadRequest{ FilePath: filePath, diff --git a/service/files/interface.go b/service/files/interface.go index b0cb0973c..5a573f9f3 100755 --- a/service/files/interface.go +++ b/service/files/interface.go @@ -179,8 +179,9 @@ type FilesService interface { // Download a file. // - // Downloads a file of up to 5 GiB. The file contents are the response body. - // This is a standard HTTP file download, not a JSON RPC. + // Downloads a file. The file contents are the response body. This is a + // standard HTTP file download, not a JSON RPC. It supports the Range and + // If-Unmodified-Since HTTP headers. Download(ctx context.Context, request DownloadRequest) (*DownloadResponse, error) // Get directory metadata. diff --git a/service/jobs/model.go b/service/jobs/model.go index ecbdfb4fc..f26b53c3a 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -209,6 +209,108 @@ type CancelRun struct { type CancelRunResponse struct { } +// Copied from elastic-spark-common/api/messages/runs.proto. Using the original +// definition to remove coupling with jobs API definition +type CleanRoomTaskRunLifeCycleState string + +const CleanRoomTaskRunLifeCycleStateBlocked CleanRoomTaskRunLifeCycleState = `BLOCKED` + +const CleanRoomTaskRunLifeCycleStateInternalError CleanRoomTaskRunLifeCycleState = `INTERNAL_ERROR` + +const CleanRoomTaskRunLifeCycleStatePending CleanRoomTaskRunLifeCycleState = `PENDING` + +const CleanRoomTaskRunLifeCycleStateQueued CleanRoomTaskRunLifeCycleState = `QUEUED` + +const CleanRoomTaskRunLifeCycleStateRunning CleanRoomTaskRunLifeCycleState = `RUNNING` + +const CleanRoomTaskRunLifeCycleStateSkipped CleanRoomTaskRunLifeCycleState = `SKIPPED` + +const CleanRoomTaskRunLifeCycleStateTerminated CleanRoomTaskRunLifeCycleState = `TERMINATED` + +const CleanRoomTaskRunLifeCycleStateTerminating CleanRoomTaskRunLifeCycleState = `TERMINATING` + +const CleanRoomTaskRunLifeCycleStateWaitingForRetry CleanRoomTaskRunLifeCycleState = `WAITING_FOR_RETRY` + +// String representation for [fmt.Print] +func (f *CleanRoomTaskRunLifeCycleState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomTaskRunLifeCycleState) Set(v string) error { + switch v { + case `BLOCKED`, `INTERNAL_ERROR`, `PENDING`, `QUEUED`, `RUNNING`, `SKIPPED`, `TERMINATED`, `TERMINATING`, `WAITING_FOR_RETRY`: + *f = CleanRoomTaskRunLifeCycleState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "BLOCKED", "INTERNAL_ERROR", "PENDING", "QUEUED", "RUNNING", "SKIPPED", "TERMINATED", "TERMINATING", "WAITING_FOR_RETRY"`, v) + } +} + +// Type always returns CleanRoomTaskRunLifeCycleState to satisfy [pflag.Value] interface +func (f *CleanRoomTaskRunLifeCycleState) Type() string { + return "CleanRoomTaskRunLifeCycleState" +} + +// Copied from elastic-spark-common/api/messages/runs.proto. Using the original +// definition to avoid cyclic dependency. +type CleanRoomTaskRunResultState string + +const CleanRoomTaskRunResultStateCanceled CleanRoomTaskRunResultState = `CANCELED` + +const CleanRoomTaskRunResultStateDisabled CleanRoomTaskRunResultState = `DISABLED` + +const CleanRoomTaskRunResultStateEvicted CleanRoomTaskRunResultState = `EVICTED` + +const CleanRoomTaskRunResultStateExcluded CleanRoomTaskRunResultState = `EXCLUDED` + +const CleanRoomTaskRunResultStateFailed CleanRoomTaskRunResultState = `FAILED` + +const CleanRoomTaskRunResultStateMaximumConcurrentRunsReached CleanRoomTaskRunResultState = `MAXIMUM_CONCURRENT_RUNS_REACHED` + +const CleanRoomTaskRunResultStateSuccess CleanRoomTaskRunResultState = `SUCCESS` + +const CleanRoomTaskRunResultStateSuccessWithFailures CleanRoomTaskRunResultState = `SUCCESS_WITH_FAILURES` + +const CleanRoomTaskRunResultStateTimedout CleanRoomTaskRunResultState = `TIMEDOUT` + +const CleanRoomTaskRunResultStateUpstreamCanceled CleanRoomTaskRunResultState = `UPSTREAM_CANCELED` + +const CleanRoomTaskRunResultStateUpstreamEvicted CleanRoomTaskRunResultState = `UPSTREAM_EVICTED` + +const CleanRoomTaskRunResultStateUpstreamFailed CleanRoomTaskRunResultState = `UPSTREAM_FAILED` + +// String representation for [fmt.Print] +func (f *CleanRoomTaskRunResultState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *CleanRoomTaskRunResultState) Set(v string) error { + switch v { + case `CANCELED`, `DISABLED`, `EVICTED`, `EXCLUDED`, `FAILED`, `MAXIMUM_CONCURRENT_RUNS_REACHED`, `SUCCESS`, `SUCCESS_WITH_FAILURES`, `TIMEDOUT`, `UPSTREAM_CANCELED`, `UPSTREAM_EVICTED`, `UPSTREAM_FAILED`: + *f = CleanRoomTaskRunResultState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "CANCELED", "DISABLED", "EVICTED", "EXCLUDED", "FAILED", "MAXIMUM_CONCURRENT_RUNS_REACHED", "SUCCESS", "SUCCESS_WITH_FAILURES", "TIMEDOUT", "UPSTREAM_CANCELED", "UPSTREAM_EVICTED", "UPSTREAM_FAILED"`, v) + } +} + +// Type always returns CleanRoomTaskRunResultState to satisfy [pflag.Value] interface +func (f *CleanRoomTaskRunResultState) Type() string { + return "CleanRoomTaskRunResultState" +} + +// Stores the run state of the clean room notebook V1 task. +type CleanRoomTaskRunState struct { + // A value indicating the run's current lifecycle state. This field is + // always available in the response. + LifeCycleState CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"` + // A value indicating the run's result. This field is only available for + // terminal lifecycle states. + ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"` +} + type ClusterInstance struct { // The canonical identifier for the cluster used by a run. This field is // always available for runs on existing clusters. For runs on new clusters, @@ -441,9 +543,8 @@ type CreateJob struct { Parameters []JobParameterDefinition `json:"parameters,omitempty"` // The queue settings of the job. Queue *QueueSettings `json:"queue,omitempty"` - // Write-only setting. Specifies the user, service principal or group that - // the job/pipeline runs as. If not specified, the job/pipeline runs as the - // user who created the job/pipeline. + // Write-only setting. Specifies the user or service principal that the job + // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. @@ -1384,9 +1485,8 @@ type JobPermissionsRequest struct { JobId string `json:"-" url:"-"` } -// Write-only setting. Specifies the user, service principal or group that the -// job/pipeline runs as. If not specified, the job/pipeline runs as the user who -// created the job/pipeline. +// Write-only setting. Specifies the user or service principal that the job runs +// as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If not, // an error is thrown. @@ -1483,9 +1583,8 @@ type JobSettings struct { Parameters []JobParameterDefinition `json:"parameters,omitempty"` // The queue settings of the job. Queue *QueueSettings `json:"queue,omitempty"` - // Write-only setting. Specifies the user, service principal or group that - // the job/pipeline runs as. If not specified, the job/pipeline runs as the - // user who created the job/pipeline. + // Write-only setting. Specifies the user or service principal that the job + // runs as. If not specified, the job runs as the user who created the job. // // Either `user_name` or `service_principal_name` should be specified. If // not, an error is thrown. diff --git a/service/pkg.go b/service/pkg.go index fe080f3f7..3cebabf98 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -22,6 +22,12 @@ // // - [catalog.CatalogsAPI]: A catalog is the first layer of Unity Catalog’s three-level namespace. // +// - [cleanrooms.CleanRoomAssetsAPI]: Clean room assets are data and code objects — Tables, volumes, and notebooks that are shared with the clean room. +// +// - [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. +// // - [compute.ClusterPoliciesAPI]: You can use cluster policies to control users' ability to configure clusters based on a set of rules. // // - [compute.ClustersAPI]: The Clusters API allows you to create, start, edit, list, terminate, and delete clusters. @@ -42,10 +48,10 @@ // // - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. // -// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. -// // - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. // +// - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. +// // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. // // - [settings.CspEnablementAccountAPI]: The compliance security profile settings at the account level control whether to enable it for new workspaces. @@ -265,6 +271,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/apps" "github.com/databricks/databricks-sdk-go/service/billing" "github.com/databricks/databricks-sdk-go/service/catalog" + "github.com/databricks/databricks-sdk-go/service/cleanrooms" "github.com/databricks/databricks-sdk-go/service/compute" "github.com/databricks/databricks-sdk-go/service/dashboards" "github.com/databricks/databricks-sdk-go/service/files" @@ -299,6 +306,9 @@ var ( _ *settings.AutomaticClusterUpdateAPI = nil _ *billing.BillableUsageAPI = nil _ *catalog.CatalogsAPI = nil + _ *cleanrooms.CleanRoomAssetsAPI = nil + _ *cleanrooms.CleanRoomTaskRunsAPI = nil + _ *cleanrooms.CleanRoomsAPI = nil _ *compute.ClusterPoliciesAPI = nil _ *compute.ClustersAPI = nil _ *compute.CommandExecutionAPI = nil @@ -309,8 +319,8 @@ var ( _ *marketplace.ConsumerListingsAPI = nil _ *marketplace.ConsumerPersonalizationRequestsAPI = nil _ *marketplace.ConsumerProvidersAPI = nil - _ *catalog.CredentialsAPI = nil _ *provisioning.CredentialsAPI = nil + _ *catalog.CredentialsAPI = nil _ *settings.CredentialsManagerAPI = nil _ *settings.CspEnablementAccountAPI = nil _ *iam.CurrentUserAPI = nil diff --git a/service/settings/api.go b/service/settings/api.go index 4bdd59b48..520214899 100755 --- a/service/settings/api.go +++ b/service/settings/api.go @@ -373,6 +373,12 @@ func (a *AccountSettingsAPI) PersonalCompute() PersonalComputeInterface { type AibiDashboardEmbeddingAccessPolicyInterface interface { + // Delete the AI/BI dashboard embedding access policy. + // + // Delete the AI/BI dashboard embedding access policy, reverting back to the + // default. + Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) + // Retrieve the AI/BI dashboard embedding access policy. // // Retrieves the AI/BI dashboard embedding access policy. The default setting is @@ -403,6 +409,12 @@ type AibiDashboardEmbeddingAccessPolicyAPI struct { type AibiDashboardEmbeddingApprovedDomainsInterface interface { + // Delete AI/BI dashboard embedding approved domains. + // + // Delete the list of domains approved to host embedded AI/BI dashboards, + // reverting back to the default empty list. + Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) + // Retrieve the list of domains approved to host embedded AI/BI dashboards. // // Retrieves the list of domains approved to host embedded AI/BI dashboards. diff --git a/service/settings/impl.go b/service/settings/impl.go index f1db1ab3c..3681bffc2 100755 --- a/service/settings/impl.go +++ b/service/settings/impl.go @@ -82,6 +82,15 @@ type aibiDashboardEmbeddingAccessPolicyImpl struct { client *client.DatabricksClient } +func (a *aibiDashboardEmbeddingAccessPolicyImpl) Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) { + var deleteAibiDashboardEmbeddingAccessPolicySettingResponse DeleteAibiDashboardEmbeddingAccessPolicySettingResponse + path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteAibiDashboardEmbeddingAccessPolicySettingResponse) + return &deleteAibiDashboardEmbeddingAccessPolicySettingResponse, err +} + func (a *aibiDashboardEmbeddingAccessPolicyImpl) Get(ctx context.Context, request GetAibiDashboardEmbeddingAccessPolicySettingRequest) (*AibiDashboardEmbeddingAccessPolicySetting, error) { var aibiDashboardEmbeddingAccessPolicySetting AibiDashboardEmbeddingAccessPolicySetting path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" @@ -106,6 +115,15 @@ type aibiDashboardEmbeddingApprovedDomainsImpl struct { client *client.DatabricksClient } +func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) { + var deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse + path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) + return &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, err +} + func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Get(ctx context.Context, request GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*AibiDashboardEmbeddingApprovedDomainsSetting, error) { var aibiDashboardEmbeddingApprovedDomainsSetting AibiDashboardEmbeddingApprovedDomainsSetting path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" diff --git a/service/settings/interface.go b/service/settings/interface.go index 60484c7b6..d78c38625 100755 --- a/service/settings/interface.go +++ b/service/settings/interface.go @@ -112,6 +112,12 @@ type AccountSettingsService interface { // setting is conditionally enabled (ALLOW_APPROVED_DOMAINS). type AibiDashboardEmbeddingAccessPolicyService interface { + // Delete the AI/BI dashboard embedding access policy. + // + // Delete the AI/BI dashboard embedding access policy, reverting back to the + // default. + Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) + // Retrieve the AI/BI dashboard embedding access policy. // // Retrieves the AI/BI dashboard embedding access policy. The default @@ -131,6 +137,12 @@ type AibiDashboardEmbeddingAccessPolicyService interface { // not set to ALLOW_APPROVED_DOMAINS. type AibiDashboardEmbeddingApprovedDomainsService interface { + // Delete AI/BI dashboard embedding approved domains. + // + // Delete the list of domains approved to host embedded AI/BI dashboards, + // reverting back to the default empty list. + Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) + // Retrieve the list of domains approved to host embedded AI/BI dashboards. // // Retrieves the list of domains approved to host embedded AI/BI dashboards. diff --git a/service/settings/model.go b/service/settings/model.go index 705491239..66cc47739 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -661,6 +661,74 @@ type DeleteAccountIpAccessListRequest struct { IpAccessListId string `json:"-" url:"-"` } +// Delete the AI/BI dashboard embedding access policy +type DeleteAibiDashboardEmbeddingAccessPolicySettingRequest struct { + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// The etag is returned. +type DeleteAibiDashboardEmbeddingAccessPolicySettingResponse struct { + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"etag"` +} + +// Delete AI/BI dashboard embedding approved domains +type DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest struct { + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"-" url:"etag,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// The etag is returned. +type DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse struct { + // etag used for versioning. The response is at least as fresh as the eTag + // provided. This is used for optimistic concurrency control as a way to + // help prevent simultaneous writes of a setting overwriting each other. It + // is strongly suggested that systems make use of the etag in the read -> + // delete pattern to perform setting deletions in order to avoid race + // conditions. That is, get an etag from a GET request, and pass it with the + // DELETE request to identify the rule set version you are deleting. + Etag string `json:"etag"` +} + // Delete the default namespace setting type DeleteDefaultNamespaceSettingRequest struct { // etag used for versioning. The response is at least as fresh as the eTag @@ -1019,6 +1087,267 @@ func (s DisableLegacyFeatures) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// The network policies applying for egress traffic. This message is used by the +// UI/REST API. We translate this message to the format expected by the +// dataplane in Lakehouse Network Manager (for the format expected by the +// dataplane, see networkconfig.textproto). +type EgressNetworkPolicy struct { + // The access policy enforced for egress traffic to the internet. + InternetAccess *EgressNetworkPolicyInternetAccessPolicy `json:"internet_access,omitempty"` +} + +type EgressNetworkPolicyInternetAccessPolicy struct { + AllowedInternetDestinations []EgressNetworkPolicyInternetAccessPolicyInternetDestination `json:"allowed_internet_destinations,omitempty"` + + AllowedStorageDestinations []EgressNetworkPolicyInternetAccessPolicyStorageDestination `json:"allowed_storage_destinations,omitempty"` + // Optional. If not specified, assume the policy is enforced for all + // workloads. + LogOnlyMode *EgressNetworkPolicyInternetAccessPolicyLogOnlyMode `json:"log_only_mode,omitempty"` + // At which level can Databricks and Databricks managed compute access + // Internet. FULL_ACCESS: Databricks can access Internet. No blocking rules + // will apply. RESTRICTED_ACCESS: Databricks can only access explicitly + // allowed internet and storage destinations, as well as UC connections and + // external locations. PRIVATE_ACCESS_ONLY (not used): Databricks can only + // access destinations via private link. + RestrictionMode EgressNetworkPolicyInternetAccessPolicyRestrictionMode `json:"restriction_mode,omitempty"` +} + +// Users can specify accessible internet destinations when outbound access is +// restricted. We only support domain name (FQDN) destinations for the time +// being, though going forwards we want to support host names and IP addresses. +type EgressNetworkPolicyInternetAccessPolicyInternetDestination struct { + Destination string `json:"destination,omitempty"` + // The filtering protocol used by the DP. For private and public preview, + // SEG will only support TCP filtering (i.e. DNS based filtering, filtering + // by destination IP address), so protocol will be set to TCP by default and + // hidden from the user. In the future, users may be able to select HTTP + // filtering (i.e. SNI based filtering, filtering by FQDN). + Protocol EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol `json:"protocol,omitempty"` + + Type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType `json:"type,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *EgressNetworkPolicyInternetAccessPolicyInternetDestination) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EgressNetworkPolicyInternetAccessPolicyInternetDestination) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// The filtering protocol used by the DP. For private and public preview, SEG +// will only support TCP filtering (i.e. DNS based filtering, filtering by +// destination IP address), so protocol will be set to TCP by default and hidden +// from the user. In the future, users may be able to select HTTP filtering +// (i.e. SNI based filtering, filtering by FQDN). +type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol string + +const EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocolTcp EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol = `TCP` + +// String representation for [fmt.Print] +func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol) Set(v string) error { + switch v { + case `TCP`: + *f = EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "TCP"`, v) + } +} + +// Type always returns EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol to satisfy [pflag.Value] interface +func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol) Type() string { + return "EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationFilteringProtocol" +} + +type EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType string + +const EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationTypeFqdn EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType = `FQDN` + +// String representation for [fmt.Print] +func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType) Set(v string) error { + switch v { + case `FQDN`: + *f = EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FQDN"`, v) + } +} + +// Type always returns EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType to satisfy [pflag.Value] interface +func (f *EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType) Type() string { + return "EgressNetworkPolicyInternetAccessPolicyInternetDestinationInternetDestinationType" +} + +type EgressNetworkPolicyInternetAccessPolicyLogOnlyMode struct { + LogOnlyModeType EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType `json:"log_only_mode_type,omitempty"` + + Workloads []EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType `json:"workloads,omitempty"` +} + +type EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType string + +const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeAllServices EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType = `ALL_SERVICES` + +const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeTypeSelectedServices EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType = `SELECTED_SERVICES` + +// String representation for [fmt.Print] +func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) Set(v string) error { + switch v { + case `ALL_SERVICES`, `SELECTED_SERVICES`: + *f = EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ALL_SERVICES", "SELECTED_SERVICES"`, v) + } +} + +// Type always returns EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType to satisfy [pflag.Value] interface +func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType) Type() string { + return "EgressNetworkPolicyInternetAccessPolicyLogOnlyModeLogOnlyModeType" +} + +// The values should match the list of workloads used in networkconfig.proto +type EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType string + +const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeDbsql EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType = `DBSQL` + +const EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadTypeMlServing EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType = `ML_SERVING` + +// String representation for [fmt.Print] +func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) Set(v string) error { + switch v { + case `DBSQL`, `ML_SERVING`: + *f = EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DBSQL", "ML_SERVING"`, v) + } +} + +// Type always returns EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType to satisfy [pflag.Value] interface +func (f *EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType) Type() string { + return "EgressNetworkPolicyInternetAccessPolicyLogOnlyModeWorkloadType" +} + +// At which level can Databricks and Databricks managed compute access Internet. +// FULL_ACCESS: Databricks can access Internet. No blocking rules will apply. +// RESTRICTED_ACCESS: Databricks can only access explicitly allowed internet and +// storage destinations, as well as UC connections and external locations. +// PRIVATE_ACCESS_ONLY (not used): Databricks can only access destinations via +// private link. +type EgressNetworkPolicyInternetAccessPolicyRestrictionMode string + +const EgressNetworkPolicyInternetAccessPolicyRestrictionModeFullAccess EgressNetworkPolicyInternetAccessPolicyRestrictionMode = `FULL_ACCESS` + +const EgressNetworkPolicyInternetAccessPolicyRestrictionModePrivateAccessOnly EgressNetworkPolicyInternetAccessPolicyRestrictionMode = `PRIVATE_ACCESS_ONLY` + +const EgressNetworkPolicyInternetAccessPolicyRestrictionModeRestrictedAccess EgressNetworkPolicyInternetAccessPolicyRestrictionMode = `RESTRICTED_ACCESS` + +// String representation for [fmt.Print] +func (f *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) Set(v string) error { + switch v { + case `FULL_ACCESS`, `PRIVATE_ACCESS_ONLY`, `RESTRICTED_ACCESS`: + *f = EgressNetworkPolicyInternetAccessPolicyRestrictionMode(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FULL_ACCESS", "PRIVATE_ACCESS_ONLY", "RESTRICTED_ACCESS"`, v) + } +} + +// Type always returns EgressNetworkPolicyInternetAccessPolicyRestrictionMode to satisfy [pflag.Value] interface +func (f *EgressNetworkPolicyInternetAccessPolicyRestrictionMode) Type() string { + return "EgressNetworkPolicyInternetAccessPolicyRestrictionMode" +} + +// Users can specify accessible storage destinations. +type EgressNetworkPolicyInternetAccessPolicyStorageDestination struct { + AllowedPaths []string `json:"allowed_paths,omitempty"` + + AzureContainer string `json:"azure_container,omitempty"` + + AzureDnsZone string `json:"azure_dns_zone,omitempty"` + + AzureStorageAccount string `json:"azure_storage_account,omitempty"` + + AzureStorageService string `json:"azure_storage_service,omitempty"` + + BucketName string `json:"bucket_name,omitempty"` + + Region string `json:"region,omitempty"` + + Type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType `json:"type,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *EgressNetworkPolicyInternetAccessPolicyStorageDestination) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s EgressNetworkPolicyInternetAccessPolicyStorageDestination) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType string + +const EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeAwsS3 EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType = `AWS_S3` + +const EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeAzureStorage EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType = `AZURE_STORAGE` + +const EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeCloudflareR2 EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType = `CLOUDFLARE_R2` + +const EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationTypeGoogleCloudStorage EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType = `GOOGLE_CLOUD_STORAGE` + +// String representation for [fmt.Print] +func (f *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType) Set(v string) error { + switch v { + case `AWS_S3`, `AZURE_STORAGE`, `CLOUDFLARE_R2`, `GOOGLE_CLOUD_STORAGE`: + *f = EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "AWS_S3", "AZURE_STORAGE", "CLOUDFLARE_R2", "GOOGLE_CLOUD_STORAGE"`, v) + } +} + +// Type always returns EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType to satisfy [pflag.Value] interface +func (f *EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType) Type() string { + return "EgressNetworkPolicyInternetAccessPolicyStorageDestinationStorageDestinationType" +} + type EmailConfig struct { // Email addresses to notify. Addresses []string `json:"addresses,omitempty"` diff --git a/service/sharing/model.go b/service/sharing/model.go index 24e940abf..4da345b00 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -364,13 +364,18 @@ type Partition struct { Values []PartitionValue `json:"values,omitempty"` } +type PartitionSpecificationPartition struct { + // An array of partition values. + Values []PartitionValue `json:"values,omitempty"` +} + type PartitionValue struct { // The name of the partition column. Name string `json:"name,omitempty"` // The operator to apply for the value. Op PartitionValueOp `json:"op,omitempty"` // The key of a Delta Sharing recipient's property. For example - // `databricks-account-id`. When this field is set, field `value` can not be + // "databricks-account-id". When this field is set, field `value` can not be // set. RecipientPropertyKey string `json:"recipient_property_key,omitempty"` // The value of the partition column. When this value is not set, it means @@ -389,7 +394,6 @@ func (s PartitionValue) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// The operator to apply for the value. type PartitionValueOp string const PartitionValueOpEqual PartitionValueOp = `EQUAL` @@ -439,6 +443,8 @@ const PrivilegeCreateExternalVolume Privilege = `CREATE_EXTERNAL_VOLUME` const PrivilegeCreateForeignCatalog Privilege = `CREATE_FOREIGN_CATALOG` +const PrivilegeCreateForeignSecurable Privilege = `CREATE_FOREIGN_SECURABLE` + const PrivilegeCreateFunction Privilege = `CREATE_FUNCTION` const PrivilegeCreateManagedStorage Privilege = `CREATE_MANAGED_STORAGE` @@ -515,11 +521,11 @@ func (f *Privilege) String() string { // Set raw string value and validate it against allowed values func (f *Privilege) Set(v string) error { switch v { - case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: + case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FOREIGN_SECURABLE`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: *f = Privilege(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) + return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) } } diff --git a/workspace_client.go b/workspace_client.go index eac0d3a9a..f0bc03167 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -11,6 +11,7 @@ import ( "github.com/databricks/databricks-sdk-go/service/apps" "github.com/databricks/databricks-sdk-go/service/catalog" + "github.com/databricks/databricks-sdk-go/service/cleanrooms" "github.com/databricks/databricks-sdk-go/service/compute" "github.com/databricks/databricks-sdk-go/service/dashboards" "github.com/databricks/databricks-sdk-go/service/files" @@ -78,6 +79,19 @@ type WorkspaceClient struct { // depending on privileges granted centrally in Unity Catalog. Catalogs catalog.CatalogsInterface + // Clean room assets are data and code objects — Tables, volumes, and + // notebooks that are shared with the clean room. + CleanRoomAssets cleanrooms.CleanRoomAssetsInterface + + // Clean room task runs are the executions of notebooks in a clean room. + CleanRoomTaskRuns cleanrooms.CleanRoomTaskRunsInterface + + // 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. + CleanRooms cleanrooms.CleanRoomsInterface + // You can use cluster policies to control users' ability to configure // clusters based on a set of rules. These rules specify which attributes or // attribute values can be used during cluster creation. Cluster policies @@ -174,9 +188,9 @@ type WorkspaceClient struct { // can access the credential. // // To create credentials, you must be a Databricks account admin or have the - // `CREATE SERVICE CREDENTIAL privilege. The user who creates the credential - // can delegate ownership to another user or group to manage permissions on - // it + // `CREATE SERVICE CREDENTIAL` privilege. The user who creates the + // credential can delegate ownership to another user or group to manage + // permissions on it. Credentials catalog.CredentialsInterface // Credentials manager interacts with with Identity Providers to to perform @@ -1142,6 +1156,9 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Apps: apps.NewApps(databricksClient), ArtifactAllowlists: catalog.NewArtifactAllowlists(databricksClient), Catalogs: catalog.NewCatalogs(databricksClient), + CleanRoomAssets: cleanrooms.NewCleanRoomAssets(databricksClient), + CleanRoomTaskRuns: cleanrooms.NewCleanRoomTaskRuns(databricksClient), + CleanRooms: cleanrooms.NewCleanRooms(databricksClient), ClusterPolicies: compute.NewClusterPolicies(databricksClient), Clusters: compute.NewClusters(databricksClient), CommandExecution: compute.NewCommandExecution(databricksClient),